|
static boolean | triangulate (List< PVector > contour, List< Integer > result, boolean open) |
|
static Integer[] | triangulate (List< PVector > contour, boolean open) |
|
static Integer[] | triangulate (PVector[] contour, boolean open) |
|
static int[] | asPrimatives (Integer[] array) |
|
static double | area (PVector[] contour) |
|
static boolean | isInsideTriangle (double aX, double aY, double bX, double bY, double cX, double cY, double pX, double pY) |
|
static boolean | isInsideTriangle (PVector a, PVector b, PVector c, PVector p) |
|
static boolean | isInsideTriangle (PVector a, PVector b, PVector c, double pX, double pY) |
|
Based on source code found on the Internet and modified by the author to work directly with Processing. The URL for the original code has been lost).
- Author
- unknown, Peter Lager
static double shapes3d.utils.Triangulator.area |
( |
PVector[] |
contour | ) |
|
|
static |
Calculate the area of the polygon.
- Parameters
-
contour | an array of vertices that make up an open 2D polygon |
- Returns
- the area of the polygon
static int [] shapes3d.utils.Triangulator.asPrimatives |
( |
Integer[] |
array | ) |
|
|
static |
Converts Integer[] to int[]
- Parameters
-
array | of boxed integers i.e. Integer(s) |
- Returns
- an array of integer primitives i.e. int(s)
static boolean shapes3d.utils.Triangulator.isInsideTriangle |
( |
double |
aX, |
|
|
double |
aY, |
|
|
double |
bX, |
|
|
double |
bY, |
|
|
double |
cX, |
|
|
double |
cY, |
|
|
double |
pX, |
|
|
double |
pY |
|
) |
| |
|
static |
Decide if point pX/pY is inside triangle defined by triangle ABC
- Parameters
-
aX | vertex A : x value |
aY | vertex A : y value |
bX | vertex B : x value |
bY | vertex B : y value |
cX | vertex C : x value |
cY | vertex C : y value |
pX | x value to test |
pY | y value to test |
- Returns
- true if inside else false
static boolean shapes3d.utils.Triangulator.isInsideTriangle |
( |
PVector |
a, |
|
|
PVector |
b, |
|
|
PVector |
c, |
|
|
PVector |
p |
|
) |
| |
|
static |
Decide if point p is inside triangle defined by triangle ABC
- Parameters
-
a | triangle vertex |
b | triangle vertex |
c | triangle vertex |
p | the point to test |
- Returns
- true if inside else false
static boolean shapes3d.utils.Triangulator.isInsideTriangle |
( |
PVector |
a, |
|
|
PVector |
b, |
|
|
PVector |
c, |
|
|
double |
pX, |
|
|
double |
pY |
|
) |
| |
|
static |
Decide if point pX/pY is inside triangle defined by triangle ABC
- Parameters
-
a | triangle vertex |
b | triangle vertex |
c | triangle vertex |
pX | x value to test |
pY | y value to test |
- Returns
- true if inside else false
static boolean shapes3d.utils.Triangulator.triangulate |
( |
List< PVector > |
contour, |
|
|
List< Integer > |
result, |
|
|
boolean |
open |
|
) |
| |
|
static |
Create a set of triangles from a concave/convex polygon with no holes and no intersecting sides.
- Parameters
-
contour | an open list of vertices that make up a 2D polygon |
open | true if the contour is open, false if closed |
result | list of vertex indices (to contour list) in groups of three for the render triangles |
- Returns
- true if succeeded else false
static Integer [] shapes3d.utils.Triangulator.triangulate |
( |
List< PVector > |
contour, |
|
|
boolean |
open |
|
) |
| |
|
static |
Create a set of triangles from a concave/convex polygon with no holes and no intersecting sides.
- Parameters
-
contour | an open list of vertices that make up a 2D polygon |
open | true if the contour is open, false if closed |
- Returns
- list of vertex indices (to contour list) in groups of three for the render triangles
static Integer [] shapes3d.utils.Triangulator.triangulate |
( |
PVector[] |
contour, |
|
|
boolean |
open |
|
) |
| |
|
static |
Create a set of triangles from a concave/convex polygon with no holes and no intersecting sides.
- Parameters
-
contour | an array of vertices that make up an open 2D polygon |
open | true if the contour is open, false if closed |
- Returns
- list of vertex indices (to contour list) in groups of three for the render triangles
The documentation for this class was generated from the following file:
- /Users/peter/git/shapes3d-repos/Shapes 3D/src/shapes3d/utils/Triangulator.java