Identifying/Avoiding Topological Naming Problems

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!
User avatar
teletypeguy
Posts: 96
Joined: Thu Jun 01, 2023 8:41 pm

Identifying/Avoiding Topological Naming Problems

Post by teletypeguy »

As a very new freecad user, I have been reading about and trying to understand the Topological Naming Problem at least to the point where my workflow does not lead into problems as my designs get more complicated.
https://wiki.freecad.org/Topological_naming_problem
https://wiki.freecad.org/Feature_editin ... ble_models

With a very simple part design body example:

First way:
Sketch a rectangle on XY and pad it, select the top face of pad, create a sketch on this face for a second pad/pocket...
This seems like an intuitive way to do it, but it sounds like it could potentially lead to TNP.
And if so, why is it allowed?

Second way:
Sketch a rectangle on XY and pad it, select the top face of pad and create a datum plane, sketch on datum plane, then continue with second pad/pocket...
Datum plan is referenced to top face of first pad -- is this OK?

Third way:
Sketch a rectangle on XY and pad it. Now select XY plane again, create datum plane, offset the Z attachment of
this datum plane to height of previous pad, then sketch on this datum plane, continue with second pad/pocket...
This would benefit from a spreadsheet param so the height of first pad and the offset of the datum plane for second sketch are the same, which is fine as I plan to use parameters quite often.

I generated a dependency graph for my first project and it looks pretty scary. I'm quite certain this is a completely wrong way to design something, but it just evolved as I learned. It is a cabinet design -- the "face frame" is a bunch of wooden rails and stiles that get assembled together, and I made separate bodies for every one of those components, and offset them into position (with no assy wb). The left wall of the carcase has rabbets cut into three edges, and I did a clone/transform to mirror that to the right-side wall. The example drawer is a rectangular pad with pockets cut into top/bot faces. It is all heavily driven by parameters in a spreadsheet.

It seems stable but I now wonder what latent problems I may have, and how I could identify them from the dependency graph -- the hi-res png is too big to attach here, but this is a screenshot:
dep1.png
dep1.png (191.77 KiB) Viewed 1154 times
My file is attached if anyone wants to peek at it. Any insight or pointers appreciated. Thx.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git)
Build type: Release
Branch: releases/FreeCAD-0-20
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)
Attachments
mbath-cab-1.FCStd
(134.23 KiB) Downloaded 6 times
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Identifying/Avoiding Topological Naming Problems

Post by drmacro »

The reason it is allowed is, because it is the way it supposed to work. Unfortunately, until TNP mitigation is implemented, alternative workflow is required to minimize the risk of TNP.

Generally, Datum planes attached to generated geometry, i.e. the face of the pad, will be prone to TNP.

The best is to create a sketch attached to a base plane and use the Attachment>Position property to adjust the location of the sketch. Many times this is done with an expression referencing Pad.Length for example.

Then when/if using external geometry as reference in the sketch, select geometry from other sketches, not generated faces or edges.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Identifying/Avoiding Topological Naming Problems

Post by chrisb »

teletypeguy wrote: Fri Jun 02, 2023 9:13 pm is this OK?
DatumPlanes are prone to TNP as are sketches. They are sensible to be used when you have multiple sketches in the same non standard plane or if you want to invert translation and rotation.

The use case you describe is a very common start for many models. Often it costs nothing but pays well to revert the first pad. i.e. to make it go down instead of up. then the second sketch can be placed in the same main plane as the first.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
teletypeguy
Posts: 96
Joined: Thu Jun 01, 2023 8:41 pm

Re: Identifying/Avoiding Topological Naming Problems

Post by teletypeguy »

drmacro wrote: Fri Jun 02, 2023 10:04 pm The best is to create a sketch attached to a base plane and use the Attachment>Position property to adjust the location of the sketch. Many times this is done with an expression referencing Pad.Length for example.
I see. That is easy enough to do when starting a new project so I will try to get in the habit of offsetting. It does not really need a datum plane to offset then, does it? A datum plane can be generated on the base plane, then offset and sketch on it, but I now find that I can just sketch on the base plane and then offset the sketch. Seems like same result, so is the datum plane unnecessary in this offset case?
thx
User avatar
teletypeguy
Posts: 96
Joined: Thu Jun 01, 2023 8:41 pm

Re: Identifying/Avoiding Topological Naming Problems

Post by teletypeguy »

chrisb wrote: Fri Jun 02, 2023 10:18 pm Often it costs nothing but pays well to revert the first pad. i.e. to make it go down instead of up. then the second sketch can be placed in the same main plane as the first.
Yeah, that sounds like the quick way to do a lot of pad/pocket parts like plates with holes and such. Nice.
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Identifying/Avoiding Topological Naming Problems

Post by freedman »

Yeah, that sounds like the quick way to do a lot of pad/pocket parts like plates with holes and such. Nice.
This is where the datum plane can be useful, if you need a bunch of something then all the sketches can be attached to a datum plane. This does nothing to change TNP but if it occurs the reattaching of the datum plane can fix many sketches. Also by moving the datum plane you will move all sketches attached to it, this can be useful.
User avatar
teletypeguy
Posts: 96
Joined: Thu Jun 01, 2023 8:41 pm

Re: Identifying/Avoiding Topological Naming Problems

Post by teletypeguy »

Combining those ideas would be something like this then?
- create body
- select XY plane (for example)
- create datum plane
- sketch on datum plane and pad (reverse) down
- sketch on datum plane and pocket down
- other sketches on this datum plane if desired...
- move datum plane (attachment/position) to move the body to desired location
- and repeat for 'nuther body...

All bodies are referenced to a datum plane which is referenced to base plane, I think.

That's an easy workflow.
pad-pocket-datum.png
pad-pocket-datum.png (287.94 KiB) Viewed 964 times
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Identifying/Avoiding Topological Naming Problems

Post by freedman »

- move datum plane (attachment/position) to move the body to desired location
All good up to this point. The whole body is moved by it's Placement, the Body is attached to nothing, it can be moved

The datum plane is there to help you make the body, which in PartDesign needs to be a all one piece. If your trying to learn structure I would forget about datum planes and focus on standard planes. Datum planes have a use but for the normal simple model I would not use them, get the hang of using standard planes.

So the Body is just sitting, no attachment. If you want to make another piece of the model you have two choices 1) model in place 2) use an assembler to attach the body.
Model in place is just create a new Body and start sketching.
Last edited by freedman on Sat Jun 03, 2023 5:41 am, edited 2 times in total.
User avatar
teletypeguy
Posts: 96
Joined: Thu Jun 01, 2023 8:41 pm

Re: Identifying/Avoiding Topological Naming Problems

Post by teletypeguy »

Slowly falling into place :) I have a new project to dive into, so just need to put some hours in.

There are a lot of great folks on this forum -- I appreciate all the help!
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Identifying/Avoiding Topological Naming Problems

Post by onekk »

There his an hidden truth, FreeCAD is parametric, and sometime it is not clear enough to newbies.

Suppose you a have a base sketch placed on XY plane, his natural direction is the normal along Z so if you pad something it will protrude in Z+ (if nothing strange is happening).

Suppose it is padded of 150mm you have the upper face at 150.00 Z, but even Sketch1.Pad1.Length will be 150.00 Z.

So no need to use a datum plane for this simple translation.

You need to place another shape on top of it. Simply place new sketch placement Z using an expression assigning his Z ewual to Sketch1.Pad1.Length.

if you then modify Sketch1.Pad1.Length all you model is recalculated to take in account this dimension change.

but as example you can assign a pocket Length to be =Sketch1.Pad1.Length * 0.25 to have a 1/4 pocket depth and so on.

Almost all could be "predicted" as you are using a 3d cad, so every thing is calculated in a way or another as computers have no fantasy so everything is a buch of binary digits and calculations algorithms (even AI is stored as 0 and 1), at least until quantum computers will became a viable reality. :D

The difficult part is to have:

- a "spatial conscience" of your model.
- a "geometric conscience" of your model.

But this could be achieved with some study and "head banging" or asking here for advices, usually the latter option should be fast.

With time I've learned to write down some answers as humans are not like computers and "hard disk crashes" are more frequent in the human brain than in the "artificial brain". At least in my old brain MTBF (Mean time Between Faults) that is the figure used to depict HD quality is very low.

:D


Kind Regards

Carlo D.
Last edited by onekk on Sat Jun 03, 2023 10:11 am, edited 1 time in total.
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/
Post Reply