Remix.run Logo
dgroshev 3 hours ago

The way modern CAD systems work is by having a tree of features/actions that is then used to construct an analytical representation of a 3D object. The features/actions can rely on "sketches" (2D drawings that are coupled with a real time geometric constraint solver) and can be "projected" into sketches, creating new reference lines, that can then be used by the sketch constrain solver, generating a sketch that can be used for more 3D features.

This is already complex and fiddly enough. Just having a stable 2D drawing environment that uses a constraint solver but also behaves predictably and doesn't run into numerical instability issues is already an achievement. You don't want a spline blowing up while the user is applying constraints one by one! And yet it's trivial compared to the rest of the problem.

Having 3D features analytically (not numerically!) interacting with each other means someone needs to write code that handles the interactions. When I click on a corner and apply a G2 fillet to it, it means that there's now a new 3D surface where every section is a spline with at least 4 control points. When I then intersect that corner with a sphere, the geometric kernel must be able to analytically represent the resulting surface (intersecting that spline-profiled surface with a sphere). If I project that surface into a sketch, the kernel needs to represent its outline from an arbitrary angle — again, analytically. Naturally, there is an explosion of special cases: that sphere might either intersect the fillet, just touch it (with a single contact point), or not touch it at all, maybe after I made some edits to the earlier features.

Blender at its core is comparatively trivial. Polygons are just clumps of points, they can be operated on numerically. CAD is hell.