Reusing sketches, parts/bodies etc.

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!
MarkMLl
Posts: 15
Joined: Thu Jan 20, 2022 11:12 am

Re: Reusing sketches, parts/bodies etc.

Post by MarkMLl »

MarkMLl wrote: Thu Jan 27, 2022 12:00 pm
drmacro wrote: Sun Jan 23, 2022 11:21 am Have you read and worked the examples on this page?: https://wiki.freecadweb.org/Part_and_PartDesign

The examples down the page create identical models exclusively in Part workbench and Part Design workbench.
Thanks, I'll follow up.
OK, I've re-read that and looked at the workflow using the "Part" and "Part Design" workbenches. I'm a bit disturbed that the result of the "Part Design" method is similarly linear to what I'd ended up with, and that the description shows that as effectively being the only way to work (with that workbench).

Apart from that, I've been experimenting with "Polar Pattern" etc. and would appreciate confirmation of a couple of things if anybody could spare the time.

First, when making a pad one starts off with a single sketch, there is no effective way of merging two sketches.

The sketch has to have an unbroken outline and no connected internal lines, e.g. has to be a single rectangle rather than two rectangles even if two pairs of points were constrained to be coincident. If there are connected internal lines, the result is a TopoDS::Face error.

It's not possible to connect two pads/pockets and then make a polar pattern from the result. For example, a strengthening web (as shown in the wiki example) with a hole bored through to save weight and material.

However if the sketch has unconnected internal detail, e.g. comprises a rectangle with a circle drawn internally, then the usual topological conventions apply and when padded the circle becomes a hole and the result may be polar-patterned.

Parts produced by the Part Design workbench and solids produced by the Part workbench may be fused by Part workbench boolean operations, with the top-level result being e.g. convertable to a mesh hence a .stl.

However so far it appears- to me- that parts have to be specified and in particular positioned numerically. I'm troubled about situations where the maths doesn't work out nicely, which is why my original example had a seven-sided prism.

If an entity has to be e.g. positioned on a specified face of another entity, this has to be done at this level.

With my current level of understanding, I'd hate to attempt e.g. the balustrades on a spiral staircase. (I admit, as soon as I wrote that I realised that drawing the staircase and then positioning the balustrade on each tread wasn't the way to do it. But I think that that sort of positioning job is still a reasonable illustration.)

I'm still very uncertain about the distinction between parts and bodies etc., and the significance of e.g. a fusion operation appearing outside the current part.
Attachments
testpiece_1.FCStd
(66.65 KiB) Downloaded 7 times
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Reusing sketches, parts/bodies etc.

Post by chrisb »

MarkMLl wrote: Fri Jan 28, 2022 11:32 am First, when making a pad one starts off with a single sketch, there is no effective way of merging two sketches.
Sketcher has a tool to merge sketches.
The sketch has to have an unbroken outline and no connected internal lines, e.g. has to be a single rectangle rather than two rectangles even if two pairs of points were constrained to be coincident. If there are connected internal lines, the result is a TopoDS::Face error.
yes
It's not possible to connect two pads/pockets and then make a polar pattern from the result. For example, a strengthening web (as shown in the wiki example) with a hole bored through to save weight and material.
wrong, you can have multiple features in a pattern.
However if the sketch has unconnected internal detail, e.g. comprises a rectangle with a circle drawn internally, then the usual topological conventions apply and when padded the circle becomes a hole and the result may be polar-patterned.
yes
Parts produced by the Part Design workbench and solids produced by the Part workbench may be fused by Part workbench boolean operations, with the top-level result being e.g. convertable to a mesh hence a .stl.
yes, if you mean with top-level result in PartDesign a body.

However so far it appears- to me- that parts have to be specified and in particular positioned numerically. I'm troubled about situations where the maths doesn't work out nicely, which is why my original example had a seven-sided prism.
The trick here is, to attach things properly
If an entity has to be e.g. positioned on a specified face of another entity, this has to be done at this level.
You can attach things directly to faces, but it is not recommended.
I'm still very uncertain about the distinction between parts and bodies etc., and the significance of e.g. a fusion operation appearing outside the current part.
They are made using different techniques. From the outside a PartDesign body is as good as a solid made in Part workbench.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
drmacro
Veteran
Posts: 8873
Joined: Sun Mar 02, 2014 4:35 pm

Re: Reusing sketches, parts/bodies etc.

Post by drmacro »

MarkMLl wrote: Fri Jan 28, 2022 11:32 am ...
I'm still very uncertain about the distinction between parts and bodies etc., and the significance of e.g. a fusion operation appearing outside the current part.
The Part workbench produces only single solitary solids. Whether it is a primitive or a odd shaped solid created from an extruded sketch. They have no relationship until one is applied by the user. (I.e. a boolean operation between two or more.)

A Part Design workbench Body is the accumulation of all operations under the Body. The operations (referred to as features) Pad, Pocket, etc. are not stand alone solids.
(In essence, each feature shown under the Body has automatically defined the relationship between it and the one above it.)

From the standpoint of the Part workbench, a Part Design Body is just another solid. So, a Part workbench Extrude and a Part Design Body can be used in a Part workbench Boolean operation.

But, From the standpoint of the Part workbench, a Part Design Body Feature (for instance a Pad) is not a stand alone solid, so is not used with a Part workbench Boolean.

This is explained here in excruciating detail culminating with an example where the same object is developed using each workbench exclusively:
https://wiki.freecadweb.org/Part_and_PartDesign
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
MarkMLl
Posts: 15
Joined: Thu Jan 20, 2022 11:12 am

Re: Reusing sketches, parts/bodies etc.

Post by MarkMLl »

chrisb wrote: Fri Jan 28, 2022 1:58 pm Sketcher has a tool to merge sketches.
...
wrong, you can have multiple features in a pattern.
...
The trick here is, to attach things properly
Thanks, terms to follow up noted.

I suspect that your emphasis on /attach/ might go a long way towards answering my original question.
From the outside a PartDesign body is as good as a solid made in Part workbench.
That's something I think I'd got. But it's still the overall sequence Document -> Part -> Body etc.

I'll work at it.
Last edited by MarkMLl on Fri Jan 28, 2022 5:34 pm, edited 1 time in total.
MarkMLl
Posts: 15
Joined: Thu Jan 20, 2022 11:12 am

Re: Reusing sketches, parts/bodies etc.

Post by MarkMLl »

drmacro wrote: Fri Jan 28, 2022 2:28 pm A Part Design workbench Body is the accumulation of all operations
I think that might be the important point. So in effect, it's a pointer to the tip entity.
This is explained here in excruciating detail culminating with an example where the same object is developed using each workbench exclusively:
https://wiki.freecadweb.org/Part_and_PartDesign
...which I've read and re-read. But earlier in the thread my workflow was criticised for being excessively linear, while according to the PDF that's the way things ought to be- in the context of Part Design workflow.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Reusing sketches, parts/bodies etc.

Post by GeneFC »

MarkMLl wrote: Fri Jan 28, 2022 5:33 pm ...which I've read and re-read. But earlier in the thread my workflow was criticised for being excessively linear, while according to the PDF that's the way things ought to be- in the context of Part Design workflow.
Sorry, I must have confused you with my opening comments. Your workflow was not excessively linear, your attachment strategy was.

The workflow should almost always be linear, i.e., try to avoid going back and adding something earlier in the tree. (It can be done, but it can also cause problems.)

The "attachment" recommendation is to avoid building a "house of cards". Instead, always try to anchor sketches to something that will never change, such as an origin plane.

Gene
MarkMLl
Posts: 15
Joined: Thu Jan 20, 2022 11:12 am

Re: Reusing sketches, parts/bodies etc.

Post by MarkMLl »

GeneFC wrote: Fri Jan 28, 2022 5:55 pm
MarkMLl wrote: Fri Jan 28, 2022 5:33 pm ...which I've read and re-read. But earlier in the thread my workflow was criticised for being excessively linear, while according to the PDF that's the way things ought to be- in the context of Part Design workflow.
Sorry, I must have confused you with my opening comments. Your workflow was not excessively linear, your attachment strategy was.

The workflow should almost always be linear, i.e., try to avoid going back and adding something earlier in the tree. (It can be done, but it can also cause problems.)

The "attachment" recommendation is to avoid building a "house of cards". Instead, always trying to anchor sketches to something that will never change, such as an origin plane.

Gene
Thanks for that, had me slightly worried.

I've obviously discovered the problems of adding and changing things... and of course these have been publicly aired by others. By and large I'm fairly confident with the sketcher and basic part design stuff, and this thread has given me quite a lot to go on... I'm definitely not out of the woods yet but there might possibly be a glimmer of light at the other end of the tunnel.

MarkMLl
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Reusing sketches, parts/bodies etc.

Post by GeneFC »

MarkMLl wrote: Fri Jan 28, 2022 11:32 am First, when making a pad one starts off with a single sketch, there is no effective way of merging two sketches.

The sketch has to have an unbroken outline and no connected internal lines, e.g. has to be a single rectangle rather than two rectangles even if two pairs of points were constrained to be coincident. If there are connected internal lines, the result is a TopoDS::Face error.
Often the easiest method to "merge" sketches is to pad or pocket them one after the other. As long as the result is a single solid it works fine.

The attached image is a fully constrained sketch. How would anyone in the world decide how to pad or pocket this sketch?

Sketch.JPG
Sketch.JPG (15.84 KiB) Viewed 493 times

Overlapping rectangles and other similar constructions have the same ambiguities.

Gene
MarkMLl
Posts: 15
Joined: Thu Jan 20, 2022 11:12 am

Re: Reusing sketches, parts/bodies etc.

Post by MarkMLl »

GeneFC wrote: Fri Jan 28, 2022 6:03 pm The attached image is a fully constrained sketch. How would anyone in the world decide how to pad or pocket this sketch?
You appear to be agreeing with me.

Look, I am /not/ /complaining/, OK? Now, the actual example I had was a triangle abutted to a rectangle, but as with my description it had two pairs of points constrained to be coincident. At that point, it would not be unreasonable to assume that the algorithm would eliminate the two edges which ran between those points.

I continued by observing that an unconnected shape (e.g. a circle) was used as an implicit pocket. Chris was kind enough to confirm that my observation was correct, and as I said it makes sense topologically.

Taking into account the edge-crossing behaviour and the finite precision of floating point arithmetic, and particularly taking into account the complementary pad/pocket behaviour which appears to be applied... well OK, it's not too bad that things work that way.

Which does of course leave me with the expectation that a sketch converted to a pocket will have internal disconnected shapes converted to pads. (I checked, it works.)

MarkMLl
drmacro
Veteran
Posts: 8873
Joined: Sun Mar 02, 2014 4:35 pm

Re: Reusing sketches, parts/bodies etc.

Post by drmacro »

If you really want to make a single sketch and Pad/Pocket with sub-elements of it, it can be done.

It is just not the normal paradigm of Part Design.

See the WIreFilter macro in the Addon manager.

Using multi sketches, IMO, provides an easier to follow feature tree, makes sketches simpler (which is a goal, since simple sketches are easier constrain and easier to modify and less prone to error.)

And, this is my preferred workflow. 8-)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply