ShapeOp
0.1.0
|
Closeness constraint. Constrains a vertex to a position in space. Projects onto a given rest position. More...
#include <Constraint.h>
Public Member Functions | |
ClosenessConstraint (const std::vector< int > &idI, Scalar weight, const Matrix3X &positions) | |
Constraint constructor. The target is the position of vertex idI in the initial positions given in the constructor. More... | |
virtual void | project (const Matrix3X &, 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 | setPosition (const Vector3 &position) |
Set a new closeness position. | |
Vector3 | getPosition () const |
Get the closeness position. | |
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< Constraint > | shapeConstraintFactory (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. | |
Closeness constraint. Constrains a vertex to a position in space. Projects onto a given rest position.
SHAPEOP_INLINE ShapeOp::ClosenessConstraint::ClosenessConstraint | ( | const std::vector< int > & | idI, |
Scalar | weight, | ||
const Matrix3X & | positions | ||
) |
Constraint constructor. The target is the position of vertex idI in the initial positions given in the constructor.
idI | contains the one index of the vertex that wants to be close to a given target. |
weight | The weight of the constraint to be added relative to the other constraints. |
positions | The positions of all the n vertices stacked in a 3 by n matrix. |