5#include "MRPch/MRBindingMacros.h"
53 assert( maxGuideDistSq > 0 );
54 const auto d = pos - guidePos;
55 float distSq =
sqr( d );
56 if ( distSq <= maxGuideDistSq )
58 return guidePos + std::sqrt( maxGuideDistSq / distSq ) * d;
constexpr auto sqr(T x) noexcept -> decltype(x *x)
squared value; the result type is the type of x*x, which is int for small integer types (char,...
Definition MRMeshFwd.h:800
RelaxApproxType
Definition MRRelaxParams.h:43
float force
speed of relaxing, typical values (0.0, 0.5]
Definition MRRelaxParams.h:23
V getLimitedPos(const V &pos, const V &guidePos, typename VectorTraits< V >::BaseType maxGuideDistSq)
Definition MRRelaxParams.h:51
const VertBitSet * region
region to relax
Definition MRRelaxParams.h:20
T BaseType
The base template handles scalars (or just non-vectors).
Definition MRVectorTraits.h:21
float maxInitialDist
maximum distance between a point and its position before relaxation, ignored if limitNearInitial = fa...
Definition MRRelaxParams.h:33
bool limitNearInitial
if true then maximal displacement of each point during denoising will be limited
Definition MRRelaxParams.h:30
int _padding
Definition MRRelaxParams.h:39
bool updateCaches
Definition MRRelaxParams.h:27
int iterations
number of iterations
Definition MRRelaxParams.h:17
@ Planar
Definition MRRelaxParams.h:44
@ Quadric
Definition MRRelaxParams.h:45
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRRelaxParams.h:15