Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re-mesh of Delaunay Triangulation for robust Mesh Cutting Application

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re-mesh of Delaunay Triangulation for robust Mesh Cutting Application


Chronological Thread 
  • From: RAGHU PRASAD <>
  • To:
  • Subject: [cgal-discuss] Re-mesh of Delaunay Triangulation for robust Mesh Cutting Application
  • Date: Mon, 26 Mar 2012 00:43:27 +0530

Hi All,


My  Delaunay Trian-gulation assumes a given set of points, and it is always convex. Cuts result in non-convex boundaries, so the standard Delaunay Triangulation in CGAL is not directly usable.Thefore I am trying to  use the  edge flip technique  to locally improve the mesh.


My apparoach  works as follows: when cutting, the cutting tool  is attached to a node, the active node, so moving the scalpel moves the active node. The
active node is always part of the boundary, so it is incident to two boundary edges, the cut edges. During a cut, these edges almost coincide geometrically,
and form an incision. I call triangles incident with the active node active triangles. The active node is moved, and after each movement, local remeshing
should be  applied to the active triangles.

My question is does CGAL Dealunay has any re meshing mechanism .The remeshing process should perform the following


Edges are flipped to improve the element angles.If another node is found close to the active node, it is removed. When the incision becomes too large, it is split thus introducing new nodes to approximate the cutting tool path

#include <CGAL/Exact_predicates_inexact_constructions_kernel .h>
#include <CGAL/Arr_non_caching_segment_traits_2.h>
#include <CGAL/Arrangement_2 .h>
typedef CGAL: : Exact_predicates_inexact_constructions_kernel Kernel ;
typedef Kernel : :FT Number_type ;
typedef CGAL: : Arr_non_caching_segment_traits_2<Kernel> Traits ;
typedef Traits : : Point_2 Point ;
typedef Traits : :X_monotone_curve_2 Segment ;
typedef CGAL: :Arrangement_2<Traits> Arrangement;
typedef Arrangement : : Vertex_handle Vertex_handle;
typedef Arrangement : : Halfedge_handle Halfedge_handle ;
typedef Arrangement : : Face_handle Face_handle
typedef CGAL::Surface_mesh_default_triangulation_3 Tr;
typedef Tr::Geom_traits GT;


// Insert isolated points .
Arrangement arr ;
Face_handle uf = arr . unbounded_face ( ) ;
Vertex_handle u1 = arr . insert_in_face_interior(Point (3 , 3) , uf ) ;
Vertex_handle u2 = arr . insert_in_face_interior(Point (1 , 5) , uf ) ;
Vertex_handle u3 = arr . insert_in_face_interior(Point (5 , 5) , uf ) ;
// Insert four segments that form a square−shaped face .
Point p1(1 , 3) , p2(3 , 5) , p3(5 , 3) , p4(3 , 1);
Segment s1 (p1 , p2) , s2 (p2 , p3) , s3 (p3 , p4) , s4 (p4 , p1 ) ;
Halfedge_handle e1 = arr . insert_in_face_interior( s1 , uf ) ;
Vertex_handle v1 = e1−>source ( ) ;
Vertex_handle v2 = e1−>target ( ) ;
Halfedge_handle e2 = arr . insert_from_left_vertex ( s2 , v2 ) ;
Vertex_handle v3 = e2−>target ( ) ;
Halfedge_handle e3 = arr . insert_from_right_vertex( s3 , v3 ) ;
Vertex_handle v4 = e3−>target ( ) ;
Halfedge_handle e4 = arr . insert_at_vertices( s4 , v4 , v1 ) ;

Tr tr;            
 C2t3 c2t3 (tr);  

 Gray_level_image image("data/skull_2.9.inr", 2.9f);


 GT::Point_3 bounding_sphere_center(122., 102., 117.);
 GT::FT bounding_sphere_squared_radius = 200.*200.*2.;
 GT::Sphere_3 bounding_sphere(bounding_sphere_center,
                                  bounding_sphere_squared_radius);


 Surface_3 surface(image, bounding_sphere, 1e-5);


 CGAL::Surface_mesh_default_criteria_3<Tr> criteria(30.,
                                                    5.,
                                                    5.);


 CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Manifold_tag());
 std::ofstream out("out.off");
 CGAL::output_surface_facets_to_off (out, c2t3);
 std::cout << "Final number of points: " << tr.number_of_vertices() << "\n";


Perform Re-mesh

{


}









--
Warm Regards

Raghu Prasad


Archive powered by MHonArc 2.6.16.

Top of Page