iMSTK
Interactive Medical Simulation Toolkit
imstkSurfaceInsertionConstraint.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 using namespace imstk;
12 
19 {
20 public:
22  ~SurfaceInsertionConstraint() override = default;
23 
24  void initConstraint(
25  const Vec3d& insertionPoint,
26  const PbdParticleId& ptN,
27  const PbdParticleId& ptB1,
28  const PbdParticleId& ptB2,
29  const PbdParticleId& ptB3,
30  const Vec3d& contactPt,
31  const Vec3d& barycentricPt,
32  double stiffnessA,
33  double stiffnessB);
34 
35  bool computeValueAndGradient(PbdState& bodies,
36  double& c, std::vector<Vec3d>& dcdx) override;
37 
38 private:
39  Vec3d m_insertionPoint;
40  Vec3d m_barycentricPt;
41  Vec3d m_contactPt;
42 };
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 a barycentric point on a surface mesh to a rigid body arc needle.
Provides interface for accessing particles from a 2d array of PbdBody,Particles.
Definition: imstkPbdBody.h:229