ArticleslgStudy

mathematics

Constructive solid geometry

Constructive solid geometry is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Constructive solid geometry rather than just read about it. In short: Constructive solid geometry (CSG; formerly called computational binary solid geometry) is a technique used in solid modeling. Constructive solid geometry allows a modeler to create a complex surface or object by using Boolean operators to combine simpler objects, potentially generating visually complex objects by combining a few primitive ones.

Constructive solid geometry — main illustration
Constructive solid geometry — illustration

Key takeaways

  • Constructive solid geometry belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Constructive solid geometry to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Constructive solid geometry from memory before moving on to harder problems.

Reference excerpt

Constructive solid geometry (CSG; formerly called computational binary solid geometry) is a technique used in solid modeling. Constructive solid geometry allows a modeler to create a complex surface or object by using Boolean operators to combine simpler objects, potentially generating visually complex objects by combining a few primitive ones. In 3D computer graphics and CAD, CSG is often used in procedural modeling. CSG can also be performed on polygonal meshes, and may or may not be procedural and/or parametric. CSG can be contrasted with polygon mesh modeling, boundary representation, and box modeling.

Workings The simplest solid objects used for the representation are called geometric primitives. Typically they are the objects of simple shape: cuboids, cylinders, prisms, pyramids, spheres, cones. The set of allowable primitives is limited by each software package. Some software packages allow CSG on curved objects while other packages do not. An object is constructed from primitives by means of allowable operations, which are typically Boolean operations on sets: union (OR), intersection (AND) and difference (NOT), as well as geometric transformations of those sets. A primitive 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. These primitives can be combined into compound objects using operations like these:

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

Ray tracing Rendering of constructive solid geometry is particularly simple when ray tracing. Ray tracers intersect a ray with both primitives that are being operated on, apply the operator to the intersection intervals along the 1D ray, and then take the point closest to the camera along the ray as being the result.

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. Nearly all engineering CAD packages use CSG (where it may be useful for representing tool cuts, and features where parts must fit together). The Quake engine and Unreal Engine both use this system, as does Hammer (the native Source engine level editor), and Torque Game Engine/Torque Game Engine Advanced. 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 representations, additional topological data is required, or consistency checks must be performed to assure that the given boundary description specifies a valid solid object. A convenient property of CSG shapes is that it is 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 resulting Boolean expression is evaluated. This is a desirable quality for some applications such as ray tracing.

Conversion from meshes to CSG With CSG models being parameterized by construction, they are often favorable over usual meshes when it comes to applications where the goal is to fabricate customized models. For such applications it can be interesting to convert already existing meshes to CSG trees. This problem of automatically converting meshes to CSG trees is called inverse CSG. A resulting CSG tree is required to occupy the same volume in 3D space as the input mesh while having a minimal number of nodes. Simple solutions are preferred to ensure that the resulting model is easy to edit. Solving this problem is a challenge because of the large search space that has to be explored. It combines continuous parameters such as dimension and size of the primitive shapes, and discrete parameters such as the Boolean operators used to build the final CSG tree. Deductive methods solve this problem by building a set of half-spaces that describe the interior of the geometry. These half-spaces are used to describe primitives that can be combined to get the final model. Another approach decouples the detection of primitive shapes and the computation of the CSG tree that defines the final model. This approach exploits the ability of modern program synthesis tools to find a CSG tree with minimal complexity. There are also approaches that use genetic algorithms to iteratively optimize an initial shape towards the shape of the desired mesh.

Notable applications with CSG support

Generic modelling languages and software HyperFun PLaSM

Ray tracing and particle transport PhotoRealistic RenderMan POV-Ray

Computer-aided design

AutoCAD Autodesk Inventor Autodesk Fusion 360 BRL-CAD CATIA FreeCAD NX CAD SolveSpace Onshape OpenSCAD PTC Creo Parametric (formerly known as Pro/Engineer) Realsoft 3D Rhino Solid Edge SolidWorks Tinkercad Vectorworks

Gaming Dreams Godot GtkRadiant LittleBigPlanet Roblox Unity, via free or paid plug-ins from the Unity Asset Store. UnrealEd Valve Hammer Editor

Others 3Delight Aqsis (as of version 0.6.0) Blender – primarily a surface mesh editor, but capable of simple CSG using meta objects and using the Boolean modifier on mesh objects. CGAL – a library of geometric algorithms and data structures, in particular Boolean operations on polygonal meshes. Clara.io Geant4 Magica CSG MCNP OpenMC - Monte Carlo Photon and Neutron Transport Code SketchUp Womp

References

Illustrations

Constructive solid geometry: CSG objects can be represented by binary trees, where leaves represent primitives, and nodes represent operations. In this figure, the nodes are labeled .mw-parser-output .texhtml{font-family:"Nimbus Roman No9 L","Times New Roman",Times,serif;font-size:118%;line-height:1;font-variant-numeric:lining-nums tabular-nums;font-kerning:none}.mw-parser-output .texhtml .texhtml{font-size:100%}.mw-parser-output .texhtml-big{font-size:165%}.mw-parser-output .mvar{font-style:italic}@media(min-width:420px){.mw-parser-output .texhtml{white-space:nowrap}}∩ for intersection, ∪ for union, and — for difference.
CSG objects can be represented by binary trees, where leaves represent primitives, and nodes represent operations. In this figure, the nodes are labeled .mw-parser-output .texhtml{font-family:"Nimbus Roman No9 L","Times New Roman",Times,serif;font-size:118%;line-height:1;font-variant-numeric:lining-nums tabular-nums;font-kerning:none}.mw-parser-output .texhtml .texhtml{font-size:100%}.mw-parser-output .texhtml-big{font-size:165%}.mw-parser-output .mvar{font-style:italic}@media(min-width:420px){.mw-parser-output .texhtml{white-space:nowrap}}∩ for intersection, ∪ for union, and — for difference.
Constructive solid geometry illustration
Constructive solid geometry illustration
Constructive solid geometry illustration
Constructive solid geometry: CSG operations being applied in the context of rays in a ray tracer
CSG operations being applied in the context of rays in a ray tracer

Worked examples

Example 1 — a first encounter with Constructive solid geometry

Start with the simplest possible case. Write down what Constructive solid geometry claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Constructive solid geometry before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Constructive solid geometry ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Constructive solid geometry

In research
Constructive solid geometry appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Constructive solid geometry in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Constructive solid geometry is common in secondary-school and first-year university syllabi. It links to neighbouring topics 3D computer graphics, Computer-aided design, Euclidean solid geometry, so understanding it makes those chapters shorter.
In everyday life
Look for Constructive solid geometry outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Constructive solid geometry” →

How to study Constructive solid geometry in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Constructive solid geometry means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Constructive solid geometry out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Constructive solid geometry in simple terms?

Constructive solid geometry (CSG; formerly called computational binary solid geometry) is a technique used in solid modeling. Constructive solid geometry allows a modeler to create a complex surface or object by using Boolean operators to combine simpler objects, potentially generating visually com…

Why does Constructive solid geometry matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Constructive solid geometry?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Constructive solid geometry.

Tags

  • 3D computer graphics
  • Computer-aided design
  • Euclidean solid geometry

Keep exploring