From 708307d3459c25d82b235803744547744b99565c Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Thu, 19 Oct 2023 09:30:33 +0200 Subject: [PATCH] - eliminate modifiche per pezzi grandi --- Main.lua | 2 +- NestingLib.lua | 39 +-------------------------------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/Main.lua b/Main.lua index bcd2e96..06cffce 100644 --- a/Main.lua +++ b/Main.lua @@ -19,7 +19,7 @@ package.cpath = package.cpath .. ";/EgtDevTest/LUAREST/32/?.lua" require( 'EgtBase') _ENV = EgtProtectGlobal() -EgtEnableDebug( true) +EgtEnableDebug( false) -- Imposto direttorio libreria specializzata per Nesting local sBaseDir = EgtGetSourceDir() diff --git a/NestingLib.lua b/NestingLib.lua index 520b716..f58ce0c 100644 --- a/NestingLib.lua +++ b/NestingLib.lua @@ -537,12 +537,8 @@ local SKELETONPART = "SKELETON" local CUTOPT = "CUTOPT" -- funzione legge il dxf ed aggiunge il pezzo al nesting local function AddPartListToNesting(PartList, ErrorList, Material) - local BigPartsQty = 0 local LastId = GDB_ID.ROOT for Part = 1, #PartList do - if PartList[Part].PartExtCode == '128057' then - local f = 3 - end -- tipo di rotazione del pezzo consentita : 0 -> rotazione libera, 1 -> rotazione solo di 180°, 2 -> nessuna rotazione local RotationType = 0 -- verifico se gia' presente per importazione precedente @@ -714,10 +710,6 @@ local function AddPartListToNesting(PartList, ErrorList, Material) RotationType = 1 end EgtSetName(nMaxId, OUTLINE) - -- verifico se e' grande quasi come il foglio - if OutlineBox:getDimX() > Material.L_mm - 51 or OutlineBox:getDimY() > Material.W_mm - 26 then - BigPartsQty = BigPartsQty + 1 - end -- copio outline in un layer dedicato local OutlineLayer = EgtGroup(PartId1) EgtSetName(OutlineLayer, OUTLINE) @@ -894,8 +886,6 @@ local function AddPartListToNesting(PartList, ErrorList, Material) end EgtAutoNestAddToolOutlineToPart( PartId1, nSkeletonRegionId) end - --EgtSaveFile("c:\\Temp\\TestSauderBig.nge") - return BigPartsQty end -- @@ -1060,8 +1050,7 @@ function NestingLib.NestPartInRawPart(LastRaw, PartList, Material, ErrorList, Is EgtResetCurrMachGroup() -- aggiungo tutti i pezzi al nesting - local BigPartsQty = 0 - BigPartsQty = AddPartListToNesting(PartList, ErrorList, Material) or 0 + AddPartListToNesting(PartList, ErrorList, Material) -- ripristino MachGroup EgtSetCurrMachGroup(nOldMachGroup) @@ -1083,19 +1072,6 @@ function NestingLib.NestPartInRawPart(LastRaw, PartList, Material, ErrorList, Is end end - -- se ci sono pezzi grandi --- if BigPartsQty > 0 then --- -- creo un ugual numero di fogli senza etichetta --- local BigSheetPartId = EgtGroup(GDB_ID.ROOT) --- EgtSetName(BigSheetPartId, "Sheet") --- local BigSheetLayerId = EgtGroup(BigSheetPartId) --- EgtSetName(BigSheetLayerId, OUTLINE) --- local BigSheetOutlineId = EgtRectangle2P(BigSheetLayerId, Point3d(0,0,0), Point3d(Material.L_mm, Material.W_mm, 0), GDB_RT.GLOB) --- EgtModifyCurveThickness(BigSheetOutlineId, -Material.T_mm) --- EgtSetName(BigSheetOutlineId, OUTLINE) --- EgtAutoNestAddSheet( BigSheetPartId, BigSheetOutlineId, dKerf, 0, BigPartsQty) -- EgtAutoNestAddSheet( SheetId, OutlineId, dKerf, nPriority, nCount) --- end - -- verifico se ultimo grezzo non nullo local LastMachGroupId = nil if LastRaw and LastRaw ~= GDB_ID.NULL then @@ -1125,18 +1101,6 @@ function NestingLib.NestPartInRawPart(LastRaw, PartList, Material, ErrorList, Is -- la aggiungo come difetto EgtAutoNestAddDefectToSheet(SheetPartId, nSheetLabel) -- EgtAutoNestAddDefectToSheet( SheetId, DefectId) else - -- se ci sono pezzi grandi - if BigPartsQty > 0 then - -- -- creo un ugual numero di fogli senza etichetta - -- local BigSheetPartId = EgtGroup(GDB_ID.ROOT) - -- EgtSetName(BigSheetPartId, "Sheet") - -- local BigSheetLayerId = EgtGroup(BigSheetPartId) - -- EgtSetName(BigSheetLayerId, OUTLINE) - -- local BigSheetOutlineId = EgtRectangle2P(BigSheetLayerId, Point3d(0,0,0), Point3d(Material.L_mm, Material.W_mm, 0), GDB_RT.GLOB) - -- EgtModifyCurveThickness(BigSheetOutlineId, -Material.T_mm) - -- EgtSetName(BigSheetOutlineId, OUTLINE) - EgtAutoNestAddSheet( SheetPartId, SheetOutlineId, dKerf, 0, BigPartsQty) -- EgtAutoNestAddSheet( SheetId, OutlineId, dKerf, nPriority, nCount) - end -- creo etichetta dello sheet local dLabelW = 50 local dLabelH = 25 @@ -1217,7 +1181,6 @@ function NestingLib.NestPartInRawPart(LastRaw, PartList, Material, ErrorList, Is else table.insert(ErrorList, {ErrType = "E.10", Uid = "Generic", Description = "Error in nesting function!"}) end - --EgtSaveFile("c://Temp//TestSauderBigParts.nge") -- ritorno l'ultimo grezzo utilizzato return LastRaw end