Compare commits

..

69 Commits

Author SHA1 Message Date
andrea.villa ba6142dbc5 Merge remote-tracking branch 'origin/develop' 2026-04-23 12:26:44 +02:00
andrea.villa cfaa30d55c Update Log e Version 2026-04-23 12:26:31 +02:00
andrea.villa ea79ac1366 Tutte le forature vengono ordinate per diametro decrescente 2026-04-22 12:11:35 +02:00
luca.mazzoleni 2468599200 Merge tag '3.1d1' into develop
3.1d1
2026-04-08 16:12:24 +02:00
luca.mazzoleni ea598ef7ff Merge branch 'release/3.1d1' 2026-04-08 16:12:13 +02:00
luca.mazzoleni 9290d3f1cf update log e version 2026-04-08 16:11:59 +02:00
luca.mazzoleni 698a913a93 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataWall into develop 2026-04-08 12:28:31 +02:00
luca.mazzoleni f62c42475e - in LapJoint migliorate tasche. Ora usa sempre la fresa migliore e se necessario limita l'escursione con il parametro Open 2026-04-08 12:28:27 +02:00
andrea.villa f397b220b9 In WallExec, quando si disattivano le feature in doppio, si verifica che effettivamente esista la Mirror 2026-04-07 11:57:45 +02:00
luca.mazzoleni d19cf453e0 Merge branch 'master' into develop 2026-04-02 13:10:58 +02:00
luca.mazzoleni a9d497925d update log 2026-04-02 13:10:49 +02:00
Dario Sassi ef5170b6e6 DataWall 3.1c1 :
- modificati CleanCorner per gestire utensili conici con angolo di apertura tra 30 e 45 gradi (inclinazione calcolata in automatico)
- piccola modifica a Process per rielaborare file bwe da EgtBeamWall.
2026-03-30 16:33:53 +02:00
Dario Sassi 3d2b740e89 Merge commit 'b7078cfe112b384241491124429fbd8be7063faa' 2026-03-30 10:36:41 +02:00
luca.mazzoleni b7078cfe11 - in FreeContour.AddSawings corretta scelta invert/workside e inversione allungamento inizio/fine 2026-03-24 08:44:16 +01:00
luca.mazzoleni 30726886c1 Merge branch 'master' into develop 2026-01-29 09:15:18 +01:00
Dario Sassi ed80dccaf0 DataWall 3.1a1 :
- aggiunta gestione sgrossatura superfici per Feature Variant 1 (se lav.ne abilitata da Ini macchina).
2026-01-22 08:08:00 +01:00
luca.mazzoleni 0f4a0804e2 Merge tag '2.7k1' into develop
2.7k1
2025-11-20 09:52:21 +01:00
luca.mazzoleni 8830001985 Merge branch 'release/2.7k1' 2025-11-20 09:52:11 +01:00
luca.mazzoleni c0e2199903 - update log e version 2025-11-20 09:51:09 +01:00
luca.mazzoleni b7854f1160 - in LapJoint groove 3 cieche fatte con Q8=1 invece che 2 2025-11-20 09:44:00 +01:00
luca.mazzoleni 63ad68a653 - in LapJoint correzione a tasche inclinate 2025-11-17 11:12:42 +01:00
luca.mazzoleni 4458c174e8 - in LapJoint con Q08=2 ora si usa sidemill anche se groove 3 blind da sopra 2025-11-14 12:46:19 +01:00
luca.mazzoleni 697965b30b Merge tag '2.7j2' into develop
2.7j2
2025-10-21 10:39:04 +02:00
luca.mazzoleni 20900c9724 Merge branch 'release/2.7j2' 2025-10-21 10:38:57 +02:00
luca.mazzoleni 9043e80c84 update version e log 2025-10-21 10:38:46 +02:00
luca.mazzoleni 45780fce29 - in LapJoint si gestisce il verso di lavorazione delle milling principali in concordanza. Può diventare discordanza da flag macchina 2025-10-20 14:34:03 +02:00
luca.mazzoleni 45cdddb994 - in PanelSaw corretti spazi in export cutting list per Cutty 2025-10-17 14:34:12 +02:00
luca.mazzoleni 24e20625b6 Merge tag '2.7j1' into develop
2.7j1
2025-10-08 17:20:42 +02:00
luca.mazzoleni c77062160a Merge branch 'release/2.7j1' 2025-10-08 17:20:33 +02:00
luca.mazzoleni bb0d02c1e5 update version e log 2025-10-08 17:20:00 +02:00
luca.mazzoleni cb2c752d65 Merge branch 'HomagPanelSawExport' into develop 2025-10-08 17:17:07 +02:00
luca.mazzoleni 30d0efa0ca - in PanelSaw in esportazione Homag la descrizione del tipo di grain è in olandese 2025-10-08 17:16:55 +02:00
luca.mazzoleni 7f4e117339 - in PanelSaw, in esportazione Cutty e Homag si gestisce la direzione fibra 2025-10-07 15:34:17 +02:00
luca.mazzoleni 366a9d5f49 - in PanelSaw piccolo refactoring 2025-10-07 10:28:56 +02:00
luca.mazzoleni 9e869b5c26 - in PanelSaw implementata scrittura cutting list anche per HOMAG (csv) 2025-10-06 17:27:53 +02:00
luca.mazzoleni a0e82e5647 - in PanelSaw, in Cutty, si scrivono il materiale e il nome del pezzo. Piccolo refactoring 2025-10-01 14:50:30 +02:00
luca.mazzoleni a17e649d44 - in WallLib aggiunta funzione per splittare le tabelle più lunghe di un numero massimo di elementi
- in PanelSaw modificate l'esportazione formato Cutty per prevedere più file nel caso si superi il numero massimo di pannelli gestito
2025-09-30 15:45:56 +02:00
andrea.villa 79856f6345 Merge remote-tracking branch 'origin/master' into develop 2025-09-18 11:41:25 +02:00
andrea.villa 94e0ba559b Merge remote-tracking branch 'origin/develop' 2025-09-18 11:32:51 +02:00
andrea.villa 2bde93681f update version e log 2025-09-18 11:32:28 +02:00
andrea.villa bc467fc784 In PanelSaw migliorata gestione scrittura dati. Dato F7 uniformato a F1 e F2. Versione funzionante, testata in macchina. 2025-09-18 11:30:16 +02:00
andrea.villa fc5071a9ae In PanelSaw, tolto debug 2025-09-17 15:50:54 +02:00
andrea.villa 036c782671 - Aggiunto campo descrizione su pezzo
- Aggiunto materiale su Master-Panel
- Possibilità di indicare il numero di caratteri di un campo
2025-09-17 15:49:54 +02:00
luca.mazzoleni 5a6ac3ac8d - in PanelSaw rimossa l'estensione dal nome della cutting list generata 2025-09-16 17:08:17 +02:00
luca.mazzoleni 234692545d Merge branch 'master' into develop 2025-09-16 12:27:47 +02:00
luca.mazzoleni 17d411e5c2 update compile 2025-09-16 12:27:35 +02:00
luca.mazzoleni 4b0334ab65 Merge tag '2.7i1' into develop
2.7i1
2025-09-16 12:24:47 +02:00
luca.mazzoleni b6f025266d Merge branch 'release/2.7i1' 2025-09-16 12:24:34 +02:00
luca.mazzoleni c91b58b6a1 update version e log 2025-09-16 12:24:19 +02:00
luca.mazzoleni 533a8e9f1f Merge branch 'PanelSawCuttingListExport' into develop 2025-09-16 12:08:43 +02:00
luca.mazzoleni 8d26b20ce4 - in NestProcess modifiche per leggere la modalità di nesting e le sezionatrici per cui esportare da WallData 2025-09-11 12:37:07 +02:00
luca.mazzoleni dbf668863a - NestProcess modificata per riflettere nuovi FLAg da BeamWall
- in PanelSaw modificato il nome del file esportato
2025-09-08 18:14:37 +02:00
luca.mazzoleni 5b45aee1f2 - in NestProcess, per nesting tipo cabinet si chiama la fliprot prima di nestare;
- in PanelSaw si gestisce il caso in cui il materiale sia vuoto
2025-09-08 15:39:28 +02:00
luca.mazzoleni 2b94531281 - in PanelSaw si costruisce il file esportato in formato Cutty
- in NestProcess si chiama la PanelSaw formato Cutty (test)
2025-09-08 11:43:38 +02:00
luca.mazzoleni ed0e726391 - in panel saw si scrive una cutlist per ogni combinazione unica di materiale e spessore 2025-09-04 17:18:52 +02:00
luca.mazzoleni 14d726ffae - modifiche parziali per creazione cutting list per Casadei 2025-09-04 09:13:58 +02:00
luca.mazzoleni 9dc093e16b - in NestProcess modifiche per ruotare il pezzo in caso di presenza fori orizzontali D50 2025-08-29 18:19:42 +02:00
luca.mazzoleni 7775fa75fc - modificato nesting semplice per cabinet. Ora si assegna il nome del PDN del pezzo. Se presenti multipli, si aggiunge il contatore del multiplo al PDN. 2025-08-28 14:44:41 +02:00
luca.mazzoleni a449af35d9 - in NestProcess implementato nesting semplice per cabinet, un pezzo per grezzo 2025-08-25 18:06:02 +02:00
luca.mazzoleni 83432e36f4 Merge tag '2.7h1' into develop
2.7h1
2025-08-06 11:20:07 +02:00
luca.mazzoleni 740d244d87 Merge branch 'release/2.7h1' 2025-08-06 11:19:58 +02:00
luca.mazzoleni 3e7b1dc0fd update log e version 2025-08-06 11:19:41 +02:00
luca.mazzoleni 10e5d79412 - in LapJoint MakeMoreFaces migliorata scelta sidemill vs catena vs svuotatura 2025-08-06 11:18:05 +02:00
luca.mazzoleni 97e204fbb1 Merge tag '2.7g3' into develop
2.7g3
2025-07-24 15:49:12 +02:00
luca.mazzoleni 74daefd044 Merge branch 'release/2.7g3' 2025-07-24 15:49:05 +02:00
luca.mazzoleni a92d22e526 - update log e versione 2025-07-24 15:48:56 +02:00
luca.mazzoleni 099b159aae - in Lapjoint corretto step in caso due facce verso l'alto 2025-07-24 14:32:38 +02:00
luca.mazzoleni 76624de1a5 Merge branch 'master' into develop 2025-07-17 17:37:33 +02:00
luca.mazzoleni 9046099e35 Merge tag '2.7g1' into develop
2.7g1
2025-07-09 13:07:35 +02:00
12 changed files with 872 additions and 211 deletions
+1
View File
@@ -4,6 +4,7 @@ REM Per togliere info di debug aggiungere flag -s prima del nome del file di inp
REM Compilazione 32 e 64 bit
\EgtProg\Dll32\luac54 -o bin\LuaLibs\PanelSaw.lua -s LuaLibs\PanelSaw.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\Squaring.lua -s LuaLibs\Squaring.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WallExec.lua -s LuaLibs\WallExec.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WallLib.lua -s LuaLibs\WallLib.lua
+438
View File
@@ -0,0 +1,438 @@
-- PanelSaw.lua by Egalware s.r.l. 2025/09/02
-- Creazione lista taglio e/o programmi di taglio per sezionatrici
-- Intestazioni
require( 'EgtBase')
-- Dati
local WL = require ( 'WallLib')
local PanelSaw = {}
local function GetPanelList()
local PanelList = {}
local idMachGroup = EgtGetFirstMachGroup()
local nMachGroupCount = EgtGetMachGroupCount()
-- nessun MachGroup ossia nessun pannello: si esce subito
if ( not idMachGroup) or ( nMachGroupCount == 0) then
return nil
end
-- per ogni MachGroup si estraggono le informazioni del pannello
for i = 1, nMachGroupCount do
local vPartInfo = EgtSplitString( EgtGetInfo( idMachGroup, 'PART1', 's'))
local idPart = vPartInfo[1]
table.insert( PanelList, {})
PanelList[i].dLength = EgtGetInfo( idMachGroup, 'PANELLEN', 'd')
PanelList[i].dWidth = EgtGetInfo( idMachGroup, 'PANELWIDTH', 'd')
PanelList[i].dThickness = EgtGetInfo( idMachGroup, 'PANELHEIGHT', 'd')
PanelList[i].sMaterialFullName = EgtGetInfo( idMachGroup, 'MATERIAL', 's') or '0000-MATERIAL'
PanelList[i].sMaterialPlusThickness = PanelList[i].sMaterialFullName .. '_' .. tostring( string.format( '%.1f', PanelList[i].dThickness))
local vMaterialInfo = EgtSplitString( PanelList[i].sMaterialFullName, '-')
PanelList[i].idMaterial = vMaterialInfo[1]
PanelList[i].idProd = EgtGetInfo( idMachGroup, 'PRODID', 'i')
PanelList[i].idPatt = EgtGetInfo( idMachGroup, 'PATTID', 'i')
PanelList[i].nPdn = EgtGetInfo( idPart, 'PDN', 'i')
PanelList[i].sName = EgtGetInfo( idPart, 'NAM', 's')
PanelList[i].sDescription = PanelList[i].sName
local sGrainInfo = EgtGetInfo( idPart, "GRAINDIRECTION", 's')
PanelList[i].sGrainDirection = 'None'
if sGrainInfo then
local bUseGrain = ( string.sub( sGrainInfo, 7) == '1')
local sGrainDirection = string.sub( sGrainInfo, 1, 5)
if bUseGrain then
if sGrainDirection == "1,0,0" then
PanelList[i].sGrainDirection = 'Length'
elseif sGrainDirection == "0,1,0" then
PanelList[i].sGrainDirection = 'Width'
end
end
end
-- in questa modalità ogni MachGroup è 1 pezzo, non esistono multipli
-- TODO valutare se raggruppare i pannelli uguali per la cutting list
PanelList[i].nQuantity = 1
-- TODO le informazioni di edgebanding devono arrivare dal btl
PanelList[i].sEdgeMaterialLeft = ''
PanelList[i].sEdgeMaterialRight = ''
PanelList[i].sEdgeMaterialTop = ''
PanelList[i].sEdgeMaterialBottom = ''
-- TODO il barcode deve arrivare dal btl
PanelList[i].sBarcode = ''
idMachGroup = EgtGetNextMachGroup( idMachGroup)
end
return PanelList
end
local function GetSheetList()
local SheetList = {
{
dLength = 2800,
dWidth = 2070,
dThickness = 8,
},
{
dLength = 2800,
dWidth = 2070,
dThickness = 18,
}
}
return SheetList
end
local function GetProjectInfo()
local ProjectInfo = {}
local idBtlInfo = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
_, ProjectInfo.sProjectName = EgtSplitPath( EgtGetInfo( idBtlInfo, 'PROJECTNAME', 's') or '')
return ProjectInfo
end
local function BuildCuttingList_Cutty( PanelList, SheetList, ProjectInfo)
-- se il numero di pezzi supera il limite, si devono creare più liste
local nMaxPanelsCount = 30
local SplittedPanelList = WL.SplitTableInChunks( PanelList, nMaxPanelsCount)
local LinesToWriteList = {}
for nCurrentPanelList = 1, #SplittedPanelList do
local Lines = {}
local CurrentPanelList = SplittedPanelList[nCurrentPanelList]
LinesToWriteList[nCurrentPanelList] = {}
local F0 = {
Header = { 'F0'},
HeaderPlaceholders = { '%-53s'},
Values = { ' 7.70', '210700', '150300'},
ValuesPlaceholders = { '%s', '%s', '%s'}
}
local F0b = {
Header = { 'F0b', '""', '""', '""', '""'},
HeaderPlaceholders = { '%s', '%s', '%s', '%s', '%s'}
}
local F1 = {
Header = { 'F1', CurrentPanelList[1].dThickness, 0, 0, 0, ''},
HeaderPlaceholders = { '%s', '%.3f', '%.3f', '%.3f', '%.3f', '%-20s'},
ValuesList = {},
ValuesPlaceholders = { '%.3f', '%.3f', '%d', '%d', '%d', '%-29d', '%-50s', '%d', '%.3f', '%d', '%d', '%d', '%d'},
}
for i = 1, #SheetList do
F1.ValuesList[i] = { SheetList[i].dLength, SheetList[i].dWidth, 99, 200, 1, 1, CurrentPanelList[1].sMaterialFullName, 0, 1, 0, 0, 0, 0}
end
local F2 = {
Header = { 'F2', 0, 0, 0},
HeaderPlaceholders = { '%s', '%d', '%d', '%d'},
ValuesList = {},
ValuesPlaceholders = { '%.3f', '%.3f', '%d', '%d', '%d', '%d', '%d', '%-20s', '%d', '%d', '%d', '%d', '%-50s', '%d', '%d', '%d', '%d', '%d', '%d', '%.3f', '%d', '%d', '%-85d', '%.3f', '%.3f'},
}
for i = 1, #CurrentPanelList do
local nGrain = 0
if PanelList[i].sGrainDirection == 'Length' then
nGrain = 1
elseif PanelList[i].sGrainDirection == 'Width' then
nGrain = 1
CurrentPanelList[i].dLength, CurrentPanelList[i].dWidth = CurrentPanelList[i].dWidth, CurrentPanelList[i].dLength
end
F2.ValuesList[i] = { CurrentPanelList[i].dLength, CurrentPanelList[i].dWidth, CurrentPanelList[i].nQuantity, 0, nGrain, 0, 0, CurrentPanelList[i].nPdn, 0, 0, 0, 0, CurrentPanelList[i].sDescription, 0, 0, 0, 0, 1, 0, 1500, 0, 0, 0, 0, 0}
end
local F7 = {
Header = { 'F7', 3052, 0},
HeaderPlaceholders = { '%s', '%s', '%d'},
ValuesList = {
{ 218, 436},
{ 167, 669},
{ 204, 408},
{ 204, 204},
{ 204, 204},
{ 209, 209},
{ 167, 167},
{ 213, 213},
{ 229, 229},
{ 164, 164},
{ 150, 150}
},
ValuesPlaceholders = {
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'},
{ '%s', '%s'}
}
}
local F7b = {
Header = { 'F7b', 0, 0, 0, 0},
HeaderPlaceholders = { '%s', '%.3f', '%.3f', '%.3f', '%.3f'},
Values = {},
ValuesPlaceholders = {}
}
local F8 = {
Header = { 'F8', 0, 0, 20, 20, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
HeaderPlaceholders = { '%s', '%.3f', '%.3f', '%d', '%d', '%d', '%d', '%.3f', '%d', '%d', '%d', '%d', '%d', '%d', '%.3f', '%d', '%d', '%d', '%d', '%d', '%d', '%.3f', '%.3f', '%.3f'}
}
local F9 = {
Header = { 'F9', 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4.3, 0, 0, 0, 2, 0, 2450, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
HeaderPlaceholders = { '%s', '%d', '%.3f', '%d', '%.3f', '%.3f', '%.3f', '%.3f', '%.3f', '%d', '%d', '%.3f', '%d', '%d', '%d', '%d', '%.3f', '%.3f', '%d', '%d', '%.3f', '%.3f', '%.3f', '%.3f', '%d', '%d', '%.3f', '%.3f'}
}
local F3 = {
Header = { 'F3'},
HeaderPlaceholders = { '%s'}
}
local E0 = {
Header = { 'E0'},
HeaderPlaceholders = { '%s'}
}
-- F0
table.insert( Lines, string.format( table.concat( F0.HeaderPlaceholders, ' '), table.unpack( F0.Header)))
table.insert( Lines, string.format( table.concat( F0.ValuesPlaceholders, ' '), table.unpack( F0.Values)))
-- linea vuota
table.insert( Lines, '')
-- F0b
table.insert( Lines, string.format( table.concat( F0b.HeaderPlaceholders, ' '), table.unpack( F0b.Header)))
-- linea vuota
table.insert( Lines, '')
-- F1 - sheets
table.insert( Lines, string.format( table.concat( F1.HeaderPlaceholders, ' '), table.unpack( F1.Header)))
for i = 1, #F1.ValuesList do
local Values = F1.ValuesList[i]
local Placeholders = F1.ValuesPlaceholders
table.insert( Lines, string.format( table.concat( Placeholders, ' '), table.unpack( Values)))
end
-- linea vuota
table.insert( Lines, '')
-- F2 - panels
table.insert( Lines, string.format( table.concat( F2.HeaderPlaceholders, ' '), table.unpack( F2.Header)))
for i = 1, #F2.ValuesList do
local Values = F2.ValuesList[i]
local Placeholders = F2.ValuesPlaceholders
table.insert( Lines, string.format( table.concat( Placeholders, ' '), table.unpack( Values)))
end
-- linea vuota
table.insert( Lines, '')
-- F7
table.insert( Lines, string.format( table.concat( F7.HeaderPlaceholders, ' '), table.unpack( F7.Header)))
for i = 1, #F7.ValuesList do
local Values = F7.ValuesList[i]
local Placeholders = F7.ValuesPlaceholders[i]
table.insert( Lines, string.format( table.concat( Placeholders, ' '), table.unpack( Values)))
end
-- linea vuota
table.insert( Lines, '')
-- F7b
table.insert( Lines, string.format( table.concat( F7b.HeaderPlaceholders, ' '), table.unpack( F7b.Header)))
-- linea vuota
table.insert( Lines, '')
-- F8
table.insert( Lines, string.format( table.concat( F8.HeaderPlaceholders, ' '), table.unpack( F8.Header)))
-- linea vuota
table.insert( Lines, '')
-- F9
table.insert( Lines, string.format( table.concat( F9.HeaderPlaceholders, ' '), table.unpack( F9.Header)))
-- linea vuota
table.insert( Lines, '')
-- F3
table.insert ( Lines, string.format( table.concat( F3.HeaderPlaceholders, ' '), table.unpack( F3.Header)))
-- E0
table.insert( Lines, string.format( table.concat( E0.HeaderPlaceholders, ' '), table.unpack( E0.Header)))
-- linea vuota
table.insert( Lines, '')
LinesToWriteList[nCurrentPanelList] = Lines
end
return LinesToWriteList
end
local function BuildCuttingList_Homag( PanelList, ActualSheetList, ProjectInfo)
local LinesToWriteList = {}
local sExtension = 'csv'
local Lines = {}
local Header = {
Values = { 'Description', 'Quantity', 'Length', 'Width', 'Material', 'Grain', 'EdgeLeft', 'EdgeRight', 'EdgeTop', 'EdgeBottom', 'OrderNumber', 'BarCode'},
ValuesPlaceholders = { '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'}
}
local Panels = {
ValuesList = {},
ValuesPlaceholders = { '%s', '%d', '%.1f', '%.1f', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' }
}
for i = 1, #PanelList do
local sGrain = PanelList[i].sGrainDirection
-- TODO questo dipenderà dalla lingua dell'esportazione; andrà fatto un tipo di esportazione specifica per ogni lingua (es: HOMAG_NL, HOMAG_ENG, ...)
if sGrain == 'None' then
sGrain = 'Geen'
elseif sGrain == 'Length' then
sGrain = 'Lengte'
elseif sGrain == 'Width' then
sGrain = 'Breedte'
end
Panels.ValuesList[i] = { PanelList[i].sDescription, PanelList[i].nQuantity, PanelList[i].dLength, PanelList[i].dWidth, PanelList[i].sMaterialPlusThickness, sGrain, PanelList[i].sEdgeMaterialLeft, PanelList[i].sEdgeMaterialRight, PanelList[i].sEdgeMaterialTop, PanelList[i].sEdgeMaterialBottom, ProjectInfo.sProjectName, PanelList[i].sBarcode}
end
-- Intestazione
table.insert( Lines, string.format( table.concat( Header.ValuesPlaceholders, ','), table.unpack( Header.Values)))
-- Lista Pannelli
for i = 1, #Panels.ValuesList do
local Values = Panels.ValuesList[i]
local Placeholders = Panels.ValuesPlaceholders
table.insert( Lines, string.format( table.concat( Placeholders, ','), table.unpack( Values)))
end
LinesToWriteList[1] = Lines
return LinesToWriteList, sExtension
end
local function BuildCuttingList( PanelList, sOutputType)
local LinesToWriteList = {}
local sExtension = ''
local SheetList = GetSheetList()
local ProjectInfo = GetProjectInfo()
local dRequiredThickness = PanelList[1].dThickness
-- solo gli sheets dello spessore corretto vanno considerati
local ActualSheetList = {}
for i = 1, #SheetList do
if abs( SheetList[i].dThickness - dRequiredThickness) < 10 * GEO.EPS_SMALL then
ActualSheetList[#ActualSheetList+1] = {
dLength = SheetList[i].dLength,
dWidth = SheetList[i].dWidth,
dThickness = SheetList[i].dThickness,
sMaterial = SheetList[i].sMaterial
}
end
end
-- Casadei
if sOutputType == 'CUTTY' then
LinesToWriteList = BuildCuttingList_Cutty( PanelList, ActualSheetList, ProjectInfo)
-- Homag
elseif sOutputType == 'HOMAG' then
LinesToWriteList, sExtension = BuildCuttingList_Homag( PanelList, ActualSheetList, ProjectInfo)
end
return LinesToWriteList, sExtension
end
-- restituisce i pannelli raggruppati per coppia materiale-spessore univoca
local function GroupByMaterial( PanelList)
local PanelsGroupedByMaterial = {}
for i = 1, #PanelList do
local idMaterial = PanelList[i].idMaterial
local dMaterialThickness = PanelList[i].dThickness
-- si crea una chiave unica dalla coppia
local key = idMaterial .. "_" .. tostring( dMaterialThickness)
-- se la chiave non esiste già nella tabella, si crea
if not PanelsGroupedByMaterial[key] then
PanelsGroupedByMaterial[key] = {}
end
-- aggiunta del pezzo corrente al gruppo chiave corrispondente
table.insert( PanelsGroupedByMaterial[key], PanelList[i])
end
return PanelsGroupedByMaterial
end
function PanelSaw.GenerateCuttingList( sOutputType)
local PanelList = GetPanelList()
local PanelsGroupedByMaterial = GroupByMaterial( PanelList)
for key, PanelListSingleMaterial in pairs( PanelsGroupedByMaterial) do
-- path in cui scrivere i file
local sCurrentNgePath, sCurrentNgeName = EgtSplitPath( EgtGetCurrFilePath())
if sOutputType then
-- costruzione lista istruzioni
local LinesToWriteList, sExtension = BuildCuttingList( PanelListSingleMaterial, sOutputType)
for i = 1, #LinesToWriteList do
-- scrittura file
local sFilename = sCurrentNgePath .. 'CutList-' .. sCurrentNgeName .. '-' .. key .. '-' .. i .. sOutputType
sFilename = sFilename:gsub( '%.', '_')
-- aggiunta eventuale estensione
sFilename = sFilename .. '.' .. sExtension
local hFile, nFileErr = io.open( sFilename, 'w')
if not hFile then
EgtOutLog( 'Error creating cutting list : IO error ' .. tostring( nFileErr))
return false
end
hFile:write( table.concat( LinesToWriteList[i], "\n"))
hFile:close()
end
-- se nessun tipo si deve scrivere un json semplice
else
end
end
return
end
return PanelSaw
+2 -1
View File
@@ -214,7 +214,8 @@ function WMachiningLib.FindSurfacing( sType)
local Surfacing = Surfacings[i]
if Surfacing.On and Surfacing.Type == sType and SetCurrMachiningAndTool( Surfacing.Name) then
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
if nMchType == MCH_MY.SURFFINISHING then
if (( sType == 'Roughing' and nMchType == MCH_MY.SURFROUGHING) or
( sType == 'Finishing' and nMchType == MCH_MY.SURFFINISHING)) then
return Surfacing.Name
end
end
+62 -48
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2024/03/24
-- ProcessFreeContour.lua by Egaltech s.r.l. 2026/03/30
-- Gestione calcolo profilo libero per Pareti
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
@@ -717,19 +717,19 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bC
end
---------------------------------------------------------------------
local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2,
dTall1, dTall2, dDiam3, dTall3)
local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01)
local function CalcInterference( nNewProc, vtExtr, ptCentr,
dDiam1, dTall1, dDiam2, dTall2, dDiam3, dTall3)
local ptCentrGrid1 = ptCentr + 0.1 * vtExtr
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB)
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1 / 2, dDiam2 / 2 - 0.1, dTall1, nNewProc, 0, GDB_RT.GLOB)
if bColl1 then return true end
local ptCentrGrid2 = ptCentr + ( vtExtr * ( dTall1 + 0.01))
local ptCentrGrid2 = ptCentr + dTall1 * vtExtr
frOriTool = Frame3d( ptCentrGrid2, vtExtr)
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2 / 2 - 0.1, dTall2, nNewProc, 0, GDB_RT.GLOB)
if bColl2 then return true end
local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01))
local ptCentrGrid3 = ptCentr + ( dTall1 + dTall2) * vtExtr
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3 / 2 - 0.1, dTall3, nNewProc, 0, GDB_RT.GLOB)
if bColl3 then return true end
-- restituisco risultato controllo collisioni
return false
@@ -785,8 +785,8 @@ end
---------------------------------------------------------------------
local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, dOffsAng, dDepthMach,
bThruThick, dThSurf, dDiam1, dDiam2, dTall1,
dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
bThruThick, dThSurf, dConeSideAng, dDiam1, dTall1,
dDiam2, dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
-- variabili costruzione geometria
local pAuxId = {}
local nAuxId
@@ -854,23 +854,21 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
-- sommo i tre versori per avere una direzione media
vtExtrExit = vtN2 + vtN3
vtExtrExit:normalize()
-- se tipo 1 calcolo angolo tilt di 45°
if nTypeConeCut == 1 then
vtExtr = vtExtrExit + Z_AX()
-- altrimenti tipo 2, calcolo angolo tilt di 33° (dalla verticale)
else
vtExtr = vtExtrExit + Vector3d(0,0,1.539865)
end
-- calcolo la componente Z dipendente dall'angolo tilt
local dAlfa = EgtClamp( dConeSideAng, 15, 30)
local dGamma = 90 - asin( sqrt( 2) * sin( dConeSideAng))
local dTanGamma = sin( dGamma) / cos( dGamma)
vtExtr = vtExtrExit + Vector3d( 0, 0, dTanGamma)
vtExtr:normalize()
local vtCheck = Vector3d(vtExtr)
local vtCheck = Vector3d( vtExtr)
-- se ho un offset angolare ruoto il percorso
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
if abs( dOffsAng) > 100 * GEO.EPS_ANG_SMALL then
vtCheck:rotate( Z_AX(), dOffsAng)
end
-- controllo se c'è collisione con le facce della superfice
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
dTall1, dTall2, dDiam3, dTall3) then
local sErr = 'Collision detect from clean corner tool and surface'
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach),
dDiam1, dTall1, dDiam2, dTall2, dDiam3, dTall3) then
local sErr = 'Collision detected between clean corner tool and surface'
EgtOutLog( sErr)
return true, ''
end
@@ -1054,22 +1052,26 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
-- recupero i dati dell'utensile
local dMillDiam = 20
local dMillTotDiam = 20
local dMillDiamTh = 20
local dToolLength = 20
local dThickTool = 20
local dSideAng = 0
local dMillLength = 20
local dMillThick = 20
local dMillSideAng = 0
local dMillStemLength = 10
local dMillThDiam = 70
local dMillThLength = 20
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
dMillThDiam = EgtTdbGetCurrToolThDiam() or dMillThDiam
dMillThLength = EgtTdbGetCurrToolThLength() or dMillThLength
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
dMillSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dMillSideAng
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool
dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth -- qui è la distanza dal portautensile
-- calcolo il secondo diametro del cono
dMillTotDiam = dMillDiam + ( abs( dThickTool) * tan( dSideAng)) * 2
dMillThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMillThick
dMillLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dMillLength
-- diametro massimo del cono
dMillTotDiam = dMillDiam + ( abs( dMillThick) * tan( dMillSideAng)) * 2
-- lunghezza del gambo
dMillStemLength = dMillLength - abs( dMillThick) - dMillThLength
end
end
-- verifico se ciclo chiuso
@@ -1157,21 +1159,21 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
-- primo taglio
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, -dAngOffs, dDepthMach,
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
-- secondo taglio
bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, dAngOffs, dDepthMach,
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
-- altrimenti ho un solo percorso
else
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, 0, dDepthMach,
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
end
end
@@ -1684,8 +1686,14 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}})
-- si inverte il percorso, se necessario, per evitare che la sega a catena ruoti contro la traversa
local bToInvert = vFace[i].Norm:getX() >= 0.018
-- allungamento e accorciamento percorso
local dSal = - dSawDiam / 2
local dEal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
if bToInvert then
dSal, dEal = dEal, dSal
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- assegno utilizzo faccia
@@ -1695,12 +1703,12 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
-- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- assegno lato di lavoro e inversione direzione movimento
if vFace[i].Norm:getX() < 0.018 then
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
else
if bToInvert then
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
else
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
@@ -1732,11 +1740,17 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}})
-- si inverte il percorso, se necessario, per evitare che la sega a catena ruoti contro la traversa
local bToInvert = vFace[i].Norm:getX() >= 0.018
-- allungamento e accorciamento percorso
local dSal = - dSawDiam / 2
local dEal = - dSawDiam / 2
if ( vFace[i].Type & 2) ~= 0 then
dSal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
end
if bToInvert then
dSal, dEal = dEal, dSal
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- assegno utilizzo faccia
@@ -1746,12 +1760,12 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
-- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- assegno lato di lavoro e inversione direzione movimento
if vFace[i].Norm:getX() < 0.018 then
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
else
if bToInvert then
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
else
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
+111 -104
View File
@@ -1,4 +1,4 @@
-- WProcessLapJoint.lua by Egaltech s.r.l. 2023/10/02
-- WProcessLapJoint.lua by Egaltech s.r.l. 2026/03/30
-- Gestione calcolo mezzo-legno per Pareti
-- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant).
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
@@ -698,20 +698,20 @@ local function ReorderFacesFromTab( nIdSurf, vFace)
end
---------------------------------------------------------------------
local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2,
dTall1, dTall2, dDiam3, dTall3)
local function CalcInterference( nNewProc, vtExtr, ptCentr,
dDiam1, dTall1, dDiam2, dTall2, dDiam3, dTall3)
local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01)
local ptCentrGrid1 = ptCentr + 0.1 * vtExtr
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB)
local bColl1 = EgtTestConeSurface( frOriTool, dDiam1 / 2, dDiam2 / 2 - 0.1, dTall1, nNewProc, 0, GDB_RT.GLOB)
if bColl1 then return true end
local ptCentrGrid2 = ptCentr + ( vtExtr * ( dTall1 + 0.01))
local ptCentrGrid2 = ptCentr + dTall1 * vtExtr
frOriTool = Frame3d( ptCentrGrid2, vtExtr)
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2 / 2 - 0.1, dTall2, nNewProc, 0, GDB_RT.GLOB)
if bColl2 then return true end
local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01))
local ptCentrGrid3 = ptCentr + ( dTall1 + dTall2) * vtExtr
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3 / 2 - 0.1, dTall3, nNewProc, 0, GDB_RT.GLOB)
if bColl3 then return true end
-- restituisco risultato controllo collisioni
return false
@@ -758,8 +758,8 @@ end
---------------------------------------------------------------------
local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, dOffsAng, dDepthMach,
bThruThick, dThSurf, dDiam1, dDiam2, dTall1,
dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
bThruThick, dThSurf, dConeSideAng, dDiam1, dTall1,
dDiam2, dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
-- variabili costruzione geometria
local pAuxId = {}
local nAuxId
@@ -826,23 +826,21 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
-- sommo i tre versori per avere una direzione media
vtExtrExit = vtN2 + vtN3
vtExtrExit:normalize()
-- se tipo 1 calcolo angolo tilt di 45°
if nTypeConeCut == 1 then
vtExtr = vtExtrExit + Z_AX()
-- altrimenti tipo 2, calcolo angolo tilt di 33° (dalla verticale)
else
vtExtr = vtExtrExit + Vector3d(0,0,1.539865)
end
-- calcolo la componente Z dipendente dall'angolo tilt
local dAlfa = EgtClamp( dConeSideAng, 15, 30)
local dGamma = 90 - asin( sqrt( 2) * sin( dConeSideAng))
local dTanGamma = sin( dGamma) / cos( dGamma)
vtExtr = vtExtrExit + Vector3d( 0, 0, dTanGamma)
vtExtr:normalize()
local vtCheck = Vector3d(vtExtr)
-- se ho un offset angolare ruoto il percorso
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
if abs( dOffsAng) > 100 * GEO.EPS_ANG_SMALL then
vtCheck:rotate( Z_AX(), dOffsAng)
end
-- controllo se c'è collisione con le facce della superfice
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
dTall1, dTall2, dDiam3, dTall3) then
local sErr = 'Collision detect from clean corner tool and surface'
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach),
dDiam1, dTall1, dDiam2, dTall2, dDiam3, dTall3) then
local sErr = 'Collision detected between clean corner tool and surface'
EgtOutLog( sErr)
return true, ''
end
@@ -1029,22 +1027,26 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
-- recupero i dati dell'utensile
local dMillDiam = 20
local dMillTotDiam = 20
local dMillDiamTh = 20
local dToolLength = 20
local dThickTool = 20
local dSideAng = 0
local dMillLength = 20
local dMillThick = 20
local dMillSideAng = 0
local dMillStemLength = 10
local dMillThDiam = 70
local dMillThLength = 20
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
dMillThDiam = EgtTdbGetCurrToolThDiam() or dMillThDiam
dMillThLength = EgtTdbGetCurrToolThLength() or dMillThLength
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
dMillSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dMillSideAng
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool
dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth -- qui è la distanza dal portautensile
-- calcolo il secondo diametro del cono
dMillTotDiam = dMillDiam + ( abs(dThickTool) * tan(dSideAng)) * 2
dMillThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMillThick
dMillLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dMillLength
-- diametro massimo del cono
dMillTotDiam = dMillDiam + ( abs( dMillThick) * tan( dMillSideAng)) * 2
-- lunghezza del gambo
dMillStemLength = dMillLength - abs( dMillThick) - dMillThLength
end
end
-- copio la feature nel layer di appoggio
@@ -1135,21 +1137,21 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
-- primo taglio
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, -dAngOffs, dDepthMach,
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
-- secondo taglio
bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, dAngOffs, dDepthMach,
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
-- altrimenti ho un solo percorso
else
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, 0, dDepthMach,
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
bThruThick, dDepth, dMillSideAng, dMillDiam, abs( dMillThick),
dMillTotDiam, dMillStemLength, dMillThDiam, dMillThLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
end
end
@@ -1373,9 +1375,11 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
local dMillTotLen = 30
local dMaxDepth = 0
local dThDiam = 100
local bIsToolCcw = false
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
bIsToolCcw = EgtTdbGetCurrToolParam( MCH_TP.SPEED) < 0
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMillLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dMillLen
dMillTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) or dMillTotLen
@@ -1413,13 +1417,19 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) -- -dMillDiam/2 + dAddLen)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, dSideDist + WD.CUT_SIC)
-- setto inversione in base al workside
local bIsWorkSideRight = ( EgtGetMachiningParam( MCH_MP.WORKSIDE) == MCH_MILL_WS.RIGHT)
local bInvert = false
if bIsWorkSideRight then
bInvert = true
-- setto inversione e lato di lavoro
local bIsDominantX = abs( vtRef:getY()) > abs( vtRef:getX()) + 10 * GEO.EPS_SMALL
local bUseConventionalMilling = ( bIsDominantX and WD.USE_CONVENTIONAL_MILLING_ALONG_X) or WD.USE_CONVENTIONAL_MILLING_ALONG_Y
local bInvert, nWorkside
if bUseConventionalMilling then
bInvert = not bIsToolCcw
nWorkside = bIsToolCcw and MCH_MILL_WS.LEFT or MCH_MILL_WS.RIGHT
else
bInvert = bIsToolCcw
nWorkside = bIsToolCcw and MCH_MILL_WS.RIGHT or MCH_MILL_WS.LEFT
end
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkside)
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.ADIR_ZP
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
@@ -1509,9 +1519,11 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local dMillDiamThStem = 0
local dMillLenTh = 0
local dSideStep = 0
local bIsToolCcw = false
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
bIsToolCcw = EgtTdbGetCurrToolParam( MCH_TP.SPEED) < 0
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMillLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dMillLen
dMillTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) or dMillTotLen
@@ -2020,17 +2032,20 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
dStepOri = dStep
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
local nStep = ceil( ( dThick - dMaxMat) / dStep)
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
-- tasca aperta sopra non necessita di MaxElev
local dMaxElev
-- tasca aperta sopra non necessita di MaxElev e mantiene lo step originale
if Proc.Fct == 2 and Proc.AffectedFaces.Top then
dMaxElev = nil
else
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
end
if nSinglePass and nSinglePass > 0 then
dStep = 0
if nSinglePass == 1 then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
end
dMaxElev = dMaxMat
end
if bUpwardMilling then
dStep = -dStep
@@ -2050,9 +2065,19 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end
-- scrivo le note della lavorazione
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- setto il lato di lavoro standard
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
-- setto lato di lavoro e inversione
local bIsDominantX = abs( vtN:getY()) > abs( vtN:getX()) + 10 * GEO.EPS_SMALL
local bUseConventionalMilling = ( bIsDominantX and WD.USE_CONVENTIONAL_MILLING_ALONG_X) or WD.USE_CONVENTIONAL_MILLING_ALONG_Y
local bInvert, nWorkside
if bUseConventionalMilling then
bInvert = bIsToolCcw
nWorkside = bIsToolCcw and MCH_MILL_WS.LEFT or MCH_MILL_WS.RIGHT
else
bInvert = not bIsToolCcw
nWorkside = bIsToolCcw and MCH_MILL_WS.RIGHT or MCH_MILL_WS.LEFT
end
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkside)
-- setto offset radiale per gestire le eventuali passate in orizzontale
local dRadialOffset = dSideStep * ( nSideStep - i)
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
@@ -2279,7 +2304,7 @@ end
-- se necessario forza la tasca a chiusa
local function VerifyPocket( Proc, nFacet, dElev, nRawId)
local bForceClosedPocket = false
local dToolOvershoot
local b3Raw = EgtGetRawPartBBox( nRawId)
-- verifico se la feature è sul bordo (non ci sono altri pezzi davanti alla tasca). Se è sul bordo, l'utensile potrà attaccare da fuori.
local bIsFeatureOnEdge = ( Proc.Topology == 'Groove' and Proc.Fct == 4 and Proc.DistanceToNearestParts.Front > b3Raw:getDimY())
@@ -2341,21 +2366,15 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId)
if Proc.AffectedFaces.Right then
dDistanceToNearestPart = min( dDistanceToNearestPart, Proc.DistanceToNearestParts.Right)
end
-- se la distanza è inferiore ad un valore minimo forzo la tasca chiusa per evitare che la ricerca utensile fallisca
local dMinToolDiameter = 25
if dDistanceToNearestPart < dMinToolDiameter / 2 - 10 * GEO.EPS_SMALL then
bForceClosedPocket = true
dDistanceToNearestPart = dMaxDiameter
end
local bExcludeNoTipFeed = ( Proc.Topology == 'Pocket')
-- recupero la lavorazione
local bUseDElevToFindPocketing = true
local sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, dElev, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart)
local sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, dElev, nil, nil, bExcludeNoTipFeed)
-- se tasca troppo profonda cerco senza elevazione e limiterò la profondità
if not sPocketing then
bUseDElevToFindPocketing = false
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, nil, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart)
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, nil, nil, nil, bExcludeNoTipFeed)
end
local dMillDiam = 20
local dMaxDepth = 0
@@ -2366,7 +2385,7 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId)
-- se doppio cerco una lavorazione adatta
if Proc.Double and Proc.Double == 2 then
local sPocketingBackup = sPocketing
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1', true, dDistanceToNearestPart)
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1', true)
if not WM.IsMachiningOkForDouble( sPocketing) then
Proc.Double = 0
sPocketing = sPocketingBackup
@@ -2379,41 +2398,10 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId)
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
end
end
-- verifico se la lavorazione (o il suo eventuale mirror) potrebbe danneggiare le parti limitrofe e devo quindi forzare una tasca chiusa
local bIsMachiningDamagingOtherParts = IsMachiningDamagingOtherParts( Proc, dMillDiam, nRawId)
if bIsMachiningDamagingOtherParts then
bForceClosedPocket = true
end
-- disattivo il doppio se devo forzare una tasca chiusa ma l'altra no
if Proc.Double and Proc.Double > 0 then
local bIsMirrorMachiningDamagingOtherParts = IsMachiningDamagingOtherParts( Proc.Mirror, dMillDiam, nRawId)
if bIsMachiningDamagingOtherParts ~= bIsMirrorMachiningDamagingOtherParts then
Proc.Double = 0
end
end
dToolOvershoot = min( dDistanceToNearestPart, dMillDiam / 2 + 1)
-- altrimenti diametro utensile troppo piccolo: devo forzare tasca chiusa
else
bForceClosedPocket = true
end
-- se tasca chiusa cerco lavorazione con diametro massimo pari a dimensione tasca e riverifico per eventuale doppio
if bForceClosedPocket then
dMaxDiameter = 0.9 * dStartDiameter
bUseDElevToFindPocketing = true
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, dElev, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart)
if not sPocketing then
bUseDElevToFindPocketing = false
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, nil, nil, nil, bExcludeNoTipFeed, dDistanceToNearestPart)
end
-- se doppio cerco una lavorazione adatta
if Proc.Double and Proc.Double == 2 then
local sPocketingBackup = sPocketing
sPocketing = WM.FindPocketing( 'Pocket', dMaxDiameter, EgtIf( bUseDElevToFindPocketing, dElev, nil), nil, 'H1', true, dDistanceToNearestPart)
if not WM.IsMachiningOkForDouble( sPocketing) then
Proc.Double = 0
sPocketing = sPocketingBackup
end
end
dToolOvershoot = 0
end
-- recupero dati utensile
@@ -2426,7 +2414,7 @@ local function VerifyPocket( Proc, nFacet, dElev, nRawId)
end
end
return sPocketing, bForceClosedPocket, bIsFeatureOnEdge, sTuuid, dMillDiam, dMaxDepth, dThDiam
return sPocketing, dToolOvershoot, bIsFeatureOnEdge, sTuuid, dMillDiam, dMaxDepth, dThDiam
end
---------------------------------------------------------------------
local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
@@ -2437,7 +2425,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
local nNewProc = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacet)
-- cerco lavorazione adatta e recupero i dati utensile
local sPocketing, bForceClosedPocket, bIsFeatureOnEdge, sTuuid, dMillDiam, dMaxDepth, dThDiam = VerifyPocket( Proc, nFacet, dElev, nRawId)
local sPocketing, dToolOvershoot, bIsFeatureOnEdge, sTuuid, dMillDiam, dMaxDepth, dThDiam = VerifyPocket( Proc, nFacet, dElev, nRawId)
if not sPocketing then
local sErr = 'Error : pocketing not found in library'
EgtOutLog( sErr)
@@ -2488,8 +2476,11 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxOptSize', 0.1)
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALOUT)
end
-- setto eventuale nota per forzare tasca chiusa
if bForceClosedPocket then sUserNotes = EgtSetValInNotes( sUserNotes, 'Open', 0) end
-- setto eventuale nota per forzare massima uscita dalla geometria
if dToolOvershoot then
sUserNotes = EgtSetValInNotes( sUserNotes, 'Open', dToolOvershoot)
sUserNotes = EgtSetValInNotes( sUserNotes, 'ExtProj', dToolOvershoot)
end
-- setto eventuale nota per forzare attacco esterno, fino ad un certo spessore del grezzo
local dMaxRawThicknessToStartOut = 75
if bIsFeatureOnEdge and ( not Proc.Double or Proc.Double == 0) then sUserNotes = EgtSetValInNotes( sUserNotes, 'OpenMinSafe', dMaxRawThicknessToStartOut) end
@@ -2880,6 +2871,8 @@ end
---------------------------------------------------------------------
local function MakeMoreFaces( Proc, nRawId, b3Raw)
-- recupero parametri Q
local _, nUseMillOnSide = EvaluateQParam( Proc)
-- con una faccia di fondo valida
if Proc.Stype == 1 or Proc.Stype == 2 then
-- recupero eventuale flag forzatura svuotatura
@@ -2887,15 +2880,17 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
-- cerco la faccia con il maggior numero di adiacenze
local nFacInd, dElev, nFacInd2, dElev2 = WL.GetFaceWithMostAdj( Proc.Id, Proc.PartId)
-- se necessario scambio le facce
if Proc.Stype == 2 then
local bIsGroove3Blind = Proc.Fct == 3 and Proc.Topology == 'Groove' and not Proc.IsThrough
local bPreferSidemill = ( nUseMillOnSide >= 1)
if Proc.Stype == 2 or ( bPreferSidemill and bIsGroove3Blind) then
nFacInd, dElev, nFacInd2, dElev2 = nFacInd2, dElev2, nFacInd, dElev
end
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
local dMaxSlotThicknessForBlade = 19
local bIsSmallSlot = ( Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade - 10 * GEO.EPS_SMALL) and ( vtN:getZ() > -0.01) and ( vtN:getZ() < 0.5))
local bIsSmallSlot = ( Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade - 10 * GEO.EPS_SMALL) and ( vtN:getZ() > -0.01))
-- se di fianco
if not bPckt and Proc.Fct >= 3 and ( ( vtN:getZ() < WD.NZ_MINA) or bIsSmallSlot) then
if not bPckt and Proc.Fct >= 3 and ( ( bPreferSidemill and bIsGroove3Blind) or ( vtN:getZ() < WD.NZ_MINA) or bIsSmallSlot) then
-- recupero elevazione faccia in feature
local dSideElev = WL.GetFaceElevation( Proc.Id, nFacInd)
-- se abilitata lavorazione ribasso con fresa di fianco e parametro Q03 abilitato
@@ -2911,7 +2906,6 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
sMillOnSide = sMillOnSideBackup
end
end
local _, nUseMillOnSide = EvaluateQParam( Proc)
-- se ho abilitata lavorazione di fresa di fianco
if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 and not bIsSmallSlot then
-- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH
@@ -2997,12 +2991,25 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
end
end
end
-- si tenta sidemill
if sMilling and dElev < dMaxDepthOnSide then
return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling, nil, nil, nil, nil, nil, nil, nil, bDoubleMillOnSide)
-- altrimenti sega a catena
else
return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV)
end
-- sidemill non possibile: si tenta sega a catena
local bOk, sErr = MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV)
if bOk then
return bOk, sErr
end
-- sega a catena fallisce: se possibile si prova con svuotatura
local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)
if nFacet then
return MakeByPocketing( Proc, nFacet, nRawId, b3Raw, true)
end
-- se nessuna strategia è riuscita, si ritorna errore
sErr = 'Side milling not possible'
EgtOutLog( sErr)
return false, sErr
end
end
local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)
+48 -34
View File
@@ -52,6 +52,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
local function MakeCode_1( Proc, nRawId, b3Raw)
local sWarn
-- recupero e verifico l'entità curva associata
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then
@@ -63,41 +64,54 @@ local function MakeCode_1( Proc, nRawId, b3Raw)
return false, sErr
end
local vtExtr = EgtCurveExtrusion( AuxId or GDB_ID.NULL, GDB_ID.ROOT)
-- recupero la lavorazione
local sSurfFin = WM.FindSurfacing( 'Finishing')
if not sSurfFin then
local sErr = 'Error : surface finishing not found in library'
EgtOutLog( sErr)
return false, sErr
-- cerco e applico le lavorazioni di superficie opportune
local sMachIni = EgtGetCurrMachineDir()..'\\'..EgtGetCurrMachineName()..'.ini'
local bSurfRough = ( EgtGetNumberFromIni( 'Machinings', 'SurfRoughing', 0, sMachIni) >= 1)
local SurfLav = { { Type='Roughing', Name='SurfRou_', Err=true}, { Type='Finishing', Name='SurfFin_', Err=true}}
local nStart = EgtIf( bSurfRough, 1, 2)
for i = nStart, 2 do
-- recupero la lavorazione
local sSurfLav = WM.FindSurfacing( SurfLav[i].Type)
if not sSurfLav then
if SurfLav[i].Err then
local sErr = 'Error : surface '.. SurfLav[i].Type .. ' not found in library'
EgtOutLog( sErr)
return false, sErr
else
sWarn = 'Warning : surface '.. SurfLav[i].Type .. ' not found in library'
EgtOutLog( sWarn)
end
else
-- inserisco la lavorazione di superficie
local sName = SurfLav[i].Name .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = WM.AddMachining( Proc, sName, sSurfLav)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfLav
EgtOutLog( sErr)
return false, sErr
end
EgtSetInfo( nMchFId, 'Part', Proc.PartId)
-- se lavorazione di fianco setto la nota per spostarla dopo i tagli di lama
if vtExtr:getZ() < WD.NZ_MINA then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, -1},{AuxId, -1}})
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.ADIR_ZP
if AreSameVectorApprox( vtExtr, Z_AX()) then
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
end
-- inserisco la lavorazione di finitura superficie
local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = WM.AddMachining( Proc, sName, sSurfFin)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin
EgtOutLog( sErr)
return false, sErr
end
EgtSetInfo( nMchFId, 'Part', Proc.PartId)
-- se lavorazione di fianco setto la nota per spostarla dopo i tagli di lama
if vtExtr:getZ() < WD.NZ_MINA then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, -1},{AuxId, -1}})
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.ADIR_ZP
if AreSameVectorApprox( vtExtr, Z_AX()) then
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
return true
return true, sWarn
end
---------------------------------------------------------------------
+11 -9
View File
@@ -525,10 +525,8 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and
( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) and
( not nPriority or EgtGetInfo( nOperId, 'PRIORITY', 'i') == nPriority ) and
( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or
( not bExistName and not ContainsStartName( nOperId, StartNames))) and
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or
( not bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') ~= 1)) then
( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or ( not bExistName and not ContainsStartName( nOperId, StartNames))) and
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or ( not bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') ~= 1)) then
-- non si deve cambiare lo stato di attivazione della lavorazione (se disabilitata errata)
EgtSetCurrMachining( nOperId)
if not EgtIsMachiningEmpty() then
@@ -652,13 +650,15 @@ local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true, nil, nil, nil, nil, nil, nPriority)
-- Forature e Svuotature
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true, nil, nPriority)
-- -- Forature ***
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false)
-- Forature ***
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, nil, false, nil, true, nil, nil)
-- -- Svuotature ***
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', false)
-- -- Fresature che sono rifiniture di spigoli
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
-- Lavorazioni di superficie
-- Lavorazioni di sgrossatura superficie
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFROUGHING, nil, nil, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
-- Lavorazioni di finitura superficie
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
-- Fresature per gole
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
@@ -686,7 +686,9 @@ local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
-- Svuotature che vanno fatte dopo i tagli con lama
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
-- Lavorazioni di superficie che vanno fatte dopo i tagli con lama
-- Lavorazioni di sgrossatura superficie che vanno fatte dopo i tagli con lama
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFROUGHING, nil, nil, 'MOVE_AFTER', true)
-- Lavorazioni di finitura superficie che vanno fatte dopo i tagli con lama
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true)
end
return PrevMch
@@ -1325,7 +1327,7 @@ function WallExec.ProcessFeatures()
if Proc.Double and Proc.Double > 0 then
for j = 1, #vProc do
local ProcMirror = vProc[j]
if Proc.Mirror.Id == ProcMirror.Id then
if Proc.Mirror and ( Proc.Mirror.Id == ProcMirror.Id) then
-- per i fori l'operazione si basa sulla geometria ausiliaria
if Proc.TopologyLongName == 'DRILLING' then
local AuxId = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i') or 0
+22
View File
@@ -552,5 +552,27 @@ function WallLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH, dRawL)
return ( ( ( abs( b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) or ( abs( b3Proc:getDimX() - dRawL) < 10 * GEO.EPS_SMALL or b3Proc:getDimX() > dRawL)) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
end
-------------------------------------------------------------------------------------------------------------
-- Splitta una tabella in tabelle di dimensioni massima nMaxItemsCount
function WallLib.SplitTableInChunks( Table, nChunkSize)
local Result = {}
local Chunk = {}
for i, v in ipairs( Table) do
table.insert( Chunk, v)
if #Chunk == nChunkSize then
table.insert( Result, Chunk)
Chunk = {}
end
end
-- se rimangono elementi, li aggiungo
if #Chunk > 0 then
table.insert( Result, Chunk)
end
return Result
end
-------------------------------------------------------------------------------------------------------------
return WallLib
+130 -8
View File
@@ -18,13 +18,14 @@ NEST.MACH_AREA_USE_OTHER_DIAM = 1 -- 0
NEST.MACH_AREA_OTHER_DIAM = 200
NEST.MACH_AREA_IGNORE_3rdFACE = 1 -- 0
if NEST.FLAG ~= 11 then
local sLog = 'NestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN[1] .. ', ' .. WIDTH[1]
EgtOutLog( sLog)
local sLog = 'NestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN[1] .. ', ' .. WIDTH[1]
EgtOutLog( sLog)
-- Cancello file di log specifico
local sLogFile = EgtChangePathExtension( NEST.FILE, '.txt')
EgtEraseFile( sLogFile)
-- Cancello file di log specifico
local sLogFile = EgtChangePathExtension( NEST.FILE, '.txt')
EgtEraseFile( sLogFile)
end
-- Imposto direttorio libreria specializzata per Travi
EgtAddToPackagePath( NEST.BASEDIR .. '\\LuaLibs\\?.lua')
@@ -56,6 +57,8 @@ _G.package.loaded.WProcessDoubleCut = nil
local DoubleCut = require( 'WProcessDoubleCut')
_G.package.loaded.WProcessFreeContour = nil
local FreeContour = require( 'WProcessFreeContour')
_G.package.loaded.PanelSaw = nil
local PanelSaw = require( 'PanelSaw')
-- Carico i dati globali
local WD = require( 'WallData')
@@ -65,6 +68,7 @@ local s_dSideMillDiamDown = WD.SIDEMILL_DIAM_DOWN or 350
local s_dSideMillDiamUp = WD.SIDEMILL_DIAM_UP or 65
local s_dHorDrillLen = WD.HOR_DRILL_LEN or 1780
local s_dHorDrillDiam = WD.HOR_DRILL_DIAM or 35
local s_dHorDrillDiam5Axes = WD.HOR_DRILL_DIAM_5AX or 0
local s_sOrigCorner = WD.ORIG_CORNER or 'TL'
local s_dIntRulli = WD.INTRULLI or 1200
local s_dMinRawYHorDrill = WD.MINRAWY_HOR_DRILL or 2800
@@ -535,7 +539,7 @@ local function ClassifyDrillsOnLateralFaces( nPartId, dMinSheetWidth)
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then break end
-- verifico se diametro compatibile con la punta
local dDiam = 2 * EgtArcRadius( AuxId)
if abs( dDiam - s_dHorDrillDiam) < WD.DRILL_TOL + GEO.EPS_SMALL then
if ( abs( dDiam - s_dHorDrillDiam5Axes) < WD.DRILL_TOL + GEO.EPS_SMALL) or ( abs( dDiam - s_dHorDrillDiam) < WD.DRILL_TOL + GEO.EPS_SMALL) then
local ptDrill = EgtCP( AuxId, GDB_RT.GLOB)
local dLen = abs( EgtCurveThickness( AuxId))
local bLong = dLen > s_dHorDrillLen - 1
@@ -1683,6 +1687,124 @@ NEST.ERR = 0
-- resetto gruppo di lavorazione corrente
EgtResetCurrMachGroup()
-- modalità nesting utile per cabinet: un grezzo per ogni pezzo, pezzo centrato nel grezzo. Il grezzo non viene preso da magazzino ma creato ad hoc, con un dato sovramateriale.
-- il numero del MachGroup deve coincidere con il PDN del pezzo originale
if NEST.FLAG ~= 11 and WD.ENABLE_SIMPLE_NESTING then
-- sovramateriale richiesto
local dOverMaterial = max( 0, NEST.KERF or 2)
-- inizializzazione parametri per creazione grezzo tramite BatchProcessNew
_G.WALL = {}
WALL.FILE = NEST.FILE
WALL.MACHINE = NEST.MACHINE
WALL.BASEDIR = NEST.BASEDIR
WALL.FLAG = 6 -- CREATE_PANEL
WALL.NESTING_REF = 'BL'
-- si ricrea la lista pezzi ordinata
local PartList = {}
local nPartCounter = 0
for nPartId, nCount in pairs( PART) do
nPartCounter = nPartCounter + 1
PartList[nPartCounter] = {}
PartList[nPartCounter].nId = nPartId
PartList[nPartCounter].nCount = nCount
PartList[nPartCounter].nPdn = EgtGetInfo( nPartId, "PDN", 'i')
PartList[nPartCounter].bAddCounterToNaming = false
-- se presente un pezzo con multipli il PDN sarà seguito da un contatore
if nCount > 1 then
PartList[nPartCounter].bAddCounterToNaming = true
end
end
-- si riordina in base al PDN
table.sort( PartList, function(a, b) return tonumber( a.nPdn) < tonumber( b.nPdn) end)
-- per ogni singolo pezzo si chiama la fliprot per avere la migliore orientazione
-- si creano duplo e machgroup e si settano le note opportune per poi creare i grezzi richiamando la BatchProcessNew (flag 6)
for i = 1, #PartList do
local nPartId = PartList[i].nId
local nPartCount = PartList[i].nCount
local nPdn = PartList[i].nPdn
local bAddCounterToNaming = PartList[i].bAddCounterToNaming
-- si ruotano e invertono i pezzi per avere la migliore posizione di lavorazione
_G.NFAR = {}
NFAR.ERR = 0
NFAR.MSG = ''
NFAR.PARTID = nPartId
NFAR.BASEDIR = NEST.BASEDIR
dofile( NEST.BASEDIR .. "\\NestFlipAndRotate.lua")
-- informazioni dalla parte originale
-- box e relative dimensioni
local nBoxLayerId = EgtGetFirstNameInGroup( nPartId, "Box")
local nBoxId = EgtGetFirstNameInGroup( nBoxLayerId, "Box")
local b3Part = EgtGetBBoxGlob( nBoxId, GDB_BB.STANDARD)
-- inversione e rotazione
local nPartFlip = EgtGetInfo( nPartId, "INVERTED", 'i') or 0
local nPartRotation = EgtGetInfo( nPartId, "ROTATED", 'i') or 0
-- dimensioni grezzo, considerando sovramateriale
local dRawLength = b3Part:getDimX() + 2 * dOverMaterial
local dRawWidth = b3Part:getDimY() + 2 * dOverMaterial
for j = 1, nPartCount do
-- creazione gruppo di lavoro
local sMachGroupName = nPdn
if bAddCounterToNaming then
sMachGroupName = nPdn .. '_' .. string.format("%02d", j)
end
local nMachGroupId = EgtAddMachGroup( sMachGroupName)
if not nMachGroupId then
EgtOutLog( "Errore: MachGroup " .. nPdn .. " già presente")
EgtOutBox( 'Error : MachGroup ' .. nPdn .. ' already existing', 'Nesting failed')
NEST.ERR = 2
return
end
-- settaggio note in gruppo di lavoro
EgtSetInfo( nMachGroupId, "PANELLEN", dRawLength)
EgtSetInfo( nMachGroupId, "PANELWIDTH", dRawWidth)
EgtSetInfo( nMachGroupId, "MATERIAL", NEST.MATERIAL)
EgtSetInfo( nMachGroupId, "PRODID", NEST.PRODID)
EgtSetInfo( nMachGroupId, "PATTID", nMachGroupId)
-- creazione duplo
local nPartDuploId = EgtDuploNew( nPartId)
-- settaggio note in duplo
EgtSetInfo( nMachGroupId, "PART" .. 1, nPartDuploId .. "," .. EgtNumToString( dOverMaterial) .. "," .. EgtNumToString( dOverMaterial) .. "," .. 0 .."," .. 0)
EgtSetInfo( nPartDuploId, "POSY", dOverMaterial)
EgtSetInfo( nPartDuploId, "POSX", dOverMaterial)
EgtSetInfo( nPartDuploId, "FLIP", nPartFlip)
EgtSetInfo( nPartDuploId, "ROT", nPartRotation)
-- creazione grezzi tramite BatchProcessNew
EgtSetCurrMachGroup( nMachGroupId)
EgtSetInfo( nMachGroupId, "UPDATEUI", 1)
dofile( NEST.BASEDIR .. "\\BatchProcessNew.lua")
end
end
EgtProcessEvents( 200 + 100, 0)
EgtResetCurrMachGroup()
EgtOutLog( ' +++ NestProcess completed')
EgtOutLog( ' +++ Generating Cutting List')
return
elseif NEST.FLAG == 11 then
local vCuttingListType = EgtSplitString( WD.PANELSAW_TYPE)
for i = 1, #vCuttingListType do
local sCuttingListType = vCuttingListType[i]
PanelSaw.GenerateCuttingList( sCuttingListType)
end
return
end
-- inizio nesting automatico
EgtAutoNestStart()
@@ -1691,7 +1813,7 @@ local RawParts = {}
-- creo tabella dei grezzi
for sIndex, dLen in pairs( LEN) do
RawParts[tonumber(sIndex)] = { Len = dLen}
end
end
for sIndex, dWidth in pairs( WIDTH) do
RawParts[tonumber(sIndex)].Width = dWidth
end
+8 -4
View File
@@ -1,4 +1,4 @@
-- Process.lua by Egaltech s.r.l. 2022/05/09
-- Process.lua by Egaltech s.r.l. 2026/03/30
-- Gestione calcolo disposizione e lavorazioni per Pareti
-- Si opera sulla macchina corrente
-- 2020/12/09 Come per BatchProcess.lua si gestiscono anche rotazioni di inversione con valori negativi.
@@ -108,6 +108,10 @@ local function MyProcessInputData()
-- Recupero informazione se progetto o produzione
local bProj = ( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'PROJECT', 'i') == 1)
-- Verifico se progetto deriva da BeamWall
local _, _, sExt = EgtSplitPath( EgtGetCurrFilePath() or '')
local bBwProj = ( ( string.upper( sExt or '') == '.BWE'))
-- Eseguo eventuali rotazioni e inversioni testa-coda
for i = 1, #vWall do
@@ -115,7 +119,7 @@ local function MyProcessInputData()
-- rotazione
local dRotAng = EgtGetInfo( vWall[i].Id, 'ROTATED', 'd')
if dRotAng then
if abs( dRotAng) > GEO.EPS_ANG_SMALL and not EgtExistsInfo( vWall[i].Id, 'ROTATED_DONE') then
if abs( dRotAng) > GEO.EPS_ANG_SMALL and not bBwProj and not EgtExistsInfo( vWall[i].Id, 'ROTATED_DONE') then
local ptRotCen = b3Solid:getCenter()
EgtRotate( vWall[i].Id, ptRotCen, X_AX(), dRotAng, GDB_RT.GLOB)
b3Solid:rotate( ptRotCen, X_AX(), dRotAng)
@@ -125,7 +129,7 @@ local function MyProcessInputData()
-- inversione
local dInvAng = EgtGetInfo( vWall[i].Id, 'INVERTED', 'd')
if dInvAng then
if abs( dInvAng - 180) > GEO.EPS_ANG_SMALL and abs( dInvAng + 180) > GEO.EPS_ANG_SMALL and not EgtExistsInfo( vWall[i].Id, 'INVERTED_DONE') then
if abs( dInvAng - 180) > GEO.EPS_ANG_SMALL and abs( dInvAng + 180) > GEO.EPS_ANG_SMALL and not bBwProj and not EgtExistsInfo( vWall[i].Id, 'INVERTED_DONE') then
local ptInvCen = b3Solid:getCenter()
EgtRotate( vWall[i].Id, ptInvCen, Z_AX(), dInvAng - 180, GDB_RT.GLOB)
b3Solid:rotate( ptInvCen, Z_AX(), dInvAng - 180)
@@ -134,7 +138,7 @@ local function MyProcessInputData()
end
-- correzioni per rotazioni non centrate di produzioni TS3 (quasi sempre multipli di 90 deg)
local sType = EgtGetInfo( vWall[i].Id, 'TYPE', 's')
if not bProj and dRotAng and dInvAng and sType ~= 'LAYER' then
if not bProj and not bBwProj and dRotAng and dInvAng and sType ~= 'LAYER' then
if abs( dInvAng - 0) < GEO.EPS_ANG_SMALL then
if abs( dRotAng - 180) < GEO.EPS_ANG_SMALL then
vWall[i].PosZ = vWall[i].PosZ - vWall[i].Box:getDimY()
+36
View File
@@ -1,5 +1,41 @@
==== Wall Update Log ====
Versione 3.1d2 (23/04/2026)
- Modif : Tutte le forature vengono ordinate per diametro decrescente
Versione 3.1d1 (08/04/2026)
- Modif : in LapJoint, svuotature, l'uscita dalla geometria viene limitata della massima quantità che non rovina il pezzo vicino
- Fixed : correzione per chiodature
Versione 3.1c1 (02/04/2026)
- Added : in CleanCorner si gestiscono angoli diversi da 30
- Fixed : in puliture con sega a catena corrett scelta errata del lato
Versione 2.7k1 (20/11/2025)
- Modif : in LapJoint con Q08=1 ora si fanno con milling anche tasche a L cieche da sopra
- Fixed : in LapJoint correzione alle lavorazioni inclinate
Versione 2.7j2 (21/10/2025)
- Modif : in LapJoint i percorsi dei truciolatori sono sempre in concordanza a meno di forzature con apposito flag macchina
- Modif : in PanelSaw migliorata l'esportazione Cutty
Versione 2.7j1 (08/10/2025)
- Added : in PanelSaw si gestiscono le esportazioni Homag
- Added : in PanelSaw si gestisce la direzione fibra
- Modif : in PanelSaw migliorata l'esportazione Cutty
Versione 2.7i2 (18/09/2025)
- Modif : in PanelSaw gestione campi a lunghezza fissa
Versione 2.7i1 (16/09/2025)
- Added : per cabinet aggiunta esportazione cutting list e modalità nesting semplice
Versione 2.7h1 (06/08/2025)
- Modif : in LapJoint migliorata scelta lavorazione in caso di feature piccola
Versione 2.7g3 (24/07/2025)
- Fixed : in Lapjoint corretto step in caso due facce verso l'alto
Versione 2.7g2 (17/07/2025)
- Added : aggiunta gestione origine e offset da questa che non fanno riprocessare l'intero grezzo (ma solo aggiornare)
- Fixed : corretta BatchProcess per nome file anche se da non riprocessare.
+3 -3
View File
@@ -1,6 +1,6 @@
-- Version.lua by Egalware s.r.l. 2025/07/17
-- Version.lua by Egalware s.r.l. 2026/03/30
-- Gestione della versione di Wall
NAME = 'Wall'
VERSION = '2.7g2'
MIN_EXE = '2.7f2'
VERSION = '3.1d2'
MIN_EXE = '3.1c1'