7#include "../concepts.h"
27 template <Prov
idesProjectionOperator ComputeObject>
29 const typename ComputeObject::VectorType& _pos)
const
31 return _f.project(_pos);
37 template <
typename ComputeObject>
38 PONCA_MULTIARCH
typename ComputeObject::VectorType
operator()(
39 const ComputeObject& _f,
const typename ComputeObject::VectorType& _pos)
const
66 template <Prov
idesImplicitPrimitive ComputeObject>
68 const typename ComputeObject::VectorType& _pos)
const
70 PONCA_MULTIARCH_STD_MATH(min)
71 using VectorType =
typename ComputeObject::VectorType;
72 using Scalar =
typename ComputeObject::Scalar;
75 VectorType dir = _f.primitiveGradient(_pos);
76 Scalar ilg = Scalar(1.) / dir.norm();
78 Scalar ad = _f.potential(_pos);
79 Scalar delta = -ad * min(ilg, Scalar(1.));
80 VectorType proj = _pos + dir * delta;
82 for (
unsigned int i = 0; i < nbIter; ++i)
84 grad = _f.primitiveGradient(proj);
85 ilg = Scalar(1.) / grad.norm();
86 delta = -_f.potential(proj) * min(ilg, Scalar(1.));
95 template <
typename ComputeObject>
96 PONCA_MULTIARCH
typename ComputeObject::VectorType
operator()(
97 const ComputeObject& f,
const typename ComputeObject::VectorType& pos)
const
This Source Code Form is subject to the terms of the Mozilla Public License, v.
ComputeObject is a virtual object that represents an algorithm which can be used with the compute fun...
Project a point using the primitive projection operator.
ComputeObject::VectorType operator()(const ComputeObject &_f, const typename ComputeObject::VectorType &_pos) const
Project a point using the primitive projection operator.
ComputeObject::VectorType project(const ComputeObject &_f, const typename ComputeObject::VectorType &_pos) const
Project a point using the primitive projection operator.
Project a point using the gradinet of the sdf.
ComputeObject::VectorType project(const ComputeObject &_f, const typename ComputeObject::VectorType &_pos) const
Project a point using the gradinet of the sdf.
ComputeObject::VectorType operator()(const ComputeObject &f, const typename ComputeObject::VectorType &pos) const
Project a point using the gradinet of the sdf.