Skip to content

Lucandia/3d_pattern

Repository files navigation

3D Pattern

A simple interface to generate soap dishes for 3D printing Visit the original Printables page!

Try the web app:

3d_pattern powered by streamlit

Streamlit App

Convert png to svg

To convert a png to a svg I suggest using 'vectorize bitmap' on Inkscape. On Linux, you can install the packages imagemagick and potrace, and use the terminal commands:

convert YOUR_FILE.png YOUR_FILE.pnm
potrace -s -o YOUR_FILE.svg YOUR_FILE.pnm
rm YOUR_FILE.pnm

Generate your soap dish from the svg:

You can use OpenScad to generate the soap dish. The code is stored in the file 'soap_dish_openscad.scad' and it is pretty simple:

union(){ // merge the pattern and the border
  import("YOUR_PATH/border.stl");
    intersection(){ // select the pattern area of the soap dish and make a slope
      linear_extrude(height = 5) // extrude the svg
        translate(v=[X_TRAN,Y_TRAN,0]) // translate the svg image
          rotate(a=[0,0,Z_DEG]) // rotate the svg image
            scale([X_SCALE,Y_SCALE,1]) // scale the X and Y axis of the svg
              import(file = "YOUR_PATH/YOUR_FILE.svg", center = true);
    import("YOUR_PATH/intersect_base.stl");
}}

Remember to change:

  • X_TRAN, Y_TRAN with the displacement to move the image
  • Z_DEG with the angle to rotate the image
  • X_SCALE, Y_SCALE with the scale of the x-axis and y-axis
  • the file paths for 'intersect_base.stl' and 'border.stl' (you can find the files in the Github repository)
  • the file path for your svg file.

Donate

I enjoy working on this project in my free time, if you want to support me with a coffee just click here!

License

Code is licensed under the GNU General Public License v3.0 (GPL-3.0)

License: GPL-3.0

Models are licensed under the Creative Commons Non Commercial Share Alike License 4.0 (CC BY-NC-SA 4.0)

License: CC BY-NC-SA 4.0

About

A simple interface to generate soap dish for 3D printing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published