iMSTK
Interactive Medical Simulation Toolkit
imstkPbdPointTriangleConstraint.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkPbdCollisionConstraint.h"
10 
11 namespace imstk
12 {
20 {
21 public:
23  ~PbdPointTriangleConstraint() override = default;
24 
25  IMSTK_TYPE_NAME(PbdTriangleConstraint)
26 
27 public:
37  void initConstraint(const PbdParticleId& ptA,
38  const PbdParticleId& ptB1, const PbdParticleId& ptB2, const PbdParticleId& ptB3,
39  double stiffnessA, double stiffnessB);
40 
47  bool computeValueAndGradient(PbdState& bodies,
48  double& c, std::vector<Vec3d>& dcdx) override;
49 };
50 } // namespace imstk
The PbdPointTriangleConstraint moves a point to a triangle, and the triangle to the point...
The PbdCollisionConstraint implements two sided collision. This allows the usage of differing stiffne...
std::pair< int, int > PbdParticleId
Index pair that refers to a particle in a PbdState. Index 0 is the body id, Index 1 is the particle i...
Compound Geometry.
void initConstraint(const PbdParticleId &ptA, const PbdParticleId &ptB1, const PbdParticleId &ptB2, const PbdParticleId &ptB3, double stiffnessA, double stiffnessB)
Initialize the constraint.
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
Definition: imstkPbdBody.h:229
bool computeValueAndGradient(PbdState &bodies, double &c, std::vector< Vec3d > &dcdx) override
Compute value and gradient of constraint function.