← Back to context

Comment by bigfishrunning

20 hours ago

My whole CAD experience is with OpenSCAD, which apparently uses the same kernel; Honest question -- what is the alternative? I would assume the vast majority of 3D model processing relies on triangle meshes...

Meshes are an output, not a source, and not a good internal representation.

Meshes are only a lossy approximation of the actual geometry, and the errors accumulate as features reference off of earlier features.

A simple example is a line tangent to an arc. The line will only be the correct distance from the center of the arc at one point (one angle) per segment.

In openscad you don't notice the problem because since it's code and you have variables and programming ways of expressing relationships, you would usually not try to derive one thing from another by geometry, instead both things would reference a common ancestor variable. But that's a technical implimentation detail that works around the problem by just not doing a thing that doesn't work. The problem is still there that a valid geometry constraint would produce invalid results.

SolveSpace is available in library form. It uses NURBS to represent surfaces, with triangles as a fallback.

https://solvespace.com/library.pl

  • Notably the library was used (at least for a while) in the development of Dune 3D:

    https://dune3d.org/

    but then the author used the source directly as noted in the Github footnote:

    >I ended up directly using solvespace's solver instead of the suggested wrapper code since it didn't expose all of the features I needed. I also had to patch the solver to make it sufficiently fast for the kinds of equations I was generating by symbolically solving equations where applicable.