#svg #graphics #template #generate #cam #filename #stationary

app stationary-cam

This safe CLI generates a stationary cam as .svg

4 releases

0.2.4 Jul 1, 2023
0.2.3 Jun 26, 2023
0.2.2 Apr 29, 2023
0.2.1 Mar 20, 2023

#45 in Data formats

37 downloads per month

MIT/Apache

22KB
261 lines

Crates.io

stationary-cam

This safe Rust CLI generates SVG templates for stationary cams.

Example

cargo install stationary-cam
~/.cargo/bin/stationary-cam \
    --filename "example" \
    --strokes \
        "S1=M 5,0 L 5,30" \
        "S2=M 5,0 L 5,30" \
        "S3=M 5,0 L 5,30" \
        "S4=M 5,0 L 5,30" \
        "S5=M 5,0 L 5,30" \
        "S6=M 5,0 L 5,30" \
        "S7=M 5,0 L 5,30" \
        "S8=M 5,0 L 5,30" \
        "S9=M 5,0 L 5,30" \
        "S10=M 5,0 L 5,30" \
    --diameter-mm 460 \
    --center-circle-radius-mm 18.0 \
    --outer-circles-radius-mm 5.0 \
    --outer-circles-margin-mm 50.0 \
    --vertices-per-millimeter 1

This will result in a SVG looking like this:

Result

Building the cam

You can use the generated SVG template to cut the cam out of a metal plate, cardboard or any other material. Depending on the material of the cam, you might need a different file format.

Using GIMP to convert the SVG to PNG

  1. When opening the SVG with GIMP, you can select the size of the picture.
  2. File -> Export As... -> example.png

Using Blender to convert the SVG to OBJ or STL

OBJ and STL files are often used for 3D printing or CNC woodworking.

  1. File -> Import -> Scalable Vector Graphics (.svg)
  2. Select all objects
  3. Object Data Properties -> Resolution Preview U -> See console
  4. Right click -> Set Origin -> Geometry to Origin
  5. Right click -> Convert To -> Mesh
  6. Select cam object and select all vertices
  7. Press E to move them up a bit
  8. Select tooth object and select all vertices
  9. ALT-N -> Flip
  10. Press E to move them down a bit
  11. n times: Select each side or two vertices and merge to last
  12. Select all objects
  13. Control-M -> z
  14. Right click -> Join
  15. File -> Export -> e.g. Wavefront OBJ / STL etc.

Using Inkscape to convert the SVG to DXF

DXF files are often used for metal laser cutting machines.

inkscape --export-type="dxf" example.svg

License

Licensed under either of these:

Dependencies

~1.1–1.7MB
~32K SLoC