Package mgui.geometry.mesh
Class MeshDecimation
java.lang.Object
mgui.interfaces.Utility
mgui.geometry.mesh.MeshDecimation
public class MeshDecimation extends Utility
Utility class for specialized functions dealing with mesh decimation.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Constructor Summary
Constructors Constructor Description MeshDecimation()
-
Method Summary
Modifier and Type Method Description static void
decimateNeighbours(Mesh3D mesh)
Decimates by removing nodes one-by-one, skipping boundary nodes: 1.static void
decimateVTK(Mesh3D mesh, double featureAngle, double errorThreshold, int targetSize, boolean ensureTarget)
Decimates a mesh as decribed in:static void
tagBoundaryNodes(java.util.ArrayList<MguiBoolean> tagged, NeighbourhoodMesh n_mesh)
Tag all boundary nodes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
MeshDecimation
public MeshDecimation()
-
-
Method Details
-
decimateVTK
public static void decimateVTK(Mesh3D mesh, double featureAngle, double errorThreshold, int targetSize, boolean ensureTarget)Decimates a mesh as decribed in:Knapp, Mesh decimation using VTK, and..
Schroeder WJ, Zarge JA, Lorensen WE. (1992) Decimation of Triangle Meshes. Conference Proceedings of SIGGRAPH. pp. 65-70
As follows:
1. Represent mesh as an edge set
2. Classify edges as feature edges if their opposing faces have an angle > threshold
3. Classify vertices as:
- Simple: surrounded by a complete cycle of triangles
- Complex: like simple, but with one or more edges having multiple triangles
- Boundary: surrounded by semi-cycle of triangles
- Interior: Having exactly two feature edges
- Corner: Having more than two feature edges
4. Calculate and sort by error (mesh without this vertex compared to mesh with this vertex)
5. Eliminate vertices starting with those having the lowest error, until either the specified target number (of remaining vertices) is met, or until no more vertices are below the error threshold (unless ensureTarget == true, in which case vertices will continue to be removed until the target size is met)
- Parameters:
mesh
- Mesh to decimatefeatureAngle
- minimum angle above which edges are considered feature edgeserrorThreshold
- maximum error beyond which vertices will not be removed (unless ensureTarget == true)targetSize
- target number of verticesendureTarget
- ensure that the the mesh is decimated to targetSize
-
decimateNeighbours
Decimates by removing nodes one-by-one, skipping boundary nodes: 1. random list of nodes & tags 2. get neighbourhood mesh 3. for each node 4. if not tagged and not boundary node 5. remove from mesh 6. tag 7. tag all neighbours- Parameters:
mesh
- Mesh to decimate TODO: keep feature edges TODO: refine by comparing to original and iterating
-
tagBoundaryNodes
public static void tagBoundaryNodes(java.util.ArrayList<MguiBoolean> tagged, NeighbourhoodMesh n_mesh)Tag all boundary nodes.
-