From 02fe05d5e12dbb8c16978ecdb2140e222d894725 Mon Sep 17 00:00:00 2001 From: SaraP Date: Thu, 20 Apr 2023 12:03:45 +0200 Subject: [PATCH] 3dPrinting 2.5d4 : - corretto errore nel calcolo del lead out per setti. --- LuaLibs/CalcToolPath.lua | 29 +++++++++++++++++------------ Version.lua | 2 +- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/LuaLibs/CalcToolPath.lua b/LuaLibs/CalcToolPath.lua index 8e2ae21..4388577 100644 --- a/LuaLibs/CalcToolPath.lua +++ b/LuaLibs/CalcToolPath.lua @@ -770,26 +770,31 @@ local function VerifyRibsLead( nId, nRibId, dStrand, bInVsOut, nGrpTmp) -- recupero il lead in local nPrev = EgtGetPrev( nRibId) if nPrev and EgtGetName( nPrev) == LEAD_IN_CRV then - local nSrfTot = EgtSurfFrFatCurve( EgtGetParent( nLeadId), nPrev, 0.5 * dStrand, false) - if nSrfTot then - local nRes = EgtCurveWithRegionClassify( nLeadId, nSrfTot) - if nRes == GDB_CRC.IN or nRes == GDB_CRC.INTERS then - EgtErase( nSrfTot) - EgtErase( nLeadId) - return false - end - else - nSrfTot = EgtSurfFrFatCurve( EgtGetParent( nLeadId), nLeadId, 0.5 * dStrand, false) + -- il caso critico รจ quando hanno direzioni opposte + local vtSPrev = EgtSV( nPrev, GDB_ID.ROOT) + local vtSCurr = EgtSV( nLeadId, GDB_ID.ROOT) + if AreOppositeVectorApprox( vtSPrev, vtSCurr) then + local nSrfTot = EgtSurfFrFatCurve( EgtGetParent( nLeadId), nPrev, 0.5 * dStrand, false) if nSrfTot then - local nRes = EgtCurveWithRegionClassify( nPrev, nSrfTot) + local nRes = EgtCurveWithRegionClassify( nLeadId, nSrfTot) if nRes == GDB_CRC.IN or nRes == GDB_CRC.INTERS then EgtErase( nSrfTot) EgtErase( nLeadId) return false end + else + nSrfTot = EgtSurfFrFatCurve( EgtGetParent( nLeadId), nLeadId, 0.5 * dStrand, false) + if nSrfTot then + local nRes = EgtCurveWithRegionClassify( nPrev, nSrfTot) + if nRes == GDB_CRC.IN or nRes == GDB_CRC.INTERS then + EgtErase( nSrfTot) + EgtErase( nLeadId) + return false + end + end end + EgtErase( nSrfTot) end - EgtErase( nSrfTot) end end diff --git a/Version.lua b/Version.lua index 0cbaf3c..c031d25 100644 --- a/Version.lua +++ b/Version.lua @@ -1,4 +1,4 @@ -- Version.lua by Egaltech s.r.l. 2023/02/28 -- Gestione della versione di 3dPrinting -VERSION = '2.5d3' \ No newline at end of file +VERSION = '2.5d4' \ No newline at end of file