- All Known Implementing Classes:
PolygonArray,SubPatch
public interface Mesh
Instances of this interface define a polygonal mesh
which can be used in
MeshVolume
to define a volume. The polygons are obtained through
getPolygon(int, int[], int[]) as index arrays into the
list of vertices which is obtained through getVertex(int, javax.vecmath.Tuple3d)
and the list of normals which is obtained through
getNormal(int, javax.vecmath.Tuple3d).- Author:
- Ole Kniemeyer
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of edges of a single polygon of the mesh.voidGets the normal vector of normalindex.intReturns the number of normals of the mesh.intgetPolygon(int index, int[] indicesOut, int[] normalsOut) Writes the vertex indices of polygonindextoindicesOutand the normal indices tonormalsOutand returns the number of vertices of the polygon.intReturns the number of polygons of the mesh.voidGets the uv coordinates of vertexindex.voidGets the spatial vertex coordinates of vertexindex.intReturns the number of vertices of the mesh.booleanisClosed()Indicates whether this mesh is a closed surface or not.booleanisPolygonPlanar(int index) Returnstrueiff the polygon numberindexis planar.
-
Method Details
-
getPolygonCount
int getPolygonCount()Returns the number of polygons of the mesh.- Returns:
- number of polygons
-
getMaxEdgeCount
int getMaxEdgeCount()Returns the maximum number of edges of a single polygon of the mesh.- Returns:
- maximum number of edges
-
getVertexCount
int getVertexCount()Returns the number of vertices of the mesh.- Returns:
- number of vertices
-
getNormalCount
int getNormalCount()Returns the number of normals of the mesh.- Returns:
- number of normals
-
isPolygonPlanar
boolean isPolygonPlanar(int index) Returnstrueiff the polygon numberindexis planar.- Parameters:
index- polygon number- Returns:
- is polygon planar?
-
getPolygon
int getPolygon(int index, int[] indicesOut, int[] normalsOut) Writes the vertex indices of polygonindextoindicesOutand the normal indices tonormalsOutand returns the number of vertices of the polygon. If the mesh is closed (seeisClosed()), inside and outside are determined by the ordering of the vertices: when seen from the outside, vertices have to be oriented in a counter-clockwise manner. Then also the normal vectors have to point to the outside.- Parameters:
index- polygon numberindicesOut- the vertex indices will be placed in herenormalsOut- the normal indices will be placed in here- Returns:
- number of vertex indices of polygon
-
getVertex
Gets the spatial vertex coordinates of vertexindex.- Parameters:
index- vertex numberout- vertex coordinates will be placed in here
-
getNormal
Gets the normal vector of normalindex. The normal vector is not necessarily normalized.- Parameters:
index- normal numberout- normal vector will be placed in here
-
getUV
Gets the uv coordinates of vertexindex.- Parameters:
index- vertex numberout- uv coordinates will be placed in here
-
isClosed
boolean isClosed()Indicates whether this mesh is a closed surface or not. If it is closed, normal vectors have to point to the exterior.- Returns:
- is surface closed?
-