Skip to content

Diving into 2D

Posted on:March 9, 2023

Projections

A pretty projection

Looking at build123d’s documentation. I really liked their way to project 3D object in a SVG. As I am also using open cascade it should have been easy. It wasn’t too difficult, but opened a way to do some yak shaving.

I wanted to expose the point of view to project into in a way that was intuitive to the user. First, I am quite happy to have replaced the give me an axis approach of open cascade with a camera (which should be more intuitive if you are not too deep into geometry).

Then I wanted a way to expose standard projections. That’s when I found this page on Wikipedia. So I implemented it as an example on the replicad docs site. I stopped myself before creating a single use page to generate them from any STEP file.

It also helped me find some bug in the SVG renderer (from drawings).

I can still see some issues when I approximate circle looking BSplines into cubic Bézier. This is a bit annoying, but I don’t have a good solution (yet).

Writing down things I have learnt

I had an interesting discussion when I realised that I should communicate more the things that I have learnt. Even if it interests just me, this is a good way to not loose what I delved into.

So the first result is this post on my main blog. The second thing is this devlog and post!

Going 2D

As the conclusion of the blog post might have suggested it, I have started to work on my own 2D CAD library. I want to extract the code I have written for replicad (boolean operations and offsets) and add my own version of the primitive (which should not be too difficult I hope).

I have slowly started (and not published anything). As a way to make sure I don’t implement things in a too stupid manner I have started reading a book that seems good on the topic. It is quite fun to refresh some old linear algebra notions!