Remix.run Logo
dgroshev 4 hours ago

Same, but I don't think it's possible without a large and sustained investment into a free geometric modelling kernel, which can probably be only done by a government.

Parasolid is powering practically every major CAD system. Its development started in 1986 and it's still actively developed. The amount of effort that goes into those things is immense (39 years of commercial development!) and I don't believe it can be done pro-bono in someone's spare time. What's worse, with this kind of software there is no "graceful degradation": while something like a MIP solver can be useful even if it's quite a bit slower than Gurobi, a kernel that can't model complex lofts and fillets is not particularly useful.

3D CAD is much harder than Blender and less amenable to open source development.

4 hours ago | parent | next [-]
[deleted]
dr_dshiv 4 hours ago | parent | prev | next [-]

> Same, but I don't think it's possible without a large and sustained investment into a free geometric modelling kernel, which can probably be only done by a government.

Can you help me understand why this problem is so hard?

Chris_Newton 13 minutes ago | parent | next [-]

Geometric modelling tends to need a lot of detailed work for two main reasons.

Firstly, you probably have a variety of analytic shapes to represent — things like lines and circles in 2D or cubes and spheres in 3D. Even seemingly simple questions, like whether two such shapes intersect or not, can require a significant amount of logic to calculate the answer. That logic will often be specific to the exact combination of shapes you have, because the number of freedoms and nature of any symmetries in the shapes you’re working with can mean you would use completely different algorithms for superficially similar situations.

Secondly, while you’re probably going to implement a lot of analytic calculations, in realistic models you’re probably going to end up using numerical methods as well. That can be because you need to work with geometry like Bézier curves or NURBS surfaces that has many freedoms. It can be because even if you start with convenient analytic shapes, new geometry that you derive from those shapes, for example by offsetting a single shape or by combining details from multiple shapes as in constructive solid geometry, won’t in general have an analytic shape itself.

By the time you allow for the numerous different types of constraint that you might want to enforce between different types of geometry and the numerous different ways you can construct new geometry from geometry you already have, the scale of the problem explodes. And on top of that, almost everything you do is going to have numerical sensitivity issues, and all but the simplest algorithms are going to need detailed, careful analysis to make sure you really have covered all the possibilities. In this field, “edge case” and “corner case” are literal terms and not just figures of speech!

To give a practical example, without looking up how to do it, could you confidently calculate whether two arbitrary cuboids are completely separate or they touch or intersect somewhere? As another example, given an arbitrary parametric surface, a sphere in a position just resting on that surface, and the constraint that the surface of the sphere must remain tangent to the parametric surface without intersecting it anywhere, how would you calculate the path the centre of the sphere will follow if you introduce gravity to start the sphere rolling in a certain direction along the surface?

These are relatively simple problems in the field, but each already has some subtlety that leaves the “obvious” solutions incomplete. Solve a few thousand problems like that, each unique and with its own calculation strategy, and now you’re starting to get a practically useful geometric modelling system. (You’ve also probably had a team of dozens of mathematicians and developers working on it for decades.)

CoreformGreg 2 hours ago | parent | prev | next [-]

The other reply is really good. To add to that, the intersection of two bi-cubic Bezier patches (each being but one part of a cubic B-spline surface) is an implicit equation of degree 18^2=324. This simply cannot be implemented exactly in a geometry kernel and thus must be approximated. How do you want to approximate this? If you choose trimming (the industry standard) now you have to handle gaps in your geometry. If you choose remapping into an unstructured watertight spline, you need to solve a constraint system that is NP-hard. If you choose reparameterizing… well, see nVariate’s watertight Boolean technique (disclaimer: I once sponsored a project with nVariate).

Now, generally speaking, in a CAD model most surfaces will be “analytic” (plane, torus, conical, arc, line, etc). But whenever some complex surface that joins these surfaces is required, (NUR)B-splines are the principal technique for “covering” the gap.

dgroshev 3 hours ago | parent | prev [-]

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.

LoganDark 4 hours ago | parent | prev [-]

> Same, but I don't think it's possible without a large and sustained investment into a free geometric modelling kernel, which can probably be only done by a government.

Fornjot has been attempting this: https://www.fornjot.app

It's going to be years or decades before it's competitive though. Also, it looks like they switched to keeping progress updates private except to sponsors, which means I don't actually have any easily-accessible information about it anymore which is sad.

dgroshev 4 hours ago | parent [-]

I'm very skeptical that one person can make a dent. Paging through the releases, they seem to focus on constructive solid geometry and code-driven shape generation, which I believe is a dead end.

The tricky bit is having a G2 (or even G3) fillet that intersects a complex shape built from surface patches and thickened, with both projected into a new sketch, and keeping the workflow sane if I go and adjust the original fillet. I hope one day we'll see a free (as in speech) kernel that can enable that, until then it's just Parasolid, sadly.