Tolerance Edge vs Vertexes

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!
Post Reply
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Tolerance Edge vs Vertexes

Post by MRx »

>>> e=Gui.Selection.getSelectionEx()[0].SubObjects[0]
>>> e.Tolerance
0.05
>>> e.Vertexes[0].Tolerance
0.116921094337508
>>> e.Vertexes[1].Tolerance
0.132305818316937
ZxPVEo.png
ZxPVEo.png (4.71 KiB) Viewed 1482 times
does anyone know a reasonable way how to update the tolerance of the vertexes of an unconnected edge?

If I pass it through a sketch the tolerance of the vertex will also be okay, but is there any other way?

e.Vertexes[0].Tolerance=0.05 doesn't work, to my understanding there's no reason why this should not work because the Vertex is supposed to be tied to the loose edge, why is this immutable? (the answer to that is .. because it's also immutable in opencascade ... so freecad is possibly just forwarding the tolerance setting if at all...)

Now I kind of understand why Rhino3D has the option to re-create all edges of an object - freecad needs that option too for sure.

I'm trying to fix an object here which was damaged by some freecad / opencascade functions - and the tolerance seems to be the root problem.


ok I'm a little bit further here, the edge should be fixed with ShapeFix_ShapeTolerance.

Code: Select all

ShapeFix_ShapeTolerance st;
st.SetTolerance(e, <newtolerance>, TopAbs_VERTEX);
question is if this is implemented in FreeCAD.
it is...
Shape.fixTolerance(...)

so that solves the problem with the tolerance for me.

I see this problem as a very critical issue in FreeCAD, it's probably the main reason why my object got damaged in the first place - too high tolerance and things were snapping together during boolean operations causing further extreme problems.
Attachments
tolerance.FCStd
(6.07 KiB) Downloaded 25 times
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Tolerance Edge vs Vertexes

Post by MRx »

ok to answer it myself...

The geometry checker will tell which vertex has an issue.

I simply fixed it with .fixTolerance() on the live object without re-creating anything.

now the vertex issue and the too small edge issue disappeared.
the first tolerance returned >0.1 after changing it it showed a tolerance of 0.05

eg:

Code: Select all

>>> App.ActiveDocument.Shell_solid001.Shape.Vertexes[724-1].fixTolerance(0.05)
>>> App.ActiveDocument.Shell_solid001.Shape.Vertexes[724-1].Tolerance
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Tolerance Edge vs Vertexes

Post by TheMarkster »

When I run checkgeometry on your file it finds no errors. Can you attach a file showing the error and the code required to fix it?
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Tolerance Edge vs Vertexes

Post by MRx »

I have isolated the tolerance issue and posted the actual question here since I didn't know how to fix the tolerance. My object is already fixed.

Alternatively you can just draw an object, pick 2 vertexes nearby and extend their tolerance so they will intersect with each other.

You can draw eg. a cube, pick one vertex set the tolerance to 1 of the vertex. Once it's set you won't be able to pad the face nearby that edge to a value between eg. 0.1-1. Pad will just produce no output.
This tolerance issue can produce all kind of weird issues which won't make any sense to the user because the settings aren't directly exposed via the user interface
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Tolerance Edge vs Vertexes

Post by adrianinsaval »

MRx wrote: Tue Jan 18, 2022 7:11 pm Alternatively you can just draw an object, pick 2 vertexes nearby and extend their tolerance so they will intersect with each other.
This is irrelevant because the software would not do this on it's own so it's not actionable. We need specific operations that lead to a problem.
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Tolerance Edge vs Vertexes

Post by MRx »

The disaster happened already for me - so first priority for me was to get out of it (past, since it's fixed already)
SECOND priority would be to figure out where it came from, this is as mentioned on my radar to keep watching it in the future.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Tolerance Edge vs Vertexes

Post by TheMarkster »

Very recently, wmayer has exposed some Precision stuff to python. Perhaps some of that can be of use, but this was only in the recent couple days or so and is unlikely to be in any of the weekly builds yet.

If there are checkgeometry failures that can be remedied by adjusting tolerances using some python code, then this I think is a great find. What we need is a model showing the failure and some code that fixes the failure. A before and after would be great.
MRx
Posts: 319
Joined: Wed Jul 08, 2020 5:59 am
Location: Tainan / Taiwan

Re: Tolerance Edge vs Vertexes

Post by MRx »

forgive me, the object where it happens has a commercial background that's why I don't want to publish it (it's entirely funded by myself and all my work on freecad as well).

If I get across it again in the future with another object I'll provide it. Also I'll keep an eye on the tolerance issue now that I'm aware of it.


Actually is there a place in FreeCAD where the tolerance can be set? I start to think that various scripts and modules choose whatever they want to choose.
There's the draft section in the configuration but I'd expect that those settings are only used for the draft workbench itself.
Other than that, in the Unit tab the number of floating point digits can be configured, but certainly that doesn't mean that this is supposed to be the tolerance accuracy.

I still seem to run into tolerance issues after boolean operations here, I'm resetting it manually to avoid corruptions on the object. And all the corruptions are clearly derived from the tolerance settings of various Vertexes and Edges.
I think FreeCAD has a massive tolerancing issue all over the place, which for detailed objects is a very serious problem.


Part.show(App.ActiveDocument.Shell_solid.Shape.cut(App.ActiveDocument.Extrude003.Shape, 0.001)) <<- (the Gui Boolean cut does not offer any tolerance settings).

Without tolerance settings:
6E2XUV.png
6E2XUV.png (21.67 KiB) Viewed 1159 times
With tolerance settings:
283nFP.png
283nFP.png (3.54 KiB) Viewed 1159 times
So my assumption from last week was already correct -- FreeCAD is messing it up completely
Post Reply