Constructive Solid Geometry - PowerPoint PPT Presentation

About This Presentation
Title:

Constructive Solid Geometry

Description:

Constructive Solid Geometry Mel Slater http://graphics.lcs.mit.edu/~legakis/legakis_ucdavis/Gallery/CSG1.jpg – PowerPoint PPT presentation

Number of Views:877
Avg rating:3.0/5.0
Slides: 22
Provided by: uca110
Category:

less

Transcript and Presenter's Notes

Title: Constructive Solid Geometry


1
Constructive Solid Geometry
  • Mel Slater

http//graphics.lcs.mit.edu/legakis/legakis_ucdav
is/Gallery/CSG1.jpg
2
Introduction
  • Quadric Surfaces
  • Ray Intersections with Quadrics
  • Set Operations
  • Ray Classification

3
Quadric Surfaces
  • Consider a sphere
  • And also a cylinder
  • These are special cases of a general class of
    object called quadrics.

4
Quadric Surfaces
  • Let Q be a 44 matrix
  • Let p (x,y,z,1)
  • s(x,y,z) pTQp 0.
  • The quadric is the boundary and the interior of
    the surface defined by the equation, and hence
    consists of pTQp ? 0.

5
Quadric Surfaces
  • Note that the highest power of any coordinate is
    2 (hence quadric).
  • Note that the a,,j are given constants
  • Special cases a,,j of define different types of
    surface.
  • Multiplying out we get

6
Special Cases
  • Plane
  • Sphere
  • Cylinder

7
Special Cases
  • Cone
  • Paraboloid

8
More Properties
  • Given a quadric the normal at point p is given by
    2pTQ.
  • If all the points p on a quadric are transformed,
    eg, q pM then the result is also a quadric
  • where M is a transformation matrix.

9
Ray Intersection
  • The beauty of the quadric representation is that
    the unified representation requires only one
    ray-intersection algorithm.
  • Let p(t) p tv, t ?0
  • Be the parametric equation of the ray that starts
    at p in direction p.
  • Substitute p(t) into pTQp 0 and solve the
    quadratic equation for t.
  • This will give
  • Complex results if no intersection
  • Two equal values of t if tangent
  • Two real values the entry and exit points
    otherwise.
  • (What happens in the case of a plane?)

10
Set Operations
  • The quadrics represent solid objects
  • Unlike boundary representations for mesh and
    B-Spline approaches
  • We can use set operations such as union,
    intersection and difference to combine such
    solids together.

11
Regularising Operation
  • Given a point p we define the open ball.
  • A boundary point in any point-set S is a point p
    such that for any ?gt0 B(p, ?) will contain points
    in S and also in not-S.
  • S is an open set if it does not contain its
    boundary.
  • Closure(S) S ?boundary(S)

12
Regularising Operation
  • Interior(S) S boundary(S)
  • Regularisation(S) closure(interior(S))
  • For any set operation it is the regularisation of
    the result that is required.
  • A op B regularisation(A op B)
  • where op is any operator such as union,
    difference, intersection

13
Example
Intersection results in illegal set
  • Is the set, which is closed in (b) with interior
    in (c)
  • and regularisation in (d)

14
CSG Operations
  • We can define set operations such as ?, ?, ?(not)
    and difference -.
  • We can make formulae expressing more complex
    objects as combinations of simpler objects, eg
  • A ?B C
  • ((A ?B) ?C)-D
  • Each can be expressed as a binary operator tree.

15
((A ?B) ?C)-D
-
?
Each expression canbe represented as a binary
operator tree.
D
?
C
A
B
16
CSG Data Structure
  • typedef struct _csgtree
  • Operator op
  • Quadric primitive
  • struct _csgtree right
  • struct _csgtree left
  • CSGTreePtr
  • Each leaf node represents a primitive (usually a
    quadric primitive).
  • op can also be leaf rather than a combination
    operator.

17
Intersecting a Ray
  • Pseudo code for ray-tree intersection

18
Intersecting a Ray
  • The result will be a sequence of intersection
    points along the ray, represented by the
    parametric values
  • t0, t1, t2, ,tn
  • where there are n intersections
  • Each individual intersection with a solid will
    result (typically) in two values.

19
Combine Function
  • Shows how the result of the left and right solids
    combine together.
  • Note that the set operations therefore occur at a
    2D level.

20
Examples
ccvweb.csres.utexas.edu/ccv/projects/VisualEyes/v
isualization/domainpara/algebraic2/parameterizatio
n/gallery/Reconstruction/Csg/
www-2.cs.cmu.edu/afs/cs/misc/rayshade/all_mach/om
ega/doc/Examples/jpg/csg.jpg
21
Summary
  • Unified representation for quadric surfaces
    provides a simplicity and elegance for a wide
    class of shapes.
  • CSG provides a simple methodology for
    combinations via set operations of solids
  • CSG does not require quadrics, it can work other
    types of solid representation.
Write a Comment
User Comments (0)
About PowerShow.com