Skip to content

bqpd/cadtoon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

cadtoon

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

How to use cadtoons

  1. Make an SVG drawing * Inkscape is an excellent tool for this
  2. Give new and meaningful ids 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
  3. 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)
      1. cadtoon deletes absolute arcs ("A" commands)
      • Solution: delete the absolute arcs if possible, or use the path editor to convert them to relative arcs.
      1. 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.
  4. 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
  5. (coming soon) Import the ractive-ready SVG (e.g. example-ractive.svg) into a gpkit model

cadtoons Dependencies

cadtoons uses the lovely Ractive.js to animate SVGs.

TODO

  • sandbox
    • there should be a "compile" button/warning
    • there should be a "reset" button

About

Tools for making animatable svg "cartoons" of engineering models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages