File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/sofa/collisionAlgorithm/operations Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,18 @@ namespace sofa::collisionAlgorithm::Operations::Needle
66bool prunePointsUsingEdges (std::vector<BaseProximity::SPtr>& couplingPts,
77 const EdgeElement::SPtr& edge)
88{
9+ if (!edge)
10+ {
11+ msg_warning (" Needle::PrunePointsAheadOfTip" )
12+ << " Null element pointer in prunePointsUsingEdges; returning false" ;
13+ return false ;
14+ }
915 const type::Vec3 edgeBase (edge->getP0 ()->getPosition ());
1016 const type::Vec3 tip (edge->getP1 ()->getPosition ());
1117
1218 const type::Vec3 edgeDirection = tip - edgeBase;
19+
20+ if (couplingPts.empty ()) return true ;
1321 const type::Vec3 tip2Pt = couplingPts.back ()->getPosition () - tip;
1422
1523 // Positive dot product means the point is ahead of the tip
You can’t perform that action at this time.
0 commit comments