manifold (good)

Upload: rajesh-kaluri

Post on 07-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/4/2019 Manifold (Good)

    1/51

    Solid Modeling

    Reference:

    Computer Graphics. Principles and Practice

    Foley - van dam

    Feiner

    Hugheschapter 12

  • 8/4/2019 Manifold (Good)

    2/51

    Solid representation - DesiderataRequicha 80

    Domain:A representation should be able to represent auseful set of geometric objects.

    Unambiguity:When you see a representation of a solid, youwill know what is being represented withoutany doubt. An unambiguous representation isusually referred to as a completeone.

    Uniqueness:from the representations it is immediatelypossibile to determine if two solids are identical

  • 8/4/2019 Manifold (Good)

    3/51

    DesiderataRequicha 80

    Accuracy

    Little or no approximation

    ValidnessA representation should not create any phisically

    unrealizable or impossible solids. Closure

    Solids will be transformed and used with otheroperations such as union and intersection. "Closure"

    means that transforming a valid solid always yields avalid solid.

    Compactness and Efficiencyto save memory and computation time

  • 8/4/2019 Manifold (Good)

    4/51

  • 8/4/2019 Manifold (Good)

    5/51

    2-ManifoldTorus

    Intuitively, we can deform the surface locally into

    a plane without tearing it or identifying separatepoints with each other.

  • 8/4/2019 Manifold (Good)

    6/51

    A non manifold object

    Surfaces thatintersect or touchthemselves are non

    manifolds.

  • 8/4/2019 Manifold (Good)

    7/51

    Boolean Operations on Solids

    Boolean operation on valid solids mayproduce non valid solids.

    Example: Intersecting two cubes that touchalong a face produces a face, i.e. a nonvalid solid

  • 8/4/2019 Manifold (Good)

    8/51

    Regularized Boolean operations

    Goal: eliminate dangling" lower-dimensionalstructures that may be produced byBoolean operations

    Notation:

    A*

    B, A

    * B, A -* B

  • 8/4/2019 Manifold (Good)

    9/51

    Regularized IntersectionExample

  • 8/4/2019 Manifold (Good)

    10/51

    Regularized Boolean Intersection

    Compute A * B

    Three steps:

    1. Compute A

    B2. Take the interior of A B

    3. Form the closure of this interior by adding allboundary points adjacent to some interior

    neighborhood.

    A * B = closure(interior A B )

  • 8/4/2019 Manifold (Good)

    11/51

    Some definitions

    The interior consists of all those points p of A Bsuch 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 ifwe 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 thissegment are interior points of A B, except q.

  • 8/4/2019 Manifold (Good)

    12/51

    Regularized Boolean operationson 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.

  • 8/4/2019 Manifold (Good)

    13/51

    Constructive Solid Geometry(CSG)

    A solid is represented as a set theoretic

    Boolean expression of primitive solidobjects, of a simpler structure.

    Both the surface and the interior of anobject are defined, albeit implicitly.

  • 8/4/2019 Manifold (Good)

    14/51

    Primitives

    Blocks, cylinders, spheres, cones, andtori

    A primitive object is instantiated byspecifying some parameters Side lengths of blocks, the diameter and

    length of cylinders, placing the primitives with respect to a

    common world coordinate frame

  • 8/4/2019 Manifold (Good)

    15/51

    Combining the primitives

    A solid can be considered as the result ofapplying regularized Boolean operators toa set of instantiated and transformed CSGprimitives

    CSG representations are not unique

  • 8/4/2019 Manifold (Good)

    16/51

    Example

  • 8/4/2019 Manifold (Good)

    17/51

    Example(from Shene, Michigan)

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

  • 8/4/2019 Manifold (Good)

    18/51

    B-reps

    Boundary representationa solid is modeled as a set of surfaces forming its boundary.

    Topology and Geometry

    1. Topology

    how the surfaces are connectedtogether.(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 thefaces are a subset.

    3. Topology and Geometry are strongly linked.

  • 8/4/2019 Manifold (Good)

    19/51

    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.

  • 8/4/2019 Manifold (Good)

    20/51

    Euler-Poincare formula:

    For a polyhedron

    V - E + F - 2 = 0 V = Vertices

    E = Edges F = Faces

    Example: A tetrahedron has four vertices, fourfaces, and six edges

    4-6+4=2.

  • 8/4/2019 Manifold (Good)

    21/51

    Proof by induction

    Base: the formula is true for tetrahedaInduction 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 Sol3The, the two faces disappear and:

    F3 = F1 + F2 - 2

    V3 = V1 + V2 - nE3 = E1 + E2 - n

    Thus:

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

  • 8/4/2019 Manifold (Good)

    22/51

    Euler Poincare Formula

    Necessary but not sufficient condition for a validrepresentation.

    Example: 8 vertices, 12 edges, 6 faces

  • 8/4/2019 Manifold (Good)

    23/51

    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

  • 8/4/2019 Manifold (Good)

    24/51

    Extension of Euler-Poincareformula 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 butnot tearing, or cutting ) solids modifies the solid withoutchanging the topology or the above numbers.

  • 8/4/2019 Manifold (Good)

    25/51

    A solid with holes and loopsExample

    V E + F H = 2 (C G)

    24 36 + 15 3 = 2( 1 1)

  • 8/4/2019 Manifold (Good)

    26/51

    ExampleA surface with genus 2

  • 8/4/2019 Manifold (Good)

    27/51

    Validity of a B-rep

    Ensuring validity of a B-rep can be very difficult

    Topological validity Orientability adjacent faces must have correct

    orientationsGeometric validity:Determining position/orientation of

    vertices/planes, etc.

    Inaccuracies in geometry and computation canlead to topological inconsistencies.

  • 8/4/2019 Manifold (Good)

    28/51

    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 liewithin a solid, but topological information says it liesoutside.

    Example 2: Intersection of 3 plane equations for facesyields coordinates that are different than those of thevertex shared by those faces.

  • 8/4/2019 Manifold (Good)

    29/51

    Winged-Edge RepresentationBaumgart 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 ..

  • 8/4/2019 Manifold (Good)

    30/51

    Each edge has 8 pointers to:its two faces:

    Pface and Nface

    its two vertices

    each of its four neighboringedges (wings)

    Traversal of V1 and V2 in

    opposte directions whentraversing Pface and Nfacein counterclockwise order

    The two edges at N are theprevious counterclockwiseon the Pface and theprevious clockwise on theNface

    V1=N

    V2=P

    PfaceNface

    PccwePcwe

    NccweNcwe

  • 8/4/2019 Manifold (Good)

    31/51

    Edge nodes -> topology

    vertex nodes -> geometry

    face nodes -> photometry

  • 8/4/2019 Manifold (Good)

    32/51

    Key properties

    constant element size

    topological consistency

    efficient search for lists of edges of the faces

    efficient perimeter calculation

  • 8/4/2019 Manifold (Good)

    33/51

    CSG and B-repsummary

    They have different inherent strengths andweaknesses.

    CSG object always valid its surface is closed and orientable and

    encloses a volume, provided the primitivesare valid.

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

  • 8/4/2019 Manifold (Good)

    34/51

    Sweeping Representations

    Sweeping a contour along a space curve

    Translational

    Rotational

    Generalized

  • 8/4/2019 Manifold (Good)

    35/51

    Examples

  • 8/4/2019 Manifold (Good)

    36/51

    Spatial representations

  • 8/4/2019 Manifold (Good)

    37/51

    Cell decomposition

  • 8/4/2019 Manifold (Good)

    38/51

    QuadtreeSameh 84

    Recursive binary subdivision of the plane intoquadrants.

    A quadrant may be full, partially full or emptydepending on the portion of the quadrantoccupied by the object.

    Subdivision continues until all quadrants areeither full or empty

    Hi hi l d t t t

  • 8/4/2019 Manifold (Good)

    39/51

    Hierarchical data structureQuadtree example

    Partially full (or gray) nodeFull (or black) node

    Empty (or white) node

  • 8/4/2019 Manifold (Good)

    40/51

    Quadrant numbering or labeling

    2NE

    3NW

    0SE

    1SW

  • 8/4/2019 Manifold (Good)

    41/51

    Boolean OperationsUnion

    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. If either node is blackthen a corresponding blacknode is addedto the new tree

    2. If one of the nodes is white then a node is added with the color ofthe other node of the pair

    3. If both nodes are gray, then a gray node is added and thealgorithm is applied recursively to the children nodes

  • 8/4/2019 Manifold (Good)

    42/51

    Is that all?

    For case 3, if all children of the addednode turn out to be black then they aredeleted and the node itself become black

  • 8/4/2019 Manifold (Good)

    43/51

    Intersection operation

    Similar to union with the role of black andwhite are interchanged.

    Fi di th i hb f d

  • 8/4/2019 Manifold (Good)

    44/51

    Finding the neighbor of a nodein a given direction

    Find the neighbor of the red node in the N direction

  • 8/4/2019 Manifold (Good)

    45/51

    Algorithm

    Traverse the tree upward until the lowestcommon ancestor of the node and its neighboris found

    This is done by moving up towards the root until anode is reached from a south S ( 0 or 1) link

    Then move downward in a mirror fashion until aleaf of the tree

    Li i

  • 8/4/2019 Manifold (Good)

    46/51

    Linear representationof a quadtree

    Post-order list of the nodes

    A node is represented a string of digits,each digit corresponding to a level in thetree

  • 8/4/2019 Manifold (Good)

    47/51

    Example

    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

    0 1 2 3

  • 8/4/2019 Manifold (Good)

    48/51

    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

  • 8/4/2019 Manifold (Good)

    49/51

    BSPBinary Space Partitioning Trees

    Space-partitioning based on planes (or, inhigher dimensions,hyperplanes)

    A plane divides the space points into two

    regions corresponding to the two halfspaces defined by the plane.

    A recursive subdivision using planes until

    the partitioning satisfies somerequirements produces a BSP tree

    E l

  • 8/4/2019 Manifold (Good)

    50/51

    ExamplePolygon

  • 8/4/2019 Manifold (Good)

    51/51

    Protein BSP