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...
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.
Breps. Nearly all commercial cad packages operate on boundary representations of objects.
Mesh is also a boundary representation. I think you meam NURBS.
It's just the name, BREP stands for Boundary REPresentation.
I would start with CSG if you are new to these ideas:
https://en.wikipedia.org/wiki/Constructive_solid_geometry
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.
OpenCASCADE?
https://dev.opencascade.org/
Notably wrapped by build123d into cad as a code package
pythonocc is a joy
https://github.com/tpaviot/pythonocc-core
libfive