discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Solved! (kinda) using openscad to export dxf files

D
digital
Wed, Jan 21, 2015 8:53 PM

if you want to slice your stl and use openscad to export them to a dxf format
then try this workflow

  1. in Autodesk Meshmixer, go to Edit-> Align and select Type:AAbox
  2. in Meshmixer go to Edit-> Make slices and select Method:Stacked 3D
  3. in Meshmixer, select each slice and click Edit-> Make solid
  4. Export each slice that has been converted to a solid as an stl file
    (layer1_solid.stl, layer2_solid.stl, etc.)
  5. In openscad, import your stl
  6. use the following code

projection(cut=true)
translate([0,0,-z)
import("yourstl.stl");

Your z will be dependent on your stl file. To the best of my knowledge,
there is no module that will give you the origin of the stl file or place it
at the origin. I just experimented with different values. I believe aligning
the stl in Meshmixer will place the bottom of your stl at [0,0,0]

  1. export to DXF!

The tricky part is that you can't iterate the process with a for loop.
Others have suggested running shell commands but my stl was small enough
where I could just do it manually.

There might be a better way to do this but this worked for me. Cheers

--
View this message in context: http://forum.openscad.org/Solved-kinda-using-openscad-to-export-dxf-files-tp11188.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

if you want to slice your stl and use openscad to export them to a dxf format then try this workflow 1. in Autodesk Meshmixer, go to Edit-> Align and select Type:AAbox 2. in Meshmixer go to Edit-> Make slices and select Method:Stacked 3D 3. in Meshmixer, select each slice and click Edit-> Make solid 4. Export each slice that has been converted to a solid as an stl file (layer1_solid.stl, layer2_solid.stl, etc.) 5. In openscad, import your stl 6. use the following code projection(cut=true) translate([0,0,-z) import("yourstl.stl"); Your z will be dependent on your stl file. To the best of my knowledge, there is no module that will give you the origin of the stl file or place it at the origin. I just experimented with different values. I believe aligning the stl in Meshmixer will place the bottom of your stl at [0,0,0] 7. export to DXF! The tricky part is that you can't iterate the process with a for loop. Others have suggested running shell commands but my stl was small enough where I could just do it manually. There might be a better way to do this but this worked for me. Cheers -- View this message in context: http://forum.openscad.org/Solved-kinda-using-openscad-to-export-dxf-files-tp11188.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Wed, Jan 21, 2015 10:20 PM

To the best of my knowledge, there is no module that will give you the

origin of the stl file or place it at the origin.

I'm not into dxf, but had you seen
https://en.wikibooks.org/w/index.php?title=OpenSCAD_User_Manual/General&section=16#Getting_input


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/Solved-kinda-using-openscad-to-export-dxf-files-tp11188p11190.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

> To the best of my knowledge, there is no module that will give you the origin of the stl file or place it at the origin. I'm not into dxf, but had you seen https://en.wikibooks.org/w/index.php?title=OpenSCAD_User_Manual/General&section=16#Getting_input ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/Solved-kinda-using-openscad-to-export-dxf-files-tp11188p11190.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Wed, Jan 21, 2015 10:21 PM

oops... STL not dxf.. Slaps back of head...


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/Solved-kinda-using-openscad-to-export-dxf-files-tp11188p11191.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

oops... STL not dxf.. Slaps back of head... ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/Solved-kinda-using-openscad-to-export-dxf-files-tp11188p11191.html Sent from the OpenSCAD mailing list archive at Nabble.com.