VolumeToolsInterface Class Reference

#include <volumetools.h>

Detailed Description

VolumeToolsInterface provides methods to process volumes.

Static Public Member Functions

static MAXON_METHOD Result< BaseArray< String > > GetGridNamesFromFile (const Url &filename)
 
static MAXON_METHOD Result< DataDictionary > GetMetaDataFromFile (const Url &filename)
 
static MAXON_METHOD Result< BaseArray< Volume > > LoadVDBFile (const Url &filename, Float scale, BaseArray< String > *gridNames=nullptr, const BaseArray< Int > *gridIndices=nullptr, DataDictionary *metaData=nullptr)
 
static MAXON_METHOD Result< void > LoadGridIntoVolume (const Url &filename, Float scale, Int gridIndex, Volume &volume, DataDictionary *metaData=nullptr)
 
static MAXON_METHOD Result< void > LoadAllGridsIntoVolumes (const Url &filename, Float scale, maxon::BaseArray< Volume > &volume, DataDictionary *metaData=nullptr)
 
static MAXON_METHOD Result< void > SaveVDBFile (const Url &filename, Float scale, BaseArray< Volume > &volumes, const DataDictionary &metaData=DataDictionary())
 
static MAXON_METHOD Result< Volume > BoolVolumes (const Volume &volumeOne, const Volume &volumeTwo, BOOLTYPE type)
 
static MAXON_METHOD Result< Volume > MixVolumes (const Volume &volumeOne, const Volume &volumeTwo, MIXTYPE type)
 
static MAXON_METHOD Result< PolygonObject * > VolumeToMesh (const Volume &volume, Float iso, Float adaptiveValue)
 
static MAXON_METHOD Result< Volume > MeshToVolume (const Block< Vector > &vertices, const Block< VolumeConversionPolygon > &polygons, Matrix polygonObjectMatrix, Float gridSize, Int32 bandWidthInterior, Int32 bandWidthExterior, const ThreadRef &checkForCancellation, POLYGONCONVERSIONFLAGS conversionSettings=POLYGONCONVERSIONFLAGS::NONE, const Matrix *creationTransform=nullptr)
 
static MAXON_METHOD Result< Volume > GeometryObjectToVolume (const Geometry &geometry, Matrix polygonObjectMatrix, Float gridSize, Int32 bandWidthInterior, Int32 bandWidthExterior, const ThreadRef &checkForCancellation, POLYGONCONVERSIONFLAGS conversionSettings=POLYGONCONVERSIONFLAGS::NONE, const Matrix *creationTransform=nullptr)
 
static MAXON_METHOD Result< Volume > PointsToVolume (const DelegatePointObjectsPairList &pointObjects, Float gridSize, Int32 bandWidth, const ThreadRef &checkForCancellation, const Matrix *creationTransform=nullptr, Float velocityScale=0.0)
 
static MAXON_METHOD Result< Volume > ApplySDFFilterToVolume (const Volume &volume, const SDFFilterSettings &filterType, const ThreadRef &checkForCancellation, const Volume *maskVolume=nullptr, FieldSampleData *maskField=nullptr)
 
static MAXON_METHOD Result< Volume > ApplyFilterToVolume (const Volume &volume, const FilterSettings &filterType, const ThreadRef &checkForCancellation, const Volume *maskVolume=nullptr, FieldSampleData *maskField=nullptr)
 
static MAXON_METHOD Result< Volume > ConvertFieldsToVolume (FieldSampleData &fieldData, Float gridSize, const Range< Vector > &sampleBox, const ThreadRef &checkForCancellation, const Volume *volumeReference=nullptr, const Matrix *creationTransform=nullptr)
 
static MAXON_METHOD Result< Volume > ConvertSDFToFog (const Volume &volume, Float cutoff=LIMIT< Float >::MAX)
 
static MAXON_METHOD Result< Volume > ConvertFogToSDF (const Volume &volume, Float iso, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > ResampleVolume (const Volume &volume, const Matrix &resampleTransform, const RESAMPLEINTERPOLATIONTYPE interpolationType, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > CreateMaskFromField (FieldSampleData &fieldData, const Volume &volumeReference, Float background, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > CreateNewFloat32Volume (Float32 background)
 
static MAXON_METHOD Result< Volume > CreateGradientVolume (const Volume &volume, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > CreateSphereVolume (Float radius, const Vector &position, Float gridSize, Int32 bandWidth, const ThreadRef &checkForCancellation, const Matrix *creationTransform=nullptr)
 
static MAXON_METHOD Result< Volume > CreatePlatonicVolume (Int32 sides, Float size, const Vector &position, Float gridSize, Int32 bandWidth, const ThreadRef &checkForCancellation, const Matrix *creationTransform=nullptr)
 
static MAXON_METHOD Result< Volume > CreateNewVector32Volume (Vector32 background)
 
static MAXON_METHOD Result< Volume > MixVectorVolumes (const Volume &volumeOne, const Volume &volumeTwo, MIXVECTORTYPE type)
 
static MAXON_METHOD Result< Volume > ConvertFieldsToVectorVolume (FieldSampleData &fieldData, Float gridSize, const Range< Vector > &sampleBox, const ThreadRef &checkForCancellation, const Volume *volumeReference=nullptr, const Matrix *creationTransform=nullptr)
 
static MAXON_METHOD Result< Volume > NormalizeVectorVolume (const Volume &volume, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > CreateCurlVolume (const Volume &volume, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > CreateMeanCurvatureVolume (const Volume &volume, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > RotateVectorVolume (const Volume &volume, const Vector &rotationAxis, const Float angle, const ThreadRef &checkForCancellation, FieldSampleData *maskField=nullptr)
 
static MAXON_METHOD Result< Volume > ConvertVectorToFog (const Volume &volume, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > BlendVolumes (const Volume &volumeA, const Volume &volumeB, const Float blendValue, const ThreadRef &checkForCancellation)
 
static MAXON_METHOD Result< Volume > SmoothBoolVolumes (const Volume &volumeOne, const Volume &volumeTwo, BOOLTYPE type, Float radius)
 
static MAXON_METHOD Result< Array< Vector > > ScatterPointsInVolume (const Volume &volume, UInt64 pointCount, Float spread, Int seed)
 
static MAXON_METHOD Result< BaseArray< UInt32 > > GetNanoVDBCopy (const Volume &volume, NANOVDBPRECISION precision=NANOVDBPRECISION::FP16)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (VolumeToolsInterface, MAXON_REFERENCE_STATIC, "net.maxon.volume.interface.volumetools")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( VolumeToolsInterface  ,
MAXON_REFERENCE_STATIC  ,
"net.maxon.volume.interface.volumetools"   
)
private

◆ GetGridNamesFromFile()

static MAXON_METHOD Result<BaseArray<String> > GetGridNamesFromFile ( const Url filename)
static

Read and return the gridnames from a .vdb file.

Parameters
[in]filenameThe url of the file.
Returns
A list of strings that represent the grid names in the .vdb file.

◆ GetMetaDataFromFile()

static MAXON_METHOD Result<DataDictionary> GetMetaDataFromFile ( const Url filename)
static

Read and return the metadata from a .vdb file.

Parameters
[in]filenameThe url of the file.
Returns
A data dictionary with metadata stored under string keys.

◆ LoadVDBFile()

static MAXON_METHOD Result<BaseArray<Volume> > LoadVDBFile ( const Url filename,
Float  scale,
BaseArray< String > *  gridNames = nullptr,
const BaseArray< Int > *  gridIndices = nullptr,
DataDictionary *  metaData = nullptr 
)
static

Loads volumes from a .vdb file.

Parameters
[in]filenameThe url of the file to load from.
[in]scaleA scale factor for loading the grids.
[out]gridNamesIf a BaseArray is passed, it will be filled with the grid names.
[in]gridIndicesOptional list of indices that should be loaded from the file.
[out]metaDataIf passed, will be filled with the metadata from the file.
Returns
A list of volumes that were loaded from the .vdb file.

◆ LoadGridIntoVolume()

static MAXON_METHOD Result<void> LoadGridIntoVolume ( const Url filename,
Float  scale,
Int  gridIndex,
Volume &  volume,
DataDictionary *  metaData = nullptr 
)
static

Loads a grid into a volume from a .vdb file.

Parameters
[in]filenameThe url of the file to load from.
[in]scaleA scale factor for loading the grids.
[in]gridIndexThe index of the grid in the .vdb file.
[out]volumeThe volume reference to load the grid into.
[out]metaDataIf passed, will be filled with the metadata from the file.
Returns
OK on success.

◆ LoadAllGridsIntoVolumes()

static MAXON_METHOD Result<void> LoadAllGridsIntoVolumes ( const Url filename,
Float  scale,
maxon::BaseArray< Volume > &  volume,
DataDictionary *  metaData = nullptr 
)
static

Loads all grids into a list of volumes from a .vdb file.

Parameters
[in]filenameThe url of the file to load from.
[in]scaleA scale factor for loading the grids.
[out]volumeThe output list of loaded volumes.
[out]metaDataIf passed, will be filled with the metadata from the file.
Returns
OK on success.

◆ SaveVDBFile()

static MAXON_METHOD Result<void> SaveVDBFile ( const Url filename,
Float  scale,
BaseArray< Volume > &  volumes,
const DataDictionary &  metaData = DataDictionary() 
)
static

Saves volumes to a .vdb file.

Parameters
[in]filenameThe url of the file to save to.
[in]scaleA scale factor for saving the grids.
[in]volumesA list of volumes that should be saved to the .vdb file.
[in]metaDataOptional Metadata to write to the file. Have to be added under string keys to the data dictionary.
Returns
OK on success.

◆ BoolVolumes()

static MAXON_METHOD Result<Volume> BoolVolumes ( const Volume &  volumeOne,
const Volume &  volumeTwo,
BOOLTYPE  type 
)
static

Bools two SDF volumes into one with a given bool type of BOOLTYPE.

Parameters
[in]volumeOneThe first SDF volume for the boolean operation.
[in]volumeTwoThe second SDF volume for the boolean operation.
[in]typeThe bool type BOOLTYPE.
Returns
The booled volume.

◆ MixVolumes()

static MAXON_METHOD Result<Volume> MixVolumes ( const Volume &  volumeOne,
const Volume &  volumeTwo,
MIXTYPE  type 
)
static

Mix two volumes into one with a given mix type of MIXTYPE.

Parameters
[in]volumeOneThe first volume for the mix operation.
[in]volumeTwoThe second volume for the mix operation.
[in]typeThe mix type MIXTYPE.
Returns
The mixed volume.

◆ VolumeToMesh()

static MAXON_METHOD Result<PolygonObject*> VolumeToMesh ( const Volume &  volume,
Float  iso,
Float  adaptiveValue 
)
static

Extracts a polygon object iso surface from a volume. This is done by a marching cube algorithm.

Parameters
[in]volumeThe volume to extract a surface from.
[in]isoThe iso value at which a surface should be extracted.
[in]adaptiveValueAn adaptive value between 0.0 and 1.0 that reduces the polygon count based on curvature.
Returns
The extracted polygon object.

◆ MeshToVolume()

static MAXON_METHOD Result<Volume> MeshToVolume ( const Block< Vector > &  vertices,
const Block< VolumeConversionPolygon > &  polygons,
Matrix  polygonObjectMatrix,
Float  gridSize,
Int32  bandWidthInterior,
Int32  bandWidthExterior,
const ThreadRef checkForCancellation,
POLYGONCONVERSIONFLAGS  conversionSettings = POLYGONCONVERSIONFLAGS::NONE,
const Matrix creationTransform = nullptr 
)
static

Converts a polygon object to a SDF volume.

Parameters
[in]verticesThe vertex positions of the polygon object.
[in]polygonsThe polygon information. This needs to be a list of ::VolumeConversionPolygon
[in]polygonObjectMatrixThe global position, scale and rotation matrix of the polygon object.
[in]gridSizeThe desired gridsize of the created volume.
[in]bandWidthInteriorThe amount of exterior voxels that distance information is calculated for.
[in]bandWidthExteriorThe amount of interior voxels that distance information is calculated for.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]conversionSettingsOptional settings for the conversion to Volume POLYGONCONVERSIONFLAGS.
[in]creationTransformAn optional override to the target grid matrix. If this is used the gridSize is ignored.
Returns
The converted SDF volume representing the input polygon object.

◆ GeometryObjectToVolume()

static MAXON_METHOD Result<Volume> GeometryObjectToVolume ( const Geometry &  geometry,
Matrix  polygonObjectMatrix,
Float  gridSize,
Int32  bandWidthInterior,
Int32  bandWidthExterior,
const ThreadRef checkForCancellation,
POLYGONCONVERSIONFLAGS  conversionSettings = POLYGONCONVERSIONFLAGS::NONE,
const Matrix creationTransform = nullptr 
)
static

Converts a GeometryObject to a SDF volume.

See also
MeshToVolume, same thing, just converts from new GeometryObject type.
Parameters
[in]geometryThe geometry object wrapper.
[in]polygonObjectMatrixThe global position, scale and rotation matrix of the polygon object.
[in]gridSizeThe desired gridsize of the created volume.
[in]bandWidthInteriorThe amount of exterior voxels that distance information is calculated for.
[in]bandWidthExteriorThe amount of interior voxels that distance information is calculated for.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]conversionSettingsOptional settings for the conversion to Volume POLYGONCONVERSIONFLAGS.
[in]creationTransformAn optional override to the target grid matrix. If this is used the gridSize is ignored.
Returns
The converted SDF volume representing the input polygon object.

◆ PointsToVolume()

static MAXON_METHOD Result<Volume> PointsToVolume ( const DelegatePointObjectsPairList pointObjects,
Float  gridSize,
Int32  bandWidth,
const ThreadRef checkForCancellation,
const Matrix creationTransform = nullptr,
Float  velocityScale = 0.0 
)
static

Converts points in space to a SDF volume. This can be used to convert particles, vertices, spline sampling points or other points to a volume.

// maxon scope is assumed
// the polygon object to convert its vertices from
PolygonObject* somePolyObject = ...;
auto addVertices = [&](void* object, PointsToVolumeListRef& pointsList) -> Result<void>
{
if (!object)
return IllegalArgumentError(CREATE);
PolygonObject* polyObj = (PolygonObject*)object;
const Vector* points = polyObj->GetPointR();
Matrix objectPosition = polyObj->GetMg();
for (Int32 pointIndex = 0; pointIndex < pointCount; pointIndex++)
{
// add the points to the particlelist, the radius is captured by reference
pointsList.AppendPoint(objectPosition * points[pointIndex], radius) iferr_return;
}
return OK;
};
// create a delegate/object pair
// set the delegate to the pair
polySampling.first = addVertices;
// add the one polygon object to the list of converted objects. This can be multiple objects processed by the delegate
polySampling.second.Resize(1) iferr_return;
polySampling.second[0] = polygonObject;
// add the pair to the list for the conversion
pointObjects.Append(polySampling) iferr_return;
// call the conversion
Volume newVolume = VolumeToolsInterface::PointsToVolume(pointObjects, gridSize, bandWidth, checkForCancellation, gridMatrix) iferr_return;
}
PyObject * object
Definition: asdl.h:7
Matrix GetMg() const
Definition: c4d_baseobject.h:510
const Vector * GetPointR() const
Definition: c4d_baseobject.h:1599
Definition: c4d_baseobject.h:1784
static MAXON_METHOD Result< Volume > PointsToVolume(const DelegatePointObjectsPairList &pointObjects, Float gridSize, Int32 bandWidth, const ThreadRef &checkForCancellation, const Matrix *creationTransform=nullptr, Float velocityScale=0.0)
maxon::Int32 Int32
Definition: ge_sys_math.h:56
return OK
Definition: apibase.h:2735
BaseArray< DelegatePointObjectsPair > DelegatePointObjectsPairList
Definition: volumetools.h:185
Pair< Delegate< Result< void >(void *, PointsToVolumeListRef &)>, BaseArray< void * > > DelegatePointObjectsPair
Definition: volumetools.h:184
#define iferr_scope
Definition: resultbase.h:1389
#define iferr_return
Definition: resultbase.h:1524
Parameters
[in]pointObjectsA list of Delegate/Object pairs that specify how to get point positions from the object.
[in]gridSizeThe desired gridsize of the created volume.
[in]bandWidthThe amount of voxels around the creates spheres that distance information is calculated for.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]creationTransformAn optional override to the target grid matrix. If this is used the gridSize is ignored.
[in]velocityScaleA velocity scale that the volumes will be extended to if they have a direction set.
Returns
The converted SDF volume representing the input polygon object.

◆ ApplySDFFilterToVolume()

static MAXON_METHOD Result<Volume> ApplySDFFilterToVolume ( const Volume &  volume,
const SDFFilterSettings filterType,
const ThreadRef checkForCancellation,
const Volume *  maskVolume = nullptr,
FieldSampleData maskField = nullptr 
)
static

Applies a filter operation to a SDF volume. This work only on SDF volumes.

Parameters
[in]volumeThe volume that should be filtered.
[in]filterTypeSettings for the filter operation. See ::SDFFilterSettings.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]maskVolumeAn optional volume object to be used as mask.
[in]maskFieldAn optional field data struct to be used as field mask.
Returns
A new filtered version of the input volume.

◆ ApplyFilterToVolume()

static MAXON_METHOD Result<Volume> ApplyFilterToVolume ( const Volume &  volume,
const FilterSettings filterType,
const ThreadRef checkForCancellation,
const Volume *  maskVolume = nullptr,
FieldSampleData maskField = nullptr 
)
static

Applies a filter operation to a volume.

Parameters
[in]volumeThe volume that should be filtered.
[in]filterTypeSettings for the filter operation. See ::FilterSettings.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]maskVolumeAn optional volume object to be used as mask.
[in]maskFieldAn optional field data struct to be used as field mask.
Returns
A new filtered version of the input volume.

◆ ConvertFieldsToVolume()

static MAXON_METHOD Result<Volume> ConvertFieldsToVolume ( FieldSampleData fieldData,
Float  gridSize,
const Range< Vector > &  sampleBox,
const ThreadRef checkForCancellation,
const Volume *  volumeReference = nullptr,
const Matrix creationTransform = nullptr 
)
static

Convert a field list or a field object into a volume. This can either be done in a box that samples the grid fully or with a volume reference. In case of a volume the active voxels of the volume will be sampled and the result will have the same structure as the reference volume. Note that FieldSampleData can have information for a field list or a field object. If FieldSampleData's fieldOwner is a field object, fieldList can be nullptr.

Parameters
[in]fieldDataA data struct about the fieldlist data.
[in]gridSizeThe voxel size of the resulting volume.
[in]sampleBoxA bounding box.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]volumeReferenceAn optional volume object that will define the sampling positions by it's active voxels. If this is used the voxelSize and sampleBox are ignored.
[in]creationTransformAn optional override to the target grid matrix. If this is used the gridSize is ignored.
Returns
A volume that contains the values of the field in the active voxels.

◆ ConvertSDFToFog()

static MAXON_METHOD Result<Volume> ConvertSDFToFog ( const Volume &  volume,
Float  cutoff = LIMITFloat >::MAX 
)
static

Convert a SDF Volume to a fog volume. The interiour of the SDF object will be filled with data ranging from 0.0 to 1.0 with a falloff.

Parameters
[in]volumeThe SDF volume that should be converted.
[in]cutoffThe distance for the falloff from 0.0 (SDF 0.0 value) to 1.0.
Returns
A fog volume.

◆ ConvertFogToSDF()

static MAXON_METHOD Result<Volume> ConvertFogToSDF ( const Volume &  volume,
Float  iso,
const ThreadRef checkForCancellation 
)
static

Convert a fog Volume to a SDF volume. The resulting surface of the SDF volume is defined by the passed iso value.

Parameters
[in]volumeThe fog volume that should be converted.
[in]isoThe iso value at which the surface should be created.
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
A SDF volume.

◆ ResampleVolume()

static MAXON_METHOD Result<Volume> ResampleVolume ( const Volume &  volume,
const Matrix resampleTransform,
const RESAMPLEINTERPOLATIONTYPE  interpolationType,
const ThreadRef checkForCancellation 
)
static

Resample a volume into a new transformation matrix.

Parameters
[in]volumeThe volume that should be resampled.
[in]resampleTransformThe transformation matrix in which the volume should be resampled into.
[in]interpolationTypeThe resample interpolation type. See RESAMPLEINTERPOLATIONTYPE.
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
The created resampled volume.

◆ CreateMaskFromField()

static MAXON_METHOD Result<Volume> CreateMaskFromField ( FieldSampleData fieldData,
const Volume &  volumeReference,
Float  background,
const ThreadRef checkForCancellation 
)
static

Creates a volume mask for a volume reference with values sampled from a field.

Parameters
[in]fieldDataA data struct about the fieldlist data.
[in]volumeReferenceThe reference volume that samples the field into the mask.
[in]backgroundThe background of the mask. This will become the maskvalue in areas that have no active voxel in the volumeReference.
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
The created mask volume.

◆ CreateNewFloat32Volume()

static MAXON_METHOD Result<Volume> CreateNewFloat32Volume ( Float32  background)
static

Creates a new float volume with default transform. The gridtype will be GRIDCLASS::UNKNOWN.

Parameters
[in]backgroundThe background value for the volume.
Returns
The newly created volume.

◆ CreateGradientVolume()

static MAXON_METHOD Result<Volume> CreateGradientVolume ( const Volume &  volume,
const ThreadRef checkForCancellation 
)
static

Creates a gradient volume from a numeric volume.

Parameters
[in]volumeThe numeric volume.
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
The newly created gradient volume.

◆ CreateSphereVolume()

static MAXON_METHOD Result<Volume> CreateSphereVolume ( Float  radius,
const Vector position,
Float  gridSize,
Int32  bandWidth,
const ThreadRef checkForCancellation,
const Matrix creationTransform = nullptr 
)
static

Creates a SDF volume of a spherical shape.

Parameters
[in]radiusThe radius of the created sphere.
[in]positionThe position of the sphere.
[in]gridSizeThe desired gridsize of the created volume.
[in]bandWidthThe amount of interior and exterior voxels that distance information is calculated for. Should be greater than 1.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]creationTransformAn optional override to the target grid matrix. If this is used the gridSize is ignored.
Returns
The created SDF volume representing the input sphere settings.

◆ CreatePlatonicVolume()

static MAXON_METHOD Result<Volume> CreatePlatonicVolume ( Int32  sides,
Float  size,
const Vector position,
Float  gridSize,
Int32  bandWidth,
const ThreadRef checkForCancellation,
const Matrix creationTransform = nullptr 
)
static

Creates a SDF volume of a platonic shape. If invalid Arguments are set the function returns an empty volume

Parameters
[in]sidesThe number of sides of the platonic. Define the valid Arguments in the description of the parameter
[in]sizeThe size of the created platonic.
[in]positionThe position of the platonic.
[in]gridSizeThe desired gridsize of the created volume.
[in]bandWidthThe amount of interior and exterior voxels that distance information is calculated for. Should be greater than 1.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]creationTransformAn optional override to the target grid matrix. If this is used the gridSize is ignored.
Returns
The created SDF volume representing the input platonic settings.

◆ CreateNewVector32Volume()

static MAXON_METHOD Result<Volume> CreateNewVector32Volume ( Vector32  background)
static

Creates a new float vector volume with default transform. The gridtype will be GRIDCLASS::UNKNOWN.

Parameters
[in]backgroundThe background vector value for the volume.
Returns
The newly created volume.

◆ MixVectorVolumes()

static MAXON_METHOD Result<Volume> MixVectorVolumes ( const Volume &  volumeOne,
const Volume &  volumeTwo,
MIXVECTORTYPE  type 
)
static

Mix two vector volumes into one with a given mix type of MIXVECTORTYPE.

Parameters
[in]volumeOneThe first vector volume for the mix operation.
[in]volumeTwoThe second vector volume for the mix operation.
[in]typeThe mix type MIXVECTORTYPE.
Returns
The mixed vector volume.

◆ ConvertFieldsToVectorVolume()

static MAXON_METHOD Result<Volume> ConvertFieldsToVectorVolume ( FieldSampleData fieldData,
Float  gridSize,
const Range< Vector > &  sampleBox,
const ThreadRef checkForCancellation,
const Volume *  volumeReference = nullptr,
const Matrix creationTransform = nullptr 
)
static

Convert a field lists directional channel or a field object into a vector volume. This can either be done in a box that samples the grid fully or with a volume reference. In case of a volume the active voxels of the volume will be sampled and the result will have the same structure as the reference volume. Note that FieldSampleData can have information for a field list or a field object. If FieldSampleData's fieldOwner is a field object, fieldList can be nullptr.

Parameters
[in]fieldDataA data struct about the fieldlist data.
[in]gridSizeThe voxel size of the resulting volume.
[in]sampleBoxA bounding box.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]volumeReferenceAn optional volume object that will define the sampling positions by it's active voxels. If this is used the voxelSize and sampleBox are ignored.
[in]creationTransformAn optional override to the target grid matrix. If this is used the gridSize is ignored.
Returns
A vector volume that contains the directions of the field in the active voxels.

◆ NormalizeVectorVolume()

static MAXON_METHOD Result<Volume> NormalizeVectorVolume ( const Volume &  volume,
const ThreadRef checkForCancellation 
)
static

Creates a normalized vector volume from an input vector volume.

Parameters
[in]volumeThe vector volume that should be normalized.
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
The newly created normalized vector volume.

◆ CreateCurlVolume()

static MAXON_METHOD Result<Volume> CreateCurlVolume ( const Volume &  volume,
const ThreadRef checkForCancellation 
)
static

Creates a vector volume representing the curl of a vector volume.

Parameters
[in]volumeThe vector volume the curl should be calculated from.
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
The newly created curl vector volume.

◆ CreateMeanCurvatureVolume()

static MAXON_METHOD Result<Volume> CreateMeanCurvatureVolume ( const Volume &  volume,
const ThreadRef checkForCancellation 
)
static

Creates a curvature volume from a numeric volume.

Parameters
[in]volumeThe numeric volume.
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
The newly created curvature volume.

◆ RotateVectorVolume()

static MAXON_METHOD Result<Volume> RotateVectorVolume ( const Volume &  volume,
const Vector rotationAxis,
const Float  angle,
const ThreadRef checkForCancellation,
FieldSampleData maskField = nullptr 
)
static

Rotate the vectors of a vector volume by a specified angle around a rotation axis.

Parameters
[in]volumeThe vector volume to rotate.
[in]rotationAxisThe rotation axis to rotate around.
[in]angleThe angle in radians to rotate.
[in]checkForCancellationA thread reference that cancellation is tested against.
[in]maskFieldAn optional field data struct to be used as field mask.
Returns
The newly created curvature volume.

◆ ConvertVectorToFog()

static MAXON_METHOD Result<Volume> ConvertVectorToFog ( const Volume &  volume,
const ThreadRef checkForCancellation 
)
static

Convert a vector volume to a fog volume. The resulting volume will have the length of the vectors stored at the original voxel position.

Parameters
[in]volumeThe fog volume that should be converted.
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
A fog volume with the length of the vectors stored.

◆ BlendVolumes()

static MAXON_METHOD Result<Volume> BlendVolumes ( const Volume &  volumeA,
const Volume &  volumeB,
const Float  blendValue,
const ThreadRef checkForCancellation 
)
static

Does a linear blend operation of two volume grids. Both grids need to have the same type and this type needs to be blendable.

Parameters
[in]volumeAThe first volume of the blend operation.
[in]volumeBThe second volume of the blend operation.
[in]blendValueThe linear blend value between A and B. 1.0 results in A, 0.0 in B
[in]checkForCancellationA thread reference that cancellation is tested against.
Returns
A Volume that is the blend between Volume A and Volume B.

◆ SmoothBoolVolumes()

static MAXON_METHOD Result<Volume> SmoothBoolVolumes ( const Volume &  volumeOne,
const Volume &  volumeTwo,
BOOLTYPE  type,
Float  radius 
)
static

Smooth Bools two SDF volumes into one with a given bool type of BOOLTYPE.

Parameters
[in]volumeOneThe first SDF volume for the boolean operation.
[in]volumeTwoThe second SDF volume for the boolean operation.
[in]typeThe bool type BOOLTYPE.
[in]radiusThe radius of the smoothing area around the overlapping parts.
Returns
The booled volume.

◆ ScatterPointsInVolume()

static MAXON_METHOD Result<Array<Vector> > ScatterPointsInVolume ( const Volume &  volume,
UInt64  pointCount,
Float  spread,
Int  seed 
)
static

Scatters points inside of Fog volume

Parameters
[in]volumeThe fog volume to scatter points in
[in]pointCountThe number of points to scatter
[in]spreadThe spread of the scattered points
Returns
The array of scattered points

◆ GetNanoVDBCopy()

static MAXON_METHOD Result<BaseArray<UInt32> > GetNanoVDBCopy ( const Volume &  volume,
NANOVDBPRECISION  precision = NANOVDBPRECISION::FP16 
)
static

Converts the internal data to the nanovdb format and returns it in nanoVDBData. If the underyling GRIDTYPE is FLOAT or DOUBLE - returns a converted volume of type nanovdb::Fp16 by default.
If the underyling GRIDTYPE is VECTOR32 or VECTOR64 - returns a converted volume of type nanovdb::Vec3<float> by default. Note that if the GRIDTYPE is VECTOR32 the resulting velocity vector has to be mirrored along the xy plane (.z *= -1.0f).

Parameters
[in]precisionThe precision returned - only FLOAT available for vector grids.
Returns
The output BaseArray of binary data.