Advanced Graphics

Dr Neil Dodgson, University of Cambridge Computer Laboratory
Part II course, 1998


Lecture 3 Index
...back to lecture 2
Part A: Constructive Solid Geometry
Part B: Implicit surfaces, voxels and marching cubes
on to lecture 4...

3A) Constructive Solid Geometry

Constructive solid geometry (CSG) essentially consists of Boolean set operations on closed primitives in 3D space. The three CSG operations are union, intersection and difference.

CSG is covered in FvDFH sections 12.7 and 15.10.3.

The following example illustrates the three CSG operations in use on simple three dimensional primitives.

<Image: ray traced sphere> <Image: ray traced box> The two primitives: a sphere and a box.
<Image: CSG union> The union of the two primitives.
<Image: CSG intersection> The intersection of the two primitives.
<Image: CSG difference: box minus sphere> The difference of the two primitives: box minus sphere.

The following example, based on FvDFH Plate III.2, shows an object for which CSG is (probably) the only sensible modelling technique. The object rendered in the right-hand image is constructed from the primitives shown in the left-hand image. It is mostly made out of cylinders, but you will recognise the extruded star from Lecture 2B.
<Image: CSG example: the primitives> <Image: CSG example: the finished object>

<Image: CSG example: initials> At right, I tried the "Godel, Escher, Bach" treatment on my initials. Unfortunately the letters N, A, and D are not as amenable to this as the letters G, E, and B: notice that the shadow of the N has a slight curve at its top right, owing to the N's intersection with the curve on the D and the slope on the A. Various other arrangements of the three letters were tried, all of which gave more noticable artefacts than this. Each of the letters is a CSG object (the D, for example, is constructed from cylinders and boxes). The final effect is produced simply by intersecting the three letters.

Exercises
  1. Work out how to represent a Lego technic brick as a CSG object. You may assume that you have box and cylinder primitives.
    <Image: some CSG Lego technic bricks> <Image: a close-up of the Lego technic bricks>

  2. [1998/7/12] Work out how to represent the following object using CSG. You may assume the following primitives: sphere, cylinder, cone, torus, box.
    <Image: the object from the 1998 exam question> <Image: the object from the 1998 exam question>

  3. List the three ways of combining objects using Constructive Solid Geometry (CSG). Describe how an object built using CSG can be represented as a tree structure. Given the intersection points of a ray with each primitive in the tree, explain how these points are passed up the tree by each type of combination node.


Lecture 3 Index
...back to lecture 2
Part A: Constructive Solid Geometry
Part B: Implicit surfaces, voxels and marching cubes
on to lecture 4...


Neil Dodgson | Advanced Graphics | Computer Laboratory

Source file: l3a.html
Page last updated on Mon Sep 7 12:47:51 BST 1998
by Neil Dodgson (nad@cl.cam.ac.uk)