CSG Status

Hi all, I’m happy to join this forum. :slight_smile:

I’m look ing for CSG or other Solid Modelling equivalent with JoGL. My background is PovRAY and Processing. I tried to find any implementations of Boolean operations for Solid manipulations in Java. It could be simple as clipping two cubes together, intersection of a plane and a cylinder…

I know that CSGs are complex algorithms.

Constructive Solid Geometry is an abstraction, and has no place at the rendering level. It’s only used at the level of Modeling tools and Scenegraphs. If you want to do CSG with JOGL, you should use a modeler like Milkshape3D to build your objects.

I’m looking for a Programming Environnment for CSG like this: http://www.geocities.com/danbalby/ or http://www.nbb.cornell.edu/neurobio/land/OldStudentProjects/cs490-96to97/indira/csg/doc.html. Milkshape is a programming environnement? I’m not familiar with scenegraphs. I had a look at jMonkey, but it didn’t found any csg.

CSG is commonly used for raytracers because it is well suited to the ray trace algorithym.

CSG however is totally unsuited to modern 3D cards, which use a form of BREP (Boundary Represetnation) and render descrete textured polygons projected into 2 dimensions.

The only way to do CSG and end up on a 3D card is to do a CSG to BREP conversion. This is a time-consuming and somewhat complicated operation. You can find papers on how to do it dating back about 10 years ago in SIGGRAPH proceedings, but the short form is bascially this:

For any 2 solids and a CSG operation:
(1) COnvert the solids to their BREP form (may be an approximation if curved surfaces are involved).
(2) Split all the intersecting polygons of each solid into polys that are either totally inside or totally outside of the space contained by the other solid.
(3) collect all the polygons that satisfy th operation
(4)reassemble into a new solid.