Feature Req: Sketcher elements identified by UUID instead of index.

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
sanderboer
Posts: 21
Joined: Fri Aug 30, 2019 9:47 am

Feature Req: Sketcher elements identified by UUID instead of index.

Postby sanderboer » Sat Sep 14, 2019 8:21 am

Hi,

tl;dr: Elements in a sketch should be consistently identifiable across additions/subtractions from the sketch to guarantee persistence to external references.

Maybe it is just me, but I rely a lot on 'layered' sketches. I draw main reference lines in one sketch and use them as external reference in other sketches. Now, if I redraw one of the reference lines or add/subtract elements in another manner in the reference sketch, the sketch that relies on the external references gets borked.

Quick example, start a new sketch, draw a rectangle, close it. Start another sketch, reference two parallel lines of the first sketch, close second sketch. Open first sketch again and fillet some corners. In the second sketch, references get altered, one is probably an arc now.
If I look at the naming of the references (f.i., Sketch.Edge4), it looks like elements in a sketch get renamed/reindexed from zero every time additions/subtractions take place. I wonder if that is an OCC thing or not...
openBrain
Posts: 1961
Joined: Fri Nov 09, 2018 5:38 pm

Re: Feature Req: Sketcher elements identified by UUID instead of index.

Postby openBrain » Sat Sep 14, 2019 10:17 am

Searching "Topological Naming Issue" in the forum should give you more information than you expect. :)
vocx
Posts: 1443
Joined: Thu Oct 18, 2018 9:18 pm

Re: Feature Req: Sketcher elements identified by UUID instead of index.

Postby vocx » Wed Sep 18, 2019 3:30 am

sanderboer wrote:
Sat Sep 14, 2019 8:21 am
...it looks like elements in a sketch get renamed/reindexed from zero every time additions/subtractions take place. I wonder if that is an OCC thing or not...
This is the infamous Topological naming problem that has existed forever in FreeCAD. Realthunder, the developer of the "Link" component (see App::Link: the big merge), has a solution to this issue, that he plans to submit to the master code. The changes to the core of FreeCAD are important, therefore they probably won't land in the master code very soon, but maybe they will be ready for testing during the 0.20 development cycle next year.

You can read about realthunder's ideas in the wiki in his GitHub page, Topological-Naming. As far as I understand, all of this is implemented in his Assembly3 workbench, so you may want to test it there.