Enumerations | Functions
PolyIntersect.hpp File Reference

Finds the intersection points between two polygons. More...

#include "geotests.hpp"
#include "Edge.hpp"
Include dependency graph for PolyIntersect.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  InFlags { UnKnown, Pi, Qi }
 Flags for if the segment is inner or outer.
 
enum  IntersectFlags { True, False, Par }
 Flags for there is an intersction or not or if the segments are parallel.
 

Functions

vector< Vector2DConvexIntersect (vector< Vector2D > const &poly0, vector< Vector2D > const &poly1)
 Calculates the intersection between two convex polygons. More...
 
IntersectFlags SegmentIntersection (Vector2D const &p0, Vector2D const &p1, Vector2D const &q0, Vector2D const &q1, Vector2D &Intersection)
 Checks if two segments intersect. More...
 

Detailed Description

Finds the intersection points between two polygons.

Author
Elad Steinberg

Definition in file PolyIntersect.hpp.

Function Documentation

◆ ConvexIntersect()

vector<Vector2D> ConvexIntersect ( vector< Vector2D > const &  poly0,
vector< Vector2D > const &  poly1 
)

Calculates the intersection between two convex polygons.

Parameters
poly0The first polygon
poly1The second polygon
Returns
The vertices of the intersecting polygon, can be empty

Definition at line 82 of file PolyIntersect.cpp.

Here is the caller graph for this function:

◆ SegmentIntersection()

IntersectFlags SegmentIntersection ( Vector2D const &  p0,
Vector2D const &  p1,
Vector2D const &  q0,
Vector2D const &  q1,
Vector2D Intersection 
)

Checks if two segments intersect.

Parameters
p0The first vertice of the first segment
p1The second vertice of the first segment
q0The first vertice of the second segment
q1The second vertice of the second segment
IntersectionThe location of the intersection (if there is) given as output
Returns
A flag stating if thereis an intersection no intersection or the two segements parallel

Definition at line 6 of file PolyIntersect.cpp.

Here is the call graph for this function: