I've seen people quote a good modern CAD kernal as a 100 man year project. It's probably not going to happen, maybe there's some avenue for government funding?
Alternatively Signed-Distance-Functions are pretty nice. They're not BREP, but they're a lot easier to implement, and it might be possible to shove them into a BREP-shaped hole.
Here's a signed-distance-function based CAD kernal written in a few thousand lines of python+numpy, that seems to be about as fast as openscad. Maybe faster. https://github.com/fogleman/sdf
It just uses marching cubes for triangulation but the SDFs are all numpy'd and the SDF is evaluated in batches on multiple threads so it's relatively fast.
I wrote it because I was a little frustrated with OpenSCAD. SDFs make it trivial to do things like rounded corners, for example.
- https://github.com/nickc92/ViewSCAD
- Matt Keeter's stuff (listed here https://www.mattkeeter.com/projects/, including https://github.com/mkeeter/antimony and https://www.mattkeeter.com/projects/ao/, though I see you have libfive)
- https://solvespace.com/index.pl
- https://mirmik.github.io/zencad/en/
- https://github.com/fogleman/sdf
This is from a list entitled "migrate away from OpenSCAD", but somehow I can never manage to do that...Thanks for this site!
Yeah, I think that's a consequence of how they're constructing the objects. But things like signed distance fields make that easier* because it'd just be "expand the SDF by 3mm" - https://github.com/fogleman/sdf has `shell` for this.
* if you can wrap your head around the math/geometry, I guess
Holy crap, why have I not seen this before?!?!!? I was even planning to start coding something like this myself. This is awesome! Thanks!!!!