From 5cde54467a1277b3da7c9dbebfc9705d00e45011 Mon Sep 17 00:00:00 2001 From: DarioS Date: Fri, 5 Aug 2022 07:25:45 +0200 Subject: [PATCH] EgtMachKernel : - in mortasatura sistemato calcolo affondamento quando inclinata rispetto al movimento - corretto calcolo spessore da associare a curva derivata da contorno superficie con TOOL_PAR_SLANT. --- Mortising.cpp | 5 +++++ Operation.cpp | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) 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 ;