46
Yingcai Xiao Chapter 9 Advanced Algorithms

Yingcai Xiao

  • Upload
    kieu

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

Chapter 9 Advanced Algorithms. Yingcai Xiao. Constructing Topology. Data collected in the real world. Usually scattered, not confirming to a grid. Can be interpolated into a grid. But problem rises when we use global interpolation methods. - PowerPoint PPT Presentation

Citation preview

Page 1: Yingcai Xiao

Yingcai Xiao

Chapter 9

Advanced Algorithms

Page 2: Yingcai Xiao

Constructing Topology

Page 3: Yingcai Xiao

• Data collected in the real world

① Usually scattered, not confirming to a grid.

② Can be interpolated into a grid. But problem rises when we use global interpolation methods.

Page 4: Yingcai Xiao

Scattered Data: sample points distributed unevenly and non-uniformly Scattered Data: sample points distributed unevenly and non-uniformly throughout the volume of interest. throughout the volume of interest.

Example Data: chemical leakage at a tank-farm.Example Data: chemical leakage at a tank-farm.

Page 5: Yingcai Xiao

Thin-plate Spline f x y z b d d c c x c y c zi i ii

n

( , ) = ( ) + + + + =

, log2

1 2 31

4

Page 6: Yingcai Xiao

Volume Spline f x y z b d c c x c y c zi ii

n

( , ) = + + + + =

, 31 2 3

14

Page 7: Yingcai Xiao

Shepard method f x y z

n

i

d v

n

i

di i i( , ) =

=

=

,

1 1

1 1

Page 8: Yingcai Xiao

• Data collected in the real world

① Can we use local interpolation with the closest points?

② Need to find and connect the closest points.

③ Demo in 2D.

Page 9: Yingcai Xiao

Visualizing Unstructured Points

Triangulation: Connect points to form a triangulated topological structure. (topology generation)

Page 10: Yingcai Xiao

TriangulationTriangulation

Use Edge Swapping to make a Delaunay Triangulation.

1. Find the minimum bounding triangle. (may need to add a fake point)

2. Add one point at a time, do triangulation.

3. After each point is added, check if the joined triangles are optimal or not; if not swap the joining edge (edge swapping). Check all other triangles and make sure they are still optimal after adding the current point.

4. Repeat step 3 to add each point and we when all points are added and all triangles are optimal.

5. Clean up: remove all fake points and related triangles.

Page 11: Yingcai Xiao

TriangulationTriangulation

Properties of Delaunay Triangulation:

1. Circumsphic property: no other points in the circumspheres.

2. Optimal property: The minimum interior angle of a triangle is greater than or equal to the minimum interior angle of any other triangulation

3. It is the dual of the Diritchlet tessellation

① Voronoi cell, Centroid

② A collection of connected Voronoi cells tessellete the area (partition, coverage)

Page 12: Yingcai Xiao

TriangulationTriangulation

Formal definition of Triangulation:

N dimensional triangulation of a point set P=(P1, P2, ……,Pn) is a collection of n-dimensional simplexes (triangles) whose defining points lie in P.

 

Optimal Triangulation: a triangulation that generates maximized minimum angles.

Delaunay Trianglation: an optimal triangulation, which satisfies the circumshpere condition.

Circumsphere Condition: the circumshpere of any n-dementional simplexe contains no other points of p except the n+1 points defining the simplex.

Page 13: Yingcai Xiao

TriangulationTriangulation

Example VTK Code:

vtkPolyData *p= vtkPolyData::New();

pSetPoints(pnts);

//pnts: pointer to an array of points, vtkFloatPoints

vtkDelaunay3D *d= vtkDelaunay3D::New();

dSetInput(p);

dSetTolerance(0.0001);

vtkPolyDataMapper *m= vtkPolyDataMapper::New();

mSetInput(dGetOutput);

vtkActor *a= vtkActor::New();

aSetMapper(m);

Page 14: Yingcai Xiao

Visualizing Unstructured Points

Splatting for Point Data

Gaussian Splatting

s: scale factor

R: radius of influence

Data value assigned to grid nodes within the radius of influence of the data point.

Page 15: Yingcai Xiao

Scalar Algorithms

Page 16: Yingcai Xiao

Marching Triangles for Contour LinesMarching Triangles for Contour Lines

Marching Tetrahedrons for Isosurface.

8 cases, 3 unique, doted vertexes are inside: v > contour value

Page 17: Yingcai Xiao

Dividing Cubes • Generate contour surfaces using dense point clouds.

• For each voxel, interpolate into it if the contour going through it, display points around the interpolated surface.

• Subdivide the voxel to have each subvoxel cover one pixel. Draw a point in the subvoxel if it is near the isosurface (nodal values brace the threshold values).

• Display points are much faster than surfaces.• The resulting surface is not continuous.

Page 18: Yingcai Xiao

Dividing Cubes

Page 19: Yingcai Xiao

Carpet Plots

• Display a 2D grid (a slice of a 3D grid) as a 3D extruded surface based on the data values

• The extrusion is perpendicular to the 2D slice and is proportional to the data values.

Page 20: Yingcai Xiao

Carpet Plots

V(r) = e-r cos(10r);

Page 21: Yingcai Xiao

Clipping Geometry with a Scalar Field

Original Geometry Clipped Geometry

Page 22: Yingcai Xiao

Clipping Geometry with a Scalar Field

• Data controlled geometry change.• To reveal the inside of a volume.Ex. Data values: v(x,y,z) = x + y + z – c Isosurface: v=0 defines a plane, use it

to cut geometry.

Marching Cube Cases: Vertex inside/outside 256=>15 Unique cases

Page 23: Yingcai Xiao

Clipping Geometry with a Scalar Field

Marching Triangles: 8 cases, 4 unique (doted vertexes are inside: v < 0)

Page 24: Yingcai Xiao

Clip a plane by a cylinder and a sphere.vtkImplicitBoolean *ib =

vtkImplicitBoolean::New();

ibAddFunction(cylinder);

ibAddFunction(sphere);

vtkClipPolyData *c =

vtkClipPolyData::New();

cSetInput(planGetOutput())

cSetClipFunction(ib);

cGenerateClippedOutputOn();

cGenerateClipScalarsOn();

cSetValue(0) // v = 0;

Page 25: Yingcai Xiao

Vector Algorithms

Page 26: Yingcai Xiao

Stream Tubes

Stream Lines depict flow direction of a vector fields

What about temperature? Color coding.

How about add speed, acceleration, vortisity (twist)?

 

 

Page 27: Yingcai Xiao

Tensor Algorithm

Page 28: Yingcai Xiao

Hyperstreamlines

Page 29: Yingcai Xiao

High Dimensional Visualization

F(x), F(x,y), F(x,y,z), F(x1, x2, x3, ……)

• Glyph, use each part of the glyph for a variable.

• Use Parallel Coordinate Systems

 

x1 x2 x3 x4

Plot of a four dimensional point.

Page 30: Yingcai Xiao

Parallel Coordinate SystemsParallel Coordinate Systems

• Brushing

• Minimal Example

• Reordering

• Coloring

 

x1 x2 x3 x4

Plot of a four dimensional point.

• Compositing• Progressive Rendering• Bundling

Page 31: Yingcai Xiao

Parallel Coordinate SystemsParallel Coordinate Systemshttp://www.xdat.org

http://www.cs.tau.ac.il/~aiisreal/

https://github.com/syntagmatic/parallel-coordinates

https://syntagmatic.github.io/parallel-coordinates/

http://www.ggobi.org/docs/parallel-coordinates/

http://en.wikipedia.org/wiki/Parallel_coordinates

http://stn.spotfire.com/spotfire_client_help/para/para_what_is_a_parallel_coordinate_plot.htm

https://eagereyes.org/techniques/parallel-coordinates

http://exposedata.com/parallel/

http://www.b-eye-network.com/view/3355

http://www.parallelcoordinates.de/#toggleControls

 

Page 32: Yingcai Xiao

Modeling Algorithms

Page 33: Yingcai Xiao

Modeling Algorithms

• Visualizing Geometry:

• bundary cells

• outlines,

• wireframe (w/s in a VKT window)

 

Page 34: Yingcai Xiao

Data Extraction: Dataset => Subset

Extract portions of data from a dataset.

• Geometry Extraction

portion of a grid, set of cells subsampling: every nth data point is selected.

• Threshholding: extracting based on data values.

May change topology, e.g., uniform => unstructured.

 

 

Page 35: Yingcai Xiao

Probing (Resampling): Dataset => Another Dataset

• Obtains dataset attributes by sampling the original dataset with a set of points (the probe).

• Data values can be viewed in a particular fashion.

 

Page 36: Yingcai Xiao

Swept Volume and Surfaces: Visualize Motion

A swept volume is the volume of space occupied by an object as it moves through space along a given trajectory. A polygonal is created from the original.

– Path: ST

– Steps: L

– Boolean Operation

Page 37: Yingcai Xiao

Triangle Strip Generation

Triangle strips are compact representations of triangle polygons.

Greedy method: The longer the average strip length is the better.

 

http://en.wikipedia.org/wiki/File:Triangle_Strip_Small.png

Page 38: Yingcai Xiao

Polygon Normal Generation

Reflection:

• I~f(N,C) i.e., C.N.I

• Normal may not be given by the progammer.

 

Facet Normal: Compute normal of a polygon from its vertexes.

Ex.

 

Page 39: Yingcai Xiao

Polygon Normal Generation: facet / polygonal normals

Page 40: Yingcai Xiao

Polygon Normal Generation

Vertex Normals:

Use the average of the facet normals in the use set.

Page 41: Yingcai Xiao

Polygon Normal Generation

Vertex Normals:

Shaded using vertex normal (average of facet normals), too smooth.

Page 42: Yingcai Xiao

Polygon Normal Generation

Feature Angle ~800 <900

Take the facet out of the average computation if the connected facets have angle greater than the feature angle

Page 43: Yingcai Xiao

Decimation

Polygon Reduction (Vertex Reduction)

Threshold Distance:

For lines: is the distance to the line without the vertex.

Page 44: Yingcai Xiao

Decimation

For surface: is the distance to the surface without the vertex.

Page 45: Yingcai Xiao

Mesh Smoothing

No reduction, no topology change.

But the geometry changes to make the mesh smooth.

Page 46: Yingcai Xiao

Mesh Smoothing

No reduction, no topology change.

But the geometry changes to make the mesh smooth.