What is an iso-contour? Points in a scalar field (pressure, - - PowerPoint PPT Presentation

what is an iso contour
SMART_READER_LITE
LIVE PREVIEW

What is an iso-contour? Points in a scalar field (pressure, - - PowerPoint PPT Presentation

Isocontours Marching Cubes Han-Wei Shen The Ohio State University What is an iso-contour? Points in a scalar field (pressure, temperature, etc.) that have a constant value 2D: isoline 3D: isosurface It is also called a level


slide-1
SLIDE 1

Isocontours

Marching Cubes

Han-Wei Shen The Ohio State University

slide-2
SLIDE 2

What is an iso-contour?

  • Points in a scalar field (pressure, temperature,

etc.) that have a constant value

– 2D: isoline – 3D: isosurface

  • It is also called

a level set

isolines Isosurfaces

Lf(c) = {x|f(x) = c}

slide-3
SLIDE 3

2D Isocontour

  • Given a 2D scalar field, compuLng a 2D

isocontour can be achieved cell by cell

Contour Value = C : Value > C : Value < C

slide-4
SLIDE 4

Isocontouring

  • Isocontouring in a cell is an inverse problem of

value interpolaLon

p0 p2 p3 p1 p4 p5 P =?

InterpolaLon

p0 p2 p3 p1 ? P f(P) = C

Isocontouring

slide-5
SLIDE 5

Isocontouring by Linear InterpolaLon

  • We can compute isocontour within a cell

based on linear interpolaLon

P0 (-) P2 (+) P3 (+) P1 (-) (1) IdenLfy edges that are ‘zero crossing’

  • Values at the two end points are greater

(+) and smaller (-) than the contour value (2) Calculate the posiLons of P in those edges (3) Connect the points with lines

slide-6
SLIDE 6

Step 1: IdenLfy Edges

  • Edges that have values greater (+) and less (-)

than the contour values must contain a point P that has f(p) = c

– This is based on the assumpLon that values vary linearly and conLnuously across the edge

v1 f(p1) = v1 p1 f(p2) =v2 v2 p2 C

slide-7
SLIDE 7

Step 2: Compute IntersecLon

  • The intersecLon point f(p) = c on the edge can

be computed by linear interpolaLon

C v1 f(p1) = v1 p1 f(p2) =v2 v2 p2 d1 d2

d1/d2 = (v1-C) / (C-v2) p p = (v1-C)/(v1-v2) * (p2-p1) + p1 (p – p1)/(p2-p1) = (v1-C) / (v1-v2)

slide-8
SLIDE 8

Step 3: Connect the Dots

  • Based on the principle of linear interpolaLon,

all points along the line p4p5 have values equal to C

P0 (-) P2 (+) P3 (+) P1 (-)

Repeat Step1 – Step 3 for all cells

slide-9
SLIDE 9

Isocontour Cases

  • How many way can an isocontour intersect a

linear rectangular cell?

P0 P2 P3 P1

  • The value at each vertex

can be either greater or less than the contour value

  • So there are 2 x 2 x 2 x 2 =

16 cases

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

P4 P3 P2 P1 1: > C 0: < C

slide-10
SLIDE 10

Unique Topological Cases

  • There are only four unique topological cases

(1) No intersecLon (2) Intersect with two adjacent edges (3) Intersect with two opposite cases (4) Two contours pass through the cell

What are the possible bit strings for each of the cases here?

slide-11
SLIDE 11

Put It All Together

  • 2D Isocontouring algorithm:
  • 1. Process one cell at a Lme
  • 2. Compare the values at 4 verLces

with the contour value C and idenLfy intersected edges

  • 3. Linear interpolate along the

intersected edges

  • 4. Connects the interpolated

points together

slide-12
SLIDE 12

3D Isocontour (Isosurface)

slide-13
SLIDE 13

Isosurface ExtracLon

  • Extend the 2D algorithm presented above to

three dimensions

– 3D cells – Linear interpolaLon along edges in acLve cells

  • AcLve cells: cells that intersect with the isosurface

– Compute surface patches within each cell

  • Depend on which edges are intersected by the

isosurface

slide-14
SLIDE 14

Tetrahedral Cells

  • AcLve cells: min < C < Max
  • Mark cell verLces that are greater than the

contour value as “+”, and smaller than the contour value as “-”

  • Each cell has four verLces

– Each cell can have a value greater (+) or smaller (-) than the contour value – A total of 2 x 2 x 2 x 2 = 16 combinaLons, but there are only three unique topological cases

slide-15
SLIDE 15

Case 1: No IntersecLon (all outside or inside)

  • Values at all cell verLces are greater or smaller

than the contour values

– If we call cell values greater than the contour value as ‘outside’ and smaller as ‘inside’, then all cell verLces are either completely inside or

  • utside of the isosurface

All VerLces Outside All VerLces Inside

slide-16
SLIDE 16

Case 2: One Outside (or Inside)

  • Only one of the verLces are outside or inside of

the isosurface

  • Isosurface only intersects with edges that have ‘+’

and ‘–’ verLces at two ends

One Outside One Inside

slide-17
SLIDE 17

Case 2: One Outside (or Inside)

  • Only one of the verLces are outside or inside of

the isosurface

  • Isosurface only intersects with edges that have ‘+’

and ‘–’ verLces at two ends

One Outside One Inside

slide-18
SLIDE 18

Case 2: One Outside (or Inside)

  • Only one of the verLces are outside or inside of

the isosurface

  • Isosurface only intersects with edges that have ‘+’

and ‘–’ verLces at two ends

One Outside One Inside

slide-19
SLIDE 19

Case 2: TriangulaLon

  • Compute the intersecLon points on the acLve

edges

One Outside One Inside

slide-20
SLIDE 20

Case 2: TriangulaLon

  • Compute the intersecLon points on the acLve

edges

  • Connect the intersecLon points into a single

triangle

One Outside One Inside

slide-21
SLIDE 21

Case 3: Two Outside (or Inside)

  • Two of the verLces are outside or inside of the

isosurface

  • Isosurface only intersects with edges that have ‘+’

and ‘–’ verLces at two ends

Two outside Two Inside

slide-22
SLIDE 22

Case 3: Two Outside (or Inside)

  • Two of the verLces are outside or inside of the

isosurface

  • Isosurface only intersects with edges that have ‘+’

and ‘–’ verLces at two ends

Two outside Two inside

slide-23
SLIDE 23

Case 3: Two Outside (or Inside)

  • Two of the verLces are outside or inside of the

isosurface

  • Isosurface only intersects with edges that have ‘+’

and ‘–’ verLces at two ends

Two outside Two inside

slide-24
SLIDE 24

Case 3: Two Outside (or Inside)

  • Two of the verLces are outside or inside of the

isosurface

  • Isosurface only intersects with edges that have ‘+’

and ‘–’ verLces at two ends

TWO Outside Two Inside

slide-25
SLIDE 25

Put It All Together

  • 1. Iterate through all tetrahedral cells

a) Compare the values at the four corners of each cell b) Determine the edges that intersect with the isosurface if any c) Compute the surface-edge intersecLon points using linear interpolaLon d) Triangulate the intersecLon points based on the cases discussed above

slide-26
SLIDE 26

Rectangular Cells

With 8 verLces in a cell, each having a value greater or smaller than the contour value, there can be 28 = 256 possible cases But the total number of unique topological cases is much smaller than 256

slide-27
SLIDE 27

Example of Case ReducLon

Value Symmetry

+ + _ _ _ _ _ _ + + _ _ + + + +

slide-28
SLIDE 28

Example of Case ReducLon

RotaLon Symmetry

+ + _ _ _ _ _ _ _ _ + + _ _ _ _

By inspecLon, we can reduce the number

  • f cases from 256 to 15
slide-29
SLIDE 29

Isosurface Cases

slide-30
SLIDE 30

The Marching Cubes Algorithm

  • By Lorensen and Cline in 1987

v1 v2 v3 v4 v5 v6 v7 v8 Vi is ‘1’ or ‘0’ (one bit)

1: > C; 0: <C (C= sovalue) Each cell has an index mapped to a value ranged [0,255]

Index = v8 v7 v6 v5 v4 v3 v2 v1

slide-31
SLIDE 31

Marching Cubes Table Lookup

  • Based on the values at the verLces, map the

cell to one of the 15 cases

  • Perform a table lookup to see what edges

have intersecLons

1 2 3 14 e1, e3, e5 … Index intersecLon edges e1

e2

e3 e4

e5

e6 e7 e8 e9 e10 e11 e12

slide-32
SLIDE 32

Compute IntersecLons

  • Perform linear interpolaLon to compute the

intersecLon points at the edges

  • Connect the points by looking up the marching

cubes table

+ + + + _ _ _ _

slide-33
SLIDE 33

Marching the Cubes

  • SequenLally scan through the cells – row by

row, layer by layer

  • You can re-use the intersecLon points for

neighboring cells