This commit is contained in:
Andreas Fabri 2018-06-21 16:06:46 +01:00
parent 69bcffcd15
commit c70c688456
2 changed files with 37 additions and 0 deletions

View File

@ -54,5 +54,6 @@ include_directories( BEFORE include )
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program( "heat_method_surface_mesh.cpp" )
create_single_source_cgal_program( "flip.cpp" )

View File

@ -0,0 +1,36 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/Euler_operations.h>
#include <iostream>
#include <fstream>
#include <boost/foreach.hpp>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
//typedef CGAL::Surface_mesh<Point> Mesh;
typedef CGAL::Polyhedron_3<Kernel> Mesh;
typedef boost::graph_traits<Mesh>::halfedge_descriptor halfedge_descriptor;
int main()
{
Point p(0,0,0), q(1,0,0), r(1,1,0), s(0,0,1);
Mesh sm;
CGAL::make_tetrahedron(p, q, r, s, sm);
halfedge_descriptor hd1 = *(halfedges(sm).first);
halfedge_descriptor hd2 = next(hd1,sm);
CGAL::Euler::flip_edge(hd1,sm);
std::cout << "after flip_edge" << std::endl;
std::cout << sm << std::endl;
CGAL::Euler::flip_edge(hd2,sm);
std::cout << "after flip_edge" << std::endl;
std::cout << sm << std::endl;
std::cout << "done";
return 0;
}