From 1d9b741d8dbb53f122e37bb4add77caa8de1a4a7 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 15 Mar 2022 15:21:58 +0100 Subject: [PATCH] DataWall : - modifiche per poter forzare nesting con riferimento standard ('BL') - correzione calcoli per nesting. --- LuaLibs/WallExec.lua | 3 ++- NestProcess.lua | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index 3bca12f..ba7b8cc 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -1,4 +1,4 @@ --- WallExec.lua by Egaltech s.r.l. 2021/11/07 +-- WallExec.lua by Egaltech s.r.l. 2022/03/15 -- Libreria esecuzione lavorazioni per Pareti -- Tabella per definizione modulo @@ -15,6 +15,7 @@ _G.package.loaded.PocketingData = nil _G.package.loaded.DrillData = nil _G.package.loaded.SawingData = nil local WD = require( 'WallData') +if WALL and WALL.NESTINGCORNERBL then WD.NESTING_CORNER = 'BL' end -- Carico le librerie _G.package.loaded.WMachiningLib = nil diff --git a/NestProcess.lua b/NestProcess.lua index f943409..992f491 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -1079,7 +1079,8 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet if not bOptimal then bManual = true end elseif ResLapJoints.Nbr == 4 then - nAngle = 100 + nAngle, nRotate2 = RotateOptimalCase( nPartId, 0, 90, RawPart, 100, 100) + nRotate = nRotate + nRotate2 end end @@ -1104,14 +1105,15 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet local PartAngleClassification = { PartId = tostring( nPartId), Angle = nAngle, nRotate = nRotate, bDrill = bDrill, bLongDrill = bLongDrill, bManual = bManual} local bCanBeOnOtherEdge = not bDrill or ( bDrill and RawPart.Width >= WD.MINRAWY_HOR_DRILL) - if bCanBeOnOtherEdge or bOnly180Rot then - EgtSetInfo( nPartId, "NestAllowRot", 1) - EgtSetInfo( nPartId, "NestStepRot", 180) - else - EgtSetInfo( nPartId, "NestAllowRot", 0) - EgtSetInfo( nPartId, "NestStepRot", 0) - end - + if bOnly180Rot then + if bCanBeOnOtherEdge then + EgtSetInfo( nPartId, "NestAllowRot", 1) + EgtSetInfo( nPartId, "NestStepRot", 180) + else + EgtSetInfo( nPartId, "NestAllowRot", 0) + EgtSetInfo( nPartId, "NestStepRot", 0) + end + end -- verifico se il pezzo cade (caso di foro) b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD) @@ -1356,7 +1358,7 @@ end -- Funzione che sposta e aggiunge pezzi per nesting local function AddRawParts(RawParts, vDoneManually) - + local OUTLINE = "Outline" for nIndex = 1, #RawParts do RawParts[nIndex].PartId = {} @@ -1441,8 +1443,8 @@ local function AddParts(RawParts, vPartsDoneManually) else -- posiziono con il nesting solo quelli mancanti nCount = nCount - nManuallyDone - end - + end + nPartIndex = nPartIndex + 1 -- calcolo bbox pezzo per rotazioni @@ -1774,7 +1776,7 @@ local function AddParts(RawParts, vPartsDoneManually) -- punto di riferimento sul pezzo local ptRef - local dval = 10 + local dval = 10 if ( WD.ORIG_CORNER == 'TL' or WD.ORIG_CORNER == 'TR') then ptRef = Point3d( b3Part:getMax():getX() - b3Part:getDimX() / 2, b3Part:getMax():getY() - dval, 0) else