11 const double damping_factor)
13 , m_damping_factor(damping_factor)
21 if (!VertexLaplacianSmooth::operator()(mesh, simplex))
return false;
47 if (tang.squaredNorm() < 1e-10) {
51 accessor.vector_attribute(tup) = p +
m_damping_factor * tang * tang.transpose() * (g - p);
57 if (n.squaredNorm() < 1e-10) {
62 accessor.vector_attribute(tup) =
63 p +
m_damping_factor * (Eigen::Matrix3d::Identity() - n * n.transpose()) * (g - p);
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 bool is_valid(const Tuple &tuple) const
check validity of tuple including its hash
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)
attribute::MeshAttributeHandle m_attibute_handle
VertexTangentialLaplacianSmooth(attribute::MeshAttributeHandle &handle, double damping_factor=DEFAULT_DAMPING_FACTOR)
bool operator()(Mesh &m, const simplex::Simplex &s) override
const Tuple & tuple() const
Eigen::Vector3d compute_vertex_normal(const TriMesh &m, const attribute::Accessor< double > &pos, const Tuple &v)
compute the normalized vertex normal from the incident area weighted face normals
Vector< double, 3 > Vector3d