MeshLib Documentation
Loading...
Searching...
No Matches
MRBoolean.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVoxelsFwd.h"
4
5#include "MRVDBConversions.h"
7#include "MRFloatGrid.h"
8
9namespace MR
10{
11
12// converter of meshes in or from signed distance volumetric representation
14{
15 // both in and from
16 float voxelSize = 0.001f;
17
18 // to voxels:
19 float surfaceOffset = 3; // number voxels around surface to calculate distance in (should be positive)
20
22
23 FloatGrid operator() ( const MeshPart & mp, const AffineXf3f& xf = {} ) const
24 { return meshToLevelSet( mp, xf, Vector3f::diagonal( voxelSize ), surfaceOffset, callBack); }
26
27 // from voxels:
28 float offsetVoxels = 0; // the value is in voxels (not in meters!), 0 for no-offset
29 float adaptivity = 0; // [0, 1] ratio of combining small triangles into bigger ones
30
31 MRVOXELS_API Mesh operator() ( const FloatGrid & grid ) const;
32};
33
34} //namespace MR
#define MRVOXELS_API
Definition MRVoxelsFwd.h:13
Definition MRObjectMesh.h:11
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRCameraOrientationPlugin.h:8
std::shared_ptr< OpenVdbFloatGrid > FloatGrid
Definition MRVoxelsFwd.h:25
MRVOXELS_API FloatGrid meshToLevelSet(const MeshPart &mp, const AffineXf3f &xf, const Vector3f &voxelSize, float surfaceOffset=3, ProgressCallback cb={})
Definition MRBoolean.h:14
ProgressCallback callBack
Definition MRBoolean.h:21
FloatGrid operator()(const MeshPart &mp, const AffineXf3f &xf={}) const
Definition MRBoolean.h:23
float surfaceOffset
Definition MRBoolean.h:19
float adaptivity
Definition MRBoolean.h:29
float offsetVoxels
Definition MRBoolean.h:28
float voxelSize
Definition MRBoolean.h:16
Definition MRMesh/MRMesh.h:23