public class MeshUtil extends Object
| Constructor and Description |
|---|
MeshUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
cross(double x1,
double y1,
double z1,
double x2,
double y2,
double z2,
double[] out)
Cross product between vectors V1 and V2.
|
static double |
dotProduct(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
Dot product between vectors V1 and V2.
|
static long |
edgeID(int v1,
int v2)
Builds a unique id for an edge between the two specified vertices.
|
static String |
edgeStr(long l) |
static int |
edgeV1(long l)
Returns the id of the first vertex of the specified edge.
|
static int |
edgeV2(long l)
Returns the id of the second vertex of the specified edge.
|
static double |
maxZ(Vertices vertices,
long v0,
long v1,
long v2,
double eps)
Return the maximal Z value of a given triangle, rounded to twice the
specified scale.
|
static double |
minZ(Vertices vertices,
long v0,
long v1,
long v2,
double eps)
Return the minimal Z value of a given triangle, rounded to twice the
specified scale.
|
static double |
mround(double v,
double eps,
int mod,
int rem)
Rounds a position to a multiple of small number, plus reminder.
|
static String |
triangleStr(Mesh mesh,
long id)
Produces a string representation of a triangle.
|
public static final double dotProduct(double x1,
double y1,
double z1,
double x2,
double y2,
double z2)
x1 - y1 - z1 - x2 - y2 - z2 - public static final void cross(double x1,
double y1,
double z1,
double x2,
double y2,
double z2,
double[] out)
double array.x1 - y1 - z1 - x2 - y2 - z2 - out - a double array of size at least 3 to store the
coordinates of resulting vector.public static final long edgeID(int v1,
int v2)
v1 - the id of the first vertex.v2 - the id of the second vertex.long.public static final int edgeV1(long l)
l - the edge id.int.public static final int edgeV2(long l)
l - the edge id.int.public static final String edgeStr(long l)
public static final double mround(double v,
double eps,
int mod,
int rem)
v - the value to round.eps - the scale to round to.mod - the number of time eps to round. For instance if you put 2,
everything will be a multiple of 2*eps.rem - the remainder to add to the rounded value. For instance if you
put a remainder of 1 and a mod of, all values will be rounded
to 2 times eps + eps.public static final double minZ(Vertices vertices, long v0, long v1, long v2, double eps)
vertices - the vertices structure.v0 - the triangle first vertex.v1 - the triangle second vertex.v2 - the triangle third vertex. Order does not matter.eps - the rounding scale.public static final double maxZ(Vertices vertices, long v0, long v1, long v2, double eps)
vertices - the vertices structure.v0 - the triangle first vertex.v1 - the triangle second vertex.v2 - the triangle third vertex. Order does not matter.eps - the rounding scale.Copyright © 2016–2023 ImgLib2. All rights reserved.