Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 51

Solid Modeling

Reference: Computer Graphics. Principles and Practice Foley - van dam Feiner Hughes
chapter 12

Solid representation - Desiderata


Requicha 80 Domain : A representation should be able to represent a useful set of geometric objects. Unambiguity : When you see a representation of a solid, you will know what is being represented without any doubt. An unambiguous representation is usually referred to as a complete one. Uniqueness : from the representations it is immediately possibile to determine if two solids are identical

Desiderata
Requicha 80
Accuracy Little or no approximation Validness A representation should not create any phisically unrealizable or impossible solids. Closure Solids will be transformed and used with other operations such as union and intersection. "Closure" means that transforming a valid solid always yields a valid solid. Compactness and Efficiency to save memory and computation time

Manifold surfaces
Manifold the object is locally Euclidean, i.e. for every point there is a neighborhood that is topologically the same (homeomorphic) as a disk.

2-Manifold Torus

Intuitively, we can deform the surface locally into a plane without tearing it or identifying separate points with each other.

A non manifold object


Surfaces that intersect or touch themselves are non manifolds.

Boolean Operations on Solids


Boolean operation on valid solids may produce non valid solids. Example: Intersecting two cubes that touch along a face produces a face, i.e. a non valid solid

Regularized Boolean operations


Goal: eliminate dangling" lower-dimensional structures that may be produced by Boolean operations Notation: A * B, A * B, A -* B

Regularized Intersection Example

Regularized Boolean Intersection


Compute A * B

Three steps:
1. Compute A B 2. Take the interior of A B 3. Form the closure of this interior by adding all boundary points adjacent to some interior neighborhood.

A * B = closure(interior A B )

Some definitions
The interior consists of all those points p of A B such that an open ball of radius , centered at p, consists only of points of A B, for a sufficiently small radius . A point q that is a boundary point of A B is adjacent to the interior if we can find a curve segment (q; r) of sufficiently small length, between q and another point r of A B, such that all points of this segment are interior points of A B, except q.

Regularized Boolean operations on manifolds


The result may be a non manifold solid.
As an example, the figure below may be obtained by the regularized union of two L shaped solids.

Constructive Solid Geometry (CSG)


A solid is represented as a set theoretic Boolean expression of primitive solid objects, of a simpler structure. Both the surface and the interior of an object are defined, albeit implicitly.

Primitives
Blocks, cylinders, spheres, cones, and tori A primitive object is instantiated by specifying some parameters
Side lengths of blocks, the diameter and length of cylinders, placing the primitives with respect to a common world coordinate frame

Combining the primitives


A solid can be considered as the result of applying regularized Boolean operators to a set of instantiated and transformed CSG primitives CSG representations are not unique

Example

Example (from Shene, Michigan)


(trans(Block1) + trans(Block2)) - trans(Cylinder)

B-reps
Boundary representation
a solid is modeled as a set of surfaces forming its boundary.

Topology and Geometry 1. Topology how the surfaces are connected together. (incidences and adjacencies ) and orientation of vertices, edges, and faces. 2. Geometry where the surfaces actually are in space. for example, the equations of the surfaces of which the faces are a subset.
3. Topology and Geometry are strongly linked.

B-reps (continued)
Surfaces must be orientable. Boundaries may be linear (planar) polygons or curved patches. Must be able to handle holes in faces.
Keep track of interior loops in faces.

Euler-Poincare formula:
For a polyhedron

V-E+F-2=0
V = Vertices E = Edges F = Faces Example: A tetrahedron has four vertices, four faces, and six edges 4-6+4=2.

Proof by induction
Base: the formula is true for tetraheda Induction step:
Suppose it is true for two solids, Sol1 and Sol2, Suppose the solids each have a face which is the mirror image of the corresponding face on the other. Assume the faces each have n edges. Join the solids together at those faces and obtain object Sol3 The, the two faces disappear and:

F3 = F1 + F2 - 2 V3 = V1 + V2 - n E3 = E1 + E2 - n
Thus:

V3 + F3 - E3 = (F1 + V1 - E1) + (F2 + V2 - E2 ) - 2 + n n = 2

Euler Poincare Formula


Necessary but not sufficient condition for a valid representation. Example: 8 vertices, 12 edges, 6 faces

Extension of solids
A solid can have holes A face may have a loop or ring of vertices `floating, i.e. unconnected by edges to the other vertices of the face

Extension of Euler-Poincare formula to 2-manifolds


V-E+F-H=2(C-G)
V = Vertices E = Edges F = Faces H = Holes in faces C = Components (or shells) G = Genus (holes through solid)

Tweaking (deformations, twistings, and stretchings but not tearing, or cutting ) solids modifies the solid without changing the topology or the above numbers.

A solid with holes and loops


Example

V E + F H = 2 (C G) 24 36 + 15 3 = 2( 1 1)

Example A surface with genus 2

Validity of a B-rep
Ensuring validity of a B-rep can be very difficult Topological validity
Orientability adjacent faces must have correct orientations

Geometric validity: Determining position/orientation of vertices/planes, etc.


Inaccuracies in geometry and computation can lead to topological inconsistencies.

Robustness Problems
Numerical errors:
In representation or arising in computation. Cause conflict between geometric and topological information, or conflict within geometric information. Example 1: Plane equations say that an edge should lie within a solid, but topological information says it lies outside.
Example 2: Intersection of 3 plane equations for faces yields coordinates that are different than those of the vertex shared by those faces.

Winged-Edge Representation Baumgart 1974


Polyhedral objects represented by vertices, edges and faces

Each vertex has pointer to one of its edges Each face has a pointer to one of its edges Each edge has 8 pointers to ..

Each edge has 8 pointers to:


its two faces: Pface and Nface

its two vertices each of its four neighboring edges (wings) Traversal of V1 and V2 in opposte directions when traversing Pface and Nface in counterclockwise order The two edges at N are the previous counterclockwise on the Pface and the previous clockwise on the Nface

Pcwe
V1=N Nface V2=P Nccwe

Pccwe

Pface

Ncwe

Edge nodes -> topology vertex nodes -> geometry face nodes -> photometry

Key properties
constant element size topological consistency efficient search for lists of edges of the faces efficient perimeter calculation

CSG and B-rep summary


They have different inherent strengths and weaknesses. CSG object always valid
its surface is closed and orientable and encloses a volume, provided the primitives are valid.

A B-rep object is easily rendered on a graphic display system.

Sweeping Representations
Sweeping a contour along a space curve Translational Rotational Generalized

Examples

Spatial representations

Cell decomposition

Quadtree
Sameh 84
Recursive binary subdivision of the plane into quadrants. A quadrant may be full, partially full or empty depending on the portion of the quadrant occupied by the object. Subdivision continues until all quadrants are either full or empty

Hierarchical data structure


Quadtree example

Partially full (or gray) node


Full (or black) node Empty (or white) node

Quadrant numbering or labeling


2 NE
0 SE

3 NW
1 SW

Boolean Operations Union


Given two trees S and T Traverse the two trees from top-down Consider a matching pair of nodes
(at the same position in the two trees)

Three cases:
1. 2. 3. If either node is black then a corresponding black node is added to the new tree If one of the nodes is white then a node is added with the color of the other node of the pair If both nodes are gray, then a gray node is added and the algorithm is applied recursively to the children nodes

Is that all?
For case 3, if all children of the added node turn out to be black then they are deleted and the node itself become black

Intersection operation
Similar to union with the role of black and white are interchanged.

Finding the neighbor of a node in a given direction

Find the neighbor of the red node in the N direction

Algorithm
Traverse the tree upward until the lowest common ancestor of the node and its neighbor is found This is done by moving up towards the root until a node is reached from a south S ( 0 or 1) link Then move downward in a mirror fashion until a leaf of the tree

Linear representation of a quadtree


Post-order list of the nodes A node is represented a string of digits, each digit corresponding to a level in the tree

Example
0 1 2 3

00X 02X 03X 200 202 203 22X 23X


Xs are added to nodes not at lowest level of the tree

Only full nodes are represented

Octree
Similar idea to quadtree in 3D space A node has 26 neighbors
6 along a face 12 along an edge 8 along a vertex

BSP Binary Space Partitioning Trees


Space-partitioning based on planes (or, in higher dimensions,hyperplanes) A plane divides the space points into two regions corresponding to the two half spaces defined by the plane. A recursive subdivision using planes until the partitioning satisfies some requirements produces a BSP tree

Example Polygon

Protein BSP

You might also like