Remix.run Logo
nynx 19 hours ago

Unfortunately, using a geometry kernel [1] that operates on triangle meshes means this is a no-go for serious CAD usage.

[1]: https://github.com/elalish/manifold

bigfishrunning 19 hours ago | parent | next [-]

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...

Brian_K_White 17 hours ago | parent | next [-]

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.

nynx 18 hours ago | parent | prev | next [-]

Breps. Nearly all commercial cad packages operate on boundary representations of objects.

pca006132 10 hours ago | parent | next [-]

Mesh is also a boundary representation. I think you meam NURBS.

MITSardine 2 hours ago | parent [-]

It's just the name, BREP stands for Boundary REPresentation.

bob1029 18 hours ago | parent | prev [-]

I would start with CSG if you are new to these ideas:

https://en.wikipedia.org/wiki/Constructive_solid_geometry

avhon1 7 hours ago | parent | prev | next [-]

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

https://solvespace.com/library.pl

WillAdams 5 hours ago | parent [-]

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.

nicr_22 18 hours ago | parent | prev | next [-]

OpenCASCADE?

https://dev.opencascade.org/

jf___ 9 hours ago | parent | next [-]

pythonocc is a joy

https://github.com/tpaviot/pythonocc-core

zokier 18 hours ago | parent | prev [-]

Notably wrapped by build123d into cad as a code package

autumn-antlers 18 hours ago | parent | prev [-]

libfive

xixixao 18 hours ago | parent | prev [-]

I've built something very similar (also based on triangle meshes, but in TS), and while it wouldn't work for say 3D printing, my target is game object modeling. I guess people have specific use cases in mind when referring to "CAD".

nynx 18 hours ago | parent [-]

In my mind, cad that you’re not going to manufacture is “modeling”. Not sure if that’s a common verbal distinction.

bigiain 17 hours ago | parent | next [-]

An example of common terms that disagrees with that somewhat, is "CAD/CAM" where the design component is clearly distinct from the manufacturing component.

I do agree that historically, software aimed at building 3d models for games/animations and other digital use was usually called modeling and not cad. I'm thinking of software like 3D Studio Max back in the 90s here.

https://en.wikipedia.org/wiki/CAD/CAM

I notice though that the Wikipedia article for CAD says: "This software is used to increase the productivity of the designer, improve the quality of design, improve communications through documentation, and to create a database for manufacturing."

https://en.wikipedia.org/wiki/Computer-aided_design

dgently7 10 hours ago | parent [-]

my personal distinction I use is about measurements. while you may model to a specific scale for use in 3d gfx (game by engine/animation/vfx) you cross over from "modeling" to "cad" as soon as you are creating geometry with specific real world measurements. (probably for manufacturing or engineering reasons bc thats when it matters most)

like I can model a table that is the right size and looks like it will not tip over for my game, but I am going to cad that table to run a stress sim and make the plans for building it for real.

though id still call the action of doing the building in the cad software "modeling"... so idk.. language is weird.

so software that lets you work accurately with measurements and real units == cad. (fusion360) software that just makes geometry == modeling. (blender)

but if you wanna go get real confused look at "plasticity" an app targeted at "modeling" but uses a cad engine and sells itself as "cad for artists" it has real scale measurements and everything too.

ezst 18 hours ago | parent | prev [-]

Not sure either but sharing the sentiment.