Solid Modeling Dr Scott Schaefer 1 Solid Modeling

  • Slides: 58
Download presentation
Solid Modeling Dr. Scott Schaefer 1

Solid Modeling Dr. Scott Schaefer 1

Solid Modeling Representations Constructive Solid Geometry n Octrees n Boundary Representations n Implicit Representations

Solid Modeling Representations Constructive Solid Geometry n Octrees n Boundary Representations n Implicit Representations n 2/58

Constructive Solid Geometry Combine simple primitives together using set operations u Union, subtraction, intersection

Constructive Solid Geometry Combine simple primitives together using set operations u Union, subtraction, intersection n Intuitive operations for building more complex shapes n 3/58

Constructive Solid Geometry Combine simple primitives together using set operations u Union, subtraction, intersection

Constructive Solid Geometry Combine simple primitives together using set operations u Union, subtraction, intersection n Intuitive operations for building more complex shapes n Image taken from “Feature-Sensitive Subdivision and Isosurface Reconstruction” 4/58

Constructive Solid Geometry Typically represented as binary tree n Leaves store solids (sphere, cylinder,

Constructive Solid Geometry Typically represented as binary tree n Leaves store solids (sphere, cylinder, …) n Interior nodes are operations union (union, subtraction, …) or transformations subtraction rotation n sphere cylinder 5/58

Ray Tracing CSG Trees n Assume we have a ray R and a CSG

Ray Tracing CSG Trees n Assume we have a ray R and a CSG tree T n If T is a solid, u compute all intersections of R with T u return parameter values and normals If T is a transformation u apply inverse transformation to R and recur u apply inverse transpose of transformation to normals u return parameter values Otherwise T is a boolean operation u recur on two children to obtain two sets of intervals u apply operation in T to intervals u return parameter values. n n n Display closest intersection point 6/58

Inside/Outside Test for CSG Trees n Given a point p and a tree T,

Inside/Outside Test for CSG Trees n Given a point p and a tree T, determine if p is inside/outside the solid defined by T n If T is a solid u Determine if p is inside T and return If T is a transformation u Apply the inverse transformation to p and recur Otherwise T is a boolean operation u Recur to determine inside/outside of left/right children u If T is Union t If either child is inside, return inside, else outside u If T is Intersection t If both children are inside, return inside, else outside u If T is Subtraction t If p is inside left child and outside right child, return inside, else outside n n 7/58

Application: Computing Volume Monte Carlo method n Put bounding box around object n Pick

Application: Computing Volume Monte Carlo method n Put bounding box around object n Pick n random points inside the box u Determine if each point is inside/outside the CSG Tree n Volume n 8/58

Octrees Models space as a tree with 8 children n Nodes can be 3

Octrees Models space as a tree with 8 children n Nodes can be 3 types u Interior Nodes u Solid u Empty n 9/58

Octrees Models space as a tree with 8 children n Nodes can be 3

Octrees Models space as a tree with 8 children n Nodes can be 3 types u Interior Nodes u Solid u Empty n 10/58

Building Octrees If cube completely inside, return solid node n If cube completely outside,

Building Octrees If cube completely inside, return solid node n If cube completely outside, return empty node n Otherwise recur until maximum depth reached n 11/58

Octrees n n Advantages u Storage space proportional to surface area u Inside/Outside trivial

Octrees n n Advantages u Storage space proportional to surface area u Inside/Outside trivial u Volume trivial u CSG relatively simple u Can approximate any shape Disadvantages u Blocky appearance 12/58

Octrees n n Advantages u Storage space proportional to surface area u Inside/Outside trivial

Octrees n n Advantages u Storage space proportional to surface area u Inside/Outside trivial u Volume trivial u CSG relatively simple u Can approximate any shape Disadvantages u Blocky appearance 13/58

Boundary Representations n Stores the boundary of a solid u Geometry: vertex locations u

Boundary Representations n Stores the boundary of a solid u Geometry: vertex locations u Topology: connectivity information t Vertices t Edges t Faces 14/58

Boundary Representations n Constant time adjacency information u For each vertex, t Find edges/faces

Boundary Representations n Constant time adjacency information u For each vertex, t Find edges/faces touching vertex u For each edge, t Find vertices/faces touching edge u For each face, t Find vertices/edges touching face 15/58

Half Edge Data Structure face 16/58

Half Edge Data Structure face 16/58

Half Edge Data Structure Half. Edge { Half. Edge next, prev, flip; Face face;

Half Edge Data Structure Half. Edge { Half. Edge next, prev, flip; Face face; Vertex origin; Edge edge; } Face { Half. Edge edge; // part of this face } Vertex { Half. Edge edge; // points away } Edge { Half. Edge he; } face 17/58

Half Edge Data Structure Given a face, find all vertices touching that face n

Half Edge Data Structure Given a face, find all vertices touching that face n Given a vertex, find all edge-adjacent vertices n Given a face, find all face adjacent faces n 18/58

Building a Topological Data Structure Must connect adjacent edges/faces/vertices n Edges are critical in

Building a Topological Data Structure Must connect adjacent edges/faces/vertices n Edges are critical in most data structures n n Use a hash table indexed by two vertices face 19/58

Boundary Representations Advantages u Explicitly stores neighbor information u Easy to render u Easy

Boundary Representations Advantages u Explicitly stores neighbor information u Easy to render u Easy to calculate volume u Nice looking surface n Disadvantages u CSG very difficult u Inside/Outside test hard n 20/58

Implicit Representations of Shape n Shape described by solution to f(x)=c 21/58

Implicit Representations of Shape n Shape described by solution to f(x)=c 21/58

Implicit Representations of Shape n Shape described by solution to f(x)=c 22/58

Implicit Representations of Shape n Shape described by solution to f(x)=c 22/58

Implicit Representations of Shape n Shape described by solution to f(x)=c - - -

Implicit Representations of Shape n Shape described by solution to f(x)=c - - - 23/58

Implicit Representations of Shape n Shape described by solution to f(x)=c + + -

Implicit Representations of Shape n Shape described by solution to f(x)=c + + - - - + + 24/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations n 25/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations + + n + + - - + + 26/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations n 27/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations u Union n 28/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations u Union n 29/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations u Union + + - - - + + 30/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test + n CSG operations + u Union n + - - + + 31/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test + n CSG operations + -+ u Union + + -+ - - - - - + + 32/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations -+ u Union n - -- + + 33/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test + + n CSG operations + u Union + + + u Intersection + + - + + n 34/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations + u Union + u Intersection n + - + 35/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test + + n CSG operations + u Union + + + u Intersection + + u Subtraction - + + n 36/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations + + u Union + + + u Intersection + + u Subtraction + + + n - 37/58

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test

Advantages No topology to maintain n Always defines a closed surface! n Inside/Outside test n CSG operations u Union + u Intersection + u Subtraction + n - + 38/58

Disadvantages Hard to render - no polygons n Creating polygons amounts to root finding

Disadvantages Hard to render - no polygons n Creating polygons amounts to root finding n Arbitrary shapes hard to represent as a function n 39/58

Non-Analytic Implicit Functions n Sample functions over grids 40/58

Non-Analytic Implicit Functions n Sample functions over grids 40/58

Non-Analytic Implicit Functions n Sample functions over grids 41/58

Non-Analytic Implicit Functions n Sample functions over grids 41/58

Data Sources 42/58

Data Sources 42/58

Data Sources 43/58

Data Sources 43/58

Data Sources 44/58

Data Sources 44/58

Data Sources 45/58

Data Sources 45/58

Data Sources 46/58

Data Sources 46/58

Data Sources 47/58

Data Sources 47/58

2 D Polygon Generation 48/58

2 D Polygon Generation 48/58

2 D Polygon Generation 49/58

2 D Polygon Generation 49/58

2 D Polygon Generation 50/58

2 D Polygon Generation 50/58

2 D Polygon Generation 51/58

2 D Polygon Generation 51/58

2 D Polygon Generation 52/58

2 D Polygon Generation 52/58

3 D Polygon Generation 53/58

3 D Polygon Generation 53/58

3 D Polygon Generation 54/58

3 D Polygon Generation 54/58

Fun Examples 55/58

Fun Examples 55/58

Fun Examples 56/58

Fun Examples 56/58

Fun Examples 57/58

Fun Examples 57/58

Fun Examples 58/58

Fun Examples 58/58