diff --git a/Mortising.cpp b/Mortising.cpp index 73b5f37..b43bfd2 100644 --- a/Mortising.cpp +++ b/Mortising.cpp @@ -1267,6 +1267,11 @@ Mortising::ProcessPath( int nPathId, int nPvId, int nClId) dDepth -= dThick ; // sottraggo eventuale offset longitudinale dDepth -= GetOffsL() ; + // sottraggo eventuale ingombro di larghezza se inclinato rispetto al movimento + Vector3d vtTg ; pCompo->GetMidDir( vtTg) ; + double dSinAng = max( ( vtTg ^ vtExtr).Len(), sin( 30 * DEGTORAD)) ; + double dCosAng = min( ( vtTg * vtExtr), cos( 30 * DEGTORAD)) ; + dDepth -= m_TParams.m_dDiam / 2 * dCosAng / dSinAng ; // recupero nome del path string sPathName ; diff --git a/Operation.cpp b/Operation.cpp index 8d58916..88e7820 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -876,8 +876,16 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF frExtr.Set( ORIG, vtExtr) ; frExtr.Invert() ; BBox3d b3Extr ; pCopy->GetBBox( frExtr, b3Extr) ; - if ( ! b3Extr.IsEmpty()) - pCrvCompo->SetThickness( b3Extr.GetMax().z - b3Extr.GetMin().z) ; + if ( ! b3Extr.IsEmpty()) { + double dThick = b3Extr.GetMax().z - b3Extr.GetMin().z ; + Point3d ptStart, ptEnd ; + if ( nToolDir == TOOL_PAR_SLANT && pCrvCompo->IsALine( LIN_TOL_STD, ptStart, ptEnd)) { + BBox3d b3Crv ; pCrvCompo->GetBBox( frExtr, b3Crv) ; + if ( ! b3Crv.IsEmpty()) + dThick -= b3Crv.GetMax().z - b3Crv.GetMin().z ; + } + pCrvCompo->SetThickness( dThick) ; + } } } return true ;