From 4ed01598a5f63a92677d11d576f449d8747bf0fc Mon Sep 17 00:00:00 2001 From: Riccardo Elitropi Date: Mon, 18 Sep 2023 13:17:24 +0200 Subject: [PATCH] =?UTF-8?q?EgtMachKernel=20:=20-=20controllo=20validit?= =?UTF-8?q?=C3=A0=20superfici=20e=20coerenza=20con=20le=20normali.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pocketing.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Pocketing.cpp b/Pocketing.cpp index d776740..8365867 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -9148,7 +9148,7 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo, ICRVCOMPOPOVECTO PtrOwner pCrvNew( CreateCurveComposite()) ; if ( ! bInVsOut && AdjustPathOutsideRawForOpenEdges( pCompo_clone, vCrvIsl, pCompo, ptS, ptE, dRad, dDiam, - pCrvNew, vtTrasl, pStmRaw, bInVsOut)) { + pCrvNew, vtTrasl, pStmRaw, !bInVsOut)) { pCompo->Clear() ; pCompo->CopyFrom( pCrvNew) ; } @@ -10763,8 +10763,14 @@ Pocketing::SubtractFinalShape( ISurfFlatRegion* pSfrCurr, const Vector3d& vtTras if ( IsNull( pSfrCurr_c) || ! pSfrCurr_c->IsValid()) return false ; - if ( ! pSfrCurr_c->Subtract( *pSfrShape_c)) - return false ; + //m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSfrCurr_c->Clone()) ; + //m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSfrShape_c->Clone()) ; + if ( pSfrCurr_c ->IsValid() && pSfrShape_c->IsValid()) { + if ( AreOppositeVectorApprox( pSfrCurr_c->GetNormVersor(), pSfrShape_c->GetNormVersor())) + pSfrShape_c->Invert() ; + if ( ! pSfrCurr_c->Subtract( *pSfrShape_c)) + return false ; + } // ricalcolo le TmpProp SurfFlatRegionByContours sfrBC ;