Export VDB
Writes implicits and scalar volumes to one OpenVDB file, one grid each, for simulation tools that read VDB files. Each implicit is rasterised to a narrow-band level set, as Mesh From Implicit rasterises it before meshing.
How it works
The file holds one grid for each implicit and each scalar volume, implicits first. Each
implicit is rasterised to a narrow-band level set as
Mesh From Implicit rasterises it
before meshing: MinFeatureSize is the voxel size, BoundingBox the region, and Smoothing
the number of mean-curvature passes. Each scalar volume keeps its own voxel size and band.
Inputs
| Name | Nick | Type | Default | Description |
|---|---|---|---|---|
| Implicitoptional | I | Implicitlist | Implicits to write, one grid each, rasterised with MinFeatureSize, BoundingBox, Smoothing and Bandwidth. | |
| Scalar Volumeoptional | S | Scalar Volumelist | Scalar volumes to write, one grid each, with their own voxel size and band, after the grids of the implicits. | |
| Namesoptional | N | Textlist | Grid names, one for each implicit and volume, implicits first. If omitted, a single grid is named volume, and several grids volume_0, volume_1 and onwards. | |
| MinFeatureSize | MF | Number | 1 | Minimum feature size: the voxel size of the grid each implicit is rasterised to. Smaller resolves finer detail, at a higher cost and in a larger file. |
| BoundingBoxoptional | B | Box | Optional box that sets the region each implicit is rasterised over. If omitted, the region encloses the surface of each implicit. | |
| Smoothing | SM | Integer | 0 | Number of mean-curvature smoothing passes applied to each implicit before writing (0 = none). Higher values round the surface and soften sharp creases, with slight shrinkage; strength per pass scales with MinFeatureSize. |
| Bandwidth | BW | Number | 3 | Narrow-band half-width in voxels: how thick a shell of distance values wraps the surface. Raise it for large offsets, dilation, or heavy smoothing, which need band to grow into. Default 3. Applies to the implicits. Beyond the band the file holds plus or minus the band width, so raise it when the simulation reads distances further from the surface. |
| Scale | SC | Number | 1 | Factor applied to every length in the file: voxel positions and distance values. 0.001 writes a model drawn in millimetres in metres. |
| File Path | F | Text | Full path of the .vdb file to write. A file at this path is replaced. | |
| Write | W | Boolean | False | Writes the file when true. A Button writes the file once for each click; a Toggle set to true writes the file again whenever an input changes. |
Outputs
| Name | Nick | Type | Description |
|---|---|---|---|
| Names | N | Textlist | Names of the grids in the file, one for each implicit and volume, implicits first. Empty until the file is written. |
Tips
- A VDB file has no unit. Set
Scaleto 0.001 to write a model drawn in millimetres in metres, and read the file back with
Scalar Volume From File at a Scaleof 1000. - Within the band the file holds true distances, and beyond it plus or minus the band width. Raise
Bandwidthwhen the simulation reads distances further from the surface than three voxels. - Wire a Button into
Writeto write the file once for each click. A Toggle set to true writes the file again whenever an input changes, which rasterises every implicit again each time. - Give each grid a name in
Nameswhen the simulation looks its grids up by name.
Messages
What the component may report, shown as a balloon on the canvas.
| Level | Message |
|---|---|
| Error | An Implicit or Scalar Volume item is empty. Remove the empty items, so that each name matches its grid. |
| Warning | Connect an implicit or a scalar volume to write. |
| Error | Min feature size must be > 0. |
| Error | Scale must be a positive number. |
| Warning | The file name does not end in .vdb, the extension that programs reading VDB files expect. |
| Warning | Bounding Box input is null, invalid, or degenerate (linear/planar). Each implicit is rasterised over a region that encloses its surface. |
Written for Morphé 1.0 · Rhino 8
