45 Mesh& mesh,
const AffineXf3f& meshXf,
46 const VdbVolume& volume,
const AffineXf3f& volumeXf,
55template <
typename MeshType>
117 for (
auto it =
begin; it !=
end; ++it )
122 template <
size_t degree>
126 for (
size_t i = 0; i < values.size(); ++i )
136 const VdbVolume& volume_;
140 AffineXf3f xf_, xfInv_;
#define MRVOXELS_API
Definition MRVoxelsFwd.h:13
accumulates a number of (x,y) points to find the best-least-squares parabola approximating them
Definition MRBestFitParabola.h:12
Parabola< T > getBestParabola(T tol=std::numeric_limits< T >::epsilon()) const
computes the best approximating parabola from the accumulated points;
Definition MRBestFitParabola.h:45
void addPoint(T x, T y)
accumulates one more point for parabola fitting
Definition MRBestFitParabola.h:29
Definition MRBestFitPolynomial.h:95
MRMESH_API void addPoint(T x, T y)
MRMESH_API Polynomial< T, degree > getBestPolynomial() const
Definition MRMoveMeshToVoxelMaxDeriv.h:57
MRVOXELS_API AffineXf3f xf() const
MRVOXELS_API void getPoints(std::vector< Vector3f > &result, const Vector3f &pos, const Vector3f &offset) const
static Parabolaf getBestParabola(auto begin, auto end)
Definition MRMoveMeshToVoxelMaxDeriv.h:113
MRVOXELS_API Vector3f point(VertId v) const
MRVOXELS_API int numVerts() const
static MRVOXELS_API PolynomialWrapperf getBestPolynomial(const std::vector< float > &values, size_t degree)
MRVOXELS_API float getValue(const Vector3f &pos) const
MRVOXELS_API MeshType & mesh() const
MRVOXELS_API const VdbVolume & volume() const
MRVOXELS_API void getValues(std::vector< float > &result, const Vector3f &pos, const Vector3f &offset) const
MRVOXELS_API Vector3f getOffsetVector(VertId v) const
MRVOXELS_API Vector3f xfInv(const Vector3f &pt) const
MRVOXELS_API float voxelSize() const
static MRVOXELS_API float indexFromPseudoIndex(float pseudoIndex, int count)
static MRVOXELS_API float pseudoIndex(float index, int count)
MRVOXELS_API MeshOnVoxelsT(MeshType &mesh, const AffineXf3f &meshXf, const VdbVolume &volume, const AffineXf3f &volumeXf)
MRVOXELS_API Vector3f xf(const Vector3f &pt) const
MRVOXELS_API MeshOnVoxelsT(const MeshOnVoxelsT &other)
static MRVOXELS_API float pseudoIndex(int index, int count)
static MRVOXELS_API void getDerivatives(std::vector< float > &result, const std::vector< float > &values)
static Polynomialf< degree > getBestPolynomial(const std::vector< float > &values)
Definition MRMoveMeshToVoxelMaxDeriv.h:123
MRVOXELS_API AffineXf3f xfInv() const
helper class for generalized voxel volume data access
Definition MRVoxelsVolumeAccess.h:14
Definition MRVolumeInterpolation.h:18
auto begin(const BitSet &a)
Definition MRMesh/MRBitSet.h:280
auto end(const BitSet &)
Definition MRMesh/MRBitSet.h:282
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRCameraOrientationPlugin.h:8
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
tl::expected< T, E > Expected
Definition MRExpected.h:58
MRVOXELS_API Expected< VertBitSet > moveMeshToVoxelMaxDeriv(Mesh &mesh, const AffineXf3f &meshXf, const VdbVolume &volume, const AffineXf3f &volumeXf, const MoveMeshToVoxelMaxDerivSettings &settings, ProgressCallback callback={})
Definition MRMesh/MRMesh.h:23
Definition MRMoveMeshToVoxelMaxDeriv.h:17
float intermediateSmoothForce
force of the smoothing (relaxation) of vector field of shifts on each iteration
Definition MRMoveMeshToVoxelMaxDeriv.h:34
float preparationSmoothForce
force of initial smoothing of vertices, before applying the algorithm
Definition MRMoveMeshToVoxelMaxDeriv.h:37
float outlierThreshold
Definition MRMoveMeshToVoxelMaxDeriv.h:31
int iters
number of iterations. Each iteration moves vertex only slightly and smooths the vector field of shift...
Definition MRMoveMeshToVoxelMaxDeriv.h:19
int samplePoints
Definition MRMoveMeshToVoxelMaxDeriv.h:23
int degree
degree of the polynomial used to fit sampled points. Must be in range [3; 6]
Definition MRMoveMeshToVoxelMaxDeriv.h:26
This is a unifying interface for a polynomial of some degree, known only in runtime.
Definition MRBestFitPolynomial.h:74
Definition MRBestFitPolynomial.h:32