So I have been hinting at the work being done on my 2D library. I have finally
published it, it is called pantograph
and you can find it on npm as pantograph2d
(because some crypto guy took
pantograph
).
My aim is to create a full JS (typescript) library that does what the 2D operations of replicad do - but with sane data structure, lots of tests and a good understanding of what is going on. In other words, it should fit my list of features
This is really the ship it version of this project, it only supports straight lines, it needs some low hanging optimisations, there are some bugs I am aware of that I need to fix and lots of work ahead.
But, it already fixes some issues that I had with my replicad implementation. I like the data structure I have build (and described here). And now everything is built with tests - so I know what is breaking and can reproduce, isolate and fix my bugs.
Basic roadmap
So now where do I want to go from here?
- add support for arcs (and different ways to create them)
- port the replicad code for offsets (and fillets)
- add Béziers
- add ellipses
- support non linear affine transformation (stretching models are important for sketching on faces in replicad)
- replace the 2d opencascade based code in
replicad
withpantograph
. - implement some automatic exploratory, fuzzy tests
- figure out how to handle combinations of strands with the
Diagram
data structure I have so far - document everything
Further down the line I would love to explore further topics
- add good text, SVG and DXF import (some of it can be ported from the work I did for replicad)
- implement a
split
operation that is similar to booleans but can also work withStrand
s. - optimize the algorithms
- add approximation logic
- add BSplines
- explore what a declarative API might look like