CGAL 6.2 - 2D Snap Rounding
Loading...
Searching...
No Matches
Hot pixel snap rounding

Classes and functions to round segments or polygons using hot pixel SR method.

Classes

class  CGAL::Hot_pixel_snap_rounding_traits_2< BaseKernel >
 The class Hot_pixel_snap_rounding_traits_2<Kernel> is a model of the HotPixelSnapRoundingTraits_2 concept. More...
 

Functions

template<class SegmentRange , class OutputContainer , class NamedParameters = parameters::Default_named_parameters>
void CGAL::hot_pixel_snap_rounding_2 (const SegmentRange &segments, OutputContainer &out, const NamedParameters &np=parameters::default_values())
 subdivides and rounds a range of segments so that they are pairwise disjoint in their interiors.
 
template<class PolygonRange , class OutputContainer , class NamedParameters = parameters::Default_named_parameters>
void CGAL::hot_pixel_snap_rounding_2 (const PolygonRange &polygons, OutputContainer &out, const NamedParameters &np=parameters::default_values())
 subdivides and rounds a range of polygons so that their boundary segments are pairwise disjoint in their interiors.
 

Function Documentation

◆ hot_pixel_snap_rounding_2() [1/2]

template<class PolygonRange , class OutputContainer , class NamedParameters = parameters::Default_named_parameters>
void CGAL::hot_pixel_snap_rounding_2 ( const PolygonRange &  polygons,
OutputContainer &  out,
const NamedParameters &  np = parameters::default_values() 
)

#include <CGAL/hot_pixel_snap_rounding_2.h>

subdivides and rounds a range of polygons so that their boundary segments are pairwise disjoint in their interiors.

If the input polygons are disjoint, the output polygons remain non-overlapping, although they may share vertices or edges. Each output polygon is free of self-intersections but may present pinched sections.

Template Parameters
PolygonRangemodel of a ConstRange whose iterator is model of ForwardIterator and whose value_type is model of CGAL::Polygon_2.
OutputContainermodel of the concept BackInsertionSequence whose value type is model of CGAL::Polygon_2.
NamedParametersa sequence of Named Parameters
Parameters
polygonsthe range of input polygons
outthe output container
npan optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
  • The size of the pixel. The plane will be tiled with square pixels of that width such that the origin is the center of a pixel.
  • Type: geom_traits::FT
  • Default: 1
  • determines whether to apply Iterative Snap Rounding, see the user manual for more details.
  • Type: Boolean
  • Default: true
  • If set to true, the output coordinates are expressed in the integer grid (pixel indices). Otherwise, they are given in the input coordinate system.
  • Type: Boolean
  • Default: true
Warning
a convex input polygon might no longer be convex after rounding.

◆ hot_pixel_snap_rounding_2() [2/2]

template<class SegmentRange , class OutputContainer , class NamedParameters = parameters::Default_named_parameters>
void CGAL::hot_pixel_snap_rounding_2 ( const SegmentRange &  segments,
OutputContainer &  out,
const NamedParameters &  np = parameters::default_values() 
)

#include <CGAL/hot_pixel_snap_rounding_2.h>

subdivides and rounds a range of segments so that they are pairwise disjoint in their interiors.

The output is a range of polylines, where each polyline corresponds to an input segment.

Template Parameters
SegmentRangemodel of a ConstRange whose iterator is model of ForwardIterator and whose value_type is geom_traits::Segment_2, where the type of geom_traits is detailed by np::geom_traits.
OutputContainermodel of the concept BackInsertionSequence whose value type is itself a model of the concepts DefaultConstructible and BackInsertionSequence whose value type is geom_traits::Point_2
NamedParametersa sequence of Named Parameters
Parameters
segmentsthe input segment range
outthe output container
npan optional sequence of Named Parameters among the ones listed below
Optional Named Parameters
  • The size of the pixel. The plane will be tiled with square pixels of that width such that the origin is the center of a pixel.
  • Type: geom_traits::FT
  • Default: 1
  • determines whether to apply Iterative Snap Rounding, see the user manual for more details.
  • Type: Boolean
  • Default: true
  • If set to true, the output coordinates are expressed in the integer grid (pixel indices). Otherwise, they are given in the input coordinate system.
  • Type: Boolean
  • Default: true
  • If set to true, the output polylines are unique pairs of distinct points represented a segment. As a result, the total number of output polylines may differ from the number of input segments.
  • Type: Boolean
  • Default: true
Examples
Snap_rounding_2/iterative_snap_rounding.cpp, and Snap_rounding_2/snap_rounding_to_integer.cpp.