diff --git a/Pocketing.cpp b/Pocketing.cpp index 71dbe09..eab7d75 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -7812,8 +7812,7 @@ Pocketing::ComputeTrapezoidSpiralLeadInLeadOut( ICurveComposite* pCompo, const V double dDistRef = dDist ; double dDistMin ; Vector3d vtNormMin ; - //if ( CalcDistanceFromRawSurface( m_nPhase, ptP, vtNorm, dDistMin, vtNormMin)) { - if ( GetSignedDistFromStmRaw( m_nPhase, ptP, vtDir, dDistMin, vtNorm)) { + if ( abs( vtTool * vtNorm) < 0.5 && GetSignedDistFromStmRaw( m_nPhase, ptP, vtDir, dDistMin, vtNorm)) { if ( abs( dDistMin) < abs( dDist) && abs( dDistMin) > EPS_SMALL) { dDistRef = dDistMin ; dCorr = dDist / dDistMin ;