# Geometric Modeling for Computer mjb/cs550/Handouts/... · PDF file Computer Graphics...

date post

20-Aug-2020Category

## Documents

view

2download

0

Embed Size (px)

### Transcript of Geometric Modeling for Computer mjb/cs550/Handouts/... · PDF file Computer Graphics...

1

mjb – August 26, 2019

1

Computer Graphics

Geometric Modeling for Computer Graphics

GeometricModeling.pptx

This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License

Mike Bailey [email protected]

mjb – August 26, 2019

2

Computer Graphics

Explicitly Listing Geometry and Topology

Models can consist of thousands of vertices and faces – we need some way to list them efficiently

http://graphics.stanford.edu/data/3Dscanrep

This is called a Mesh. If it’s in nice neat rows like this, it is called a Regular Mesh. If it’s not, it is called an Irregular Mesh, or oftentimes called a Triangular Irregular Network, or TIN.

2

mjb – August 26, 2019

3

Computer Graphics

static GLfloat CubeVertices[ ][3] = {

{ -1., -1., -1. }, { 1., -1., -1. }, { -1., 1., -1. }, { 1., 1., -1. }, { -1., -1., 1. }, { 1., -1., 1. }, { -1., 1., 1. }, { 1., 1., 1. }

};

static GLfloat CubeColors[ ][3] = {

{ 0., 0., 0. }, { 1., 0., 0. }, { 0., 1., 0. }, { 1., 1., 0. }, { 0., 0., 1. }, { 1., 0., 1. }, { 0., 1., 1. }, { 1., 1., 1. },

};

static GLuint CubeQuadIndices[ ][4] = {

{ 0, 2, 3, 1 }, { 4, 5, 7, 6 }, { 1, 3, 7, 5 }, { 0, 4, 6, 2 }, { 2, 6, 7, 3 }, { 0, 1, 5, 4 }

};

Explicitly Listing Geometry and Topology

0 1

32

4 5

76

mjb – August 26, 2019

4

Computer Graphics

Cube Example

3

mjb – August 26, 2019

5

Computer Graphics

GLuint CubeQuadIndices[ ][4] = {

{ 0, 2, 3, 1 }, { 4, 5, 7, 6 }, { 1, 3, 7, 5 }, { 0, 4, 6, 2 }, { 2, 6, 7, 3 }, { 0, 1, 5, 4 }

};

The Cube Can Also Be Defined with Triangles

0 1

32

4 5

76

GLuint CubeTriangleIndices[ ][3] = {

{ 0, 2, 3 }, { 0, 3, 1 }, { 4, 5, 7 }, { 4, 7, 6 }, { 1, 3, 7 }, { 1, 7, 5 }, { 0, 4, 6 }, { 0, 6, 2 }, { 2, 6, 7 }, { 2, 7, 3 }, { 0, 1, 5 } { 0, 5, 4 }

};

mjb – August 26, 2019

6

Computer Graphics

3D Printing uses a Triangular Mesh Data Format

4

mjb – August 26, 2019

7

Computer Graphics

3D Printing uses a Triangular Mesh Data Format

mjb – August 26, 2019

8

Computer Graphics

Go Beavs!

5

mjb – August 26, 2019

9

Computer Graphics

Another way to Model: Remember Venn Diagrams (2D Boolean Operators) from High School?

Two Overlapping Shapes Union: AB

Difference: A-B Intersection: AB

A B

mjb – August 26, 2019

10

Computer Graphics

Solid Modeling Using 3D Boolean Operators

Two Overlapping Solids

This is often called Constructive Solid Geometry, or CSG

Union: AB

Difference: A-BIntersection: AB

A

B

6

mjb – August 26, 2019

11

Computer Graphics

Another way to Model: Curve Sculpting – Bezier Curve Sculpting

3 2 2 3 0 1 2 3( ) (1 ) 3 (1 ) 3 (1 )P t t P t t P t t P t P

P0

P1 P2

P3

0. 1.t

𝑥 𝑦 𝑧

where P represents

mjb – August 26, 2019

12

Computer Graphics

Curve Sculpting – Bezier Curve Sculpting Example

7

mjb – August 26, 2019

13

Computer Graphics

Curve Sculpting – Bezier Curve Sculpting Example

Moving a single point moves an entire curve

A Small Amount of Input Change Results in a Large Amount of Output Change

mjb – August 26, 2019

14

Computer Graphics

Another way to Model: Surface Sculpting

Wireframe Surface

Moving a single point moves an entire surface

A Small Amount of Input Change Results in a Large Amount of Output Change

8

mjb – August 26, 2019

15

Computer Graphics

Surface Equations can also be used for Analysis

With Contour Lines Showing Curvature

mjb – August 26, 2019

16

Computer Graphics

This is often called a “Lattice” or a

“Cage”.

Another Way to Model: Volume Sculpting

lattice.mp4

A Small Amount of Input Change Results in a Large Amount of Output Change

9

mjb – August 26, 2019

17

Computer Graphics

Modeling → Simulation (Explosion)

mjb – August 26, 2019

18

Computer Graphics

Modeling → Simulation (Smoke)

10

mjb – August 26, 2019

19

Computer Graphics

Object Modeling Rules for 3D Printing

The object must be a legal solid. It must have a definite inside and a definite outside. It can’t have any missing face pieces.

Missing face

“Definite inside and outside” is sometimes called “Two-manifold” or “Watertight”

mjb – August 26, 2019

20

Computer Graphics

The Simplified Euler's Formula* for Legal Solids

F – E + V = 2

0 1

32

4 5

76

For a cube, 6 – 12 + 8 = 2

F Faces E Edges V Vertices

*sometimes called the Euler-Poincaré formula

The full formula is:

F – E + V – L = 2( B – G ) F Faces E Edges V Vertices L Inner Loops (within faces) B Bodies G Genus (number of through-holes)

11

mjb – August 26, 2019

21

Computer Graphics

Object Modeling Rules for 3D Printing

Overlapped in 3D -- bad Boolean union -- good

Objects cannot pass through other objects. If you want two shapes together, do a Boolean union on them so that they become one complete object.

*View more*