Package com.jmex.subdivision

Class Summary
Subdivision An abstract class for subdivision of surfaces.
Implementing classes must implement prepare() and doSubdivide() and preferrably override computeNormals(TriMesh batch)

Usage of subclass SubdivisionButterfly:

TriMesh mesh = {some trimesh};
Subdivision subdivision = new SubdivisionButterfly(mesh.getBatch(0)); // prepare for subdivision
subdivision.subdivide(); // subdivide
subdivision.apply(); // Applies the new subdivided buffers to the batch
subdivision.computeNormals(); // calculate new normals


Or you can use it without giving it a batch:

Subdivision subdivision = new SubdivisionButterfly();
subdivision.setVertexBuffer(batch.getVertexBuffer());
subdivision.setIndexBuffer(batch.getIndexBuffer());
subdivision.addToBufferList(batch.getTextureBuffer(0), Subdivision.BufferType.TEXTUREBUFFER);
subdivision.addToBufferList(batch.getTextureBuffer(1), Subdivision.BufferType.TEXTUREBUFFER);
subdivision.addToBufferList(batch.getColorBuffer(), Subdivision.BufferType.COLORBUFFER);
subdivision.subdivide(); // subdivide
subdivision.apply(mesh.getBatch(0)); // Applies the new subdivided buffers to the batch
subdivision.computeNormals(mesh.getBatch(0)); // calculate new normals
SubdivisionButterfly Subdivison according to the Butterfly scheme introduced by Dyn, Gregory and Levin in ['A butterfly subdivision scheme for surface interpolation with tension control', ACM Transactions on graphics 9, 2 (1990), pp.
Vector Helper class for SubdivisionBatch to do vector math with any size on the vectors
 

Enum Summary
Subdivision.BufferType Buffer types.
SubdivisionButterfly.Location Whether the vertex is interior or lies on a boundary
SubdivisionButterfly.Rule Which rule to use when splitting a certain Edge
See Page 73-75 in SIGGRAPH 2000 Course Notes, Denis Zorin, et al.
SubdivisionButterfly.Valence Regular: Valence==6 for interior vertices, Valence==4 for boundary/crease vertices Extraordinary: Everything else
SubdivisionButterfly.VertexType Helper class to calculate which Rule to use when splitting an Edge whose vertices have Location and Valence Call: VertexType.getRule(valence1, location1, valence2, location2);