Referencing Sketches - Jumping Reference (Topological Naming Problem)

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
AtD
Posts: 50
Joined: Mon Mar 18, 2019 7:14 am

Referencing Sketches - Jumping Reference (Topological Naming Problem)

Post by AtD »

Hi all,
I have a very basic question: is there a way to make robust references between sketches?
This might have been asked before, but the search didn't point me to anything useful yet, so I am sorry if this is a duplicate.

Consider this simple example in the attached images below. When I change the master sketch, the internal numbering of lines/points changes, which causes my subsequent sketch to switch places. It would be perfectly fine that the reference breaks, if I had changed the original element (point that is referenced) but it seems any change on the original sketch even at unrelated elements can cause this.
I think this is a typical example of the Topological Naming Problem. I am not aware of a fix or workaround yet. If I missed a important feature here to avoid this, please point me there. Most of my FC-Knowledge comes from playing around in the GUI.

I know that there is a growing interest in resolving the TNP and I reproduced realThunders approach here: https://forum.freecadweb.org/viewtopic. ... &start=120 . The thread is a bit hard to follow, but as far as I could see, this works for 3D-features right now. Are there efforts to resolve this on the sketch level as well?

Best regards
Add a rectangle as master sketch
Add a rectangle as master sketch
step1.png (19.54 KiB) Viewed 571 times
Add a new sketch containing a square, use the 'external reference' to attach it to a corner of the master sketch
Add a new sketch containing a square, use the 'external reference' to attach it to a corner of the master sketch
step2.png (23.82 KiB) Viewed 571 times
Edit the master sketch: set the opposite line to construction mode and add another line there
Edit the master sketch: set the opposite line to construction mode and add another line there
step3.png (10.43 KiB) Viewed 571 times


--
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24212 (Git)
Build type: Release
Branch: master
Hash: 3d227cf7179c00e57f2733f947b4b1b0368d219a
Python version: 3.8.8
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
chrisb
Veteran
Posts: 54140
Joined: Tue Mar 17, 2015 9:14 am

Re: Referencing Sketches - Jumping Reference (Topological Naming Problem)

Post by chrisb »

Currently there is no way to improve the situation for external references, when you make such structural changes to he master sketch.
And that's precisely the reason why we propagate master sketches in a slightly different form: Consider your master to contain only rough outlines which is so basic that the structure doesn't change. Such master sketches don't have to fulfil the usual requirements for padable sketches, which provides additional flexibility.

If you don't use external references but rather Expressions, you can refer to given names in your sketch which avoids the topological name changes.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
AtD
Posts: 50
Joined: Mon Mar 18, 2019 7:14 am

Re: Referencing Sketches - Jumping Reference (Topological Naming Problem)

Post by AtD »

Thanks for your prompt reply chrisb!

I am not completely sure regarding your proposal for master sketches. Actually I intend to use them gradually: maybe have one with the most basic dimensions and further ones for details - however, I am still afraid I can't ever touch them again to make changes. Basically I will have to introduce every element there, even construction lines before going on, of which I often just realize later that I need them.

Expressions are a good way and I used them already for parametrization. Altough I am afraid this introduces alot of additional work and makes the models harder to maintain, especially when more than one person works on it, because the references are hard to follow.
chrisb
Veteran
Posts: 54140
Joined: Tue Mar 17, 2015 9:14 am

Re: Referencing Sketches - Jumping Reference (Topological Naming Problem)

Post by chrisb »

In the very most cases it is no problem if you just add geometry to a sketch. However, if you rotate inside the sketch, the numbering of the elements may change.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Referencing Sketches - Jumping Reference (Topological Naming Problem)

Post by GeneFC »

AtD wrote: Thu Jul 29, 2021 7:36 am I am not completely sure regarding your proposal for master sketches. Actually I intend to use them gradually: maybe have one with the most basic dimensions and further ones for details - however, I am still afraid I can't ever touch them again to make changes. Basically I will have to introduce every element there, even construction lines before going on, of which I often just realize later that I need them.
There is no requirement to limit yourself to a single master sketch. If you simply want to add something you can add an extra sketch.

A project I am working on currently has about 20 "master" sketches.

Changes on the other hand can create problems if you do not use care, as chrisb pointed out.

Gene
Post Reply