You are on page 1of 21

MODULE • CONCEPT OF MODELLING

Constructive Solid Geometry

Faculty of Information and Communication Technology


Objectives
* Understanding the process of CSG and what
it entails

2
Topics covered
• What is CSG
• Operations
• Applications of CSG

3
What is CSG
• Constructive solid geometry (CSG) is a technique
used in solid modeling.
• CSG is often, but not always, a procedural
modeling technique used in 3D computer graphics
and CAD.
• Constructive solid geometry allows a modeler to
create a complex surface or object by using
Boolean operators to combine objects.
• Often CSG presents a model or surface that
appears visually complex, but is actually little
more than cleverly combined or decombined
objects.

4
What is CSG
• The simplest solid objects used for the
representation are called primitives.
• The primitives: cuboids, cylinders, prisms,
pyramids, spheres, cones & torus.
• The set of allowable primitives is limited by
each software package.
• Some software packages allow CSG on
curved objects while other packages do not.

5
Operations
• In modeling packages, basic geometric
objects such as the cube or 'box', sphere or
ellipse, torus, and a number of other shapes
that can be described using a mathematical
formula, are commonly known as primitives.
• These objects can typically be described by
a procedure which accepts some number of
parameters; for example, a sphere may be
described by the coordinates of its center
point, along with a radius value
Operations
• Boolean union () - merger of two or more
objects into one
• Boolean difference (-) - subtraction of one
object from another
• Boolean intersect () - overlapping portion
of objects
Operations
• The following example illustrates the three
CSG operations in use on simple three
dimensional primitives.
• The two primitives: a sphere and a box.
Operations - Union
• The union of the two primitives.
Operations - Intersection
• The intersection of the two primitives.
Operations - Difference
• The difference of the two primitives: box
minus sphere.
CSG - Modeling Technique
• The following example shows an object for which
CSG is (probably) the only sensible modeling
technique. The object rendered in the right-hand
image is constructed from the primitives shown
in the left-hand image.
Applications
• Constructive solid geometry has a number of
practical uses. It is used in cases where simple
geometric objects are desired, or where
mathematical accuracy is important.
• The Unreal engine uses this system, as do
Hammer (the mapping engine for the Source
engine) and Quake. (Hammer actually started out
as Worldcraft, which was an editor for Quake.)
• BRL-CAD is a solid modeling CAD package that is
fundamentally based on CSG modeling techniques.
CSG is popular because a modeler can use a set of
relatively simple objects to create very complicated
geometry.
Example of CSG 1

The design procedure of the above bracket can be written as an


expression:
diff(union(trans(Block1), trans(Block2)), trans(Cylinder))
where union(A,B) and diff(A,B) are the union and difference of A
and B, and trans() indicates appropriate transformations.
Or, if we use +, ^ and - for set union, intersection and difference,
the above function calls can be rewritten as a set expression as
follows:
(trans(Block1) + trans(Block2)) - trans(Cylinder)
This expression can be converted to an expression tree, the CSG
Expression, of the design:
CSG Expression Tree
Exercise
• Write an expression and an expression
tree for the following object.
Example of CSG 2
Example of CSG
Example of CSG
End of Lecture

You might also like