Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 35

Constructive Solid

Geometry
Advanced Computer Graphics
Spring Semester 2012
Agenda
Mathematics for CSG
Basic Concepts
Definition of CSG
Simple primitives
Boolean operations
CSG Tree
Applications of CSG
CSG Tools
POV-Ray
OpenSCAD
Autodesk 3ds Max
Mathematics
CSG use Boolean operators to construct a
procedural model of a complex solid. This
model, or rather the data describing the
model, is stored in the mathematical form
of a binary tree, where the leaf nodes are
simple shapes, or primitives, sized and
positioned in space, and each branch node
is a Boolean operator: union, difference or
intersection.
Mathematics
Basic Concepts
Set Theory
Boolean Algebra
Halfspaces
Binary Trees
Solids
Boolean Operators
Boolean Model
Set Theory and Boolean Algebra

Union Intersection

Difference
Halfspaces

Two-dimensional halfspaces Three-dimensional halfspaces


Binary Trees

Tree example
Solids
Boolean Operators
CSG uses special Boolean operators similar
to those that produce set union, intersection
and difference.
The computer algorithms that perform

these operations must generate objects that


are also closed sets of points, having
boundary and interior subsets that preserve
the dimensions of the initial objects.
Boolean Operators
Regularized Set Operations
Produce dimensionally homogeneous shapes
Boolean Model
Definition of CSG
Constructive Solid Geometry is a method for
solid modeling that allows the creation of
complex solid objects by combining simple
primitives using Boolean operators. All
the operations are stored and described in a
tree called CSG tree.
Simple primitives

Sphere Block Cone

Cylinder Torus
Boolean operations
Union
Two or more shapes are added together.

After that, the resulting solid could be modified as


one single solid
Boolean operations
Intersection
Two or more shapes are combined to make a new shape
that consists of the area common to both shapes.

After that, the resulting solid could be modified as one


single solid
Boolean operations
Difference
In difference, an initial shape has all subsequent shapes
subtracted from it.

After that, the resulting solid could be modified as one


single solid
CSG Tree
Applications of CSG
Game Engines
Unreal, Hammer, Torque Game Engine
Applications of CSG
CAD/CAM Applications
OpenSCAD, Autocad
Applications of CSG
3D modeler
Ayam, POV-Ray
CSG Tools
POV-Ray
The Persistence of Vision Ray-Tracer creates three-
dimensional images using a rendering technique
called ray-tracing.
It reads in a text file containing information
describing the objects and lighting in a scene and
generates an image of that scene from the view
point of a camera also described in the text file.
CSG Tools
POV-Ray CSG functions
Union

Intersection

Difference
CSG Tools
POV-Ray Example (Code)
CSG Tools
POV-Ray Example (Tree)
CSG Tools
POV-Ray Example (Result)
CSG Tools
OpenSCAD
OpenSCAD is a software for creating solid 3D CAD
objects. Is not an interactive modeler. Instead it is
something like a 3D-compiler that reads in a
script file that describes the object and renders
the 3D model from this script file.
With OpenSCAD it is possible to construct
complex 3D objects by combining 3D primitives
using CSG operations.
It has the # modifier for highlighting a sub tree
of the design.
CSG Tools
OpenSCAD Example (Code)
CSG Tools
OpenSCAD
Example (Result)
CSG Tools
OpenSCAD Example (Result with #)
CSG Tools
OpenSCAD Display CSG Tree and Products
CSG Tools
Autodesk 3ds Max
Autodesk 3ds Max is 3D computer graphics
software for making 3D animations, models, and
images.
It has support for CSG operations through a type
of compound objects called Boolean.
Then you can combine with other objects with
Boolean operations.
CSG Tools
Autodesk 3ds Max example (Process)
CSG Tools
Autodesk 3ds Max Example (Result)
Current CSG
Tool Platform(s) Installation version Last release Documentation CSG Usability Special Features Time first usage

* 5 min (2 primitives, 1
Easy: * Good quality of result images operation)
MS Windows, Mac Easy (Download Very Good (Wiki, web * Simple * 3D modeling oriented (slow * 35 min (5 primitives,
POV-Ray OS X, Linux, UNIX and install) 3.6.2 1-Jun-09 page, local help) sintaxis render) 4 operations)
* Can display CSG tree (text)
* Has a directive (#) for show in
other color the resultant invisible
primitives * 5 minutes (with
Easy: * Can compile more complex code examples)
Linux, UNIX, MS 01-Dic-11 * Simple sintax (loops, conditional statements) * 20 minutes (5
Windows and Mac Easy (Download (development Good (Wiki, just * Include many * Robust application primitives, 4
OpenSCAD OS X and install) 2011.12.30 in progress) online) examples * CAD oriented (fast render) operations)

Medium (Big
AutoDesk Download, some * 45 minutes (5
3ds Max MS Windows and configurations in Easy: primitives, 4
Design Mac OS the installation) 2013 2012 Medium (local help) * GUI * Has GUI operations)
Thank you!

You might also like