- maximum allowed orthogonal distance between two parallel segments such that they are considered to be collinear
-
Type:
GeomTraits::FT
- Default: 0.2 unit length
CGAL 5.5.4 - Shape Regularization
|
Models and functions that can be used when regularizing segments.
Classes | |
class | CGAL::Shape_regularization::Segments::Angle_regularization_2< GeomTraits, InputRange, SegmentMap > |
An angle-based regularization type for 2D segments that reinforces parallelism and orthogonality relationships. More... | |
class | CGAL::Shape_regularization::Segments::Delaunay_neighbor_query_2< GeomTraits, InputRange, SegmentMap > |
A neighbor query based on a Delaunay triangulation, which enables to find the nearest neighbors in a set of GeomTraits::Segment_2 . More... | |
class | CGAL::Shape_regularization::Segments::Offset_regularization_2< GeomTraits, InputRange, SegmentMap > |
An offset-based regularization type for 2D segments that reinforces collinearity relationships. More... | |
Functions | |
template<typename InputRange , typename NeighQuery , typename RegType , typename QPSolver , typename NamedParameters = parameters::Default_named_parameters> | |
void | CGAL::Shape_regularization::Segments::regularize_segments (InputRange &input_range, NeighQuery &neighbor_query, RegType ®ularization_type, QPSolver &quadratic_program, const NamedParameters &np=parameters::default_values()) |
regularizes a set of 2D segments. More... | |
template<typename InputRange > | |
void | CGAL::Shape_regularization::Segments::regularize_angles (InputRange &input_range) |
regularizes angles in a set of 2D segments. More... | |
template<typename InputRange > | |
void | CGAL::Shape_regularization::Segments::regularize_offsets (InputRange &input_range) |
regularizes offsets in a set of 2D segments. More... | |
template<typename InputRange , typename OutIterator , typename NamedParameters = parameters::Default_named_parameters> | |
OutIterator | CGAL::Shape_regularization::Segments::parallel_groups (const InputRange &input_range, OutIterator groups, const NamedParameters &np=parameters::default_values()) |
finds groups of parallel segments in a set of 2D segments. More... | |
template<typename InputRange , typename OutIterator , typename NamedParameters = parameters::Default_named_parameters> | |
OutIterator | CGAL::Shape_regularization::Segments::collinear_groups (const InputRange &input_range, OutIterator groups, const NamedParameters &np=parameters::default_values()) |
finds groups of collinear segments in a set of 2D segments. More... | |
template<typename InputRange , typename OutIterator , typename NamedParameters = parameters::Default_named_parameters> | |
OutIterator | CGAL::Shape_regularization::Segments::orthogonal_groups (const InputRange &input_range, OutIterator groups, const NamedParameters &np=parameters::default_values()) |
finds groups of orthogonal segments in a set of 2D segments. More... | |
template<typename InputRange , typename OutIterator , typename NamedParameters = parameters::Default_named_parameters> | |
OutIterator | CGAL::Shape_regularization::Segments::unique_segments (const InputRange &input_range, OutIterator segments, const NamedParameters &np=parameters::default_values()) |
substitutes groups of 2D collinear segments by average segments. More... | |
OutIterator CGAL::Shape_regularization::Segments::collinear_groups | ( | const InputRange & | input_range, |
OutIterator | groups, | ||
const NamedParameters & | np = parameters::default_values() |
||
) |
#include <CGAL/Shape_regularization/regularize_segments.h>
finds groups of collinear segments in a set of 2D segments.
This function enables to find groups of near collinear segments in a set of 2D segments. The groups are returned as vectors of indices. This algorithm first finds the groups of parallel segments using the function Segments::parallel_groups()
and then splits these groups into groups of collinear segments.
This function does not regularize input segments, but only groups them.
InputRange | a model of ConstRange whose iterator type is RandomAccessIterator |
OutIterator | a model of OutputIterator that accepts elements of type std::vector<std::size_t> |
NamedParameters | a sequence of Named Parameters |
input_range | a const range of input segments |
groups | an output iterator with groups of segment indices |
np | an optional sequence of Named Parameters among the ones listed below; this parameter can be omitted, the default values are then used |
| |
| |
| |
|
OutIterator CGAL::Shape_regularization::Segments::orthogonal_groups | ( | const InputRange & | input_range, |
OutIterator | groups, | ||
const NamedParameters & | np = parameters::default_values() |
||
) |
#include <CGAL/Shape_regularization/regularize_segments.h>
finds groups of orthogonal segments in a set of 2D segments.
This function enables to find groups of near orthogonal segments in a set of 2D segments. The groups are returned as vectors of indices. This algorithm first finds the groups of parallel segments using the function Segments::parallel_groups()
and then merges these groups into groups of orthogonal segments.
This function does not regularize input segments, but only groups them.
InputRange | a model of ConstRange whose iterator type is RandomAccessIterator |
OutIterator | a model of OutputIterator that accepts elements of type std::vector<std::size_t> |
NamedParameters | a sequence of Named Parameters |
input_range | a const range of input segments |
groups | an output iterator with groups of segment indices |
np | an optional sequence of Named Parameters among the ones listed below; this parameter can be omitted, the default values are then used |
| |
| |
| |
|
OutIterator CGAL::Shape_regularization::Segments::parallel_groups | ( | const InputRange & | input_range, |
OutIterator | groups, | ||
const NamedParameters & | np = parameters::default_values() |
||
) |
#include <CGAL/Shape_regularization/regularize_segments.h>
finds groups of parallel segments in a set of 2D segments.
This function enables to find groups of near parallel segments in a set of 2D segments. The groups are returned as vectors of indices. Note that two segments may be included at the same group even if they are far away from each other. This algorithm concerns only the angle relationship among segments, but not the distance.
This function does not regularize input segments, but only groups them.
InputRange | a model of ConstRange whose iterator type is RandomAccessIterator |
OutIterator | a model of OutputIterator that accepts elements of type std::vector<std::size_t> |
NamedParameters | a sequence of Named Parameters |
input_range | a const range of input segments |
groups | an output iterator with groups of segment indices |
np | an optional sequence of Named Parameters among the ones listed below; this parameter can be omitted, the default values are then used |
| |
| |
| |
|
void CGAL::Shape_regularization::Segments::regularize_angles | ( | InputRange & | input_range | ) |
#include <CGAL/Shape_regularization/regularize_segments.h>
regularizes angles in a set of 2D segments.
Given a set of unordered 2D segments, this function enables to reinforce two types of regularities among these segments:
This is an utility function based on regularize_segments()
that is using default parameters.
InputRange | a model of ConstRange whose iterator type is RandomAccessIterator |
input_range | a const range of input segments for angle regularization |
void CGAL::Shape_regularization::Segments::regularize_offsets | ( | InputRange & | input_range | ) |
#include <CGAL/Shape_regularization/regularize_segments.h>
regularizes offsets in a set of 2D segments.
Given a set of parallel 2D segments, this function enables to reinforce the collinearity property among these segments that is all parallel segments, which are detected as near collinear, are made exactly collinear.
This is an utility function based on regularize_segments()
that is using default parameters.
InputRange | a model of ConstRange whose iterator type is RandomAccessIterator |
input_range | a const range of input segments for offset regularization |
void CGAL::Shape_regularization::Segments::regularize_segments | ( | InputRange & | input_range, |
NeighQuery & | neighbor_query, | ||
RegType & | regularization_type, | ||
QPSolver & | quadratic_program, | ||
const NamedParameters & | np = parameters::default_values() |
||
) |
#include <CGAL/Shape_regularization/regularize_segments.h>
regularizes a set of 2D segments.
Given a set of unordered 2D segments, this function enables to reinforce three types of regularities among these segments:
The user has to provide a NeighborQuery
model to access local neighbors of a segment and a RegularizationType
model to define the type of regularities that should be addressed. The function is based on the class QP_regularization
. Please refer to that class and these concepts for more information.
InputRange | a model of ConstRange whose iterator type is RandomAccessIterator |
NeighQuery | a model of NeighborQuery |
RegType | a model of RegularizationType |
QPSolver | a model of QuadraticProgramTraits |
NamedParameters | a sequence of Named Parameters |
input_range | a const range of input segments for shape regularization |
neighbor_query | an instance of NeighQuery that is used internally to access neighbors of a segment; this parameter can be omitted together with the regularization_type parameter, in this case, all types of regularities will be reinforced on the whole input range and the default solver will be used (see below) |
regularization_type | an instance of RegType that is used internally to obtain bounds and target values required by the regularization; this parameter can be omitted together with the neighbor_query parameter, in this case, all types of regularities will be reinforced on the whole input range and the default solver will be used (see below) |
quadratic_program | an instance of QPSolver to solve the quadratic programming problem; this parameter can be omitted, the default solver is CGAL::OSQP_quadratic_program_traits |
np | an optional sequence of Named Parameters among the ones listed below; this parameter can be omitted, the default values are then used |
|
OutIterator CGAL::Shape_regularization::Segments::unique_segments | ( | const InputRange & | input_range, |
OutIterator | segments, | ||
const NamedParameters & | np = parameters::default_values() |
||
) |
#include <CGAL/Shape_regularization/regularize_segments.h>
substitutes groups of 2D collinear segments by average segments.
This function first calls Segments::collinear_groups()
and then substitutes each group of collinear segments by an average segment. The number of returned segments is the number of detected collinear groups.
This function does not regularize input segments, but only groups and then simplifies them.
InputRange | a model of ConstRange whose iterator type is RandomAccessIterator |
OutIterator | a model of OutputIterator that accepts segments of type GeomTraits::Segment_2 |
NamedParameters | a sequence of Named Parameters |
input_range | a const range of input segments |
segments | an output iterator with the simplified segments |
np | an optional sequence of Named Parameters among the ones listed below; this parameter can be omitted, the default values are then used |
| |
| |
| |
|