Skip to content

Add minimal program for Issue #781 #8429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions Mesh_2/test/Mesh_2/issue_781.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#define CGAL_MESH_2_DEBUG_REFINEMENT_POINTS

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>

// mesh refinement
#include <CGAL/Delaunay_mesher_2.h>
#include <CGAL/Delaunay_mesh_face_base_2.h>
#include <CGAL/Delaunay_mesh_vertex_base_2.h>
#include <CGAL/Delaunay_mesh_size_criteria_2.h>


typedef CGAL::Exact_predicates_inexact_constructions_kernel meshTriKernel;
typedef meshTriKernel::Point_2 meshTriPoint;

typedef CGAL::Delaunay_mesh_vertex_base_2<meshTriKernel> meshTriVertexBase;

typedef CGAL::Constrained_triangulation_face_base_2<meshTriKernel> Fbb;
typedef CGAL::Delaunay_mesh_face_base_2<meshTriKernel,Fbb> meshTriFaceBase;

typedef CGAL::Triangulation_data_structure_2<meshTriVertexBase,meshTriFaceBase> meshTriTDS;
typedef CGAL::Exact_intersections_tag meshTriItag;
typedef CGAL::Constrained_Delaunay_triangulation_2<meshTriKernel, meshTriTDS, meshTriItag> meshTriCDT;

typedef CGAL::Delaunay_mesh_size_criteria_2<meshTriCDT> meshCriteria;
typedef CGAL::Delaunay_mesher_2<meshTriCDT, meshCriteria> meshRefiner;

int main(int argc, char* argv[])
{
std::cerr.precision(17);
meshTriCDT cdt;

meshTriPoint pt(5.4691594172333904, 44.256641611715409);

cdt.insert( pt );

meshTriPoint t(5.4693788499999929, 44.256578099999999);

meshTriPoint m(5.4691178249999917, 44.256653649999997);

cdt.insert_constraint( m,t );

assert(cdt.is_valid());
meshRefiner mesher(cdt);
mesher.set_criteria(meshCriteria(0.125));

std::cout << "refine mesh" << std::endl;
mesher.refine_mesh();
std::cout << "complete" << std::endl;

return 0;
}