Sometimes I need a 2D vector version of something that is a 3D model. Here’s how I do it. First, if there is an STL file, I load that into OpenSCAD.
For this model I wanted a top view so I could use the hole pattern to laser cut a mounting plate.
I select Show Axes because I’m gonna need that later…
The axes will show the center of the canvas, and luckily our model is centered…
Change the view from Perspective to Orthogonal…
If you don’t know the difference between perspective view and orthogonal view, do some research I guess. (I probably learned about them in 7th grade drafting class.) Otherwise, switch between the views and it should make sense…
Okay, next I view the object from the front. Looks good!
I then add the
translate command so that I can move the object in 3D space, and I lower it down, in this case 10mm, because the center line is where it will be cut.
projection(cut=true) then cuts a slice at the zero point in the Z axis… But we’re not done yet.
(Oh, if you choose
cut=false you’ll just get the whole object, not a slice at a specific cross section of it.)
Here we can see what it looks like at an angle, which might make a bit more sense…
Let’s switch from orthogonal back to perspective view… Not required, but I’ll do it anyway.
Back to the top view… and now with the
projection you can see the slice we took from the 3D model.
The next step is important… we need to Render the file! You can’t export the SVG file until you render your model.
The model will change… in this case you can see the shapes are now green with red outlines.
And now we can Export as SVG. (You could also use DXF if you need to, though that’s a garbage format I tend to avoid.)
Here’s the SVG open in Inkscape. Brilliant! I can now add to it, and my hole pattern is spaced properly for the mount I want to make. Excellent.