modelling multiple bodies in a single part file

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
emills
Posts: 36
Joined: Fri Jan 06, 2012 3:17 am

modelling multiple bodies in a single part file

Post by emills »

this post is about general modelling philosophy. sorry it ended up so long. i hope a few people might be interested in starting a conversation on this topic.

a few days ago i posted about Freecad's behavior when trying to pad or revolve a sketch drawn on an arbitrary plane. i think some inconsistencies were addressed in the last PPA update.
i believe the changes, apart from the straightforward goal of consistent behavior, are driven by the goal of making pad, extrude, and revolve(s) always generate a single solid object.
this is a great default behaviour, but i am curious as to why it should be an absolute, as opposed to being able to change this default (return individual body for pad).
the following things i've noticed will seem very silly, as in "why would any serious engineer ever want to model like that?", but i can think of at least one compelling practical use case, and i'm sure there are many more.

right now, if i pad a sketch of two separate rectangles, one of them just gets ignored and so i get a single box (single body rule).

if i sketch on a solid face, but actually draw outside of that face and pad the sketch, freecad does not complain, but it does not make the pad. it just returns a copy of the base solid and hides the original.

if i draw a sketch on an arbitrary plane (using python to create an arbitrary face), part extrude works in the default z, but checking the box for "along normal" does nothing. it keeps extruding in z. not clear what "this option works for planes only" means, but it keeps returning z extrudes.

but there is nothing stopping me from making as many pads from individual base sketches as i want. or add as many disjoint primitives as i want. this is great until we get the assembly module, so it's possible to assemble things in a single part file. when the assembly module is out, will we lose the ability to create multiple bodies?

the one thing i really-really want multiple bodies for is multiple configurations: the basic idea is you model and entire simple assembly as a part file, so parameters are clearly linked, you won't lose parts when moving files, etc. then you save configurations with only one body shown in each of them, and choose the right configuration when you drop it in the assembly.

simple example: a whole hinge
-left side
-right side
-pin

all in one part file, separate bodies, but only one file to open to change the pin diameter and update all 3 bodies. one plate thickness parameter for both sides. put 3 of them in an assembly, edit to have one in each configuration, constrain both plates to the pin....we're in business! this is a legitimate method currently in use in high$$$ software. on my important models, i never hunt down individual parameters all over a bunch of sketches. i open the excel spreadsheet where all the configurations are listed, and add new configs with appropriate values under the linked variables (suppression state, length values, color, etc)

another use, even though it ends up forming a single body is the "extrude up to surface" technique, where the sketch does not touch the surface where the extrusion/pad will eventually connect.
we could actually do this right now by extruding beyond the target surface, boolean subtract a copy of the target, delete the leftovers on the other side, then fuse the cut extrusion and the target body.
i had imagined that this method would eventually make its way into the options of the pad, but if i can't start a pad from a sketch floating on an arbitrary plane, it's a non-starter.

sometimes, it just makes a whole lot more sense to model different subparts (disjoint bodies but constrained by each other) and then connect them, then to insist on growing everything out of a base feature.

i personally think that in the end, even with the best design rules, some people are still going to model terrible parts. enforcing these rules on everyone sometimes just makes life harder. also, a lot of the design rules in proprietary design software are more reflections of manufacturing limitations than "perfect design". that's great, for example a sheet metal module needs to stay within the realm of practical sheet metal processes. allowing users to make spheres or non linear bends would be dumb. but with 3d printing coming along by leaps and bounds, some of these rules are becoming less relevant.
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: modelling multiple bodies in a single part file

Post by jriegel »

Yea, I see your concerns, but! ;)

I don't want to mix up creation and positioning of parts (solids in case of PartDesign). Cause the next questions
you guys ask is: Why can I not position a two solid pad with assembly methods differently? how should a user later
on distinguish this two cases without a really deep look under the hood?
I know that Multi$$$ programs offering dozenth of modeling ways, but they have thousands of programmers.
I would say let us implement first
one
way of modeling consistently to the end until calling for
others.
Stop whining - start coding!
emills
Posts: 36
Joined: Fri Jan 06, 2012 3:17 am

Re: modelling multiple bodies in a single part file

Post by emills »

Hi Jurgen, thanks for the reply
i understand what you're saying about having one approach fully implemented before branching. and as i don't write c++ myself, i am definitely grateful for whatever you guys contribute to us.
i was just curious because it seemed to me that implementing those restrictions was additional work as it is, and i was afraid it would introduce roadblocks for later.
I don't want to mix up creation and positioning of parts
to me, the value in that hinge plates and pin example is not the positioning but that it is an easy way to share common parameters between a few parts.
next questions you guys ask is: Why can I not position a two solid pad with assembly methods differently?
oh. that would be bad....no one should never ever actually try to use a part with disjoint bodies for anything :shock: they should all be turned off except for the one that represent the actual part. kinda the same thing as suppressing the components of a boolean and showing the result. inserting parts with more than one body into an assembly file is.....i don't know, i had never actually considered it :)

here is a hypothetical question. it's not at all a demand for freecad, and i can do it in python anyways. i am just curious how you think freecad's gui workflow should deal with this:

say i have a solid cylinder and i want cut a 'pocket' out of it's rounded side (no object plane to sketch on), but it cuts into the piece at a slight angle (so a new sketch on standard planes to make a cut object won't work)?

the goal here is not create disjointed bodies, but they are needed them as temporary tools. unless i can 'pocket' from a sketch on arbitrary plane, or make a new object to cut with on an arbitrary plane, i don't know what to do. i can do it in python and just make the solids directly, but then i don't have access to the sketcher. so i end up solving matrices in the script just to find silly things like line intersection points and it slows me down quite a bit.

actually i know a way to do it using the sketcher, pads and only a little bit of python, but it is very silly and i know you don't want anybody to do such a stupid thing with your program, so i won't say how i do it! :D
carlod
Posts: 81
Joined: Mon Oct 03, 2011 2:52 pm

Re: modelling multiple bodies in a single part file

Post by carlod »

emills wrote:say i have a solid cylinder and i want cut a 'pocket' out of it's rounded side (no object plane to sketch on), but it cuts into the piece at a slight angle (so a new sketch on standard planes to make a cut object won't work)?
Here a simple file where i do the trick.. ;)
Attachments
3d_air_shell.FCStd
(13.04 KiB) Downloaded 82 times
emills
Posts: 36
Joined: Fri Jan 06, 2012 3:17 am

Re: modelling multiple bodies in a single part file

Post by emills »

oh, like i said...i can do it too. but it's dirty dirty trick 8-)
notice how my pocket cuts at an angle? ;)

did you move your sketch by hand with the placement variables? my method defines the plane with 3 points, as i have not had any luck using the placement variables. it looks like the sketch is moving, but then it just snaps back when i leave the property screen.

i've also noticed that if i 'play along' with the rules to get a feature created...i can come back and edit it into something that freecad would have refused to make directly. did you perhaps create the pocket sketch on zy plane and then slowly back out the sketch from the solid? that would be pretty sneaky.

Image

Uploaded with ImageShack.us
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: modelling multiple bodies in a single part file

Post by wmayer »

it looks like the sketch is moving, but then it just snaps back when i leave the property screen.
Once a sketch is attached to a support it uses the placement information of the corresponding face. Thus, trying to change the placement by hand doesn't work any more.
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: modelling multiple bodies in a single part file

Post by jriegel »

the common parameter space is a argument, but :D

There will be a parameter propagation and interface mechanism in Assembly/PartDesign.
Basically you can define a "Interface" to a Assembly or Part which define driving parameters from outside.
This interface can change parameters in features and sketches. This replicates on different level of Assemblies to.
So you can put your parameters in there (mostly known as templated design) to change your design in a well defined way...
Stop whining - start coding!
Post Reply