An algorithm for triangulating multiple 3D polygons
Ming Zou1, Tao Ju1, Nathan Carr2
1 Washington University In St. Louis, USA2 Adobe, USA
1Eurographics SGP 2013
Motivation
2
Curves
Surface
➠
Motivation
3
filling holes
Motivation
4
filling holes surfacing parallel contours
Motivation
5
filling holes surfacing parallel contours surfacing 3D sketches
Motivation
6
filling holes surfacing parallel contours surfacing 3D sketches
7
Step 1: Identify Patch Boundaries
filling holes surfacing parallel contours surfacing 3D sketches
8
Step 2: Surfacing each patch
Step 1: Identify Patch Boundaries
9
Step 2: Surfacing each patch
Step 1: Identify Patch Boundaries
Problem Definition
• Input: k 3D polygons (k≥1)
• Output: a triangulation• Consists of triangles
connecting only the input polygon vertices
• Topologically equivalent to a sphere with k holes
• Initial mesh for further refinement
10
Input:
output:
Problem Definition
• Input: k 3D polygons (k≥1)
• Output: a triangulation• Consists of triangles
connecting only the input polygon vertices
• Topologically equivalent to a sphere with k holes
• Initial mesh for further refinement
11
Monkey Saddle
Problem Definition
• Input: k 3D polygons (k≥1)
• Output: a triangulation• Consists of triangles
connecting only the input polygon vertices
• Topologically equivalent to a sphere with k holes
• Initial mesh for further refinement
12
Problem Definition
• Input: k 3D polygons (k≥1)
• Output: an optimal triangulation• A triangulation that minimize
the sum of certain metric
13
Problem Definition
• Input: k 3D polygons (k≥1)
• Output: an optimal triangulation• A triangulation that minimize
the sum of certain metric
• Per-triangle metric• Area
• Perimeter
• Bi-triangle metric• Dihedral angle
14
Related Work - Single Polygon
• A 2D polygon• Linear-time triangulation of a simple polygon
[Chazelle 91]
• No optimality guarantee
• Dynamic programming for optimal triangulation [Gilbert 79, Klincsek 80]
• A 3D polygon• Dynamic programming for optimal triangulation
[Barequet et al. 95, 96]
• Extension of [Gilbert 79] and [Klincsek 80]
• Heuristic-based algorithms [Liepa 03] [Roth et al. 97]
[Bessmeltsev et al. 12]
• No optimality guarantee
15
Related Work - Single Polygon
• A 2D polygon• Linear-time triangulation of a simple polygon
[Chazelle 91]
• No optimality guarantee
• Dynamic programming for optimal triangulation [Gilbert 79, Klincsek 80]
• A 3D polygon• Dynamic programming for optimal triangulation
[Barequet et al. 95, 96]
• Extension of [Gilbert 79] and [Klincsek 80]
• Heuristic-based algorithms [Liepa 03] [Roth et al. 97]
[Bessmeltsev et al. 12]
• No optimality guarantee
16
Related Work - Multiple Polygons
• Planar polygons in 3D• Dynamic programming for optimally triangulating
2 parallel planar polygons [Fuchs et al. 77]
• Heuristic-based algorithms for triangulating ≥2 planar polygons [Barequet et al. 04] [Boissonnat et al. 07] [Liu et al. 08]
• No optimality guarantees
17
Related Work - Multiple Polygons
• Planar polygons in 3D• Dynamic programming for optimally triangulating
2 parallel planar polygons [Fuchs et al. 77]
• Heuristic-based algorithms for triangulating ≥2 planar polygons [Barequet et al. 04] [Boissonnat et al. 07] [Liu et al. 08]
• No optimality guarantees
• Non-planar polygons in 3D• Heuristic-based algorithms
• No optimality guarantees [Rose et al. 07]
• Optimal algorithm • No known literature
18
Contributions
1. The first algorithm for optimally triangulating multiple non-planar 3D polygons• Extension of the dynamic programming algorithm for single polygon
[Barequet et al. 95, 96]
• Guarantee the manifoldness of the surface
2. A fast near-optimal variant for practical use
19
• Example: minimize the sum of triangle area
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
20
• Example: minimize the sum of triangle area
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
21
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
• Example: minimize the sum of triangle area
22spanning edge
: spanning edge
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
23spanning triangle
: spanning edge : spanning triangle
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
24
D1 D2
: spanning edge : spanning triangleDi : sub-domain
D1
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
25
D1 D2
: spanning edge : spanning triangleDi : sub-domain
D1
spanning edge
polygon segment↰
↰
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
26
D1 D2
: spanning edge : spanning triangleDi : sub-domain
Cost(D) = Cost(D1)+Cost(D2)+Area(t)
D
↵
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
27
: spanning edge : spanning triangleDi : sub-domain
Cost(D) = Cost(D1)+Cost(D2)+Area(t)
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
28
: spanning edge : spanning triangleDi : sub-domain
Cost(D) = Cost(D1)+Cost(D2)+Area(t)
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
29
: spanning edge : spanning triangleDi : sub-domain
Cost(D) = Cost(D1)+Cost(D2)+Area(t)
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
30
: spanning edge : spanning triangleDi : sub-domain
Cost(D) = Cost(D1)+Cost(D2)+Area(t)
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
31
: spanning edge : spanning triangleDi : sub-domain
Cost(D) = Cost(D1)+Cost(D2)+Area(t)
• Example: minimize the sum of triangle area
t
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
32
: spanning edge : spanning triangleDi : sub-domain
Cost(D) = Mint [Cost(D1)+Cost(D2)+Area(t)]
• Example: minimize the sum of triangle area
Triangulating A Single 3D Polygon [Barequet et. al 95, 96]
33
: spanning edge : spanning triangleDi : sub-domain
Cost(D) = Mint [Cost(D1)+Cost(D2)+Area(t)]
Triangulating Multiple 3D Polygons
34
• Extension of Domain structure
Triangulating Multiple 3D Polygons
35
: spanning edge : spanning triangleDi : sub-domain
• Extension of Domain structure
Triangulating Multiple 3D Polygons
36
: spanning edge : spanning triangleDi : sub-domain
spanning edge
spanning edgespan
ning
edg
e
• Extension of Domain structure
Triangulating Multiple 3D Polygons
37
: spanning edge : polygon segment : spanning triangleDi : sub-domain
polygon segment
polygon segment
polygon segment
• Extension of Domain structure
Triangulating Multiple 3D Polygons
38
: spanning edge : polygon segment : hole : spanning triangleDi : sub-domain
holehole
• Extension of Domain structure
Triangulating Multiple 3D Polygons
39
: spanning edge : polygon segment : hole : spanning triangleDi : sub-domain
an input polygon can appear at most once in a domaineither as a polygon segment or a hole
• Extension of Domain structure
Triangulating Multiple 3D Polygons
40
: spanning edge : polygon segment : hole : spanning triangleDi : sub-domain
1 ≤ # of polygon segments ≤ k
• Example: minimize the sum of triangle area
Triangulating Multiple 3D Polygons
41
: spanning edge : polygon segment : hole : spanning triangleDi : sub-domain
• Example: minimize the sum of triangle area
Triangulating Multiple 3D Polygons
42
: spanning edge : polygon segment : hole : spanning triangleDi : sub-domain
• Example: minimize the sum of triangle area
t
Triangulating Multiple 3D Polygons
43
: spanning edge : polygon segment : hole : spanning triangleDi : sub-domain
• Example: minimize the sum of triangle area
t
Triangulating Multiple 3D Polygons
44
t
Case I split Case II split
• Example: minimize the sum of triangle area
t
Triangulating Multiple 3D Polygons
45Case I split Case II split
↻
↺D1
D2
• Example: minimize the sum of triangle area
t
Triangulating Multiple 3D Polygons
46Case II split
↻
↺D1
D2
Cost(D,t)=Minx=1,2[ Cost(Dx) + Area(t) ]
• Example: minimize the sum of triangle area
Triangulating Multiple 3D Polygons
47
↻
↺D1
D2
D11 D12
Case II splitCost(D,t)=Minx=1,2[ Cost(Dx) + Area(t) ]
D31 D32 D41 D42
D21 D22
• Example: minimize the sum of triangle area
Triangulating Multiple 3D Polygons
48
↻
↺D1
D2
D11 D12
Cost(D,t)=Minx=1,2[ Cost(Dx) + Area(t) ]
D31 D32 D41 D42
D21 D22
Cost(D,t)=Minx=1,2,3,4[ Cost(Dx1)+Cost(Dx2)+Area(t) ]
• Example: minimize the sum of triangle area
Triangulating Multiple 3D Polygons
49
↻
↺D1
D2
D11 D12
D31 D32 D41 D42
D21 D22
Cost(D) = Mint [ Cost(D,t) ]
Triangulating Multiple 3D Polygons
50
Topologically equivalent to a sphere with k holes
Manifold Guarantee
51
52
Manifold Guarantee
53
manifold non-manifold
Manifold Guarantee
54
Manifold Guarantee
55
t
Manifold Guarantee
56
Manifold Guarantee
57
a
b
c
d
e
f
g
x y
z
w
Manifold Guarantee
58
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
59
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
➠ ➠
t
60
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
61
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
62
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
63
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
64
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
65
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
66
a
b
c d e
f
g
x
y
z
x
w
Weak Edges: edges that connecting the ends of the
polygon segments
Manifold Guarantee
t
67
a
b
c d e
f
g
x
y
z
x
w
Manifold Guarantee
68
a
b
c d e
f
g
x
y
z
x
w
y
Manifold Guarantee
69
a
b
c d e
g
x
y
z
x
w
y
Manifold Guarantee
f
• Compute optimal triangulation for each combination of weak edges, for each domain
• Only combine triangulations that do not share any weak edge
70
a
b
c d e
f
g
x
y
z
x
w
y
Manifold Guarantee
71
a
b
c d e
f
g
x
y
z
x
w
y
a
b
c d e
f
g
x
y
z
x
w
y
✘ ✔
a
b
c d e
f
g
x
y
z
x
w
y
Opt triangulation that contains weak edge set {ax, ay, xy, gy}
Opt triangulation that contains weak edge set {ax, ag, xg, gy}
• The triangulation computed by the algorithm is guarantee to be the triangulation with a minimum cost that has the right topology.
• Minimal set: a reduced set of weak edge combination.• still guarantee optimality
72
Manifold Guarantee
• Match the complexity of the algorithm for triangulating single 3D polygon [Barequet et al 95, 96]
Complexity
73
time space
per-trianglemetric
bi-trianglemetric
O(n2k+1) O(n2k)
O(n3k+1) O(n3k)
n: # of total vertices; k: # of 3D polygons;
• Test on single polygon minimizing sun of dihedral angles• practical complexities matches theoretical ones
• same complexity of [Barequet et al 95, 96]
Performance - Single polygon
74
Performance - Single polygon
• Test on single polygon minimizing sun of dihedral angles• practical complexities matches theoretical ones
• same complexity of [Barequet et al 95, 96]
75
• Test on single polygon minimizing sun of dihedral angles• practical complexities matches theoretical ones
• same complexity of [Barequet et al 95, 96]
76
Theoretical: O(n4); Practical: O(n4.11) Theoretical: O(n3); Practical: O(n2.27)
Performance - Single polygon
• Test on single polygon minimizing sun of dihedral angles• practical complexities matches theoretical ones
• same complexity of [Barequet et al 95, 96]
77
Theoretical: O(n4); Practical: O(n4.11) Theoretical: O(n3); Practical: O(n2.27)
Performance - Single polygon
• Dataset:• k (1≤k≤6) perturbed saddle curves on the corner of a regular octahedron
• 50~60 data for each k
Performance - Multiple polygons
78
• Dataset:• k (1≤k≤6) perturbed saddle curves on the corner of a regular octahedron
• 50~60 data for each k
Performance - Multiple polygons
79
Performance - Multiple polygons
80
32poly poly
Performance - Multiple polygons
81
32poly poly
Improving efficiency
82
All Triangles
Improving efficiency
83
A Triangle Subset
Improving efficiency
84
A Triangle Subset
• Considerably smaller
• Big enough to contain a close-to-optimal triangulation
Requirements of the subset
All Triangles
Improving efficiency
85
• Considerably smaller
• Big enough to contain a close-to-optimal triangulation
Requirements of the subset
All Triangles
Delaunay Triangles
Improving efficiency
86
• Considerably smaller
• Big enough to contain a close-to-optimal triangulation
• Delaunay Triangle Subset:• Fewer: O(n3) → O(n2)
• Good triangles
• No self-intersecting
Requirements of the subset
All Triangles
Delaunay Triangles
87
Performance - Single polygon
88
Performance - Single polygon
Performance - Multiple polygon
89
32 4 5 6poly poly polypoly poly
90
32 4 5 6
91
32 4 5 6
92
32 4 5 6
How Optimal?
Optimality
• Close-to-optimal results on both smooth curves and random loops on mesh• Minimizing total area
• near-optimal for single polygon
• less optimal for two polygons
• Minimizing average dihedral angle• near-optimal for both single and two-polygon
cases
93
triangulation on all triangles
triangulation on Delaunay triangles
Applications
94
• Sketch based modeling
• Hole filling• 455 groups of holes (61 holes have interior islands)
• fill all the holes in 40 sec
Applications
95
• Hole filling• 455 groups of holes (61 holes have interior islands)
• fill all the holes in 40 sec
Applications
96
Islands
Conclusion
• The first optimal algorithm for triangulating multiple non-planar 3D polygons• guarantee manifoldness of the surface
• fast near-optimal variation method
• Future work• other triangle subsets besides Delaunay triangles
• more sophisticated weighting schemes
• automatic grouping of hole islands
• Code available online!• http://www.cse.wustl.edu/~zoum/projects/TriMultPoly/
97
Thank you !
Comments | Suggestions | Questions
98