codac 1.5.6
|
Separator for Point inside a polygon. More...
#include <codac_SepPolygon.h>
Inherits ibex::SepBoundaryCtc.
Public Member Functions | |
SepPolygon (std::vector< std::vector< std::vector< double > > > &points) | |
Create a Separator with the polygon passed as argument. | |
SepPolygon (std::vector< std::vector< double > > &vertices) | |
Create a Separator with the polygon passed as argument. | |
SepPolygon (std::vector< double > &ax, std::vector< double > &ay, std::vector< double > &bx, std::vector< double > &by) | |
~SepPolygon () | |
Delete this. | |
Separator for Point inside a polygon.
This separator can be used even if the polygon is not convex
The polygon is defined by an union of oriented segment given in counter-clockwise order.
Example : The polygon ABCDE is composed of 5 segments AB – BC – CD – DE – EA
A----------------------------— E
-
B
Principle
To our knowledge, no explicit contractor for the constraint "Point in inside the polygon" exists when the polygon is non convex. Only a contractor for the border is available. To solve this issue, with an inner an outer set, the separator approach needs to be used. From an initial box, the minimal contractor on the border of the polygon is called and a test is used to classify each removed part into x_in and x_out.
codac::SepPolygon::SepPolygon | ( | std::vector< std::vector< std::vector< double > > > & | points | ) |
Create a Separator with the polygon passed as argument.
A polygon is defined as an union of segments given in a counter-clockwise order. See unit test for an example of usage
The polygon boundary contractor is composed of a union of contractor on segments (CtcSegment). This contractor is minimal as an union of minimal contractors. See #ibex::SepBoundaryCtc.
points | list of segments representing the edges of the polygon in the format of ( ((a1_x, a1_y), (b1_x, b1_x)), ((a2_x, a2_y), (b2_x, b2_x)), ...) |
codac::SepPolygon::SepPolygon | ( | std::vector< std::vector< double > > & | vertices | ) |
Create a Separator with the polygon passed as argument.
A polygon is defined as an union of segments given in a counter-clockwise order. See unit test for an example of usage
The polygon boundary contractor is composed of a union of contractor on segments (CtcSegment). This contractor is minimal as an union of minimal contractors. See #ibex::SepBoundaryCtc.
vertices | list of vertices on the form (ax, ay), (bx, by), (cx, cy), ... |
codac::SepPolygon::SepPolygon | ( | std::vector< double > & | ax, |
std::vector< double > & | ay, | ||
std::vector< double > & | bx, | ||
std::vector< double > & | by ) |
Create a Separator with the polygon passed as argument.
A polygon is defined as an union of segments given in a counter-clockwise order. See unit test for an example of usage
The polygon boundary contractor is composed of a union of contractor on segments (CtcSegment). This contractor is minimal as an union of minimal contractors. See #ibex::SepBoundaryCtc.
ax | list of x coordinate of the first point of each segment |
ay | list of y coordinate of the first point of each segment |
bx | list of x coordinate of the second point of each segment |
by | list of y coordinate of the second point of each segment |