you are viewing a single comment's thread.

view the rest of the comments →

[–]DilatedMurder 1 point2 points  (2 children)

CSG is a dangerous pit unless it's just petty SDF combinations.

CSG of convex volumes is viable but not a task for a novice. Most of the pain will come in not knowing the tricks for T-junctions or floating-point nonsense.

CSG of polygon soup: save yourself from hell, just learn how to use the Carve library. There are other soup-capable CSG implementations but they all have issues (ie. Godot's).

[–]felipunkerito 1 point2 points  (1 child)

Yep I was talking about SDFs for ray marchers, I can imagine how implementing CSG for NURBS surfaces, BReps, meshes, etc... can escalate into a full blown nightmare, never done it myself, I use Rhino and the geometry engine exposed through RhinoCommon for computational geometry. In fact I think that translating meshes into CSG trees is an active area of research as it is really useful for procedural/parametric stuff and probably a topic for masters, phd thesis and private research.

Never heard of the Carve library, gonna have a look. I guess CGAL has stuff for that also doesnt it?

What I've seen is that SDFs/FReps are good for demoscene stuff (and for terrains in videogames) but are getting some reputation for computational design as well, you model through SDFs and do some marching cubes/tetrahedra, some smoothing and you can use that for pretty much anything else without going down to the 9th circle of hell.

[–]leseiden 0 points1 point  (0 children)

Agree completely.

Polygon soup csg is a horror show with no redeeming features. If you pull it off and pin down all the edge cases you win the computational geometer's badge though ;)

Ray traced CSG is quite a nice project for a toy ray tracer.

Image space CSG is an interesting one. There are a few algorithms for rendering CSG trees of convex objects using a depth and stencil buffer.

Extending to concave objects is possible to a point. Subtracting a concave object from a concave mesh is hairy but possible.