Package toxi.volume
Class HashIsoSurface
java.lang.Object
toxi.volume.HashIsoSurface
- All Implemented Interfaces:
IsoSurface
HashMap based implementation of the IsoSurface interface. More memory
efficient than
ArrayIsoSurface
and so better suited for very
high-resolution volumes.-
Field Summary
-
Constructor Summary
ConstructorDescriptionHashIsoSurface
(VolumetricSpace volume) Creates a new instance using the expected default vertex density of 50%.HashIsoSurface
(VolumetricSpace volume, float density) Creates a new instance using the given expected vertex density. -
Method Summary
Modifier and TypeMethodDescriptioncomputeSurfaceMesh
(Mesh3D mesh, float iso) Computes the surface mesh for the given iso value.void
reset()
Resets mesh vertices to default positions and clears face index.void
setExpectedDensity
(float density)
-
Field Details
-
isoValue
public float isoValue
-
-
Constructor Details
-
HashIsoSurface
Creates a new instance using the expected default vertex density of 50%.- Parameters:
volume
-- See Also:
-
HashIsoSurface
Creates a new instance using the given expected vertex density.- Parameters:
volume
-- See Also:
-
-
Method Details
-
computeSurfaceMesh
Description copied from interface:IsoSurface
Computes the surface mesh for the given iso value. An existing mesh container can be reused (will be cleared) or created automatically (if null). In the latter case a simpleTriangleMesh
instance is created.- Specified by:
computeSurfaceMesh
in interfaceIsoSurface
- Parameters:
mesh
- existing mesh container or nulliso
- surface iso value- Returns:
- Mesh3D instance
-
reset
public void reset()Resets mesh vertices to default positions and clears face index. Needs to be called inbetween successive calls tocomputeSurfaceMesh(Mesh3D, float)
.- Specified by:
reset
in interfaceIsoSurface
-
setExpectedDensity
public void setExpectedDensity(float density)
-