cadtoons is a library that turns labeled SVG drawings into something that can be reshaped according to changing parameters. Though the library is somewhat useful for simple 2D manufacturing, its purpose is to make something like a Chernoff face for visualizing many-variable optimizations of engineering designs.
Example sandbox pages: Airplane | Quadrotor
- Make an SVG drawing * Inkscape is an excellent tool for this
- Give new and meaningful
id
s to the groups and paths that you want to control * in Inkscape do this with the "Object Properties" option, found in the context and Object menus or by pressing Ctrl-Shift-O - Run the
cadtoon.py
script on your new SVG * e.g../cadtoon.py example.svg
- If you run into any errors, please add an issue to this repository!
- Known bugs:
0. cadtoon doesn't work with objects (circles, rectangles, etc.)
- Solution: convert them to paths (Ctrl-Shift-C or the Path menu)
- cadtoon deletes absolute arcs ("A" commands)
- Solution: delete the absolute arcs if possible, or use the path editor to convert them to relative arcs.
- Translation on named groups that have been rotated follows the axes of their rotation, not x and y
- Sometimes, this is a boon, allowing easy translation at other angles. If you want x/y motion, though, you'll need to remove that rotation...
- For a group the easiest way to do this is by ungrouping, cutting the group elements, and pasting them back in place (Ctrl-Alt-V). Then regroup and rename the group
- For a path, cutting it and pasting it in place (Ctrl-Alt-V) should do the trick.
- Open the newly created "sandbox" page that cadtoons created at e.g.
example.html
* Play around with the sliders (see above for links to examples) * Add constraints to link elements so that they move together - (coming soon) Import the ractive-ready SVG (e.g.
example-ractive.svg
) into a gpkit model
cadtoons uses the lovely Ractive.js to animate SVGs.
- sandbox
- there should be a "compile" button/warning
- there should be a "reset" button