26 Constraint(
const std::vector<int> &idI, Scalar weight);
29 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const = 0;
31 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const = 0;
33 Scalar
error(
const Matrix3X &positions)
const {
return 0; }
49 const Matrix3X &positions,
50 Scalar rangeMin = 1.0,
51 Scalar rangeMax = 1.0);
54 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
56 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
58 void setEdgeLength(Scalar length);
71 const Matrix3X &positions,
72 Scalar rangeMin = 1.0,
73 Scalar rangeMax = 1.0);
76 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
78 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
91 const Matrix3X &positions,
92 Scalar rangeMin = 1.0,
93 Scalar rangeMax = 1.0);
96 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
98 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
111 const Matrix3X &positions,
112 Scalar rangeMin = 1.0,
113 Scalar rangeMax = 1.0);
116 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
118 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
131 const Matrix3X &positions,
132 Scalar rangeMin = 1.0,
133 Scalar rangeMax = 1.0);
136 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
138 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
151 const Matrix3X &positions,
152 Scalar rangeMin = 1.0,
153 Scalar rangeMax = 1.0);
156 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
158 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
171 const Matrix3X &positions);
174 virtual void project(
const Matrix3X & , Matrix3X &projections)
const override final;
176 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
178 void setPosition(
const Vector3 &position);
189 const Matrix3X &positions);
192 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
194 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
196 mutable Matrix3X input;
205 const Matrix3X &positions);
208 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
210 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
212 mutable Matrix3X input;
221 const Matrix3X &positions);
224 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
226 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
228 mutable Matrix3X input;
237 const Matrix3X &positions);
240 virtual void project(
const Matrix3X &positions, Matrix3X &projections)
const override final;
242 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
244 mutable Matrix3X input;
252 const Matrix3X &positions,
253 bool displacement_lap);
256 virtual void project(
const Matrix3X & , Matrix3X &projections)
const override final;
258 virtual void addConstraint(std::vector<Triplet> &triplets,
int &idO)
const override final;
260 Vector3 weighted_rest_;
265 #ifdef SHAPEOP_HEADER_ONLY
266 #include "Constraint.cpp"
268 #endif // CONSTRAINT_H
270 Circle constraint. See for more details.
Definition: Constraint.h:216
Base class of any constraints. This class defines the interface of a ShapeOp constraint.
Definition: Constraint.h:23
Tetrahedron strain constraint. See for more details.
Definition: Constraint.h:86
Sphere constraint. See for more details.
Definition: Constraint.h:232
Triangle strain constraint. See for more details.
Definition: Constraint.h:66
std::vector< int > idI_
ids of the vertices involved in this constraint.
Definition: Constraint.h:36
Area constraint. See for more details.
Definition: Constraint.h:106
Plane constraint. See for more details.
Definition: Constraint.h:200
Scalar error(const Matrix3X &positions) const
Compute the constraint violation for the given input positions.
Definition: Constraint.h:33
int idO_
location of this constraint in the linear system.
Definition: Constraint.h:40
Definition: Constraint.h:166
Bending constraint. See for more details.
Definition: Constraint.h:146
Line constraint. See for more details.
Definition: Constraint.h:184
Scalar weight_
weight for the constraint.
Definition: Constraint.h:38
Volume constraint. See for more details.
Definition: Constraint.h:126
Edge strain constraint. See for more details.
Definition: Constraint.h:44