the design and implementation of planar arrangements of curves in cgal iddo hanniel the research has...
Post on 19-Dec-2015
215 views
TRANSCRIPT
The Design and Implementation of Planar Arrangements of
Curves in CGAL
Iddo Hanniel
The research has been carried out at Tel Aviv University under the supervision of Prof. Dan Halperin
January 2001
Arrangements of CurvesGiven a collection C of curves in the plane,
the arrangement of C is the subdivision of the plane into vertices edges and faces induced by the curves in C
Demo 1:
Basic Arrangements Operations
Arrangements Applications
• Robot Motion Planning
• Geographic Information Systems
• CAD/CAM
• Assembly Planning
• Half-plane range searching, maximal discrepancy of a point set, minimal area triangle
Previous Arrangement Software
• Arrange - Arrangements of segments and polygons [Goldwasser 95]
• LEDA - Planar maps and intersection algorithms [Melhorn & Naher et. al.]
• MAPC - Manipulation of Algebraic Points and Curves [Manocha et. al. 99]
• CGAL Planar maps package
Novelties of Our WorkArrangement Software Package:• General• Robust and deals with degeneracies• Flexible and Extensible• Curve Hierarchy Structure• Easy to use
Adaptive Point Location:• Geometric queries on convex parametric curves• Geometric filtering - performing operations on
bounding polygons• Extensible
A GIS Application
CGAL - the Computational Geometry Algorithms Library is a collaborative effort of several academic sites in Europe to develop a robust, generic, and efficient C++ library of geometric data structures and algorithms.
The generic programming paradigm was adopted to achieve these goals.
Planar Maps in CGAL
• Deal with non-intersecting x-monotone curves.
• Use a Doubly Connected Edge List (DCEL) representation.
• Traversal over faces, halfedges and vertices, and traversal over a face and around a vertex.
• Support different curves through a traits mechanism (can be extended by the user).
• Different implementations of point location algorithms (can be extended by the user).
Geometric TraitsThe traits class is a template parameter that defines the
geometric interface to the class (or function). This enables to use the algorithms with different geometric kernels, and with different types of geometric objects.
Planar Map Traits
Types:
• Point, X_CurvePredicates and Functions:
Predicates on points, x-monotone curves and on the relationships between them.
For example: checking whether a point is above, below or on a curve.
Arrangements in CGALBuilt on top of the planar map layer.
Additions over planar maps:
• Intersections
• Non x-monotone curves
• Maintaining the information on the original curves using what we call a curve hierarchy tree
• Support of overlapping curves
• Optional non-update mode
Operations
Planar map operations:
• Point Location and Vertical Ray Shooting queries
• Traversal of planar map faces, edges and vertices
Arrangement Operations:
• Insertion and deletion of intersecting, non-x-monotone curves
• Tracing edges and subcurves along their original curves
• Overlaps
Curve nodes
Subcurve nodes
Edge nodes
1
2
34
5
6
7
8
5 6 7 81 2 3 4
Curve Hierarchy Structure
Arrangement Traits
Additions over planar map traits:
• Curve type
• Functions for detecting non x-monotone curves and splitting them into x-monotone subcurves
• Intersection functions
Arrangement Classes
Faces
Vertices
Halfedges
Curves
Subcurves
Edges
Traits
Planar map Hierarchy
Hierarchy ImplementationBase node
curve()set_curve()
Subcurve node
parent()children_begin()children_end()edges_begin()edges_end()
Curve_nodelevel_begin(i)level_end(i)number_of_sc_levels()
Edge_node
halfedge()
In_place_list_node
next ptrprev ptr
begin/end ptr
parent ptr
Adaptive Point Location
Demo 2:
Adaptive point location
Previous WorkNeagu & Lacolle `98 - computing the combinatorial
structure of an arrangement of convex Bezier curves.
Differences of our work:
• Point location.
• Local and adaptive, not global.
• Connectivity is not assumed.
• Heauristic to deal with degeneracies.
• Easily extended framework based on CGAL.
P0
P1P2
P3
C
Carrier Polygon
Control polygon
Conditions on Curves
Subdivision of a Convex Curve
P0 P2
P
P11
P1
P01
T(P)
T(P2) T(P0)
Vertical Ray Shooting - General Idea
Bound the curves by a bounding polygon, and perform all operations on this polygon rather than on the curve itself. If the bounding polygon’s approximation is not sufficient, we refine it by a subdivision process.
Ray Shooting: Condition 1
The bounding polygon directly above q (i.e., the result of the vertical ray shooting query in the arrangement of bounding polygons) does not intersect any other polygon.
q
Intersection Graph
1 2
3
1 2
3
Ray Shooting: Condition 2
Both control and carrier polygons of the bounding polygon are above the query point q.
q
Point Location Outline
• Finding the boundary of a simply connected face– Vertical ray shooting– Extending the edges– Isolating intersections
• Finding the boundary of a face with holes
• Dealing with degeneracies
Boundary Polygons and Intersection Polygons
Intersection polygon
Boundary polygon
Implementation
Curve level original curve
nodes edgesSubcurve level
Edge level
halfedges
vertices
faces
Planar map Traits class
Intersection graphHierarchy tree
Adaptive Point Location Experiments
0
1
2
3
4
5
6
7
0 10 20 30 40 50 60
number of queries
seco
nd
s vertical rayshootingpoint location
Trade-off between Different Initializations
initialization time
0
10
20
30
40
50
60
70
0 10 20 30 40 50 60
number of curves
seco
nds
no subdivisions one subdivision two subdivisions
first point location query time
0
5
10
15
20
25
30
35
40
45
50
0 10 20 30 40 50 60
number of curves
seco
nds
no subdivisions one subdivision two subdivisions
Canonical Parabolas
Comparison of 10 Canonical Parabolas
0
5
10
15
20
25
1 9
17
25
33
41
49
57
65
73
81
89
97
query number
se
co
nd
s
Comparison of 20 Canonical Parabolas
0
50
100
150
200
2501 9
17
25
33
41
49
57
65
73
81
89
97
query number
se
co
nd
s
Another Application- Boolean Operations
Boolean Operations
Finding the intersection of N polygons:
Label each face in the arrangement of the polygons with a covering number.
-1-1
-1
0
1
1 2
Demo 3:
Boolean operations
Code for covering_DFS
void covering_DFS(Face_handle f) {
Ccb_halfedge_circulator start,circ;
if (f->outer_ccb_exists()) {
start = circ = f->outer_ccb();
do {
Face_handle other_face= circ->twin()->face();
if (other_face->covering_num == -1) {
int diff = face_diff(circ);
other_face->counter = (f->covering_num + diff);
covering_DFS(other_face);
}
} while (++circ != start);
}
Holes_iterator hit = f->holes_begin();
for(; hit != f->holes_end(); ++hit) {
start = circ = *hit;
do {
Face_handle other_face= circ->twin()->face();
if (other_face->covering_num == -1) {
int diff = face_diff(circ);
other_face->counter = (f->covering_num + diff);
covering_DFS(other_face);
}
} while (++circ != start);
}
}
Future Work• Optimization of the arrangement package - improving the
internal algorithms.• Implementing new traits classes (using filtering schemes,
for conic sections) for the arrangement package.• Implementing adaptive point location traits to other
parametric curves.• Packages based on arrangements: generic planar map
overlay, fixed precision approximation of arrangements of segments and polygons.
Websites: www.math.tau.ac.il/~hanniel/ARRG00/
www.math.tau.ac.il/CGAL/