bing-yu chen national taiwan university · regularized boolean set operations closure the union of...
TRANSCRIPT
Solid Modeling
Regularized Boolean Set Operations
Boundary Representations
Spatial-Partitioning Representations
Marching Cubes
Implicit Surfaces
Constructive Solid Geometry
Regularized Boolean Set Operations
boundary / interior points points whose distance from the
object and the object’s complement is zero / other points
closed set a set contains all its boundary
points
open set a set contains none of its boundary
points
Regularized Boolean Set Operations
closure the union of a set with the set of
its boundary points
is a closed set
boundary the set of closed set’s boundary
points
interior the complement of the boundary
with respect to the object
Regularized Boolean Set Operations
regularization
the closure of a set’s interior points
regular set
a set is equal to its own regularization
regularized Boolean set operator
A op* B = closure (interior (A op B))
only produce the regular set when applied to regular sets
Ordinary Boolean Operations onSubsets of Two Objects
ii BA BAi ABi
AB
BA and ib BA
ib AB BAb ABb sameBA bb diffBA bb
Regularized Boolean Set Operations
set
X X
X X
X
X
X X
X X
X
X X
X
ii BA
BAi
ABi
ib BA
ib AB
BAb
ABb
sameBA bb
diffBA bb
BA BA BA
Boundary Representations = b-reps
describe an object in terms of its surface boundaries
vertices / edges / faces
some b-reps are restricted to planar, polygonal boundaries, and may require faces to be convex polygons or triangles
some systems support only solids whose boundaries are 2-manifolds
Spatial-Partitioning Representations
Cell Decomposition
Spatial-Occupancy Enumeration
Octrees
Binary Space-Partitioning Trees
Uniform Grid
Preprocess scene
1. Find bounding box
2. Determine grid resolution
3. Place object in cell if its bounding box overlaps the cell
Uniform Grid
Preprocess scene
1. Find bounding box
2. Determine grid resolution
3. Place object in cell if its bounding box overlaps the cell
4. Check that object overlaps cell (expensive!)
Binary Space-Partitioning Trees
An improved painter’s algorithm
Key observation:
T1
T2
Ax+By+Cz+D=0
f(p): n(p-a)=0
f(p)>0
f(p)<0
T3
T4
T5
BSP Tree Construction
BSPtree makeBSP(L: list of polygons) {if (L is empty) {
return the empty tree;} Choose a polygon P from L to serve as root;Split all polygons in L according to Preturn new TreeNode (
P,makeBSP(polygons on negative side of P),makeBSP(polygons on positive side of P))
}
Splitting polygons is expensive! It helps to choose P wisely at each step.
Example: choose five candidates, keep the one that splits the fewest polygons.
BSP Tree Display
void showBSP(v: Viewer, T: BSPtree) {
if (T is empty) return;
P = root of T;
if (viewer is in front of P) {
showBSP(back subtree of T);
draw P;
showBSP(front subtree of T);
} else {
showBSP(front subtree of T);
draw P;
showBSP(back subtree of T);
}
} 2D BSP demo
Binary Space-Partitioning Trees
P1
P2A
B
C
D
1
2
3
P1
P2 P2
A BCD
3,1,2 3,2,1 1,2,3 2,1,3
front
front front
back
backback
extremely efficient for static objects
Binary Space-Partitioning Trees
Same BSP tree can be used for any eye position, constructed only once if the scene if static.
It does not matter whether the tree is balanced. However, splitting triangles is expensive and try to avoid it by picking up different partition planes.
From Volume to Mesh:Marching Cubes
First 2D, Marching Squares
William E. Lorensen and Harvey E. Cline. Marching cubes: a high resolution 3D surface construction algorithm. ACM Computer Graphics (SIGGRAPH 1987 Conference Proceedings), Vol. 21, No. 4, p.163 - p.169, 1987.
Consistent Topology
Ambiguity problems
[Nielson and Hamann 1991]
[Natarajan 1994]
[Chernyaev 1995], etc.
Sharp Features
[Kobbelt et al. 2001], EMC (Extended Marching Cubes).
[Ju et al. 2002], DC (Dual Contouring)
Implicit Surfaces
Real function
Classifies points in space
Image synthesis (sometimes)
inside
outside
on the surface
( , , )f x y z
0f
0f
0f 0f
0f
0f
Why use Implicits?
vs. polygons
smoother
compact, fewer higher-level primitives
harder to display in real time
vs. parametric surfaces
easier to blend
no topology problems
lower degree
harder to parameterize
easier to ray trace
Quadric Surfaces
implicit surface equation
an alternative representation
with
0222222),,( 222 kjzhygxfxzeyzdxyczbyaxzyxf
0T PQP
kjhg
jcef
hebd
gfda
Q
1
z
y
x
P
Quadric Surfaces
Ellipsoid (Sphere):
Cylinder:
Hyperboloid (Cone):
Paraboloid:
2 2 2( , , ) 1 0f x y z ax by cz
2 2 2( , , ) 0f x y z ax by cz k
2 2( , , ) 2 0f x y z ax by jz
2 2( , , ) 1 0f x y z ax by
Torus
Product of two implicit circles2 2 2
2 2 2
2 2 2 2 2 2
2 2 2 2 2 2 2
( ) 0
( ) 0
(( ) )(( ) ) 0
( ) 4 ( )
F x R z r
G x R z r
F G x R z r x R z r
x z r R R z r
R
r
CSG for Implicit Surfaces
Assume inside
CSG ops by min/max ops
Union:
Intersection:
Complement:
Subtraction:0f 0g
0g
0f
0f
max( , )f g
max( , )f g
min( , )f g
f