Class Triangle
java.lang.Object
jaba.Hull.Polygon
jaba.Hull.Triangle
A class defining a triangle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedgeNeighbour(Vector tris, Vertex v1, Vertex v2) Returns the triangle that shares a particular edge.booleanTests whether a triangle is present in a vector.intmatchIndex(Vector vec) Returns the index of a triangle in a vector.static booleansameTriangle(Triangle t1, Triangle t2) Tests whether two triangles are the same.thirdVertex(Vertex v1, Vertex v2) Returns the third vertex of a triangle given the other two.intReturns six times the volume of the tetrahedron formed by a triangle and vertex.intvolumeSign(Vertex v) Returns the sign of the volume of the tetrahedron formed by a triangle and a vertex.Methods inherited from class Polygon
getVertices, nextVertex, reverse, toString
-
Constructor Details
-
Triangle
-
-
Method Details
-
sameTriangle
-
matches
Tests whether a triangle is present in a vector.- Parameters:
vec- vector of triangles to match- Returns:
- true if the operation is successful, false otherwise
-
matchIndex
Returns the index of a triangle in a vector.- Parameters:
vec- vector of triangles to match- Returns:
- index of the match or -1 if no match
-
thirdVertex
-
edgeNeighbour
Returns the triangle that shares a particular edge.- Parameters:
tris- the list of triangles to search v1 v2 the vertices that define the edgev1- the v1 parameterv2- the v2 parameter- Returns:
- the neighbouring triangle or null if not found
-
volumeSign
Returns the sign of the volume of the tetrahedron formed by a triangle and a vertex. VolumeSign is positive iff the vertex is on the negative side of the triangle, where the positive side is determined by the rh-rule. So the volume is positive if the ccw normal to points outside the tetrahedron. The final fewer-multiplications form is due to Bob Williamson.- Parameters:
v- vertex to test- Returns:
- -1/0/1 if vertex is on the negative/coplanar/positive side of the triangle according to the rh-rule
-
volume6
Returns six times the volume of the tetrahedron formed by a triangle and vertex. The volume is positive iff the vertex is on the negative side of the triangle, where the positive side is determined by the rh-rule.- Parameters:
v- the vertex- Returns:
- the resulting int
-