gringer / bioinfscripts

Bioinformatics scripts produced over the course of my work. Now maintained on GitLab.
https://gitlab.com/gringer/bioinfscripts
GNU General Public License v3.0
66 stars 14 forks source link

Instructions for stl2svg.pl? #1

Closed Sjaak1 closed 8 years ago

Sjaak1 commented 8 years ago

Could you explain how to use the stl2svg.pl script?

Thanks in advance!

gringer commented 8 years ago
  1. Create an STL file which is orientated so that the Z axis points in the desired view direction [this creates an SVG file from a top-down view]
  2. Run stl2svg on the STL file, and pipe the output to an SVG file name

Example OpenSCAD script to generate an STL file:

rotate([-45,0,0]) import("/home/gringer/models/halo/Halo_4_Helmet_Medium_Size_B/M_ChinFront_r1_0.stl");

Command line:

$ inkscape --export-dpi=600 --export-png=halo_example.png <(~/scripts/stl2svg.pl halo_example.stl)

Result:

halo_example

I've added these instructions to the top of the perl script. I did submit this script to the OpenSCAD mailing list, and I think that the SVG output functionality of OpenSCAD has been modified to work in a similar way.