Model breaks after union

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Fixtor
Posts: 5
Joined: Sat May 17, 2014 2:09 pm

Model breaks after union

Post by Fixtor »

This is not the first time it happens to me. I have no idea how to fix this. Can someone help me? It looks like a bug. Happened after making an union.

This is how it should look (before union)

This is how it does look (after union)

Thanks in advance. I hope there's an easy workaround.

Edit: added the file
Attachments
broken model.FCStd
(67.76 KiB) Downloaded 17 times
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Model breaks after union

Post by quick61 »

Pad006 is a BAD model. FreeCAD should NOT allow you to do that, but it does. Part Design is for the creation of a single solid part, not multiple parts from one sketch. The result of doing such a thing as you have done is create a long list of geometric errors in the model that may not show up at first, but as you have found out, will come to the surface later on in the models history. Sketch006 must be split into 2 separate sketches if your going to construct this model as a Part Design / CSG hybrid. Though you probably would be much better off staying with just Part Design Workbench for this model sense it is simple enough and nothing I see would dictate the need for using anything else.

Hang on a few minutes and I'll post an example.

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
Fixtor
Posts: 5
Joined: Sat May 17, 2014 2:09 pm

Re: Model breaks after union

Post by Fixtor »

Hey Mark, thanks for your reply! I fixed those issues but the model still breaks, so I have a question. Is this sketch a solid part? Or should I create this square hole with another sketch?
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Model breaks after union

Post by quick61 »

That sketch should pad and work properly.

As I said, that part can be make using just the Part Design Workbench. I did it with 3 sketches and a mirror tossed in to make things easier. The end result is a single part with no geometric errors being reported.

Here is the file -
Sketch_Built_Example.fcstd
(34.24 KiB) Downloaded 14 times
You can take a look at the first sketch as it basically does the same thing as your sketch does, but with a bit more detail. ;)

I first did the base part, then one side of the 'C' bracket, Mirrored it horizontally, then placed the end tab with the 3rd sketch.

Mark

OS: Kubuntu 14.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4535 (Git)
Branch: master
Hash: c2d0857ddcba6fc20319a541bfda3fb834e00418
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17-dev
This post made with 0.0% Micro$oft products - GOT LINUX?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Model breaks after union

Post by DeepSOIC »

Looks like this is the first boolean operation fail caused by coplanar faces I've seen so far :roll: .
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Model breaks after union

Post by DeepSOIC »

Fixtor, BTW, what version of FreeCAD are you using?

I was able to fix the model. In Sketch007, I reassembled all tangent joints to point-to-point tangency instead of coincident+tangent. There were a few (some were proper). I also did this to Sketch, where all tangent joints were correct, but it was the thing that actually cured the boolean.
So it looks like it is solver precision issue here. I might do a further investigation on this.
broken model repaired.FCStd
(63.52 KiB) Downloaded 10 times
EDIT: PS. Fixtor, please! upload the pictures directly to the forum! I feel myself a bit in danger when following the links to unfamiliar websites.
Last edited by DeepSOIC on Mon Feb 02, 2015 10:49 am, edited 2 times in total.
Reason: typo
Fixtor
Posts: 5
Joined: Sat May 17, 2014 2:09 pm

Re: Model breaks after union

Post by Fixtor »

OS: Mac OS X
Word size: 64-bit
Version: 0.14.3703 (Git)
Branch: releases/FreeCAD-0-14
Hash: c6edd47334a3e6f209e493773093db2b9b4f0e40
Python version: 2.7.5
Qt version: 4.8.6
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0

Sorry about not posting pictures on forum!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Model breaks after union

Post by DeepSOIC »

Fixtor, thanks!
I have measured the distance between two points that should become coincident, and got a value of ~4.5e-07. This is slightly above OCC's Precision::Confusion, which is 1e-7 AFAIK.
Any sizes that come close to Precision::Confusion are evil. For the stuff to work reliably, the distances should either be a couple orders of magnitude larger (and thus definitely non-coincident), or a couple orders of magnitude smaller (thus definitely coincident).

It looks like it is coming from Sketcher solve errors. They are unavoidable, and it is a bad idea to precisely replicate the shape by making two sketches identically constrained. Instead, the constraints should be to links to external geometry (in this case, the coincidence precision better than 1e-7 is essentially guaranteed).
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Model breaks after union

Post by DeepSOIC »

Interestingly, on my repaired version of the model, the coincidence is bang on. i.e. I get exactly zero distance. Fascinating :?

Here's my method of measurement.
Select two points and type the following into python console:

Code: Select all

(Gui.Selection.getSelectionEx()[0].SubObjects[0].Point-Gui.Selection.getSelectionEx()[1].SubObjects[0].Point).Length
To select the two points that occupy the same space, I select one of them, hit space to hide the object it belongs to, and Ctrl+Click the other point.
User avatar
tanderson69
Veteran
Posts: 1626
Joined: Thu Feb 18, 2010 1:07 am

Re: Model breaks after union

Post by tanderson69 »

DeepSOIC wrote:Here's my method of measurement.
Select two points and type the following into python console:...
If you turn on your report view and use part/measurement, you can achieve the same result. Conditions like this were the whole purpose behind writing that command.
measure.png
measure.png (237.5 KiB) Viewed 1116 times
Post Reply