PR #4752 Topological Naming

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
onekk
Veteran
Posts: 6208
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: PR #4752 Topological Naming

Post by onekk »

Yes @chrisb I could catch the problem.

It may be sufficient to assign a name to the face, like in my example, the face could be created from a wire, if I want to modify the face I modify the wire.

Sorry, now i could see the point, i modify the wire that is an "ancestor" of the face, so some link has to be retained to match the wire with the "newly constructed" face.

I see that when i assign the faces to the makeShell i could use an arbitrary order and FreeCAD will take care to joint the proper edges to form the shell.

But if there is a "consistent naming", i could use the name of the face to refer to this face when it is joined in the shell and exposed as a "boundary" of the solid. If I coudl refer to this face with "face2" and then when it is "assigned" to the solid i could refer to it as

Code: Select all

solid33.face2.color = yellow
It will be a great thing, or at least some advancement.

When speaking of this sort of things, it is more easy for me to be more concrete with examples.

@wsteffe I know that Sketch is important but I think that a more low level approach using Part,Faces,Edges will be sufficient, as if using scripting is the "more direct" way to model complex things, and the user has to take care of the correctness of the model, I wish that FreeCAD will emit some warning and errors when I'm doing something wrong, or at least say me "You are trying do a wrong thing, I have tried to help you doing this" :-D but maybe this is a too much ideal world.

Regards to All
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: PR #4752 Topological Naming

Post by Zolko »

onekk wrote: Sun Jun 27, 2021 3:37 pm Suppose i want to add an edge to one face and raise the face in a manner, think to transform a cube in a "house shaped" solid
Are you really sure it's possible to do that in FreeCAD ?

onekk wrote: Mon Jun 28, 2021 9:34 am @wsteffe I know that Sketch is important but I think that a more low level approach using Part,Faces,Edges will be sufficient, as if using scripting is the "more direct" way to model complex things
You seem to be talking about "Direct Modeling", but FreeCAD doesn't actually do that. Yes, you CAN wrestle it to sort-of do that badly using low-level primitives, but the primary usage of FreeCAD, as any other parametric CAD software, is to use sketches as base features for extrusions, revolutions, sweeps ... Therefore, any real-world FreeCAD scenario begins with a sketch. "real-world scenario " being the keyword here. Therefore, it's useless to talk about solving the topological naming in 3D before solving the topological naming in sketcher.

Not sure about Draft/Arch/BIM.
try the Assembly4 workbench for FreCAD — tutorials here and here
C_h_o_p_i_n
Posts: 225
Joined: Fri Apr 26, 2019 3:14 pm

Re: PR #4752 Topological Naming

Post by C_h_o_p_i_n »

Hi All,

I must admit, when I stumbled across the TNP (Topical Naming Problem) for the rather first time, I was wondering, why I can't tag (attach a name to) a surface and tag two edges as "origin" to have a reference to attach any folloing sketches - relaying to this surface - to ...

Regards,
Stefan
User avatar
onekk
Veteran
Posts: 6208
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: PR #4752 Topological Naming

Post by onekk »

Zolko wrote: Mon Jun 28, 2021 11:48 am You seem to be talking about "Direct Modeling", but FreeCAD doesn't actually do that. Yes, you CAN wrestle it to sort-of do that badly using low-level ....

From my point of view, as I use primary scripting, Part is the core of the work I do, the more low level interface I could use and if you see sources, the point where all the other "over structure" converge.

Without Part there where no object in FreeCAD, Draft is a sort of high level frontend to part, even sketch is using Part to create things.

Each construct have to build something using OCCT pass for the part thing, so adjusting the thing to be done in Part is basilar, Part is the interface with OCCT.

Don't mix the "Gui workflow" with the internal work of FreeCAD.

see:

https://wiki.freecadweb.org/Topological_data_scripting

And the first image with the scheme in.

https://wiki.freecadweb.org/Part_Module

and in more depth in:

https://wiki.freecadweb.org/OpenCASCADE


Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: PR #4752 Topological Naming

Post by wsteffe »

[
onekk wrote: Mon Jun 28, 2021 1:22 pm Don't mix the "Gui workflow" with the internal work of FreeCAD.
You may not neglect the workflow. It plays a central role in the topological naming problem.
The stability of names (what we want to achieve with topological naming) is a stability versus possible changes in the workflow.
And 99% of users (except you) interact with FC through the GUI and starts a design with a sketch.
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: PR #4752 Topological Naming

Post by chrisb »

onekk wrote: Mon Jun 28, 2021 1:22 pm as I use primary scripting,
...
Don't mix the "Gui workflow" with the internal work of FreeCAD.
Using scripting you should be able to avoid topological naming issues in the very most cases. So this may be indeed rather - although not completely - a GUI induced issue. I'm not sure if the Workbench related approach is the right way to tackle the problem. May be you are right, but finally it's not the operations itself which cause the problems, but rather the change of some parameters. Looking at Zolko's examples: it's not the Union, it's changing the dimensions of the cube.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
onekk
Veteran
Posts: 6208
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: PR #4752 Topological Naming

Post by onekk »

wsteffe wrote: Mon Jun 28, 2021 1:52 pm [
onekk wrote: Mon Jun 28, 2021 1:22 pm Don't mix the "Gui workflow" with the internal work of FreeCAD.
You may not neglect the workflow. It plays a central role in the topological naming problem.
The stability of names (what we want to achieve with topological naming) is a stability versus possible changes in the workflow.
And 99% of users (except you) interact with FC through the GUI and starts a design with a sketch.
Yes you are right and also Zolko, for the part the majority of users interact using Gui, I think that is no the 99% simply because the Python and Scripting part is basilar to those who create macros that are no very few, as the dimension of the Python part of the Forum easily show.

But FreeCAD is made around OCCT and Part and the link are showing this in a very clear way, maybe my view is biased, but all the command you are using in Gui pass through Python as the Gui interface is done in Python using PySide2.

@chrisb

Yes for the most part of the work, Topological naming is not modifying the Scripting Part.
I could ever use a reference for the object in a variable, but it could be handy to have a way to refer in a consistent way to "objects" using names.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
wsteffe
Posts: 461
Joined: Thu Aug 21, 2014 8:17 pm

Re: PR #4752 Topological Naming

Post by wsteffe »

onekk wrote: Mon Jun 28, 2021 2:10 pm But FreeCAD is made around OCCT
It is true that all the geometry, at the end, is built in OCCT. But it doesn't mean that the topological naming problem can be solved looking only at the OCCT data without considering the design flow. If you look only at the OCCT data structure (Solids,Shells,Wires,Edges ..) without considering the design flow (the history) there isn't a general way to map the changed geometrical entities towards the preexisting entities.
User avatar
onekk
Veteran
Posts: 6208
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: PR #4752 Topological Naming

Post by onekk »

@wsteffe


Ok I catch the point, the workflow is important, probably I've misunderstood the whole problem, focusing only to some aspect of the problem, for this I prefer to discuss on examples.

It is more easy to show where are the problems.

@chrisb also has solved in some way my problems when he told that using scripting you didn't encounter the problem.

Sorry for the inconvenience.

Regards to All.

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: PR #4752 Topological Naming

Post by jonasb »

C_h_o_p_i_n wrote: Mon Jun 28, 2021 12:23 pm ... I was wondering, why I can't tag (attach a name to) a surface and tag two edges as "origin" to have a reference to attach any folloing sketches - relaying to this surface - to ...
This is basically the what Datum Planes offer you. The problem comes afterwards: when "something" changes, if happen that your plane/tag/name looses its attachment point, or is attached where you don't expect it. For a human it's usually easy to tell what's "the same" surface before and after the change. For the software, it's not.
Post Reply