From e07a1d63cb2a41510be4293789d75bc7199f67fe Mon Sep 17 00:00:00 2001 From: DarioS Date: Fri, 25 Nov 2022 09:40:34 +0100 Subject: [PATCH] DataWall : - in nesting migliorati controlli esistenza dati - in controllo spessori per inserimento in pannello si usa tolleranza di 0.1 (prima era 0.01) come in EgtBeamWall. --- BatchProcessNew.lua | 2 +- NestProcess.lua | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 91d95b0..598318c 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -358,7 +358,7 @@ if bToProcess then local vWallErr = {} for i = 2, #vWall do local dDimH = vWall[i].Box:getDimZ() - if abs( dDimH - dRawH) > 10 * GEO.EPS_SMALL then + if abs( dDimH - dRawH) > 100 * GEO.EPS_SMALL then table.insert( vWallErr, i) end end diff --git a/NestProcess.lua b/NestProcess.lua index 1c72937..d88443d 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -1,4 +1,4 @@ --- NestProcess.lua by Egaltech s.r.l. 2022/06/23 +-- NestProcess.lua by Egaltech s.r.l. 2022/11/24 -- Gestione nesting automatico pareti -- Intestazioni @@ -1574,33 +1574,33 @@ local function AddParts(RawParts, vPartsDoneManually) end nOutline, nCnt = EgtGetSurfTmSilhouette( SolidId, Z_AX(), 10, nOutlineLayer, GDB_RT.GLOB) EgtBeamShowSolid( nPartId, false) - - for nInd = 0, nCnt - 1 do + + for nInd = 0, nCnt - 1 do EgtSetName( nOutline + nInd, 'ON_TMP') EgtSetStatus( nOutline + nInd, 0) end - - local nCurrOutline = nOutline + + local nCurrOutline = nOutline if nCnt > 0 then local frSum EgtScale( nOutline, GLOB_FRM(), 1, 1, 0, GDB_RT.GLOB) EgtModifyCurveExtrusion( nOutline, Z_AX(), GDB_RT.GLOB) -- verifico che la prima curva sia l'unico loop esterno - local vCrvRef = EgtCurveArea( nOutline) - for nInd = 1, nCnt - 1 do - local vCrv = EgtCurveArea( nOutline + nInd) + local vtCrvRefN = EgtCurveArea( nOutline) + for nInd = 1, nCnt - 1 do + local vtCrvN = EgtCurveArea( nOutline + nInd) -- se trovo più loop esterni uso come contorno quello del box (quindi forzo nCurrOutline a nil) - if abs( vCrv * vCrvRef - 1) < GEO.EPS_SMALL then + if vtCrvN and vtCrvRefN and AreSameVectorApprox( vtCrvN, vtCrvRefN) then nCurrOutline = nil - for nInd2 = 0, nCnt - 1 do + for nInd2 = 0, nCnt - 1 do EgtErase( nOutline + nInd2) end - nCnt = 1 - break - end + nCnt = 1 + break + end end - + --local frSum = EgtSurfFlatRegion(nOutlineLayer, nOutline) --EgtSaveFile("c:\\Temp\\ProvaNesting.nge") -- -- per ogni contorno creo flat region e le sommo @@ -1626,7 +1626,7 @@ local function AddParts(RawParts, vPartsDoneManually) -- EgtErase(nOutline + nIndex) -- end end - + if nCurrOutline and nCurrOutline ~= GDB_ID.NULL then nOutline = nCurrOutline else @@ -1769,11 +1769,11 @@ local function AddParts(RawParts, vPartsDoneManually) end -- aggiungo finestre for nInd = 1, nCnt - 1 do - local tmp1, tmp2, area = EgtCurveArea( nOutline + nInd) - if area > WD.NEST_HOLE_MIN_AREA then + local _, _, dArea = EgtCurveArea( nOutline + nInd) + if dArea and dArea > WD.NEST_HOLE_MIN_AREA then EgtModifyCurveExtrusion( nOutline + nInd, Z_AX(), GDB_RT.GLOB) EgtAutoNestAddHoleToPart( nPartId, nOutline + nInd) - end + end end -- aggiungo aree di lavorazione del pezzo