CGAL 6.1 - 3D Constrained Triangulations
Loading...
Searching...
No Matches
User Manual

Author
Laurent Rineau

This chapter describes the ...

Todo:
Explain what is a CDT. Why a given input, like a polyhedron, might not admit a constrained Delaunay triangulation. Explain "conforming to the faces of a polygon mesh".

Definitions

Section on definitions here ...

Examples

First Example

The following example shows ...


File Constrained_triangulation_3/conforming_constrained_Delaunay_triangulation_3.cpp

#include <CGAL/make_conforming_constrained_Delaunay_triangulation_3.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/draw_triangulation_3.h>
#include <algorithm>
int main(int argc, char* argv[])
{
CGAL::Surface_mesh<K::Point_3> mesh;
auto filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/mpi.off");
std::ifstream in(filename);
if(!in || !CGAL::IO::read_OFF(in, mesh)) {
std::cerr << "Error: cannot read file " << filename << std::endl;
return EXIT_FAILURE;
}
std::cout << "Read " << mesh.number_of_vertices() << " vertices and "
<< mesh.number_of_faces() << " faces" << std::endl;
std::cout << "Number of vertices in the CDT: "
<< ccdt.triangulation().number_of_vertices() << '\n'
<< "Number of constrained facets in the CDT: "
<< ccdt.number_of_constrained_facets() << '\n';
CGAL::draw(ccdt.triangulation());
}
bool read_OFF(std::istream &is, Graph &g, const NamedParameters &np=parameters::default_values())
auto make_conforming_constrained_Delaunay_triangulation_3(const PolygonMesh &mesh, const NamedParameters &np=parameters::default_values())
creates a 3D constrained Delaunay triangulation conforming to the faces of a polygon mesh.
Definition: make_conforming_constrained_Delaunay_triangulation_3.h:96
void draw(const T3 &at3, const GSOptions &gso)
std::string data_file_path(const std::string &filename)

or from a polygon soup ...


File Constrained_triangulation_3/conforming_constrained_Delaunay_triangulation_3_from_soup.cpp

#include <CGAL/make_conforming_constrained_Delaunay_triangulation_3.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <vector>
#include <CGAL/draw_triangulation_3.h>
#include <algorithm>
int main(int argc, char* argv[])
{
std::vector<K::Point_3> points;
std::vector<std::vector<std::size_t>> polygons;
auto filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/cubes.off");
std::ifstream in(filename);
if(!in || !CGAL::IO::read_OFF(in, points, polygons)) {
std::cerr << "Error: cannot read file " << filename << std::endl;
return EXIT_FAILURE;
}
std::cout << "Read " << points.size() << " vertices and "
<< polygons.size() << " polygons" << std::endl;
std::cout << "Number of vertices in the CDT: "
<< ccdt.triangulation().number_of_vertices() << '\n'
<< "Number of constrained facets in the CDT: "
<< ccdt.number_of_constrained_facets() << '\n';
CGAL::draw(ccdt.triangulation());
}