Combining and exporting parts - the part concept seems to be an illusion

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!
moggie
Posts: 18
Joined: Mon Dec 28, 2015 3:11 pm

Combining and exporting parts - the part concept seems to be an illusion

Post by moggie »

Is it possible to export a part as opposed to the contents of a part? It seems that you have to select the contents, and any position adjustments recorded on the part node itself are not taken into account. In my example below, the two pillars are adjusted to xy 0,0 of part009 by settings on sp model as it was created offset from the origin in the first place, and then positioned relative to 0,0 with expressions on the part taken from reference constraints. If I select the 3 part nodes and export as STL, the result is mangled versions of the two pillars but not part009. If I select the active nodes within the parts, the pillars are misplaced. I tried various combining attempts and moving the pillar parts inside part009, all to no avail.

So in short, I'm stuck on how to export as the parts appear as a single STL file. I could take the sp model nodes out of the pillar parts, re calculate what the positioning needs to be and union them with the fusion in part009, but then there seems no benefit in the part concept if everything has to be a single part to be exportable intact.

Any suggestions on how to progress from here very welcome!
parts-problem3.PNG
parts-problem3.PNG (21.82 KiB) Viewed 6740 times
Attachments
parts-problem3.FCStd
(87.73 KiB) Downloaded 53 times
User avatar
NormandC
Veteran
Posts: 18584
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by NormandC »

I'm short on time and can't look at your FCStd file, but

moggie wrote: Wed Feb 14, 2018 1:44 pm So in short, I'm stuck on how to export as the parts appear as a single STL file.
Do you want a single STL with the 3 parts fused as one? If that's the case, then you are not using Part containers properly, and you should only have a single Part container, with the pillars inside it.

Otherwise, I don't understand why you want a single STL of three separate parts...
moggie
Posts: 18
Joined: Mon Dec 28, 2015 3:11 pm

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by moggie »

Thanks for the reply Norman, and yes, the intent is a single part. I ended up with the pillars as parts in their own right as I worked on the pillar separately, printed one on its own as a test, and now want to combine them with the case. Mentally I saw them as parts because they're entities that might get used in another part down the line, and at one point had the pillar parts inside part009 (i.e. "this part includes these other parts") as that intuitively made sense.

Anyway, copying the pillar part contents into the main part is presumably what I need to do, but then I'll lose the offsetting and rotation that is currently specified at the part level for the pillars. Is there a trick to creating a container to which the offsetting currently on the pillar parts can be applied to, such as intersecting each pillar with a cube and offsetting the result with the same expressions that are currently on the pillar parts?
User avatar
easyw-fc
Veteran
Posts: 3552
Joined: Thu Jul 09, 2015 9:34 am

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by easyw-fc »

moggie wrote: Wed Feb 14, 2018 6:29 pm ... and yes, the intent is a single part.
I use to merge in an union many STEP models and I needed exactly this feature... so I developed a macro to fuse Part containers, using their own relative placement...
Parts-unioned.png
Parts-unioned.png (156.93 KiB) Viewed 6580 times
Here is your file unioned and the STEP and STL exported file...
parts-fused.FCStd
(158.94 KiB) Downloaded 66 times
parts-fused.stl
(52.43 KiB) Downloaded 47 times
parts-fused-exported.step
(134.33 KiB) Downloaded 61 times
I used my WB kicadStepUp and its internal union button.
You can install the WB through the Tools menu.

Maurice
moggie
Posts: 18
Joined: Mon Dec 28, 2015 3:11 pm

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by moggie »

Many thanks Maurice, that's great! Replicated the stl generation. Progress continues a bit further.
jmaustpc
Veteran
Posts: 11212
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by jmaustpc »

moggie wrote: Wed Feb 14, 2018 6:29 pm Thanks for the reply Norman, and yes, the intent is a single part. I ended up with the pillars as parts in their own right as I worked on the pillar separately, printed one on its own as a test, and now want to combine them with the case. Mentally I saw them as parts because they're entities that might get used in another part down the line, and at one point had the pillar parts inside part009 (i.e. "this part includes these other parts") as that intuitively made sense.

Anyway, copying the pillar part contents into the main part is presumably what I need to do, but then I'll lose the offsetting and rotation that is currently specified at the part level for the pillars. Is there a trick to creating a container to which the offsetting currently on the pillar parts can be applied to, such as intersecting each pillar with a cube and offsetting the result with the same expressions that are currently on the pillar parts?
the solution is far more simple, .....I think,.... someone correct me if I am missing something....... but this certainly works for a simple example like I have attached.

A PartDesign "Part" can contain anything ....including another "Part". So you just have a hierarchy of "PartDesign Parts".

Lets say we have a Part - Car engine, it will contain Part - piston assembly, which will contain Part - piston as well as Part - Set of rings.

If you select the PartDesign Part at the top of the hierarchy, then then Parts below will also be exported in the manner you discussed.

So as far as I understand, all you had to do was create a new PartDesign Part and then drag and drop the other "Parts" into it.

I have not tested to see if you get an invalid stl though, it is possible intersecting solids may produce a non-manifold mesh.

OS: Ubuntu 16.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13289 (Git)
Build type: None
Branch: master
Hash: 23fff2b1d3a066d335dea509694e8f83f859d16a
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/Australia (en_AU)

my example is just a cylinder and cuboid.

I just realised I accidentally deleted the fcstd file, ....and I have to run now ...something urgent just came up, I got a call from a local farmer that he has a calf who's mum is too sick to look after her calf, so I have to go get the calf to hand raise it. But I have to go right now....I'll be back in a few hours or so.
Jim
chrisb
Veteran
Posts: 51227
Joined: Tue Mar 17, 2015 9:14 am

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by chrisb »

I hope the calf is well!
I have created a model according to Jim's advice and all three subparts are exported. However, The position of the sphere is different in FreeCAD and STL. I'm not sure if this is a problem of the export or of FreeCAD: The sphere is attached to YZ plane and is moved in Z direction.
FreeCAD.png
FreeCAD.png (27.82 KiB) Viewed 6379 times
stl.png
stl.png (14.34 KiB) Viewed 6379 times
sphereZ.FCStd
(13.62 KiB) Downloaded 47 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 51227
Joined: Tue Mar 17, 2015 9:14 am

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by chrisb »

Things are definitely wrong when one of the parts has a placement, which seems to be very natural for parts.
The placement is ignored on export.
We have seen this in other places as well, e.g. when creating a ShapeBinder and I think this is one of the most important issues concerning Parts and Bodies.
Currently as a workaround I never use Part Placement, but that degrades the part to be hardly more than a group.
Attachments
movePart.FCStd
(13.63 KiB) Downloaded 48 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
easyw-fc
Veteran
Posts: 3552
Joined: Thu Jul 09, 2015 9:34 am

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by easyw-fc »

chrisb wrote: Thu Feb 15, 2018 7:50 am Things are definitely wrong when one of the parts has a placement, which seems to be very natural for parts.
The placement is ignored on export.
We have seen this in other places as well, e.g. when creating a ShapeBinder and I think this is one of the most important issues concerning Parts and Bodies.
Currently as a workaround I never use Part Placement, but that degrades the part to be hardly more than a group.
What is really missing atm is a single copy with the respect of relative placement
I posted already a mantis bug request
https://www.freecadweb.org/tracker/view.php?id=2905
unfortunately it is still unassigned
here some thread with similar issue
https://forum.freecadweb.org/viewtopic. ... 0&p=167153
https://forum.freecadweb.org/viewtopic. ... 41#p195863
Last edited by easyw-fc on Thu Feb 15, 2018 6:41 pm, edited 3 times in total.
oldmachine
Posts: 241
Joined: Wed May 31, 2017 11:49 pm

Re: Combining and exporting parts - the part concept seems to be an illusion

Post by oldmachine »

I admit to not reading the details of all responses as they confuse my oldmachine brain.
I glean that you want to export an STL of the complete gizmo with the related stuff in the correct location.

This may help - and I apologize for stepping on toes by saying, regardless of how the FreeCad capabilities were coded and intended, I use them the way that works for me. To that end:

Using the PartDesign Workbench.
First, I decide how I'm going to use the model, then decide how to model it (regarding Parts and/or Bodies).
Having said that - attached shows Two dumb models: One from a Part, with it's Bodies, the other from Bodies (no Part).

In each case, the individual bodies can be selected and exported as individual STL's. (Could also select the Pad/Pocket and export them individually).
In each case, the individual bodies can be selected at same time and exported as a unified STL.

In either case, the Bodies (and features) end up in the correct location in 3D space. Shown in software I use for Printing 3D (as long as the 3D software pref's are set to NOT center upon Import).

So, in the end, Design it the way you want it and Export the Part and/or Bodies for your needs.
[UPDATE} added the two files
Last edited by oldmachine on Thu Feb 15, 2018 4:50 pm, edited 1 time in total.
MAC OSX Sierra
3D Parts & Links (made using FreeCad and Solidworks): https://www.thingiverse.com/Still_Breathing/designs
Android App & Links: https://play.google.com/store/apps/deta ... .bestknots
Post Reply