ShapeOp  0.1.0
Public Member Functions | List of all members
ShapeOp::BendingConstraint Class Reference

Bending constraint. Limits the bending between two neighboring triangles. See [2] for more details. More...

#include <Constraint.h>

Inheritance diagram for ShapeOp::BendingConstraint:
ShapeOp::Constraint

Public Member Functions

 BendingConstraint (const std::vector< int > &idI, Scalar weight, const Matrix3X &positions, Scalar rangeMin=1.0, Scalar rangeMax=1.0)
 Constraint constructor. The target bend is set to the bend between the triangles spanned by four vertices in the parameter positions. The parameters rangeMin and rangeMax can be used to specify a target range for the bend [rangeMin*target_bend,rangeMax*target_bend] The bending constraint applies to two neighboring triangles sharing an edge. More...
 
virtual void project (const Matrix3X &positions, Matrix3X &projections) const overridefinal
 Find the closest configuration from the input positions that satisfy the constraint.
 
virtual void addConstraint (std::vector< Triplet > &triplets, int &idO) const overridefinal
 Add the constraint to the linear system.
 
void setRangeMin (Scalar rMin)
 Set a new range minimum.
 
void setRangeMax (Scalar rMax)
 Set a new range maximum.
 
- Public Member Functions inherited from ShapeOp::Constraint
 Constraint (const std::vector< int > &idI, Scalar weight)
 Constraint constructor. More...
 
std::size_t nIndices () const
 Number of indices of vertices involved in the constraint.
 

Additional Inherited Members

- Static Public Member Functions inherited from ShapeOp::Constraint
static std::shared_ptr< ConstraintshapeConstraintFactory (const std::string &ConstraintType, const std::vector< int > &idI, Scalar weight, const Matrix3X &positions)
 Creates a constraint from a string type, a number of indices, a weight and the initial point positions. More...
 
- Protected Attributes inherited from ShapeOp::Constraint
std::vector< int > idI_
 ids of the vertices involved in this constraint.
 
Scalar weight_
 weight for the constraint.
 
int idO_
 location of this constraint in the linear system.
 

Detailed Description

Bending constraint. Limits the bending between two neighboring triangles. See [2] for more details.

Constructor & Destructor Documentation

SHAPEOP_INLINE ShapeOp::BendingConstraint::BendingConstraint ( const std::vector< int > &  idI,
Scalar  weight,
const Matrix3X positions,
Scalar  rangeMin = 1.0,
Scalar  rangeMax = 1.0 
)

Constraint constructor. The target bend is set to the bend between the triangles spanned by four vertices in the parameter positions. The parameters rangeMin and rangeMax can be used to specify a target range for the bend [rangeMin*target_bend,rangeMax*target_bend] The bending constraint applies to two neighboring triangles sharing an edge.

Parameters
idIare four indices of the vertices of the two triangles ordered as follows:
  |        id2        |
  |       /   \       |
  |     id0---id1     |
  |       \   /       |
  |        id3        |
 
idIare four indices of the vertices of the tetrahedron
weightThe weight of the constraint to be added relative to the other constraints.
positionsThe positions of all the n vertices stacked in a 3 by n matrix.
rangeMinThe factor to determine the minimal bend: rangeMin*target_bend.
rangeMaxThe factor to determine the maximal bend: rangeMax*target_bend.

The documentation for this class was generated from the following files: