- eliminate modifiche per pezzi grandi

This commit is contained in:
Emmanuele Sassi
2023-10-19 09:30:33 +02:00
parent f4baf8a43b
commit 708307d345
2 changed files with 2 additions and 39 deletions
+1 -1
View File
@@ -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()
+1 -38
View File
@@ -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