Panda3D
|
This is an extension of Triangulator to handle polygons with three- dimensional points. More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ () | |
__init__ (const Triangulator3) | |
int | addVertex (const LPoint3d point) |
Adds a new vertex to the vertex pool. | |
int | addVertex (double x, double y, double z) |
Adds a new vertex to the vertex pool. | |
clear () | |
Removes all vertices and polygon specifications from the Triangulator, and prepares it to start over. | |
int | getNumVertices () |
Returns the number of vertices in the pool. | |
const LPlaned | getPlane () |
Returns the plane of the polygon. | |
const LPoint3d | getVertex (int n) |
Returns the nth vertex. | |
list | getVertices () |
triangulate () | |
Does the work of triangulating the specified polygon. | |
![]() | |
__init__ () | |
__init__ (const Triangulator) | |
addHoleVertex (int index) | |
Adds the next consecutive vertex of the current hole. | |
addPolygonVertex (int index) | |
Adds the next consecutive vertex of the polygon. | |
int | addVertex (const LPoint2d point) |
Adds a new vertex to the vertex pool. | |
int | addVertex (double x, double y) |
Adds a new vertex to the vertex pool. | |
beginHole () | |
Finishes the previous hole, if any, and prepares to add a new hole. | |
clear () | |
Removes all vertices and polygon specifications from the Triangulator, and prepares it to start over. | |
clearPolygon () | |
Removes the current polygon definition (and its set of holes), but does not clear the vertex pool. | |
int | getNumTriangles () |
Returns the number of triangles generated by the previous call to triangulate(). | |
int | getNumVertices () |
Returns the number of vertices in the pool. | |
int | getTriangleV0 (int n) |
Returns vertex 0 of the nth triangle generated by the previous call to triangulate(). | |
int | getTriangleV1 (int n) |
Returns vertex 1 of the nth triangle generated by the previous call to triangulate(). | |
int | getTriangleV2 (int n) |
Returns vertex 2 of the nth triangle generated by the previous call to triangulate(). | |
const LPoint2d | getVertex (int n) |
Returns the nth vertex. | |
list | getVertices () |
bool | isLeftWinding () |
Returns true if the polygon vertices are listed in counterclockwise order, or false if they appear to be listed in clockwise order. | |
triangulate () | |
Does the work of triangulating the specified polygon. | |
Public Attributes | |
const LPlaned | plane |
Returns the plane of the polygon. | |
const LPoint3d | vertices [] |
Returns the nth vertex. | |
![]() | |
const LPoint2d | vertices [] |
Returns the nth vertex. | |
This is an extension of Triangulator to handle polygons with three- dimensional points.
It assumes all of the points lie in a single plane, and internally projects the supplied points into 2-D for passing to the underlying Triangulator object.
__init__ | ( | ) |
__init__ | ( | const Triangulator3 | ) |
int addVertex | ( | const LPoint3d | point | ) |
Adds a new vertex to the vertex pool.
Returns the vertex index number.
int addVertex | ( | double | x, |
double | y, | ||
double | z ) |
Adds a new vertex to the vertex pool.
Returns the vertex index number.
clear | ( | ) |
Removes all vertices and polygon specifications from the Triangulator, and prepares it to start over.
int getNumVertices | ( | ) |
Returns the number of vertices in the pool.
Note that the Triangulator might append new vertices, in addition to those added by the user, if any of the polygon is self-intersecting, or if any of the holes intersect some part of the polygon edges.
const LPlaned getPlane | ( | ) |
Returns the plane of the polygon.
This is only available after calling triangulate().
const LPoint3d getVertex | ( | int | n | ) |
Returns the nth vertex.
list getVertices | ( | ) |
triangulate | ( | ) |
Does the work of triangulating the specified polygon.
After this call, you may retrieve the new triangles one at a time by iterating through get_triangle_v0/1/2().
const LPlaned plane |
Returns the plane of the polygon.
This is only available after calling triangulate().
const LPoint3d vertices[] |
Returns the nth vertex.