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 void
addEdge(MeshEdge e)
MeshEdge
getEdge(int i)
int
getEdgeIndex(int n1, int n2)
Returns the index of the edge connectingn1
andn2
.java.util.ArrayList<MeshEdge>
getEdges()
MeshEdge[]
getEdges(int faceIndex, int triIndex)
MeshTriangle
getEdgeTri(int i, int edge)
Returns thei
th triangle index associated with this edge.int
getFaceIndex(int tri_idx)
Returns the face index (i.e., in the source mesh) of the triangle attri_idx
.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
.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
.int
getOppositeNode(MeshEdge edge, MeshTriangle triangle)
Get the vertex index (i.e., in the source mesh) of the vertex opposite totriangle
, which is joined atedge
.MeshTriangle
getOppositeTri(int edge_idx, int face_idx)
Get the triangle opposite to triangle atface_idx
, which is joined atedge
.MeshTriangle
getOppositeTri(MeshEdge edge, MeshTriangle face)
Get the triangle opposite toface
, which is joined atedge
.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
.int
searchEdge(MeshEdge e)
Finds the specified edge in this setvoid
setMesh(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 connectingn1
andn2
.- Parameters:
n1
-n2
-- Returns:
-
addEdge
-
getEdge
-
getEdgeTri
Returns thei
th 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:
-