Datum planes vs shapebinders vs sketch on face

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
juless
Posts: 19
Joined: Wed Apr 24, 2019 11:46 am

Datum planes vs shapebinders vs sketch on face

Post by juless »

Full thread title: The usage of datum planes vs shapebinders vs directly drawing sketches on faces, and how not to break your model (due to toponaming issues I guess, not sure what the problem is :)).

My use case: In PD WB, I want to draw two cubes, one being on top of the other. The first cube is in its own body, padded from a sketch. The second cube is in a different body, and can then be made in a number of different ways, but it should change shape/position dependent on the first cube sketch / pad length. Simple use case but you can see where I'm going with this.

- Select the face where the other cube should be created > create a new shape binder > create a new sketch > use the shape binder as attachment > import the external geometry of the cube from the shape binder edges > sketch the outline of the cube (coincident to the imported geometry) > pad it.

- Select the face where the other cube should be created > create a new datum plane > make a dependent copy > create a new sketch > import the external geometry of the cube from the referencepad (a shapebinder object, which was created along with the datum plane) > sketch the outline of the cube (coincident to the imported geometry) > pad it.

- Select the face where the other cube should be created > create a new sketch > make a dependent copy > import the external geometry of the cube from the referencepad (no datum plane created, just a shapebinder object) > sketch the outline of the cube (coincident to the imported geometry) > pad it.

Looking at the dependency graph, there is no real difference compared to the three methods. Is anyone more safe than the other with respect to propagating changes / not breaking the model? Are there more robust methods to do such a thing?

From this thread (more specifically, this post by NormandC I (think...) I've learned that these three methods are not very robust.
By selecting the face of the object, you are making the datum line dependent on geometry subject to change. You're trying to avoid the pitfalls of the topological naming issue, but at the same time you're willingly throwing yourself into the pit. ;) So no, it is not the right solution.
Better is to use datum planes referenced from a part's origin axes/planes. And I thought datum planes were safer over directly sketching on faces, but I was wrong...

How can I do such a thing in my case? I don't see how I can create a new plane as a sketch plane for the second cube, which will change it's z-offset depending of the pad height of the first cube. And how the x-y geometry of the 2nd cube can be referenced. I hope that comes across understandable...

I find it hard to figure this stuff out - by the time I've realised I've done something not so clever/flexible, I'm too far in my model. And if I start with a basic example (such as described or attached), I don't (yet) have the needed complexity to see if the full model is stable enough, and can withstand changing of old features without breaking the model. Or I just don't know enough yet - I don't pretent to know anything about toponaming issues, but I know that such problems exist, and I would like to do my best to avoid such pitfalls asap.

Appreciate any and all tips, discussion, reading material, etc! Like NormandC said in that post, "The pit. You in it. So, yeah."

In the attached model, I want to be able to either change the dimensions in the Body_BottomSketch, or the pad length of the Body_Bottom, such that the Body_Middle will change its shape according to the changes in the sketch, and its offset according to the pad length.

Maybe my question (or lack of understanding) is probably also related to the order of features added in a Body, and there being a linear structure to adding new features. In my example there is a clear part creation order, and I can change the features of older parts without breaking newer parts. But this is not always the case. I'm confusing myself now... :?:

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16699 (Git)
Build type: Release
Branch: master
Hash: e484a52e9d4ccaa360952cd8755b4a8ee6ad2ea1
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Attachments
ReferenceExternalBodyGeometryExample.FCStd
(39.05 KiB) Downloaded 34 times
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Datum planes vs shapebinders vs sketch on face

Post by openBrain »

I didn't carefully read all the text but hope I caught your need.
In this particular case, if you want the 2 boxes to have same section & be in different bodies, I would :
  • Create a new sketch in the new body
  • Sketcher CarbonCopy the first sketch in this new one (hold Ctrl key to be able to do so with sketch from another body)
  • Pad this new sketch
If you ensure your first sketch is fully constrained, Carbon Copy will link the dimension constraints thus the 2nd sketch will "follow" the 1st in terms of positioning. ;)
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Datum planes vs shapebinders vs sketch on face

Post by vocx »

juless wrote: Fri May 17, 2019 2:08 pm My use case: In PD WB, I want to draw two cubes, one being on top of the other. The first cube is in its own body, padded from a sketch. The second cube is in a different body, and can then be made in a number of different ways, but it should change shape/position dependent on the first cube sketch / pad length. Simple use case but you can see where I'm going with this.
...
It is not clear to me if you are creating independent Bodies (PartDesign Body) or you want everything in a single Body. A Body is supposed to be a "contiguous solid", with non-movable parts. For example, a nail, a screw, a nut, are generally examples of a single body, each of them made of a single piece of metal. Another example is an open-end wrench, usually made of forged steel (piece of steel pressed and cut).

If you are really placing different Bodies, then this means that you are actually creating an "assembly" of parts. For example, a pipe wrench has different parts: the long handle with the lower jaw, the upper jaw, and the circular nut. You would consider this to be a single tool, but for modelling purposes it is an assembly of three bodies.
juless wrote: Fri May 17, 2019 2:08 pm ...
Better is to use datum planes referenced from a part's origin axes/planes. And I thought datum planes were safer over directly sketching on faces, but I was wrong...

How can I do such a thing in my case? I don't see how I can create a new plane as a sketch plane for the second cube, which will change it's z-offset depending of the pad height of the first cube. And how the x-y geometry of the 2nd cube can be referenced. I hope that comes across understandable...
...
For this particular case, putting an object (Pad2, Sketch2) on top of another (Pad1, Sketch1), I think using the datum plane offset for the face of Pad1 is "fine". This is a very simple transformation, that yes, is dependent on a previous feature, but doesn't present major issues when it comes to solving attachment errors. If your Pad1 changes, you just need to reattach the datum plane that supports Sketch2 to the correct face, and Pad2 should work correctly. See topological naming problem and feature editing.

Moreover, the datum plane is a visual aid, it will show prominently where your sketch should be, making it clear that it is at the position that you want, or in a wrong position.

You could also attach the datum plane to the PartDesign Body's base XY plane. Of course, in this way, you will have to control the position (Z offset) of the datum plane "manually". Perhaps you can use expressions to define a variable which can be used to control both the extrussion length of Pad1, and the Z offset of the datum plane, in order to position the Sketch2 at exactly the former object's face.

In general, using datum planes, and offsetting them from faces or the body's basic planes is "fine"; the important aspect is that each sketch be only dependent on its own plane, and thus independent from other sketches, so they can be extruded (padded) individually.
juless wrote: Fri May 17, 2019 2:08 pm My use case: In PD WB, I want to draw two cubes, one being on top of the other.
...
But again, if these "cubes" represent not simple cubes, but actual complex bodies, then maybe what you want is probably an assembly. In that case the A2plus Workbench may help you perform such attachment: attach the lower face of Body2 to the upper face of Body1.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Datum planes vs shapebinders vs sketch on face

Post by chrisb »

I understand that you chose this very simple example to talk about the principles. But the techniques discussed here should work on complicated models too.
vocx wrote: Fri May 17, 2019 5:10 pm In general, using datum planes, and offsetting them from faces or the body's basic planes is "fine";
Referencing faces is not fine in terms of toponaming issues. The number of the face can change on the slightest change in a sketch which would create a completely wrong reference.

In your example you should not use the face as ShapeBinder's source but rather the sketch, which creates the face in the end. If "Pad" is the name of the cube in the first body, then the offset should be an expression: Pad.length.

Please note that you can enter Expressions for the placement only in the DataTab, not in the PlacementDialog.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Datum planes vs shapebinders vs sketch on face

Post by vocx »

chrisb wrote: Fri May 17, 2019 8:47 pm ...
Referencing faces is not fine in terms of toponaming issues. The number of the face can change on the slightest change in a sketch which would create a completely wrong reference.
...
Well, yes, that's why I said it's "fine" in quotes. If you know how to use the datum planes, you can easily reattach (Part Attachment) the PartDesign Planes to fix the errors. You still have an error, but this is easily fixable. Even in other commercial CAD packages you sometimes have to go and re-attach things when you edit your model; this is not exclusive to FreeCAD.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Datum planes vs shapebinders vs sketch on face

Post by chrisb »

Sorry, as a foreign languager fine irony sometimes escapes me.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
HarryGeier
Veteran
Posts: 1231
Joined: Mon Jul 10, 2017 12:36 pm
Location: Hof Germany

Re: Datum planes vs shapebinders vs sketch on face

Post by HarryGeier »

juless wrote: Fri May 17, 2019 2:08 pm Full thread title: The usage of datum planes vs shapebinders vs directly drawing sketches on faces, and how not to break your model (due to toponaming issues I guess, not sure what the problem is :)).

My use case: In PD WB, I want to draw two cubes, one being on top of the other. The first cube is in its own body, padded from a sketch. The second cube is in a different body, and can then be made in a number of different ways, but it should change shape/position dependent on the first cube sketch / pad length. Simple use case but you can see where I'm going with this.
Sorry...vocx said the same before:


The second box should be placed on a datum plane, attached to second body´s origin xy plane and OFFSET by formula = firstbox.lenght ( assuming firstbox is the padded box in body 1 ) . Easy peasy and ROCK SOLID

probably also works with a local coordinate system for second box..attached and offset in Z same way.



i myself had no major issues all the time yet using shapebinders to the whole previous body object and then attaching datum planes to their faces.
Kaum macht man´s richtig , gehts´s
My Video Tutorials on Youtube: https://www.youtube.com/channel/UCoe3B ... p8Q/videos
My FreeCAD Stuff on Hidrive: https://my.hidrive.com/share/qr3l1yddy6#$/
User avatar
HarryGeier
Veteran
Posts: 1231
Joined: Mon Jul 10, 2017 12:36 pm
Location: Hof Germany

Re: Datum planes vs shapebinders vs sketch on face

Post by HarryGeier »

juless wrote: Fri May 17, 2019 2:08 pm
Better is to use datum planes referenced from a part's origin axes/planes. And I thought datum planes were safer over directly sketching on faces, but I was wrong...
I still think using a datum plane ..inbetween.. a face and a new sketch(es) is better than sketch on face . The Plane might loose it´s attachment once, still the following objects should still be fixed relative to the plane.

Sometimes i also think the toponaming is a bit ...overdiscussed... it does not happen out of the blue, it happens mostly when a desing is not beeing well defined and gets drastical changes . The guy in the video lately , comparing Solidworks to FreeCAD does it all the time, and it does not break. I do that for my own desings also many times and have no issues.
Kaum macht man´s richtig , gehts´s
My Video Tutorials on Youtube: https://www.youtube.com/channel/UCoe3B ... p8Q/videos
My FreeCAD Stuff on Hidrive: https://my.hidrive.com/share/qr3l1yddy6#$/
juless
Posts: 19
Joined: Wed Apr 24, 2019 11:46 am

Re: Datum planes vs shapebinders vs sketch on face

Post by juless »

thanks all for the replies and discussion, good food for thought. please bear with me through this reply as my shift buttons are not working ;/
In this particular case, if you want the 2 boxes to have same section & be in different bodies, I would :
Create a new sketch in the new body
Sketcher CarbonCopy the first sketch in this new one (hold Ctrl key to be able to do so with sketch from another body)
Pad this new sketch
If you ensure your first sketch is fully constrained, Carbon Copy will link the dimension constraints thus the 2nd sketch will "follow" the 1st in terms of positioning.
ah, yet another way to skin the cat - i'm certain i will be using this feature more often aswell.
It is not clear to me if you are creating independent Bodies (PartDesign Body) or you want everything in a single Body. A Body is supposed to be a "contiguous solid", with non-movable parts. For example, a nail, a screw, a nut, are generally examples of a single body, each of them made of a single piece of metal. Another example is an open-end wrench, usually made of forged steel (piece of steel pressed and cut).

If you are really placing different Bodies, then this means that you are actually creating an "assembly" of parts. For example, a pipe wrench has different parts: the long handle with the lower jaw, the upper jaw, and the circular nut. You would consider this to be a single tool, but for modelling purposes it is an assembly of three bodies.
i guess i am creating multiple partdesign bodies, but there is some dependency between the parts. they are all contiguous solids indeed, and indeed i am creating/positioning the different bodies as if it were an assembly.
For this particular case, putting an object (Pad2, Sketch2) on top of another (Pad1, Sketch1), I think using the datum plane offset for the face of Pad1 is "fine". This is a very simple transformation, that yes, is dependent on a previous feature, but doesn't present major issues when it comes to solving attachment errors. If your Pad1 changes, you just need to reattach the datum plane that supports Sketch2 to the correct face, and Pad2 should work correctly. See topological naming problem and feature editing.

Moreover, the datum plane is a visual aid, it will show prominently where your sketch should be, making it clear that it is at the position that you want, or in a wrong position.
okay, thanks for the reading material regarding the topological naming problem and feature editing. i guess i still have to get my head across the true source of the toponaming problem, and how to avoid it.
You could also attach the datum plane to the PartDesign Body's base XY plane. Of course, in this way, you will have to control the position (Z offset) of the datum plane "manually". Perhaps you can use expressions to define a variable which can be used to control both the extrussion length of Pad1, and the Z offset of the datum plane, in order to position the Sketch2 at exactly the former object's face.

In general, using datum planes, and offsetting them from faces or the body's basic planes is "fine"; the important aspect is that each sketch be only dependent on its own plane, and thus independent from other sketches, so they can be extruded (padded) individually.
this approach seems to work indeed, expressions are very nice and powerful for this.

thanks for the pointer on keeping each sketch dependent on its own plane and from other sketches.
But again, if these "cubes" represent not simple cubes, but actual complex bodies, then maybe what you want is probably an assembly. In that case the A2plus Workbench may help you perform such attachment: attach the lower face of Body2 to the upper face of Body1.
i've had a play with a2plus, but for now it's too much hassle to assemble the parts. i will reconsider the workflow though.
Referencing faces is not fine in terms of toponaming issues. The number of the face can change on the slightest change in a sketch which would create a completely wrong reference.

In your example you should not use the face as ShapeBinder's source but rather the sketch, which creates the face in the end. If "Pad" is the name of the cube in the first body, then the offset should be an expression: Pad.length.
hmm, okay - i think i get it. there is a difference between changing the name of a part, or a constraint or something - these changes get propagated everywhere properly. but because the face naming is automatic, here there is a difference, and the propagation does not work cleanly. something along those lines...
Post Reply