MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::Cuda::FastWindingNumber Class Reference

#include <MRCudaFastWindingNumber.h>

+ Inheritance diagram for MR::Cuda::FastWindingNumber:

Public Member Functions

MRCUDA_API FastWindingNumber (const Mesh &mesh)
 constructs this from AABB tree of given mesh;
 
MRCUDA_API Expected< void > calcFromVector (std::vector< float > &res, const std::vector< Vector3f > &points, float beta, FaceId skipFace, const ProgressCallback &cb) override
 calculates winding numbers in the points from given vector
 
MRCUDA_API Expected< void > calcSelfIntersections (FaceBitSet &res, float beta, const ProgressCallback &cb) override
 calculates winding numbers for all centers of mesh's triangles. if winding number is less than 0 or greater then 1, that face is marked as self-intersected
 
MRCUDA_API Expected< void > calcFromGrid (std::vector< float > &res, const Vector3i &dims, const AffineXf3f &gridToMeshXf, float beta, const ProgressCallback &cb) override
 calculates winding numbers in each point from a three-dimensional grid
 
MRCUDA_API Expected< void > calcFromGridWithDistances (std::vector< float > &res, const Vector3i &dims, const AffineXf3f &gridToMeshXf, const DistanceToMeshOptions &options, const ProgressCallback &cb) override
 calculates distances with the sign obtained from generalized winding number in each point from a three-dimensional grid; if sqr(res) < minDistSq or sqr(res) >= maxDistSq, then NaN is returned for such point
 
- Public Member Functions inherited from MR::IFastWindingNumber
virtual ~IFastWindingNumber ()=default
 

Detailed Description

the class for fast approximate computation of winding number for a mesh (using its AABB tree)

Constructor & Destructor Documentation

◆ FastWindingNumber()

MRCUDA_API MR::Cuda::FastWindingNumber::FastWindingNumber ( const Mesh & mesh)

constructs this from AABB tree of given mesh;

Member Function Documentation

◆ calcFromGrid()

MRCUDA_API Expected< void > MR::Cuda::FastWindingNumber::calcFromGrid ( std::vector< float > & res,
const Vector3i & dims,
const AffineXf3f & gridToMeshXf,
float beta,
const ProgressCallback & cb )
overridevirtual

calculates winding numbers in each point from a three-dimensional grid

Parameters
resresulting winding numbers, will be resized automatically
dimsdimensions of the grid
gridToMeshXftransform from integer grid locations to voxel's centers in mesh reference frame
betadetermines the precision of the approximation: the more the better, recommended value 2 or more

Implements MR::IFastWindingNumber.

◆ calcFromGridWithDistances()

MRCUDA_API Expected< void > MR::Cuda::FastWindingNumber::calcFromGridWithDistances ( std::vector< float > & res,
const Vector3i & dims,
const AffineXf3f & gridToMeshXf,
const DistanceToMeshOptions & options,
const ProgressCallback & cb )
overridevirtual

calculates distances with the sign obtained from generalized winding number in each point from a three-dimensional grid; if sqr(res) < minDistSq or sqr(res) >= maxDistSq, then NaN is returned for such point

Parameters
resresulting signed distances, will be resized automatically
dimsdimensions of the grid

Implements MR::IFastWindingNumber.

◆ calcFromVector()

MRCUDA_API Expected< void > MR::Cuda::FastWindingNumber::calcFromVector ( std::vector< float > & res,
const std::vector< Vector3f > & points,
float beta,
FaceId skipFace,
const ProgressCallback & cb )
overridevirtual

calculates winding numbers in the points from given vector

Parameters
resresulting winding numbers, will be resized automatically
pointsincoming points
betadetermines the precision of the approximation: the more the better, recommended value 2 or more
skipFacethis triangle (if it is close to q) will be skipped from summation

Implements MR::IFastWindingNumber.

◆ calcSelfIntersections()

MRCUDA_API Expected< void > MR::Cuda::FastWindingNumber::calcSelfIntersections ( FaceBitSet & res,
float beta,
const ProgressCallback & cb )
overridevirtual

calculates winding numbers for all centers of mesh's triangles. if winding number is less than 0 or greater then 1, that face is marked as self-intersected

Parameters
resresulting bit set
betadetermines the precision of the approximation: the more the better, recommended value 2 or more

Implements MR::IFastWindingNumber.


The documentation for this class was generated from the following file: