18 [[nodiscard]]
bool addIfGoodApprox(
const Vector3f& q,
float betaSq,
float& addTo )
const
20 const auto dp =
pos - q;
21 const auto dd = dp.lengthSq();
22 if ( dd <= betaSq *
rr )
24 if (
const auto d = std::sqrt( dd ); d > 0 )
25 addTo += dot( dp,
dirArea ) / ( d * dd );
30static_assert(
sizeof(
Dipole ) == 8 *
sizeof(
float ) );
41 const Vector3f & q,
float beta, FaceId skipFace );
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRAABBTree.h:16
Definition MRCameraOrientationPlugin.h:8
MRMESH_API float calcFastWindingNumber(const Dipoles &dipoles, const AABBTree &tree, const Mesh &mesh, const Vector3f &q, float beta, FaceId skipFace)
MRMESH_API void calcDipoles(Dipoles &dipoles, const AABBTree &tree, const Mesh &mesh)
calculates dipoles for given mesh and AABB-tree
struct MRMESH_CLASS Dipole
Definition MRMesh/MRMeshFwd.h:385
float rr
Definition MRDipole.h:15
Vector3f dirArea
Definition MRDipole.h:14
bool addIfGoodApprox(const Vector3f &q, float betaSq, float &addTo) const
Definition MRDipole.h:18
float area
Definition MRDipole.h:13
Vector3f pos
Definition MRDipole.h:12
Definition MRMesh/MRMesh.h:23