Skip to content

Reaching feature parity

Posted on:April 20, 2023

Importing the offsets and fillets code from replicad was faster than the booleans - which mean that demo now can look a bit cooler. So I implemented one in observable HQ.

The good news is that it works and is cool. The other “good” news is that it is not too difficult to make the algorithm fail by changing the parameters in the notebook. Next step is to import failure as test cases and fix them!

It also means that I am slowly reaching feature parity with the existing libraries (flatten js being the best one). I can now start work on going on feature that are beyond the scope of what already exists.

Some projects in the space I just discovered

react-cad

If I had discovered this before going into replicad I might have just stuck to it. It does what I wanted then - offer a programmatic interface to build things as software.

It does take a different approach than replicad, it is declarative first. With a React custom renderer at the core of the model it defines operation as JSX tags and allow the user to declare the model.

In terms of technology it is also built on top of open cascade - but it uses its own C++ code to wrap the primitives.

I will definitely keep an eye on this!

kurbo

This is another pure 2D library I did not see before starting pantograph. This rust crate takes the opposite approach than most of the libraries I looked at when writing about the space.

The primitive is the (cubic) Bézier curve and other curves are converted as this kind of curve. Most libraries tend to take the opposite approach and convert Béziers as sets of arcs of circle.

I do not see myself going that direction. I feel like it is better to keep some of the semantics of what was create when working with it. I might be wrong though.

But I will definitely also keep an eye on that project. Especially because of the research it does on improving approximations with Bézier.

Looking at DE-9IM

I have started exploring the choices I have for defining what kind of intersections I want to support.

Because it is exposed in flatten-js, I read a bit about the DE-9IM way to describe relationships between objects.

I don’t feel like this is the appropriate conceptual tool for what I want to achieve with pantograph. The model is made to query topological object in a GIS framework. I want to structure objects such that their relationship is plain to understand.