diff --git a/Pocketing.cpp b/Pocketing.cpp index 653a203..0d6caa2 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -4540,7 +4540,7 @@ Pocketing::ComputeTrapezoidSpiralLeadInLeadOut( ICurveComposite* pCompo, const V double dDistMin ; Vector3d vtNormMin ; if ( CalcDistanceFromRawSurface( m_nPhase, ptP, vtNorm, dDistMin, vtNormMin)) { - if ( abs( dDistMin) < abs( dDist)) { + if ( abs( dDistMin) < abs( dDist) && abs( dDistMin) > EPS_SMALL) { dDistRef = dDistMin ; dCorr = dDist / dDistMin ; }