Méthode | Description | |
---|---|---|
difference ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List |
||
intersect ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List |
||
union ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List |
Méthode | Description | |
---|---|---|
buildPolygonsFromChain ( List |
Calculates the polygon(s) from the result simplical chain. Used by method |
|
calculateBeta ( Vector2 point, Edge e, float coefficient ) : float |
Needed to calculate the characteristics function of a simplex. Used by method |
|
calculateIntersections ( Vertices polygon1, Vertices polygon2, Vertices &slicedPoly1, Vertices &slicedPoly2 ) : void |
Calculates all intersections between two polygons.
|
|
calculateResultChain ( List |
Calculates the characteristics function for all edges of the given simplical chains and builds the result chain. Used by method |
|
calculateSimplexCoefficient ( Vector2 a, Vector2 b, Vector2 c ) : float |
Returns the coefficient of a simplex. Used by method |
|
calculateSimplicalChain ( Vertices poly, List |
Calculates the simplical chain corresponding to the input polygon. Used by method |
|
execute ( Vertices subject, Vertices clip, PolyClipType clipType, PolyClipError &error ) : List |
Implements "A new algorithm for Boolean operations on general polygons" available here: http://liama.ia.ac.cn/wiki/_media/user:dong:dong_cg_05.pdf Merges two polygons, a subject and a clip with the specified operation. Polygons may not be self-intersecting. Warning: May yield incorrect results or even crash if polygons contain collinear points.
|
|
getAlpha ( Vector2 start, Vector2 end, Vector2 point ) : float |
Needed for sorting multiple intersections points on the same edge. Used by method |
|
pointInSimplex ( Vector2 point, Edge edge ) : bool |
Winding number test for a point in a simplex.
|
|
pointOnLineSegment ( Vector2 start, Vector2 end, Vector2 point ) : bool |
Tests if a point lies on a line segment. Used by method |
|
vectorEqual ( Vector2 vec1, Vector2 vec2 ) : bool |
public static difference ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List |
||
polygon1 | Vertices | |
polygon2 | Vertices | |
error | PolyClipError | |
Résultat | List |
public static intersect ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List |
||
polygon1 | Vertices | |
polygon2 | Vertices | |
error | PolyClipError | |
Résultat | List |
public static union ( Vertices polygon1, Vertices polygon2, PolyClipError &error ) : List |
||
polygon1 | Vertices | |
polygon2 | Vertices | |
error | PolyClipError | |
Résultat | List |