24 const Vector3f& voxelSize,
float surfaceOffset = 3,
31 const Vector3f& voxelSize,
float surfaceOffset = 3,
85 const Vector3i& minCoord,
const SimpleVolume& simpleVolume,
ProgressCallback cb = {}
91 const VdbVolume& vdbVolume,
const Box3i& activeBox = Box3i(),
ProgressCallback cb = {} );
98 const VdbVolume& vdbVolume,
const Box3i& activeBox = Box3i(), std::optional<MinMaxf> sourceScale = {},
ProgressCallback cb = {} );
105 const VdbVolume& vdbVolume,
const Box3i& activeBox = Box3i(), std::optional<MinMaxf> sourceScale = {},
ProgressCallback cb = {} );
138 std::shared_ptr<IFastWindingNumber>
fwn;
170 std::shared_ptr<IFastWindingNumber>
fwn;
#define MRVOXELS_API
see explanation in MRMesh/MRMeshFwd.h
Definition MRVoxelsFwd.h:14
wrapper class that helps mrbind to avoid excess MRVDBFloatGrid.h includes
Definition MRFloatGrid.h:21
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:790
AffineXf3f worldXf
Definition MRVDBConversions.h:45
Expected< SimpleVolumeMinMaxU16 > vdbVolumeToSimpleVolumeU16(const VdbVolume &vdbVolume, const Box3i &activeBox=Box3i(), std::optional< MinMaxf > sourceScale={}, ProgressCallback cb={})
bool relaxDisorientedTriangles
Definition MRVDBConversions.h:120
std::shared_ptr< IFastWindingNumber > fwn
defines particular implementation of IFastWindingNumber interface that will compute windings....
Definition MRVDBConversions.h:170
Expected< Mesh > gridToMesh(const FloatGrid &grid, const GridToMeshSettings &settings)
converts OpenVDB Grid into mesh using Dual Marching Cubes algorithm
AffineXf3f * outXf
mesh initial transform
Definition MRVDBConversions.h:46
float voxelSize
the size of voxel in intermediate voxel grid representation
Definition MRVDBConversions.h:158
float adaptivity
adaptivity - [0.0;1.0] ratio of combining small triangles into bigger ones (curvature can be lost on ...
Definition MRVDBConversions.h:115
ProgressCallback progress
to report algorithm's progress and to cancel it
Definition MRVDBConversions.h:148
void putSimpleVolumeInDenseGrid(FloatGrid &grid, const Vector3i &minCoord, const SimpleVolume &simpleVolume, ProgressCallback cb={})
Copy given simpleVolume into the grid, starting at minCoord Uses multithreaded copying,...
VdbVolume functionVolumeToVdbVolume(const FunctionVolume &functoinVolume, ProgressCallback cb={})
Type
Conversion type.
Definition MRVDBConversions.h:39
FloatGrid meshToLevelSet(const MeshPart &mp, const AffineXf3f &xf, const Vector3f &voxelSize, float surfaceOffset=3, ProgressCallback cb={})
Vector3f voxelSize
the number of voxels around surface to calculate distance in (should be positive)
Definition MRVDBConversions.h:44
float offsetB
the amount of second offset
Definition MRVDBConversions.h:164
Expected< void > makeSignedByWindingNumber(FloatGrid &grid, const Vector3f &voxelSize, const Mesh &refMesh, const MakeSignedByWindingNumberSettings &settings)
set signs for unsigned distance field grid using generalized winding number computed at voxel grid po...
int maxVertices
if the mesh exceeds this number of vertices, an error returns
Definition MRVDBConversions.h:119
VdbVolume floatGridToVdbVolume(FloatGrid grid)
fills VdbVolume data from FloatGrid (does not fill voxels size, cause we expect it outside)
Expected< SimpleVolumeMinMax > vdbVolumeToSimpleVolume(const VdbVolume &vdbVolume, const Box3i &activeBox=Box3i(), ProgressCallback cb={})
tl::expected< T, E > Expected
Definition MRExpected.h:31
float windingNumberThreshold
Definition MRVDBConversions.h:174
ProgressCallback progress
to report algorithm's progress and to cancel it
Definition MRVDBConversions.h:180
float windingNumberThreshold
Definition MRVDBConversions.h:142
enum MR::MeshToVolumeParams::Type Unsigned
VdbVolume simpleVolumeToVdbVolume(const SimpleVolumeMinMax &simpleVolume, ProgressCallback cb={})
set the simpleVolume.min as the background value
float surfaceOffset
Definition MRVDBConversions.h:43
std::shared_ptr< IFastWindingNumber > fwn
defines particular implementation of IFastWindingNumber interface that will compute windings....
Definition MRVDBConversions.h:138
void evalGridMinMax(const FloatGrid &grid, float &min, float &max)
eval min max value from FloatGrid
float windingNumberBeta
determines the precision of fast approximation: the more the better, minimum value is 1
Definition MRVDBConversions.h:145
int maxFaces
if the mesh exceeds this number of faces, an error returns
Definition MRVDBConversions.h:117
float adaptivity
in [0; 1] - ratio of combining small triangles into bigger ones (curvature can be lost on high values...
Definition MRVDBConversions.h:167
AffineXf3f meshToGridXf
defines the mapping from mesh reference from to grid reference frame
Definition MRVDBConversions.h:135
Expected< VdbVolume > meshToVolume(const MeshPart &mp, const MeshToVolumeParams ¶ms={})
float offsetA
the amount of first offset
Definition MRVDBConversions.h:161
Expected< SimpleVolumeMinMax > vdbVolumeToSimpleVolumeNorm(const VdbVolume &vdbVolume, const Box3i &activeBox=Box3i(), std::optional< MinMaxf > sourceScale={}, ProgressCallback cb={})
SimpleVolumeMinMax
Definition MRVoxelsFwd.h:35
ProgressCallback cb
to receive progress and request cancellation
Definition MRVDBConversions.h:122
Vector3f voxelSize
the size of each voxel in the grid
Definition MRVDBConversions.h:111
ProgressCallback cb
optional output: xf to original mesh (respecting worldXf)
Definition MRVDBConversions.h:47
FloatGrid meshToDistanceField(const MeshPart &mp, const AffineXf3f &xf, const Vector3f &voxelSize, float surfaceOffset=3, ProgressCallback cb={})
float isoValue
layer of grid with this value would be converted in mesh; isoValue can be negative only in level set ...
Definition MRVDBConversions.h:113
Expected< Mesh > doubleOffsetVdb(const MeshPart &mp, const DoubleOffsetSettings &settings)
float windingNumberBeta
determines the precision of fast approximation: the more the better, minimum value is 1
Definition MRVDBConversions.h:177
FunctionVolume
Definition MRVoxelsFwd.h:46
Expected< VdbVolume > meshToDistanceVdbVolume(const MeshPart &mp, const MeshToVolumeParams ¶ms={})
FloatGrid simpleVolumeToDenseGrid(const SimpleVolume &simpleVolume, float background=0.0f, ProgressCallback cb={})
@ Signed
Definition MRVDBConversions.h:40
@ Unsigned
only closed meshes can be converted with signed type
Definition MRVDBConversions.h:41
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRVDBConversions.h:156
parameters of OpenVDB Grid to Mesh conversion using Dual Marching Cubes algorithm
Definition MRVDBConversions.h:109
Definition MRVDBConversions.h:133
Parameters structure for meshToVolume function.
Definition MRVDBConversions.h:36