3D Triangulations in Pierre Alliez.
-
Upload
junior-bradley -
Category
Documents
-
view
222 -
download
0
Transcript of 3D Triangulations in Pierre Alliez.
3D Triangulations in3D Triangulations in
http://www.cgal.orghttp://www.cgal.org
Pierre AlliezPierre Alliez
http://http://www.cgal.orgwww.cgal.org
3D Triangulation3D Triangulation
TetrahedronTetrahedron
http://http://www.cgal.orgwww.cgal.org
OutlineOutline
• DefinitionsDefinitions• RepresentationRepresentation• Types of TriangulationsTypes of Triangulations• Software DesignSoftware Design
– Geometric TraitsGeometric Traits– CustomizationCustomization
• ExamplesExamples• ApplicationsApplications
http://http://www.cgal.orgwww.cgal.org
OutlineOutline
• DefinitionsDefinitions• RepresentationRepresentation• Types of TriangulationsTypes of Triangulations• Software DesignSoftware Design
– Geometric TraitsGeometric Traits– CustomizationCustomization
• ExamplesExamples• ApplicationsApplications
http://http://www.cgal.orgwww.cgal.org
DefinitionsDefinitions
3D Triangulation3D Triangulation of a point set A: of a point set A: partition of the convex hull of A partition of the convex hull of A into tetrahedrainto tetrahedra..
http://http://www.cgal.orgwww.cgal.org
DefinitionsDefinitions
• The cells (3-faces) are such that The cells (3-faces) are such that two cells either do not intersect or two cells either do not intersect or share a common facet (2-face), share a common facet (2-face), edge (1-face) or vertex (0-face).edge (1-face) or vertex (0-face).
http://http://www.cgal.orgwww.cgal.org
OutlineOutline
• DefinitionsDefinitions• RepresentationRepresentation• Types of TriangulationsTypes of Triangulations• Software DesignSoftware Design
– Geometric TraitsGeometric Traits– CustomizationCustomization
• ExamplesExamples• ApplicationsApplications
http://http://www.cgal.orgwww.cgal.org
RepresentationRepresentation
• CGAL Triangulation: CGAL Triangulation: partition of partition of IRIR3 3 (add unbounded cell).(add unbounded cell).
• To deal only with Tetrahedra:To deal only with Tetrahedra:– subdivide unbounded cell into subdivide unbounded cell into
tetrahedra.tetrahedra."infinite"infinite" vertex" vertex
http://http://www.cgal.orgwww.cgal.org
RepresentationRepresentation
• Dealing only with Dealing only with TetrahedraTetrahedra::– each facet incident to exactly two each facet incident to exactly two
cells.cells.
http://http://www.cgal.orgwww.cgal.org
3D Triangulation in 3D Triangulation in CGALCGAL
Input point setInput point set
TriangulationTriangulation– Finite tetrahedraFinite tetrahedra– One infinite vertexOne infinite vertex– Infinite tetrahedraInfinite tetrahedra
http://http://www.cgal.orgwww.cgal.org
Infinite Vertex?Infinite Vertex?
• No valid coordinatesNo valid coordinates– no predicates applicableno predicates applicable
http://http://www.cgal.orgwww.cgal.org
Internal Internal RepresentationRepresentation
Collection of Collection of verticesvertices and and cellscells linked linked together through incidence and together through incidence and adjacency relations (faces and edges adjacency relations (faces and edges are not explicitly represented).are not explicitly represented).
verticesvertices cellcell
http://http://www.cgal.orgwww.cgal.org
CellCell
Access to:Access to:• 4 incident 4 incident verticesvertices• 4 adjacent 4 adjacent cellscells
http://http://www.cgal.orgwww.cgal.org
VertexVertex
Access to:Access to:• 1 1 incident cellincident cell
http://http://www.cgal.orgwww.cgal.org
Orientation of a CellOrientation of a Cell
4 vertices indexed in 4 vertices indexed in positive positive orientationorientation (induced by (induced by underlying underlying Euclidean space Euclidean space IRIR33).).
00
11
22
33
xx
yy
zz
http://http://www.cgal.orgwww.cgal.org
Adjacent Cell IndexingAdjacent Cell Indexing
• Neighboring Neighboring cell indexed by cell indexed by ii oppositeopposite to to vertex vertex ii..
ii
iithth neighboring neighboringcellcell
cellcell
http://http://www.cgal.orgwww.cgal.org
ii
FaceFace
Represented as a Represented as a pairpair
{cell, index {cell, index ii}}
http://http://www.cgal.orgwww.cgal.org
ii
jj
EdgeEdge
Represented as a Represented as a triplettriplet
{cell,index {cell,index ii,index ,index jj}}
http://http://www.cgal.orgwww.cgal.org
OutlineOutline
• DefinitionsDefinitions• RepresentationRepresentation• Types of TriangulationsTypes of Triangulations• Software DesignSoftware Design
– Geometric TraitsGeometric Traits– CustomizationCustomization
• ExamplesExamples• ApplicationsApplications
http://http://www.cgal.orgwww.cgal.org
3 Types of 3 Types of TriangulationsTriangulations
• DelaunayDelaunay• RegularRegular• HierarchyHierarchy
http://http://www.cgal.orgwww.cgal.org
Delaunay TriangulationDelaunay Triangulation
• Empty circleEmpty circle property: property:– the circumscribing sphere of each the circumscribing sphere of each
cell does not contain any other cell does not contain any other vertex in its interior. vertex in its interior.
• Uniquely definedUniquely defined except in except in degenerate cases where five points are degenerate cases where five points are cospherical (CGAL computes a unique cospherical (CGAL computes a unique triangulation even in these cases).triangulation even in these cases).
http://http://www.cgal.orgwww.cgal.org
Delaunay TriangulationDelaunay Triangulation
Fully dynamic:Fully dynamic:• point insertionpoint insertion• vertex removalvertex removal
http://http://www.cgal.orgwww.cgal.org
Delaunay TriangulationDelaunay Triangulation
http://http://www.cgal.orgwww.cgal.org
Regular TriangulationRegular Triangulation (weighted Delaunay triangulation)(weighted Delaunay triangulation)
Weighted pointWeighted point::– pp(w)(w) = (p,w = (p,wpp), p ), p IR IR33, w, wpp IR. IR.
pwp
http://http://www.cgal.orgwww.cgal.org
Regular TriangulationRegular Triangulation (weighted Delaunay triangulation)(weighted Delaunay triangulation)
Power productPower product:: (p(p(w)(w), z, z(w)(w)) = ||p-z||) = ||p-z||2 2 - w- wp p - w- wzz
– pp(w)(w) & z & z(w) (w) said to be said to be orthogonalorthogonal iff = 0 iff = 0
http://http://www.cgal.orgwww.cgal.org
Regular TriangulationRegular Triangulation (weighted Delaunay triangulation)(weighted Delaunay triangulation)
4 weighted points have a unique 4 weighted points have a unique common orthogonal weighted common orthogonal weighted point called point called power spherepower sphere. .
http://http://www.cgal.orgwww.cgal.org
RegularRegular Triangulation Triangulation (weighted Delaunay triangulation)(weighted Delaunay triangulation)
• Let SLet S(w) (w) be a set of weighted points.be a set of weighted points.• A sphere zA sphere z(w) (w) is said to be regular if is said to be regular if
for all pfor all p(w)(w) S S(w)(w), , (p(p(w)(w), z, z(w)(w)) >= 0) >= 0
• A triangulation is A triangulation is regularregular if the if the power spheres of all simplices are power spheres of all simplices are regularregular..
http://http://www.cgal.orgwww.cgal.org
Triangulation HierarchyTriangulation Hierarchy
Triangulation augmented with a Triangulation augmented with a hierarchical data structurehierarchical data structure to allow to allow for efficient for efficient point location queriespoint location queries..
http://http://www.cgal.orgwww.cgal.org
OutlineOutline
• DefinitionsDefinitions• RepresentationRepresentation• Types of TriangulationsTypes of Triangulations• Software DesignSoftware Design
– Geometric TraitsGeometric Traits– CustomizationCustomization
• ExamplesExamples• ApplicationsApplications
http://http://www.cgal.orgwww.cgal.org
Derivation DiagramDerivation Diagram
(operate on vertex indices in cells)
http://http://www.cgal.orgwww.cgal.org
Software DesignSoftware Design
Separation between Separation between geometrygeometry & & combinatoricscombinatorics..
Triangulation_3Triangulation_3<<
TriangulationTraits_3, TriangulationTraits_3, TriangulationDataStructure_3>TriangulationDataStructure_3>
http://http://www.cgal.orgwww.cgal.org
Geometric TraitsGeometric Traits
Defines Defines geometric objectsgeometric objects & & predicatespredicates..
Objects:Objects:• pointpoint• segmentsegment• triangletriangle• tetrahedrontetrahedron• [weighted point][weighted point]
Predicates:Predicates:• orientation in spaceorientation in space• orientation of coplanar orientation of coplanar
pointspoints• order of collinear pointsorder of collinear points• empty sphere propertyempty sphere property• [power test][power test]
http://http://www.cgal.orgwww.cgal.org
Triangulation Data Triangulation Data StructureStructure
http://http://www.cgal.orgwww.cgal.org
Customization Customization (cells & (cells & vertices)vertices)
http://http://www.cgal.orgwww.cgal.org
OutlineOutline
• DefinitionsDefinitions• RepresentationRepresentation• Types of TriangulationsTypes of Triangulations• Software DesignSoftware Design
– Geometric TraitsGeometric Traits– CustomizationCustomization
• ExamplesExamples• ApplicationsApplications
http://http://www.cgal.orgwww.cgal.org
ConstructionConstruction#include#include <CGAL/Simple_cartesian.h> <CGAL/Simple_cartesian.h>#include#include <CGAL/Triangulation_3.h> <CGAL/Triangulation_3.h>
typedeftypedef CGAL::Simple_cartesian< CGAL::Simple_cartesian<floatfloat> > kernelkernel;;typedeftypedef CGAL::Triangulation_vertex_base_3< CGAL::Triangulation_vertex_base_3<kernelkernel> Vb;> Vb;typedeftypedef CGAL::Triangulation_cell_base_3< CGAL::Triangulation_cell_base_3<kernelkernel> Cb;> Cb;typedeftypedef CGAL::Triangulation_data_structure_3<Vb,Cb> CGAL::Triangulation_data_structure_3<Vb,Cb> TdsTds;;typedeftypedef CGAL::Triangulation_3< CGAL::Triangulation_3<kernelkernel,,TdsTds> Triangulation;> Triangulation;typedeftypedef kernelkernel::Point_3 Point;::Point_3 Point;
Triangulation triangulation;Triangulation triangulation;
// insertion// insertiontriangulation.insert(Point(0,0,0));triangulation.insert(Point(0,0,0));triangulation.insert(Point(0,1,0));triangulation.insert(Point(0,1,0));triangulation.insert(Point(0,0,1));triangulation.insert(Point(0,0,1));
// insertion from a list of points// insertion from a list of pointsstd::list<Point> points;std::list<Point> points;points.push_front(Point(2,0,0));points.push_front(Point(2,0,0));points.push_front(Point(3,2,0));points.push_front(Point(3,2,0));points.push_front(Point(0,1,4));points.push_front(Point(0,1,4));triangulation.insert(points.begin(),points.end());triangulation.insert(points.begin(),points.end());
http://http://www.cgal.orgwww.cgal.org
Point LocationPoint Location#include#include <CGAL/Simple_cartesian.h> <CGAL/Simple_cartesian.h>#include#include <CGAL/Triangulation_3.h> <CGAL/Triangulation_3.h>
typedeftypedef CGAL::Simple_cartesian< CGAL::Simple_cartesian<floatfloat> > kernelkernel;;typedeftypedef CGAL::Triangulation_vertex_base_3< CGAL::Triangulation_vertex_base_3<kernelkernel> Vb;> Vb;typedeftypedef CGAL::Triangulation_cell_base_3< CGAL::Triangulation_cell_base_3<kernelkernel> Cb;> Cb;typedeftypedef CGAL::Triangulation_data_structure_3<Vb,Cb> CGAL::Triangulation_data_structure_3<Vb,Cb> TdsTds;;typedeftypedef CGAL::Triangulation_3< CGAL::Triangulation_3<kernelkernel,,TdsTds> Triangulation;> Triangulation;typedeftypedef kernelkernel::Point_3 Point;::Point_3 Point;
Triangulation triangulation;Triangulation triangulation;
// insertion// insertiontriangulation.insert(Point(0,0,0));triangulation.insert(Point(0,0,0));triangulation.insert(Point(0,1,0));triangulation.insert(Point(0,1,0));
// locate// locate
Locate_type lt;Locate_type lt;
intint li, lj; li, lj;
Point p(0,0,0);Point p(0,0,0);
Cell_handle cell = triangulation.locate(p, lt, li, lj);Cell_handle cell = triangulation.locate(p, lt, li, lj);
assertassert(lt == Triangulation::VERTEX);(lt == Triangulation::VERTEX);
assertassert(cell->vertex(li)->point() == p);(cell->vertex(li)->point() == p);
http://http://www.cgal.orgwww.cgal.org
OutlineOutline
• DefinitionsDefinitions• RepresentationRepresentation• Types of TriangulationsTypes of Triangulations• Software DesignSoftware Design
– Geometric TraitsGeometric Traits– CustomizationCustomization
• ExamplesExamples• ApplicationsApplications
http://http://www.cgal.orgwww.cgal.org
ApplicationsApplications
• MeshingMeshing– simulationsimulation– numerical engineeringnumerical engineering
• Reverse EngineeringReverse Engineering– surface reconstructionsurface reconstruction
• Efficient point locationEfficient point location• Etc.Etc.