Skip to content

Commit 2b56205

Browse files
committed
[algorithm] Added a final check for coupling points removal
1 parent 68e2a6c commit 2b56205

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/sofa/collisionAlgorithm/algorithm/InsertionAlgorithm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ class InsertionAlgorithm : public BaseAlgorithm
296296
shaftProx->normalize();
297297
insertionOutput.add(shaftProx, m_couplingPts[i]);
298298
}
299+
// This is a final-frontier check: If there are coupling points stored, but the
300+
// findClosestProxOnShaf operation yields no proximities on the shaft, it could be
301+
// because the needle has exited abruptly. Thus, we clear the coupling points.
302+
if (insertionOutput.size() == 0)
303+
m_couplingPts.clear();
299304
}
300305

301306
d_collisionOutput.endEdit();

0 commit comments

Comments
 (0)