File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/sofa/collisionAlgorithm/algorithm Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -235,11 +235,14 @@ class InsertionAlgorithm : public BaseAlgorithm
235235 Operations::CreateCenterProximity::Operation::get (itShaft->getTypeInfo ());
236236 const BaseProximity::SPtr shaftProx = createShaftProximity (itShaft->element ());
237237 const EdgeProximity::SPtr edgeProx = dynamic_pointer_cast<EdgeProximity>(shaftProx);
238- const type::Vec3 normal = (edgeProx->element ()->getP1 ()->getPosition () -
239- edgeProx->element ()->getP0 ()->getPosition ())
240- .normalized ();
241- if (dot (tip2Pt, normal) > 0_sreal) {
242- m_couplingPts.pop_back ();
238+ if (edgeProx)
239+ {
240+ const type::Vec3 normal = (edgeProx->element ()->getP1 ()->getPosition () -
241+ edgeProx->element ()->getP0 ()->getPosition ())
242+ .normalized ();
243+ if (dot (tip2Pt, normal) > 0_sreal) {
244+ m_couplingPts.pop_back ();
245+ }
243246 }
244247 }
245248 }
You can’t perform that action at this time.
0 commit comments