Microsoft recently open sourced, twenty five days ago, Maker.js — a JavaScript library to create drawings on the browser for CNC and laser cutting.
I love the playground site they made to share parametric scripts (say, of a smiley face, a hello, world text, a floor plan, and more). See all demos.
From their website:
- Drawings are a simple JavaScript object which can be serialized / deserialized conventionally with JSON. This also makes a drawing easy to clone.
- Other people's Models can be required the Node.s way, modified, and re-exported.
- Models can be scaled, distorted, measured, and converted to different unit systems.
- Paths can be distorted.
- Models can be rotated or mirrored.
- Find intersection points or intersection angles of paths.
- Traverse a model tree to reason over its children.
- Detect chains formed by paths connecting end to end.
- Get the points along a path or along a chain of paths.
- Easily add a curvature at the joint between any 2 paths, using a traditional or a dogbone fillet.
- Combine models with boolean operations to get unions, intersections, or punches.
- Expand paths to simulate a stroke thickness, with the option to bevel joints.
- Outline model to create a surrounding outline, with the option to bevel joints.
- Layout clones into rows, columns, grids, bricks, or honeycombs.
Via @alfarok's GitHub stars.