3#include "MRVoxelsFwd.h"
19using VoxelPointPositioner = std::function<Vector3f(
const Vector3f&,
const Vector3f&,
float,
float,
float )>;
63 MR_BIND_PREFER_UNLOCK_GIL_WHEN_USED_AS_PARAM
119 std::unique_ptr<Impl> impl_;
Definition MRMarchingCubes.h:95
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
std::function< void()> freeVolume
this optional function is called when volume is no longer needed to deallocate it and reduce peak mem...
Definition MRMarchingCubes.h:60
Vector3f origin
origin point of voxels box in 3D space with output mesh
Definition MRMarchingCubes.h:24
MRVOXELS_API Expected< TriMesh > finalize()
finishes processing and outputs produced trimesh
MRVOXELS_API int layersPerBlock() const
the number of z-slices of the volume in the blocks
MRVOXELS_API MarchingCubesByParts(const Vector3i &dims, const MarchingCubesParams ¶ms, int layersPerBlock=0)
MRVOXELS_API Expected< void > addPart(const SimpleVolume &part)
adds one more part of volume into consideration, with first z=nextZ()
int maxVertices
if the mesh exceeds this number of vertices, an error returns
Definition MRMarchingCubes.h:44
tl::expected< T, E > Expected
Definition MRExpected.h:31
MRMESH_API double volume(const MeshTopology &topology, const VertCoords &points, const FaceBitSet *region=nullptr)
MRVOXELS_API ~MarchingCubesByParts()
MRVOXELS_API Expected< Mesh > marchingCubes(const SimpleVolume &volume, const MarchingCubesParams ¶ms={})
makes Mesh from SimpleVolume with given settings using Marching Cubes algorithm
MRVOXELS_API Expected< TriMesh > marchingCubesAsTriMesh(const SimpleVolume &volume, const MarchingCubesParams ¶ms={})
MRVOXELS_API MarchingCubesByParts & operator=(MarchingCubesByParts &&s) noexcept
enum MR::MarchingCubesParams::CachingMode cachingMode
CachingMode
Definition MRMarchingCubes.h:49
VoxelPointPositioner positioner
Definition MRMarchingCubes.h:41
MRVOXELS_API int nextZ() const
the last z-layer of the previous part and the first z-layer of the next part
ProgressCallback cb
progress callback
Definition MRMarchingCubes.h:27
MRVOXELS_API MarchingCubesByParts(MarchingCubesByParts &&s) noexcept
bool lessInside
should be false for dense volumes, and true for distance volume
Definition MRMarchingCubes.h:33
float iso
target iso-value of the surface to be extracted from volume
Definition MRMarchingCubes.h:30
std::function< Vector3f(const Vector3f &, const Vector3f &, float, float, float)> VoxelPointPositioner
Definition MRMarchingCubes.h:19
Vector< VoxelId, FaceId > * outVoxelPerFaceMap
optional output map FaceId->VoxelId
Definition MRMarchingCubes.h:36
@ None
don't cache any data
@ Normal
allocates 2 full slices per parallel thread
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMarchingCubes.h:22