Package cz.fidentis.analyst.data.mesh
Interface MeshTriangle
- All Superinterfaces:
Iterable<MeshPoint>
,Serializable
- All Known Implementing Classes:
MeshTriangleImpl
Adapter for the corner table representing a single triangle of
MeshFacet
.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Interpolation of the triangle surface points. -
Method Summary
Modifier and TypeMethodDescriptionjavax.vecmath.Vector3d
Computes and returns normalized normal vector from the vertices.javax.vecmath.Point3d
getClosestPoint
(javax.vecmath.Point3d point) Computes the point laying on the triangle which is closest to given 3D point.List
<javax.vecmath.Point3d> getCommonPoints
(MeshTriangle other) Selects the common points shared by two trianglesjavax.vecmath.Vector4d
getCurvatureOfTrianglePlane
(javax.vecmath.Point3d samplePosition, double distanceAccepted, javax.vecmath.Vector3d base1, javax.vecmath.Vector3d base2) Function tests if the mesh triangle is closer to the sample point than a certain distance and if is, calculates the second fundamental form of the sample point regarding the plane defined by the mesh triangle, otherwise returns null.getFacet()
Returns mesh facet backing the triangle.int
Returns the index under which the vertex is stored in the array of facet verticesint
Returns the index under which the vertex is stored in the array of facet verticesint
Returns the index under which the vertex is stored in the array of facet verticesReturns mesh point of the triangle's vertex.Returns mesh point of the triangle's vertex.Returns mesh point of the triangle's vertex.getRayIntersection
(Ray ray, MeshTriangle.Smoothing smoothing) Computes ray-triangle intersection.javax.vecmath.Point3d
Returns 3D coordinates of the triangle's vertex.javax.vecmath.Point3d
Returns 3D coordinates of the triangle's vertex.javax.vecmath.Point3d
Returns 3D coordinates of the triangle's vertex.javax.vecmath.Point3d
Return a center of circumcircle.boolean
checkIntersectionWithPlane
(javax.vecmath.Vector3d normal, double d) Checks whether the triangle is intersected by a planeiterator()
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getVertex1
javax.vecmath.Point3d getVertex1()Returns 3D coordinates of the triangle's vertex.- Returns:
- 3D coordinates of the triangle's vertex
-
getVertex2
javax.vecmath.Point3d getVertex2()Returns 3D coordinates of the triangle's vertex.- Returns:
- 3D coordinates of the triangle's vertex
-
getVertex3
javax.vecmath.Point3d getVertex3()Returns 3D coordinates of the triangle's vertex.- Returns:
- 3D coordinates of the triangle's vertex
-
getPoint1
MeshPoint getPoint1()Returns mesh point of the triangle's vertex.- Returns:
- mesh point of the triangle's vertex
-
getPoint2
MeshPoint getPoint2()Returns mesh point of the triangle's vertex.- Returns:
- mesh point of the triangle's vertex
-
getPoint3
MeshPoint getPoint3()Returns mesh point of the triangle's vertex.- Returns:
- mesh point of the triangle's vertex
-
getIndex1
int getIndex1()Returns the index under which the vertex is stored in the array of facet vertices- Returns:
- the index under which the vertex is stored in the array of facet vertices
-
getIndex2
int getIndex2()Returns the index under which the vertex is stored in the array of facet vertices- Returns:
- the index under which the vertex is stored in the array of facet vertices
-
getIndex3
int getIndex3()Returns the index under which the vertex is stored in the array of facet vertices- Returns:
- the index under which the vertex is stored in the array of facet vertices
-
getFacet
MeshFacet getFacet()Returns mesh facet backing the triangle.- Returns:
- mesh facet backing the triangle.
-
computeOrientedNormal
javax.vecmath.Vector3d computeOrientedNormal()Computes and returns normalized normal vector from the vertices. This vector is in the direction of the normals of vertices of the triangle.- Returns:
- normalized normal vector from the vertices.
-
getRayIntersection
Computes ray-triangle intersection. Based on this article but adapted to two-side triangles.- Parameters:
ray
- a raysmoothing
- smoothing strategy- Returns:
- the ray intersection or
null
-
getClosestPoint
javax.vecmath.Point3d getClosestPoint(javax.vecmath.Point3d point) Computes the point laying on the triangle which is closest to given 3D point. Return point is either one of the triangle's vertices, a point laying on triangles edge, or a point laying on the plane of the triangle inside the triangle boundaries.- Parameters:
point
- 3D point- Returns:
- the closest point or
null
if the input parameter is missing
-
checkIntersectionWithPlane
boolean checkIntersectionWithPlane(javax.vecmath.Vector3d normal, double d) Checks whether the triangle is intersected by a plane- Parameters:
normal
- normal defining the planed
- distance defining the plane- Returns:
- true if the triangle is intersected by the plane
-
getCommonPoints
Selects the common points shared by two triangles- Parameters:
other
- The other triangle- Returns:
- the common points of two triangles
-
iterator
-
getVoronoiPoint
javax.vecmath.Point3d getVoronoiPoint()Return a center of circumcircle. This point represents the point of Voronoi area used for Delaunay triangulation, for instance.- Returns:
- the center of circumcircle
-
getCurvatureOfTrianglePlane
javax.vecmath.Vector4d getCurvatureOfTrianglePlane(javax.vecmath.Point3d samplePosition, double distanceAccepted, javax.vecmath.Vector3d base1, javax.vecmath.Vector3d base2) Function tests if the mesh triangle is closer to the sample point than a certain distance and if is, calculates the second fundamental form of the sample point regarding the plane defined by the mesh triangle, otherwise returns null.For more details, see: V. Interrante et al.: Conveying the 3D shape of smoothly curving transparent surfaces via texture, 1997, doi: 10.1109/2945.597794
- Parameters:
samplePosition
- position of a point on model's surface selected to be a glyphdistanceAccepted
- squared distance; the triangle needs to be closer to the sample point than this distance to be taken into accountbase1
- first vector of orthogonal base; the base consists of three vectors: the normal of the sample point and two vectors(base1 and base2) defining the tangent plane of the model at the sample pointbase2
- second vector of orthogonal base; the base consists of three vectors: the normal of the sample point and two vectors(base1 and base2) defining the tangent plane of the model at the sample point- Returns:
- curvature of the sample point represented by the rate the surface normal tips in the directions of orthogonal base
-