|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectTriangleMesh
public class TriangleMesh
An n-D triangular mesh of Points. A common format for 2D and 3D meshes - the external representation is of the form:
Note: the external format does not give Edges - but we will construct a list of edges, if asked. We will even constuct a list of triangles given just the points and edges.
Note: the mesh may lie in the plane (if the points are 2D) or be a 2-D surface in 3-D (or higher).
| Constructor Summary | |
|---|---|
TriangleMesh()
Constructor |
|
| Method Summary | |
|---|---|
void |
addEdge(int[] e)
Add an edge (unless it's already there). |
void |
addEdge(int i,
int j)
Add an edge (unless it's already there). |
int |
addPoint(Point p)
Add a point and return its index |
void |
addTriangle(int[] t)
Add a triangle (unless it's already there) |
void |
addTriangle(int i,
int j,
int k)
Add a triangle (unless it's already there) |
double |
area()
Area of the mesh |
double |
area(int[] t)
Area of a triangle |
double |
area(int i,
int j,
int k)
Area of a triangle |
void |
computeEdges()
Create edges from points and triangles. |
void |
computeTriangles()
Create triangles from points and edges. |
Vector |
difference(int i,
int j)
difference between points i and j = (i-j) |
int[] |
edge(int i)
edge i |
int |
findPoint(Point p)
Return the index of a point |
boolean |
inEdges(int[] e)
Is an edge already in edges? Edges are UNordered. |
boolean |
inEdges(int i,
int j)
Is an edge already in edges? Edges are UNordered. |
boolean |
inTriangles(int[] t)
Is a triangle already in triangles? |
boolean |
inTriangles(int i,
int j,
int k)
Is a triangle already in triangles? |
int |
nEdges()
Number of edges |
Vector |
normal(int[] t)
normal to triangle |
Vector |
normal(int i,
int j,
int k)
normal to triangle |
int |
nPoints()
Number of points |
int |
nTriangles()
Number of triangles |
Point |
point(int i)
point i |
void |
printMesh(java.io.PrintStream ps)
Print Triangular Mesh to a PrintStream |
void |
printMesh(java.io.PrintStream ps,
int d)
Print Triangular Mesh to a PrintStream (only the first d coordinates). |
java.lang.String |
toString()
Format the mesh |
java.lang.String |
toString(java.lang.String df)
Format the mesh using a hint. |
int[] |
triangle(int i)
triangle i |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TriangleMesh()
| Method Detail |
|---|
public int nPoints()
public int nTriangles()
public int nEdges()
public Point point(int i)
i - index of desired Pointpublic int[] triangle(int i)
i - index of desired trianglepublic int[] edge(int i)
i - index of desired edgepublic java.lang.String toString(java.lang.String df)
df - the format to be used for a single coordinatepublic java.lang.String toString()
toString in class java.lang.Objectpublic int addPoint(Point p)
public int findPoint(Point p)
public boolean inEdges(int i,
int j)
i - index of one endpointj - index of one endpointpublic boolean inEdges(int[] e)
e - edge
public void addEdge(int i,
int j)
i - index of one endpointj - index of one endpointpublic void addEdge(int[] e)
e - edge
public boolean inTriangles(int i,
int j,
int k)
i - index of one vertexj - index of one vertexk - index of one vertexpublic boolean inTriangles(int[] t)
t - triangle
public void addTriangle(int i,
int j,
int k)
i - index of one vertexj - index of one vertexk - index of one vertexpublic void addTriangle(int[] t)
t - trianglepublic Vector normal(int i, int j, int k)
i - index of one vertexj - index of one vertexk - index of one vertexpublic Vector normal(int[] t)
t - triangle
public double area(int i,
int j,
int k)
i - index of one vertexj - index of one vertexk - index of one vertexpublic double area(int[] t)
t - trianglepublic double area()
public Vector difference(int i, int j)
public void computeEdges()
public void computeTriangles()
public void printMesh(java.io.PrintStream ps,
int d)
public void printMesh(java.io.PrintStream ps)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||