Monday, April 4, 2011

Tips of Curve Editor and CGAL for potential transplant

Key functions:

Spline::PolygonBoolean()
Spline::COnvertToCGAL()
Spline::ConvertFromCGAL();

Headerfile information:



#include "CGAL/Boolean_set_operations_2.h"
#include "CGAL/Cartesian.h"
#include "CGAL/Polygon_2.h"
#include "CGAL/Polygon_set_2.h"
#include "CGAL/Polygon_with_holes_2.h"
#include <list>


struct Kernel : public CGAL::Cartesian<float>{};
typedef Kernel::Point_2 Point_2;
typedef CGAL::Polygon_2<Kernel> Polygon_2;
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes_2;//this is for union
typedef std::list<Polygon_with_holes_2> Pwh_list_2;//this is for intersection and subtraction
typedef CGAL::Polygon_set_2<Kernel> Polygon_set_2;




void PolygonBoolean();
void ConvertToCGAL(std::vector<vec3> PointList, Polygon_2 & P);
void ConvertFromCGAL(std::vector<vec3> & PointList, Polygon_2 P);


vector<vec3> curve1;
vector<vec3> results;

No comments:

Post a Comment