17 double damping_factor)
19 , m_coordinate_handle(coordinate)
20 , m_damping_factor(damping_factor)
30 const auto old_pos = accessor.const_vector_attribute(simplex.
tuple()).cast<
double>();
35 for (
const auto& v : one_ring) {
36 new_pos = new_pos + accessor.const_vector_attribute(v).cast<
double>();
39 new_pos = new_pos / one_ring.size();
56 const Vector3d p0 = accessor.const_vector_attribute(v0).cast<
double>();
57 const Vector3d p1 = accessor.const_vector_attribute(v1).cast<
double>();
59 const Vector3d tang = (p1 - p0).normalized();
61 new_pos = old_pos +
m_damping_factor * tang * tang.transpose() * (new_pos - old_pos);
67 for (int64_t i = 0; i < one_ring.size(); ++i) {
68 const Vector3d p0 = accessor.const_vector_attribute(t).cast<
double>();
74 .const_vector_attribute(
78 Vector3d weighted_ni = (p0 - p2).cross(p1 - p2);
86 new_pos = old_pos +
m_damping_factor * (Eigen::Matrix3d::Identity() - n * n.transpose()) *
90 accessor.vector_attribute(simplex) =
Vector3r(
bool is_boundary(const simplex::Simplex &tuple) const
check if a simplex lies on a boundary or not
Tuple switch_tuples(const Tuple &tuple, const ContainerType &op_sequence) const
virtual Tuple switch_tuple(const Tuple &tuple, PrimitiveType type) const =0
switch the orientation of the Tuple of the given dimension
attribute::Accessor< T, Mesh, D > create_accessor(const attribute::MeshAttributeHandle &handle)
Handle that represents attributes for some mesh.
virtual std::vector< simplex::Simplex > execute(const simplex::Simplex &simplex) override
returns an empty vector in case of failure
const Mesh & mesh() const
std::vector< simplex::Simplex > execute(const simplex::Simplex &simplex) override
returns an empty vector in case of failure
const TypedAttributeHandle< Rational > & m_coordinate_handle
TetWildTangentialLaplacianSmoothing(Mesh &m, const TypedAttributeHandle< Rational > &coordinate, double damping_factor=1.0)
const std::vector< Simplex > & simplex_vector() const
Return const reference to the simplex vector.
const Tuple & tuple() const
SimplexCollection link(const Mesh &mesh, const simplex::Simplex &simplex, const bool sort_and_clean)
Vector< Rational, 3 > Vector3r
Vector< double, 3 > Vector3d