Assembly export

345 views
Skip to first unread message

nairb nilpop

unread,
May 1, 2021, 2:46:51 PM5/1/21
to CadQuery
Is there an easy way to export an assembly as an amf or stl file?

Adam Urbanczyk

unread,
May 1, 2021, 6:58:42 PM5/1/21
to CadQuery
Yes, you can use toCompound and then regular exporters.

m...@geosol.com.au

unread,
May 1, 2021, 7:33:59 PM5/1/21
to CadQuery
Just for my own information, why do you want to export an assembly to an STL/AMF (as opposed to exporting a single solid to STL/AMF)?

nairb nilpop

unread,
May 1, 2021, 10:33:13 PM5/1/21
to CadQuery
First off I'm brand new to CadQuery and I'm learning as I go.  If you look at my other post from today, I built an object from parts (an assembly) to get it to work.  Bottom line is that I'm not a CAD guy but I am a programmer so I'm probably missing some design patterns to make this work efficiently. I've played around with Fusion 360 so I know the very surface of CAD.  I'm highly impressed with CadQuery, but there aren't many resources for noobs so I'm hacking my way through it.  OpenSCAD was a joke (in my opinion) but CadQuery seems like the real thing.  I feel like I'm 3 steps away from the "a-ha" moment where it all clicks into place. So, that's the long answer :-)

m...@geosol.com.au

unread,
May 2, 2021, 7:18:06 PM5/2/21
to CadQuery
I was just wondering what you were using downstream that used the STL as an input. It's pretty rare to use an STL containing multiple solids.

Although I'm not actually sure if Assembly -> toCompound -> STL would contain multiple solids (referring to the STL definition of solid here), or just one solid with a discontinuous mesh.

nairb nilpop

unread,
May 2, 2021, 9:52:14 PM5/2/21
to CadQuery
Ok, I'll have to try toCompound and see.  I use CAD for 3d printing.  The 3d printer I have has a multi-color adapter that needs multiple solids to print the colors correctly.  So, multi-color prints are the ultimate goal once I get the basics down.

-Brian

m...@geosol.com.au

unread,
May 2, 2021, 10:33:18 PM5/2/21
to CadQuery
Ah, OK, that is certainly a good use for multiple solids in one STL file. You're going to have trouble with Assembly.toCompound though, I just checked and it creates one STL solid with a discontinuous mesh.

On the other side, Prusa Slicer ignores multiple solids in an (ASCII) STL anyway: https://github.com/prusa3d/PrusaSlicer/blob/version_2.3.1/src/admesh/stlinit.cpp#L121

For Prusa Slicer you can export to multiple STLs (one per Solid) and import them together. It recognises them as one part and positions them properly.

Good luck!

Craig Trader

unread,
May 12, 2021, 12:36:15 PM5/12/21
to CadQuery
It would be even better if CadQuery could export multiple solids in a 3MF (https://3mf.io/specification/) file. This would avoid the reassembly step that Brian mentioned above.

- Craig -

Adam Urbanczyk

unread,
May 13, 2021, 3:21:09 PM5/13/21
to CadQuery
For now GTLF is planned and OBJ would be easy with VTK. No specific plans regarding 3MF - contributions are welcome.

Best,
Adam 

Reply all
Reply to author
Forward
0 new messages