I had fun with this one, for other examples of people doing Stereographic Projection, I highly recommend https://www.thingiverse.com/threonin/. His stuff is amazing and I love it.
This is a writeup of how to use this OpenSCAD design using dxf files.
- I have only tested this on a square pattern, but there's no reason it has to be square, it could be rectangular or circular as well.
Instructions
- Find a black and white* pattern that you want to vectorize. Its easier if there aren't many grays. This step is skippable if you already have a monochrome vector pattern.
- I just googled "black and white pattern".
- Save the pattern to your computer.
- Inkscape Directions
- Open a new file in Inkscape (0.92) and *import* the imagefile. Don't 'Open', it can crash Inkscape. (png is good, jpeg is less good)
- Use the Menu -> Path -> Trace Bitmap tool.
- Make sure the image is selected or the tool wont work.
- I used the "Brightness Cutoff" option, Threshold: 0.45, You will want to play with these options to see what works best for your pattern.
- The new pattern is dropped ontop of, or underneath the original image, so you need to drag it off the imported bitmap image.
- You can tell which is which by typing F2 to select the edit pathnodes tool. The one with paths is the one you want. Delete the other one.
- Next we need to break up the paths into small pieces with the Menu -> Extensions -> Modify Path -> Flatten Beziers.
- This breaks the curved lines up into bite-sized pieces because OpenSCAD does not like dxf splines. If you have curves, this step is not optional.
- The smaller the "Flatness" variable, the more segments, so I used '0.1'. If you pick numbers greater than 1, you're likely to see chunky, rather than smooth shapes.
- Verify it by hitting F2 again, and then save the file to svg. (thats Inkscape's native format)
- Resize the Page by Menu -> File -> Document Properties
- Its important to have a page size that fully encompasses the pattern. Inkscape will cut off things that aren't on the page.
- I sized the page to exactly the size of the pattern, in px.
- Then I used the Menu -> Object -> Transform tool to (uncheck 'Relative') Move it exactly to (0,0)
- You can check the Layer name from Menu -> Layer -> Layers... For my scad-file you want it to be "Layer 1".
- Then SaveAs filetype .dxf
- Once you click OK, it will ask you about how you want to save it, Uncheck the ROBO-Master option, and Check the LWPOLYLINE option. I left it defaulted to base unit of pt, but using mm makes sense too.
- OpenSCAD
- When importing, OpenSCAD reads from the same directory that the scad file is in, but you can also use a full filepath. I was impatient, so my example assumes the dxf is sitting in the same directory as it.
- Its very helpful to know the size of the original image.
- I left helpful comments in the code to show you which variables to modify with what information.
Feel free to take out the Support Legs, if they are a bad fit for your pattern.
Also, this took literally 35 minutes to compile the stl, so be prepared.