CGAL 5.5.1 - 2D Straight Skeleton and Polygon Offsetting
Straight_skeleton_2/Create_straight_skeleton_from_polygon_with_holes_2.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_with_holes_2.h>
#include <CGAL/create_straight_skeleton_from_polygon_with_holes_2.h>
#include "print.h"
#include <boost/shared_ptr.hpp>
#include <cassert>
typedef K::Point_2 Point ;
typedef CGAL::Polygon_2<K> Polygon_2 ;
typedef CGAL::Polygon_with_holes_2<K> Polygon_with_holes ;
typedef boost::shared_ptr<Ss> SsPtr ;
int main()
{
Polygon_2 outer ;
outer.push_back( Point(-1,-1) ) ;
outer.push_back( Point(0,-12) ) ;
outer.push_back( Point(1,-1) ) ;
outer.push_back( Point(12,0) ) ;
outer.push_back( Point(1,1) ) ;
outer.push_back( Point(0,12) ) ;
outer.push_back( Point(-1,1) ) ;
outer.push_back( Point(-12,0) ) ;
Polygon_2 hole ;
hole.push_back( Point(-1,0) ) ;
hole.push_back( Point(0,1 ) ) ;
hole.push_back( Point(1,0 ) ) ;
hole.push_back( Point(0,-1) ) ;
assert(outer.is_counterclockwise_oriented());
assert(hole.is_clockwise_oriented());
Polygon_with_holes poly( outer ) ;
poly.add_hole( hole ) ;
print_straight_skeleton(*iss);
return 0;
}