Triangular Mesh Decimation Martin Franc, Václav Skala marty|[email protected] University of West...

28
Triangular Mesh Decimation Martin Franc, Václav Skala marty|[email protected] http://herakles.zcu.cz University of West Bohemia in Plzen Czech Republic

Transcript of Triangular Mesh Decimation Martin Franc, Václav Skala marty|[email protected] University of West...

Page 1: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Triangular Mesh Decimation

Martin Franc, Václav Skalamarty|[email protected]://herakles.zcu.cz

University of West Bohemia in PlzenCzech Republic

Page 2: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Contents

• Motivation• Decimation• Previous work• Algorithm modification• Results• Conclusion

Page 3: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Motivation• fast and interactive visualization of large and complex data (CAD, 3D

scanner, CT, MRI)• reduction of the number of triangles preserving important details of the

model

Page 4: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Decimation

• W. Schroeder 1992• Simplification methods based on a

specific mesh element removal– vertex decimation– edge decimation – edge contraction– patch decimation – vertex clustering

• Fast and simple method• Can be generalized to 3D

Page 5: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Decimation

• General scheme– mesh element importance evaluation– element removal– arising “hole” triangulation

• Non-trivial triangulation in 3D

Page 6: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Decimation

• Vertex decimation– vertex topology assessment

– importance evaluation– the least vertex removal– triangulation

Page 7: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Decimation

• Edge decimation– edge importance evaluation– the least important edge removal– triangulation

• Patch decimation– patch importance evaluation– the least important removal– triangulation

Page 8: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Previous work

• Vertex and edge decimation combination– vertices evaluation– the least important vertex selection– adjacent edges importance evaluation– triangulation

• Parallelization– independent set of vertices– multithread programming (no critical sections)

Page 9: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Previous work

• Edge contraction criterion– minimal length– minimal surface area after triangulation

• Independent set of vertices– independent set of vertices– super independent set of vertices

Page 10: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Algorithm

• Vertices evaluation• topology assessment

• importance evaluation

• The least important one search• vertices sorting (according to their importance)

• super independent set creation

• Vertex removal• edges evaluation (optimal edge selection)

• consistency check

• triangulation

Page 11: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Data structure

• Winged edge modification

1 ,2 ,5,4 ,3 ,7,6n

ne igh bo urin g t rian g le s

Page 12: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Implementation

• Symmetrical multiprocessor (shared memory)• Windows NT• Threads

– no critical sections– as many threads as free processors– procedure

• get number of free processors (P)• divide a set of vertices onto P parts• run P threads, each with its own subset of vertices

• Parallel section– vertices importance evaluation– vertices removal

• No load balancing

Page 13: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

First results

• Speedup Time ratio of various parts of the algorithm

0

1

2

3

4

5

6

7

8

9

0 1 2 3 4 5 6 7 8 9

number of threads

spee

du

p Imp. Eval.

Decimation

IDEAL CASE

Vertex Importance Evaluation

35%

Sort (Quick Sort)41%

Independent Set19%

Decimation5%

Vertex Importance Evaluation

49%

Sort (Quick Sort)25%

Independent Set11%

Decimation15%

Page 14: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Algorithm modification 1

• Vertices sorting removal– remove vertices under some importance threshold

only

kx

xy

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

-1.5 -1 -0.5 0 0.5 1 1.5

k=0.1k=0.5k=1

importance of a vertex (x)

maximum vertex importance in whole set

Page 15: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Algorithm modification 1

• Vertices evaluation• topology assessment• importance evaluation

• Vertices removal• threshold function (bucketing instead of sorting)• independent set of vertices• edges evaluation• triangulation

Page 16: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Algorithm modification 1

• + Speedup• – Higher approximation error• – Independent set of vertices

Page 17: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Algorithm modification 2

• Hash function– basic function

– modification

0%

5%

10%

15%

20%

25%

30%

35%

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

relative importance [0.1%]

per

cen

t o

f o

ccu

rren

ce

kx

xy

kx

xCy

Page 18: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Algorithm modification 2

• Idea

0

1

kx

xCy

Page 19: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Algorithm modification 2

• Function coefficients

• Application of the principle of indep. sets– vertices impacted by previous decimation step are

moved to the end of the cluster

a b

C1

1% 10% 100%

kCa

ak

1,)1(

Page 20: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Algorithm modification 2

• Preprocessing• vertices evaluation• clusters creation (according the importance)

• Processing of the least important cluster• vertex removal• triangulation• new evaluation of surrounded vertices which are

moved to the end of proper cluster

Page 21: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Results

• Mentioned approaches comparison

0

20

40

60

80

100

120

140

160

180

Teeth Bunny Horse Bone Hand Dragon Happy Buddha Turbine blade

model name

tim

e [s

ec]

Hash function Thresholding Sort

Page 22: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Results

• Time comparison (rough)

Test / machine SGI R10000 DELL 410 Precision k (DELL/SGI)SPECfp95 8.77 13.1 1.49SPECint95 10.1 17.6 1.74

Algorithm Reduction time from 69.451 to 1.000 triangles [sec]Presented algorithm 3.9 * k = 3.9* 1.49 = 5.81Garland & Heckbert 10.4Lindstrom & Turk 2585Hoppe 500JADE 325

Page 23: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Results

• Example of non-trivial data

Page 24: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Results

• Example of reduced data

871,414 triangles 430,000 triangles 87,000 triangles

Page 25: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Results

• Example of reduced data

137,072 triangles 13,706 triangles 6,854 triangles 1,248 triangles

Page 26: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Results

• Example of reduced data

58,328 triangles 29,000 triangles 6,000 triangles

Page 27: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.

Conclusion

• Fast parallel algorithm for simplification of large triangular meshes

• Efficient sequential algorithm

+ non-manifold meshes reduction– simple triangulation function

• Future work– triangulation method improvement– decimation controlled by the approximation error– volume decimation

Page 28: Triangular Mesh Decimation Martin Franc, Václav Skala marty|skala@kiv.zcu.cz  University of West Bohemia in Plzen Czech Republic.