CGAL 5.6.1 - 2D Straight Skeleton and Polygon Offsetting
Straight Skeleton Construction Functions

The following functions are used to construct the inward or outward straight skeleton of a polygon.

Functions

template<typename PointIterator , typename HoleIterator , typename SsK >
boost::shared_ptr< Straight_skeleton_2< SsK > > CGAL::create_interior_straight_skeleton_2 (PointIterator outer_contour_vertices_begin, PointIterator outer_contour_vertices_end, HoleIterator holes_begin, HoleIterator holes_end, SsK k=CGAL::Exact_predicates_inexact_constructions_kernel())
 creates a straight skeleton in the interior of the 2D polygon with holes. More...
 
template<typename PointIterator , typename SsK >
boost::shared_ptr< Straight_skeleton_2< SsK > > CGAL::create_interior_straight_skeleton_2 (PointIterator outer_contour_vertices_begin, PointIterator outer_contour_vertices_end, SsK k=CGAL::Exact_predicates_inexact_constructions_kernel())
 creates a straight skeleton in the interior of the 2D polygon. More...
 
template<typename Polygon , typename SsK >
boost::shared_ptr< Straight_skeleton_2< SsK > > CGAL::create_interior_straight_skeleton_2 (const Polygon &polygon, SsK k=CGAL::Exact_predicates_inexact_constructions_kernel())
 creates a straight skeleton in the interior of the 2D polygon polygon. More...
 
template<typename FT , typename PointIterator , typename SsK >
boost::shared_ptr< Straight_skeleton_2< SsK > > CGAL::create_exterior_straight_skeleton_2 (FT max_offset, PointIterator vertices_begin, PointIterator vertices_end, SsK k=CGAL::Exact_predicates_inexact_constructions_kernel())
 creates a straight skeleton in the exterior of a 2D polygon with holes. More...
 
template<typename FT , typename Polygon , typename SsK >
boost::shared_ptr< Straight_skeleton_2< SsK > > CGAL::create_exterior_straight_skeleton_2 (FT max_offset, const Polygon &P, SsK k=CGAL::Exact_predicates_inexact_constructions_kernel())
 creates a straight skeleton in the exterior of a 2D polygon with holes. More...
 

Function Documentation

◆ create_exterior_straight_skeleton_2() [1/2]

template<typename FT , typename PointIterator , typename SsK >
boost::shared_ptr< Straight_skeleton_2<SsK> > CGAL::create_exterior_straight_skeleton_2 ( FT  max_offset,
PointIterator  vertices_begin,
PointIterator  vertices_end,
SsK  k = CGAL::Exact_predicates_inexact_constructions_kernel() 
)

#include <CGAL/create_straight_skeleton_2.h>

creates a straight skeleton in the exterior of a 2D polygon with holes.

The function returns a straight skeleton in the limited exterior of the 2D polygon P given by the point sequence [vertices_begin,vertices_end[. The skeleton in the limited exterior of P is the skeleton in the interior of a polygon Q with P as its hole and a rectangular frame F as outer boundary. The outer boundary F is constructed by enlarging the bounding box of P a distance d. d is a margin sufficiently large to allow an outer offset at distance max_offset to be obtained from this exterior skeleton, as computed by the function compute_outer_frame_margin().

Template Parameters
SsKmust be a model of Kernel.
FTmust be a model of FieldNumberType convertible to SsK::FT.
PointIteratormust be a model of InputIterator with value type InK::Point_2.
Note
Cartesian_converter is used to convert from InK::Point_2 to SsK::Point_2, if they differ.
Precondition
vertices_begin and vertices_end describe a weakly simple polygon that is oriented counterclockwise.
See also
CGAL::create_interior_straight_skeleton_2()
CGAL::Straight_skeleton_builder_2
Examples:
Straight_skeleton_2/Create_straight_skeleton_2.cpp.

◆ create_exterior_straight_skeleton_2() [2/2]

template<typename FT , typename Polygon , typename SsK >
boost::shared_ptr< Straight_skeleton_2<SsK> > CGAL::create_exterior_straight_skeleton_2 ( FT  max_offset,
const Polygon &  P,
SsK  k = CGAL::Exact_predicates_inexact_constructions_kernel() 
)

#include <CGAL/create_straight_skeleton_2.h>

creates a straight skeleton in the exterior of a 2D polygon with holes.

The function returns a straight skeleton in the limited exterior of the 2D polygon P. The skeleton in the limited exterior of P is the skeleton in the interior of a polygon Q with P as its hole and a rectangular frame F as outer boundary. The outer boundary F is constructed by enlarging the bounding box of P a distance d. d is a margin sufficiently large to allow an outer offset at distance max_offset to be obtained from this exterior skeleton, as computed by the function compute_outer_frame_margin().

Template Parameters
SsKmust be a model of Kernel.
FTmust be a model of FieldNumberType convertible to SsK::FT.
Polygonmust be a model of SequenceContainer with value type InK::Point_2 (e.g. Polygon_2<InK>) or a model of GeneralPolygonWithHoles_2 (e.g. Polygon_with_holes_2<InK>).
Note
Cartesian_converter is used to convert from InK::Point_2 to SsK::Point_2, if they differ.
Precondition
P is a weakly simple, counterclockwise polygon with clockwise oriented holes.
Holes neither intersect each other nor the outer boundary.
All the weights must be (strictly) positive.
max_offset is positive.
See also
CGAL::create_interior_straight_skeleton_2()
CGAL::Straight_skeleton_builder_2

◆ create_interior_straight_skeleton_2() [1/3]

template<typename PointIterator , typename HoleIterator , typename SsK >
boost::shared_ptr< Straight_skeleton_2<SsK> > CGAL::create_interior_straight_skeleton_2 ( PointIterator  outer_contour_vertices_begin,
PointIterator  outer_contour_vertices_end,
HoleIterator  holes_begin,
HoleIterator  holes_end,
SsK  k = CGAL::Exact_predicates_inexact_constructions_kernel() 
)

#include <CGAL/create_straight_skeleton_2.h>

creates a straight skeleton in the interior of the 2D polygon with holes.

The outer boundary of the polygon is given by the point sequence [outer_contour_vertices_begin,outer_contour_vertices_end[ and its holes given by [holes_begin, holes_end[.

Template Parameters
PointIteratormust be a model of InputIterator with value type InK::Point_2.
HoleIteratormust be a model of InputIterator with value_type a model of SequenceContainer with value type InK::Point_2.
SsKmust be a model of Kernel.
Note
Cartesian_converter is used to convert from InK::Point_2 to SsK::Point_2, if they differ.
Precondition
the range [outer_contour_vertices_begin, outer_contour_vertices_end[ describes a weakly simple polygon that is oriented counterclockwise. \pre the range [holes_begin, holes_end[ describes a sequence of weakly simple polygons that are oriented clockwise.
Holes neither intersect each other nor the outer boundary.
See also
CGAL::create_exterior_straight_skeleton_2()
CGAL::Straight_skeleton_builder_2
Examples:
Straight_skeleton_2/Create_offset_polygons_2.cpp, Straight_skeleton_2/Create_straight_skeleton_2.cpp, Straight_skeleton_2/Create_straight_skeleton_from_polygon_with_holes_2.cpp, and Straight_skeleton_2/Show_straight_skeleton.cpp.

◆ create_interior_straight_skeleton_2() [2/3]

template<typename PointIterator , typename SsK >
boost::shared_ptr< Straight_skeleton_2<SsK> > CGAL::create_interior_straight_skeleton_2 ( PointIterator  outer_contour_vertices_begin,
PointIterator  outer_contour_vertices_end,
SsK  k = CGAL::Exact_predicates_inexact_constructions_kernel() 
)

#include <CGAL/create_straight_skeleton_2.h>

creates a straight skeleton in the interior of the 2D polygon.

The outer boundary of the polygon is given by the point sequence [outer_contour_vertices_begin,outer_contour_vertices_end[.

Template Parameters
PointIteratormust be a model of InputIterator with value type InK::Point_2.
SsKmust be a model of Kernel.
Note
Cartesian_converter is used to convert from InK::Point_2 to SsK::Point_2, if they differ.
Precondition
the range [outer_contour_vertices_begin, outer_contour_vertices_end[ describes a weakly simple polygon that is oriented counterclockwise.
See also
CGAL::create_exterior_straight_skeleton_2()
CGAL::Straight_skeleton_builder_2

◆ create_interior_straight_skeleton_2() [3/3]

template<typename Polygon , typename SsK >
boost::shared_ptr< Straight_skeleton_2<SsK> > CGAL::create_interior_straight_skeleton_2 ( const Polygon &  polygon,
SsK  k = CGAL::Exact_predicates_inexact_constructions_kernel() 
)

#include <CGAL/create_straight_skeleton_2.h>

creates a straight skeleton in the interior of the 2D polygon polygon.

Warning
Holes of the polygon are ignored. If you also need the exterior skeleton for the holes, you should call CGAL::create_interior_straight_skeleton_2() for each hole.
Template Parameters
Polygonmust be a model of SequenceContainer with value type InK::Point_2 (e.g. Polygon_2<InK>) or a model of GeneralPolygonWithHoles_2 (e.g. Polygon_with_holes_2<InK>).
SsKmust be a model of Kernel.
Note
Cartesian_converter is used to convert from InK::Point_2 to SsK::Point_2, if they differ.
Precondition
polygon is a weakly simple, counterclockwise polygon with clockwise oriented holes.
Holes neither intersect each other nor the outer boundary.
See also
CGAL::create_exterior_straight_skeleton_2()
CGAL::Straight_skeleton_builder_2