What does HackerNews think of manifold?

Geometry library for topological robustness

Language: C++

I doubt if it is possible to have a practical small kernel. Take mesh processing in https://github.com/elalish/manifold for example, we encountered a lot of problems when trying to deal with inexact floating point arithmetic. Using exact arithmetic can probably result in much simpler code (doesn't make sense in our case because the point of the library is about dealing with inexact arithmetic), but exact means slow. Also, a lot of code is about fast-paths that occurs frequently, data structures and algorithms that cut down complexity but are difficult to implement. Can we remove those fast-paths and complex algorithms? Probably yes, but this will slow things down a lot.
I think the interesting thing about CAD kernel is that there are different representations and limitations to each representation. You have triangular (or polygonal) mesh, BREP which uses NURBS, SDF which is based on functional representation. I have experience working with triangular meshes and SDF so here are my opinions about them, please correct me if I am wrong:

Triangular mesh is conceptually simple, but requires many faces to approximate curved surfaces with high precision (you may be able to use subdivision surface in some cases but intersection/union in those cases are more challenging). Also, for more complicated models, floating point errors really add up and you either have to use an exact representation (which is really slow) or try some other approaches which can be robust w.r.t. errors (e.g. https://github.com/elalish/manifold but it is really hard to get right). Another disadvantage comparing with BREP is the lack of constraint solving, which I will write about it below.

SDF is nice for mathematically defined objects. They are computationally intensive, so some sdf libraries use GPU to speedup the computation. There are approaches that can speed up the evaluation, but doesn't work well if the function is not really the distance (https://github.com/curv3d/curv/blob/master/docs/shapes/Shape...).

-----

Constraints solving: This is a big problem with mesh-based CAD. Traditional CAD usually allows you to have under-defined constraints, and users can iteratively set constraints until the model is fully defined. There is no such a thing (yet) with mesh-based CAD. Also, we don't really have nice ways to represent constraints relative to curved surfaces because there is no curved surface in our mesh...

Also, one particular challenge with text-based (or code-based) CAD is how to select the surfaces with an ergonomic API. GUI can solve this problem but writing a good GUI is a complicated task (that I am not willing to touch).

Unhealthy relationship with keyboards? Comparing with the r/MechanicalKeyboards or r/ErgoMechKeyboards people this relationship is more like divorced...

I added python binding and ended up being on of the devs for https://github.com/elalish/manifold because OpenSCAD is too slow for my modeling (I am quite impatient). Optimizing my keyboard for months with more than 5 complete rebuilds to optimize my design (looks like this: https://i.redd.it/xtf0f54mt7ya1.jpg), and is afraid of open sourcing it because my code looks too bad :(

Offtopic shoutout for solvespace, it is amazing! Is separating out the geometry code into a stand alone library on the roadmap at all? Or plans to incorporate the manifold library?

https://github.com/elalish/manifold

Now much faster and more stable thanks to the Manifold engine (https://github.com/elalish/manifold): in fact it is often faster than the last stable desktop release from https://openscad.org/.

Also much better code completion, and ships with a few examples from the various bundled libraries to get you started.

If you are doing some simpler modeling and OpenSCAD is enough for the job, you may want to have a look at https://github.com/elalish/manifold which is a mesh boolean library designed with robustness and performance in mind.