codac
Public Member Functions | List of all members
codac::SepPolygon Class Reference

Separator for Point inside a polygon. More...

#include <codac_SepPolygon.h>

Inherits SepBoundaryCtc.

Public Member Functions

 SepPolygon (std::vector< std::vector< std::vector< double > > > &points)
 Create a Separator with the polygon passed as argument. More...
 
 SepPolygon (std::vector< std::vector< double > > &vertices)
 Create a Separator with the polygon passed as argument. More...
 
 SepPolygon (std::vector< double > &ax, std::vector< double > &ay, std::vector< double > &bx, std::vector< double > &by)
 
 ~SepPolygon ()
 Delete this.
 

Detailed Description

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

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.

Constructor & Destructor Documentation

◆ SepPolygon() [1/3]

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.

Parameters
pointslist 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)), ...)

◆ SepPolygon() [2/3]

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.

Parameters
verticeslist of vertices on the form (ax, ay), (bx, by), (cx, cy), ...

◆ SepPolygon() [3/3]

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.

Parameters
axlist of x coordinate of the first point of each segment
aylist of y coordinate of the first point of each segment
bxlist of x coordinate of the second point of each segment
bylist of y coordinate of the second point of each segment

The documentation for this class was generated from the following file: