iMSTK
Interactive Medical Simulation Toolkit
imstkThreadInsertionConstraint.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 #include "imstkRbdConstraint.h"
11 
12 using namespace imstk;
13 
20 {
21 public:
23  ~ThreadInsertionConstraint() override = default;
24 
25  void initConstraint(
26  const PbdState& bodies,
27  const PbdParticleId& ptA1,
28  const PbdParticleId& ptA2,
29  const Vec2d& threadBaryPoint,
30  const PbdParticleId& ptB1,
31  const PbdParticleId& ptB2,
32  const PbdParticleId& ptB3,
33  const Vec3d& triBaryPoint,
34  double stiffnessA,
35  double stiffnessB);
36 
37  bool computeValueAndGradient(PbdState& bodies,
38  double& c, std::vector<Vec3d>& dcdx) override;
39 
40 protected:
41  Vec2d m_threadBaryPt;
42  Vec3d m_triangleBaryPt;
43  Vec3d m_triInsertionPoint;
44  Vec3d m_threadInsertionPoint;
45 };
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.
Constrains an point on a line mesh to a PBD surface mesh.
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
Definition: imstkPbdBody.h:229