|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--convexhull3d.Triangle
Basic triangular face used to form the hull.
The information stored for each triangle consists of a planar normal, a planar offset, and a doubly-linked list of three HalfEdges which surround the triangle in a counter-clockwise direction.
Field Summary | |
static int |
COPLANAR
Triangle is marked as coplanar (i.e., marginally visible) with respect to a particular point. |
static int |
NO_MARK
The triangle is not marked. |
static int |
VISIBLE
Triangle is marked as visible to a particular point. |
Constructor Summary | |
Triangle(SpatialPoint p0,
SpatialPoint p1,
SpatialPoint p2)
Constructs a Triangle from points p0, p1, and p2. |
Method Summary | |
static void |
areaVector(SpatialVector v,
SpatialPoint p0,
SpatialPoint p1,
SpatialPoint p2)
Computes the cross product of the vectors formed from (p1-p0) and (p2-p0) and stores this in the vector v. |
static double |
areaVectorDot(SpatialPoint p0,
SpatialPoint p1,
SpatialPoint p2,
SpatialVector v)
Computes the cross product of the vectors formed from (p1-p0) and (p2-p0), and then takes the dot product of this with the vector v. |
double |
distanceToPlane(SpatialPoint p)
Computes the distance from a point p to the plane of this triangle. |
HalfEdge |
findEdge(SpatialPoint vt,
SpatialPoint vh)
Finds the half-edge within this triangle which has tail vt and head vh . |
HalfEdge |
getEdge(int i)
Gets the i-th half-edge associated with the triangle. |
int |
getMark()
Gets the marking associated with this triangle. |
SpatialVector |
getNormal()
Returns the normal of the plane associated with this triangle. |
static HalfEdge |
nextBoundaryEdge(HalfEdge edge0)
Gets the next half-edge, adjacent to edge0 in a counter-clockwise direction, which lies along the boundary of a region of triangles marked VISIBLE or COPLANAR |
static HalfEdge |
nextBoundaryEdge(HalfEdge edge0,
int mark)
Gets the next half-edge, adjacent to edge0 in a counter-clockwise direction, which lies along the boundary of a region of triangles marked with the value mark . |
static HalfEdge |
prevBoundaryEdge(HalfEdge edge0)
Gets the next half-edge, adjacent to edge0 in a clockwise direction, which lies along the boundary of a region of triangles which are marked VISIBLE or COPLANAR |
void |
setMark(int m)
Sets the marking associated with this triangle. |
java.lang.String |
vertexString()
Produces a string identifying this triangle by the point index values of its vertices. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_MARK
public static final int VISIBLE
public static final int COPLANAR
Constructor Detail |
public Triangle(SpatialPoint p0, SpatialPoint p1, SpatialPoint p2)
p0
- first pointp1
- second pointp2
- third pointMethod Detail |
public static void areaVector(SpatialVector v, SpatialPoint p0, SpatialPoint p1, SpatialPoint p2)
v
- used to return the cross productp0
- first pointp1
- second pointp2
- third pointpublic static double areaVectorDot(SpatialPoint p0, SpatialPoint p1, SpatialPoint p2, SpatialVector v)
p0
- first pointp1
- second pointp2
- third pointv
- used to form dot product
public void setMark(int m)
m
- the mark valuepublic int getMark()
public HalfEdge getEdge(int i)
i
- the half-edge index, in the range 0-2.
public static HalfEdge nextBoundaryEdge(HalfEdge edge0)
VISIBLE
or COPLANAR
edge0
- original edge
public static HalfEdge nextBoundaryEdge(HalfEdge edge0, int mark)
mark
.
edge0
- original edgemark
- marking value for the region
public static HalfEdge prevBoundaryEdge(HalfEdge edge0)
VISIBLE
or COPLANAR
edge0
- original edge
public HalfEdge findEdge(SpatialPoint vt, SpatialPoint vh)
vt
and head vh
.
vt
- tail pointvh
- head point
public java.lang.String vertexString()
public double distanceToPlane(SpatialPoint p)
p
- the point
public SpatialVector getNormal()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |