| Modifier and Type | Method and Description |
|---|---|
static RealInterval |
boundingBox(Mesh mesh) |
static void |
calculateNormals(Mesh src,
Mesh dest)
Calculates the normals for a mesh.
|
static RealPoint |
center(Mesh m)
Finds the center of a mesh using vertices.
|
static Iterable<BufferMesh> |
connectedComponents(Mesh mesh)
Returns an iterable over the connected components of the specified mesh.
|
static void |
copy(Mesh src,
Mesh dest)
Copies a mesh into another mesh.
|
static <T extends BooleanType<T>> |
marchingCubes(RandomAccessibleInterval<T> source)
Creates mesh e.g.
|
static <T extends RealType<T>> |
marchingCubes(RandomAccessibleInterval<T> source,
double isoLevel)
Creates mesh e.g.
|
static BufferMesh |
merge(Iterable<Mesh> meshes) |
static int |
nConnectedComponents(Mesh mesh)
Returns the number of connected components in the specified mesh.
|
static BufferMesh |
removeDuplicateVertices(Mesh mesh,
int precision)
Creates a new mesh from a given mesh without any duplicate vertices.
|
static void |
scale(Mesh mesh,
double[] scale)
Scales the vertices position by the amount specified by the array.
|
static Mesh |
simplify(Mesh mesh,
float target_percent,
float agressiveness)
Simplifies a given mesh.
|
static void |
translate(Mesh mesh,
double[] translate)
Translates the vertices position by the amount specified by the array.
|
static void |
translateScale(Mesh mesh,
double[] translate,
double[] scale)
Translates the vertices position by the amount specified by the array,
then scales the coordinates.
|
public static RealPoint center(Mesh m)
public static RealInterval boundingBox(Mesh mesh)
public static void copy(Mesh src, Mesh dest)
src - Source mesh, from which data will be copied.dest - Destination mesh, into which source will be copied.public static void calculateNormals(Mesh src, Mesh dest)
src - Source mesh, used for vertex and triangle infodest - Destination mesh, will be populated with src's info plus the
calculated normalspublic static Mesh simplify(Mesh mesh, float target_percent, float agressiveness)
mesh - Source meshtarget_percent - the amount in percent to attempt to achieve. For example:
0.25f would result in creating a mesh with 25% of triangles
contained in the original.agressiveness - sharpness to increase the threshold. 5..8 are good numbers.
more iterations yield higher quality. Minimum 4 and maximum 20
are recommended.public static BufferMesh removeDuplicateVertices(Mesh mesh, int precision)
mesh - Source meshprecision - decimal digits to take into account when comparing mesh
verticespublic static <T extends BooleanType<T>> Mesh marchingCubes(RandomAccessibleInterval<T> source)
source - The binary input image for the marching cubes algorithm.public static <T extends RealType<T>> Mesh marchingCubes(RandomAccessibleInterval<T> source, double isoLevel)
source - The input image for the marching cubes algorithm.isoLevel - The threshold to distinguish between foreground and background
values.public static int nConnectedComponents(Mesh mesh)
mesh - the mesh.public static Iterable<BufferMesh> connectedComponents(Mesh mesh)
mesh - the mesh.public static void scale(Mesh mesh, double[] scale)
Note that the position are simply multiplied by the specified scale, so they are scaled with respect to (0,0,0) which makes this method useful mainly to have a mesh generated by marching-cube algorithm have coordinates in physical units.
mesh - the mesh to scale.scale - a double array of at least 3 elements.public static void translate(Mesh mesh, double[] translate)
The positions are equal to
new_pos[d] = old_pos[d] + translate[d].
mesh - the mesh to translate.translate - a double array of at least 3 elements.public static void translateScale(Mesh mesh, double[] translate, double[] scale)
The positions are equal to
new_pos[d] = (old_pos[d] + translate[d]) * scale[d].
mesh - the mesh to translate.translate - a double array of at least 3 elements.scale - a double array of at least 3 elements.public static BufferMesh merge(Iterable<Mesh> meshes)
Copyright © 2016–2023 ImgLib2. All rights reserved.