Package mgui.geometry.mesh
Class MeshEdgeSet
java.lang.Object
mgui.geometry.mesh.MeshEdgeSet
public class MeshEdgeSet
extends java.lang.Object
Represents a mesh in terms of triangles and edges. For purposes of subdivision it
is desirable to have an edge with reference to its adjacent triangles, and a triangle
with reference to its edges.
MeshEdgeSet has two arrays: of MeshEdge
objects and MeshTriangle objects.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
-
Constructor Summary
Constructors Constructor Description MeshEdgeSet(Mesh3D mesh3d) -
Method Summary
Modifier and Type Method Description voidaddEdge(MeshEdge e)MeshEdgegetEdge(int i)intgetEdgeIndex(int n1, int n2)Returns the index of the edge connectingn1andn2.java.util.ArrayList<MeshEdge>getEdges()MeshEdge[]getEdges(int faceIndex, int triIndex)MeshTrianglegetEdgeTri(int i, int edge)Returns theith triangle index associated with this edge.intgetFaceIndex(int tri_idx)Returns the face index (i.e., in the source mesh) of the triangle attri_idx.intgetOppositeFaceIndex(int edge_idx, int face_idx)Get the face index (i.e., in the source mesh) of the triangle opposite to triangle atface_idx, which is joined atedge.intgetOppositeNode(int edge_index, int tri_index)Get the vertex index (i.e., in the source mesh) of the vertex opposite to triangle attri_index, which is joined atedge.intgetOppositeNode(MeshEdge edge, MeshTriangle triangle)Get the vertex index (i.e., in the source mesh) of the vertex opposite totriangle, which is joined atedge.MeshTrianglegetOppositeTri(int edge_idx, int face_idx)Get the triangle opposite to triangle atface_idx, which is joined atedge.MeshTrianglegetOppositeTri(MeshEdge edge, MeshTriangle face)Get the triangle opposite toface, which is joined atedge.intgetOppositeTriIndex(int edge_idx, int face_idx)Get the triangle index (i.e., in this set) of the triangle opposite to triangle atface_idx, which is joined atedge.intsearchEdge(MeshEdge e)Finds the specified edge in this setvoidsetMesh(Mesh3D mesh3d)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
edges
-
triangles
-
mesh
-
-
Constructor Details
-
MeshEdgeSet
-
-
Method Details
-
setMesh
-
getEdges
-
getEdges
-
searchEdge
Finds the specified edge in this set- Parameters:
e-- Returns:
-
getEdgeIndex
public int getEdgeIndex(int n1, int n2)Returns the index of the edge connectingn1andn2.- Parameters:
n1-n2-- Returns:
-
addEdge
-
getEdge
-
getEdgeTri
Returns theith triangle index associated with this edge.- Parameters:
i-edge-- Returns:
-
getOppositeTri
Get the triangle opposite toface, which is joined atedge.- Parameters:
e-t-- Returns:
-
getOppositeTri
Get the triangle opposite to triangle atface_idx, which is joined atedge.- Parameters:
e-t-- Returns:
-
getOppositeFaceIndex
public int getOppositeFaceIndex(int edge_idx, int face_idx)Get the face index (i.e., in the source mesh) of the triangle opposite to triangle atface_idx, which is joined atedge.- Parameters:
e-t-- Returns:
-
getOppositeTriIndex
public int getOppositeTriIndex(int edge_idx, int face_idx)Get the triangle index (i.e., in this set) of the triangle opposite to triangle atface_idx, which is joined atedge.- Parameters:
edge_idx-face_idx-- Returns:
-
getFaceIndex
public int getFaceIndex(int tri_idx)Returns the face index (i.e., in the source mesh) of the triangle attri_idx.- Parameters:
tri_idx-- Returns:
-
getOppositeNode
Get the vertex index (i.e., in the source mesh) of the vertex opposite totriangle, which is joined atedge.- Parameters:
edge-triangle-- Returns:
-
getOppositeNode
public int getOppositeNode(int edge_index, int tri_index)Get the vertex index (i.e., in the source mesh) of the vertex opposite to triangle attri_index, which is joined atedge.- Parameters:
edge-triangle-- Returns:
-