All Topics  
Constructive solid geometry

 
Constructive Solid Geometry

   Email Print
   Bookmark   Link






 

Constructive solid geometry



 
 
Constructive solid geometry (CSG) is a technique used in solid modeling
Solid modeling

Solid modeling is the unambiguous representation of the solid parts of an object, that is, models of solid objects suitable for computer processing....
. CSG is often, but not always, a procedural modeling technique used in 3D computer graphics
3D computer graphics

3D computer graphics are graphics that use a Cartesian coordinate system#Three-dimensional coordinate system representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images....
 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.






Discussion
Ask a question about 'Constructive solid geometry'
Start a new discussion about 'Constructive solid geometry'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Constructive solid geometry (CSG) is a technique used in solid modeling
Solid modeling

Solid modeling is the unambiguous representation of the solid parts of an object, that is, models of solid objects suitable for computer processing....
. CSG is often, but not always, a procedural modeling technique used in 3D computer graphics
3D computer graphics

3D computer graphics are graphics that use a Cartesian coordinate system#Three-dimensional coordinate system representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images....
 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. (In some cases, constructive solid geometry is performed on polygonal meshes, and may or may not be procedural and/or parametric.)

The simplest solid objects used for the representation are called primitives. Typically they are the objects of simple shape: cuboid
Cuboid

In geometry, a cuboid is a solid figure bounded by six faces, forming a convex polyhedron. There are two competing and incompatible definitions of a cuboid in the mathematical literature....
s, cylinder
Cylinder (geometry)

A cylinder is one of the most curvilinear basic geometric shapes: the surface formed by the points at a fixed distance from a given straight line, the axis of the cylinder....
s, prism
Prism (geometry)

In geometry, an n-sided prism is a polyhedron made of an n-sided polygon base, a Translation copy, and n faces joining corresponding sides....
s, pyramids
Pyramid (geometry)

In geometry, a pyramid is a polyhedron formed by connecting a polygonal base and a point, called the apex . Each base edge and apex form a triangle....
, sphere
Sphere

A sphere is a symmetrical geometrical object. In non-mathematical usage, the term is used to refer either to a round ball or to its two-dimensional surface....
s, cone
Cone (geometry)

A cone is a dimension geometric shape that tapers smoothly from a flat, round base to a point called the apex or vertex. More precisely, it is the solid figure bounded by a plane base and the surface formed by the locus of all straight line segments joining the apex to the perimeter of the base....
s. The set of allowable primitives is limited by each software package. Some software packages allow CSG on curved objects while other packages do not.

It is said that an object is constructed from primitives by means of allowable operations, which are typically Boolean
Boolean

Boolean , as a noun or an adjective, may refer to:* Boolean algebra , a logical calculus of truth values or set membership* Boolean algebra , a set with operations resembling logical ones...
 operations
Operation (mathematics)

In its simplest meaning in mathematics and logic, an operation is an action or procedure which produces a new value from one or more input values....
 on sets
Set theory

Set theory is the branch of mathematics that studies Set , which are collections of objects. Although any type of object can be collected into a set, set theory is applied most often to objects that are relevant to mathematics....
: union
Union (set theory)

In set theory, the term Union refers to a set operation used in the convergence of set elements to form a resultant set containing the elements of both sets....
, intersection
Intersection (set theory)

In mathematics, the intersection of two Set A and B is the set that contains all elements of A that also belong to B , but no other elements....
 and difference
Complement (set theory)

In discrete mathematics and predominantly in set theory, a complement is a concept used in comparisons of sets to refer to the unique values of one set in relation to another....
.

A primitive can typically be described by a procedure
Procedure

A procedure is a specified series of actions, acts or operations which have to be executed in the same manner in order to always obtain the same result under the same circumstances ....
 which accepts some number of parameter
Parameter

In mathematics, statistics, and the mathematical sciences, a parameter is a quantity that defines certain characteristics of systems or function s....
s; for example, a sphere may be described by the coordinates of its center point, along with a radius value. These primitives can be combined into compound objects using operations like these:

Operations in constructive solid geometry
Boolean unionBoolean differenceBoolean intersection
Boolean Union
Boolean Difference
Boolean Intersect
The merger of two objects into one.The subtraction of one object from another.The portion common to both objects.


Combining these elementary operations, it is possible to build up objects with high complexity starting from simple ones.

Applications of CSG


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
Unreal Engine

The 'Unreal Engine' is a popular game engine developed by Epic Games. First illustrated in the 1998 first-person shooter Video game Unreal, it has been the basis of many games since, including Unreal Tournament, Turok , Mass Effect, Tom Clancy's Rainbow Six 3: Raven Shield, Tom Clancy's Rainbow Six: Vegas, America's Ar...
 uses this system, as does Hammer
Valve Hammer Editor

Valve Hammer Editor, formerly known as Worldcraft and now commonly called Hammer, is Valve Software's Level design program for their game engine, Source engine....
 (the native Source engine
Source engine

The Source engine is a game engine developed by Valve Corporation. The engine supports Microsoft Windows , Xbox, Xbox 360, and PlayStation 3.It debuted in October 2004 with Counter-Strike: Source and shortly thereafter Half-Life 2....
 level editor), Quake
Quake

Quake is a first-person shooter computer game that was released by id Software on June 22, 1996. It was the first game in the popular Quake of computer and video games....
 Lawmaker Editor (editor for Lawmaker Engine), and Torque Game Engine
Torque Game Engine

The Torque Game Engine, or TGE, is a modified version of a 3D computer graphics computer game game engine originally developed by Dynamix for the 2001 First-person shooter Tribes 2....
/Torque Game Engine Advanced
Torque Game Engine Advanced

Torque Game Engine Advanced , is an advanced video game engine recently released by GarageGames. TGEA is the technological successor to Torque Game Engine....
. BRL-CAD is a solid modeling
Solid modeling

Solid modeling is the unambiguous representation of the solid parts of an object, that is, models of solid objects suitable for computer processing....
 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. When CSG is procedural or parametric, the user can revise their complex geometry by changing the position of objects or by changing the Boolean operation used to combine those objects.

One of the advantages of CSG is that it can easily assure that objects are "solid" or water-tight if all of the primitive shapes are water-tight. This can be important for some manufacturing or engineering computation applications. By comparison when creating geometry based upon boundary-representation
Boundary representation

In solid modeling and computer-aided design, boundary representation—often abbreviated as B-rep or BREP—is a method for representing shapes using the limits....
 additional topological data is required, or consistency checks performed to assure a "solid" object.

A convenient property of CSG shapes is that it can be relatively easy to classify arbitrary points as being either inside or outside the shape created by CSG. The point is simply classified against all the underlying primitives and the boolean equation is evaluated. This can be a desirable quality for some applications such as collision detection
Collision detection

In physical simulations, video games and computational geometry, collision detection involves algorithms for checking for collision, i.e. intersection, of two given solids....
.

Applications with CSG support

  • BRL-CAD
  • Feature Manipulation Engine
    Feature Manipulation Engine

    FME is an integrated collection of Spatial ETL tools for spatial data transformation and data translation produced by Safe Software Inc. of Surrey, British Columbia, Canada....
  • GtkRadiant
    GtkRadiant

    GtkRadiant is a level design program developed by id Software and Loki Software. It is used to create maps for a number of computer games. It is maintained by id Software together with a number of volunteers....
  • POV-Ray
    POV-Ray

    The Persistence of Vision Raytracer, or POV-Ray, is a ray tracing program available for a variety of computer platforms. It was originally based on DKBTrace, written by David Kirk Buck and Aaron A....
  • SolidWorks
    SolidWorks

    SolidWorks is a 3D computer graphics mechanical CAD program that runs on Microsoft Windows and was developed by SolidWorks Corporation - now a subsidiary of Dassault Syst?mes, S....
     mechanical CAD suite
  • UnrealEd
    UnrealEd

    UnrealEd is the level editor used to create level for Unreal. It was also used for other games based on the Unreal engine, such as Deus Ex and Lineage II, although it has changed along with the engine for later games....


External links

  • - explanation of CSG definitions, equations, techniques, and uses.
  • - an opensource (LGPL) library featuring CSG capabilities on triangle meshes.
  • - an opensource (LGPL, QPL
    Q Public License

    The Q Public License is a non-copyleft free software license created by Trolltech for its free software edition of the Qt . It captures the general meaning of the GNU General Public Licence , but is incompatible with it, meaning that you cannot legally distribute products derived from both GPL'ed and QPL'ed code....
    ) library featuring, among other, .
  • - an opensource (GPL, Version 2 you can ask for a separate license) library that does image-based CSG rendering using OpenGL.
  • - a simple geometric modeling functional language able to perform CSG operations on various types of objects.
  • - a recent opensource 3D CAD program.
  • - interactive solid modeling for Monte Carlo particle transport simulations.
  • - wikipedia CSG binary tree as replicated using FME (Feature Manipulation Engine).
  • - programming library for 3D/2D graphics applications development in C++ using OpenGL, featuring CSG capabilities on triangle meshes.