Compare commits
421 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d6e98875fa | |||
| ba6142dbc5 | |||
| cfaa30d55c | |||
| ea79ac1366 | |||
| 2468599200 | |||
| ea598ef7ff | |||
| 9290d3f1cf | |||
| 698a913a93 | |||
| f62c42475e | |||
| f397b220b9 | |||
| d19cf453e0 | |||
| a9d497925d | |||
| ef5170b6e6 | |||
| 3d2b740e89 | |||
| b7078cfe11 | |||
| 30726886c1 | |||
| ed80dccaf0 | |||
| 0f4a0804e2 | |||
| 8830001985 | |||
| c0e2199903 | |||
| b7854f1160 | |||
| 63ad68a653 | |||
| 4458c174e8 | |||
| 697965b30b | |||
| 20900c9724 | |||
| 9043e80c84 | |||
| 45780fce29 | |||
| 45cdddb994 | |||
| 24e20625b6 | |||
| c77062160a | |||
| bb0d02c1e5 | |||
| cb2c752d65 | |||
| 30d0efa0ca | |||
| 7f4e117339 | |||
| 366a9d5f49 | |||
| 9e869b5c26 | |||
| a0e82e5647 | |||
| a17e649d44 | |||
| 79856f6345 | |||
| 94e0ba559b | |||
| 2bde93681f | |||
| bc467fc784 | |||
| fc5071a9ae | |||
| 036c782671 | |||
| 5a6ac3ac8d | |||
| 234692545d | |||
| 17d411e5c2 | |||
| 4b0334ab65 | |||
| b6f025266d | |||
| c91b58b6a1 | |||
| 533a8e9f1f | |||
| 8d26b20ce4 | |||
| dbf668863a | |||
| 5b45aee1f2 | |||
| 2b94531281 | |||
| ed0e726391 | |||
| 14d726ffae | |||
| 9dc093e16b | |||
| 7775fa75fc | |||
| a449af35d9 | |||
| 83432e36f4 | |||
| 740d244d87 | |||
| 3e7b1dc0fd | |||
| 10e5d79412 | |||
| 97e204fbb1 | |||
| 74daefd044 | |||
| a92d22e526 | |||
| 099b159aae | |||
| 76624de1a5 | |||
| e15a833158 | |||
| 9046099e35 | |||
| 8f36025b64 | |||
| 0bec7ba4a5 | |||
| 95346a26d7 | |||
| e59ca27cdf | |||
| 10c44c7f82 | |||
| b2adfc098b | |||
| ec1eddf909 | |||
| dfeb8c38dd | |||
| a6b72d13cd | |||
| c58a9e7912 | |||
| a13dcbccf9 | |||
| 437682ab7a | |||
| a7d6363228 | |||
| b452a9ad99 | |||
| 4fc7110885 | |||
| f07e0d4afd | |||
| 29c1eaed0c | |||
| 6cf29a3a06 | |||
| 0f84937c6f | |||
| d8af5b3989 | |||
| b8ee911ed5 | |||
| 95006f4cce | |||
| 0b78227c6b | |||
| b6dd9a096a | |||
| 2b67b00d2e | |||
| f434c70f22 | |||
| 221162ce9d | |||
| f48b40d633 | |||
| 0388dbdc0f | |||
| a27566031b | |||
| 36ddc182f9 | |||
| cb473692dd | |||
| 3e805545f0 | |||
| 611ab1cb12 | |||
| 6fda7f818f | |||
| d4c94d9e8a | |||
| 612b73e2e9 | |||
| d82802bd10 | |||
| 00d5f929bb | |||
| 8c30535a69 | |||
| 5d5eb3f5cc | |||
| e3faec9d5d | |||
| e844d761f9 | |||
| 6a86f7798e | |||
| 6a6a194df6 | |||
| dcd600af01 | |||
| 854fafddf2 | |||
| ef6cbc35df | |||
| 2887591da4 | |||
| 3d75344652 | |||
| 1952c937b0 | |||
| 99baaa6320 | |||
| 3ac752861b | |||
| d690906180 | |||
| 1bf70aaf27 | |||
| e5a2a7e5a9 | |||
| b726fbc2cc | |||
| 0771665282 | |||
| 6ba42d19e9 | |||
| 374021ad13 | |||
| dfe405f3b0 | |||
| bd7885d245 | |||
| 1c19c48e55 | |||
| 9a40887d05 | |||
| 02e1bc7881 | |||
| 5791bea4b5 | |||
| 5b39d1a4ac | |||
| 62e00e8854 | |||
| 349f0cb879 | |||
| a53a6f3e63 | |||
| 4f2ffec3ab | |||
| b1dd887899 | |||
| b325ebcd32 | |||
| f17411326b | |||
| 4752ffcfb4 | |||
| dbf17d942c | |||
| 72020a8874 | |||
| 5d422b6edc | |||
| d2b3c32b61 | |||
| b4b3df0f5e | |||
| fdd114a8cd | |||
| d5e47c06fa | |||
| abc61f53ba | |||
| 6e7c4ffda1 | |||
| bfaa85bbf2 | |||
| 5c9e199c5a | |||
| 09127ce576 | |||
| 87cd31bef7 | |||
| 32fdaf5096 | |||
| 2ea09e3ebc | |||
| ce8072ad1b | |||
| 896c0296a4 | |||
| 88fd8d525c | |||
| 01c5037d77 | |||
| 34e7befc10 | |||
| 846d96b967 | |||
| cfd3379c98 | |||
| 6f06755539 | |||
| a0af959c9f | |||
| f397b66e26 | |||
| 31782b904e | |||
| 93fe741f84 | |||
| ba2158a909 | |||
| 6e0758218c | |||
| 401108ce56 | |||
| b7973541e4 | |||
| bf1e9065ae | |||
| 1faa9e2075 | |||
| ceef5b78f3 | |||
| 66e2bd6e45 | |||
| 0508f12673 | |||
| 2bbfe1f3ce | |||
| 4a67fdeeff | |||
| 1c86ed925a | |||
| 3f8540b3df | |||
| c92327641c | |||
| 499e49f4f6 | |||
| 099e81cbfd | |||
| 0f38de8f58 | |||
| d5e30baf06 | |||
| 4531434e79 | |||
| e56074f662 | |||
| 5866566ebe | |||
| c4272d917e | |||
| 52a10eeb9f | |||
| 1d5689c007 | |||
| f402590534 | |||
| b3289195f4 | |||
| f0a07554b2 | |||
| 1ed45a8569 | |||
| 43482f5a6d | |||
| e66831d223 | |||
| 548bc7bc6c | |||
| 3f7a2c016d | |||
| 3763338bb3 | |||
| 767acf2579 | |||
| 4da70c0d3c | |||
| d939e07fd3 | |||
| 67bf77fe19 | |||
| 384d72eb13 | |||
| 22541cfc9b | |||
| 1dac9716e7 | |||
| 68464cf5b1 | |||
| 78bf456326 | |||
| cb4d597369 | |||
| 7bcd159db0 | |||
| abed970b7a | |||
| 96760ac284 | |||
| 392040f8d6 | |||
| 56dc61a9d6 | |||
| ea5e62222c | |||
| 3b098e1541 | |||
| 354cbe85b9 | |||
| 25779abb81 | |||
| 1a4baaf1be | |||
| 20fccb24af | |||
| aa94102b28 | |||
| a2d89cd98d | |||
| 6e2e976675 | |||
| db5ae17d63 | |||
| 3e9da2724b | |||
| a1946a4a41 | |||
| 87cb7480be | |||
| 9563735770 | |||
| d1218915f7 | |||
| 19c7a54aa7 | |||
| 7bbed3cb8a | |||
| 25f599a1fa | |||
| c0970c52ff | |||
| 61590f611d | |||
| f8011493f2 | |||
| a76bd31fe4 | |||
| 07a80248dc | |||
| 89838c6f28 | |||
| 764c80824a | |||
| 37da3ba714 | |||
| a1a74390c0 | |||
| c04e97a01d | |||
| 111c541f8b | |||
| 760563e0f8 | |||
| 15c80a8628 | |||
| 29a2ec8bae | |||
| e1d58a1d70 | |||
| da7d2a7159 | |||
| d1ca35e29d | |||
| e92ba3e740 | |||
| a84fb0608f | |||
| f9bb10bf6e | |||
| fea5cfd8ed | |||
| 31172238d8 | |||
| f29816c693 | |||
| 164e0474fa | |||
| 10bfb3273c | |||
| 732e6c0390 | |||
| 1ef5ae8f0c | |||
| 5340c6a92c | |||
| 9edd6aec23 | |||
| 7c67b24b37 | |||
| 12bb64bacb | |||
| 35fa519eb3 | |||
| 64ca535056 | |||
| fdd6b7f7bb | |||
| 7c2bc2ec5d | |||
| f6286d839a | |||
| 3b998e5fba | |||
| 33deb8b5e3 | |||
| 47ec893959 | |||
| 79e97c9e1f | |||
| 18ae1a71cc | |||
| 736065eaad | |||
| 09ce7d2d01 | |||
| 84eb8ec1b9 | |||
| a2fc9b4ade | |||
| bb5b13d122 | |||
| ee04bed533 | |||
| 5452ceda9f | |||
| a875f9758b | |||
| c091137ffc | |||
| 007288b9c9 | |||
| 9d0206984b | |||
| 84339a5843 | |||
| efc9a89bf5 | |||
| 780b0addc1 | |||
| 6c1d2e5cc5 | |||
| 1c623206df | |||
| eca052bd67 | |||
| 4034898f6e | |||
| aa7099539e | |||
| 510724a627 | |||
| 23a831cf50 | |||
| 8b999fad88 | |||
| b2fe513d2d | |||
| 4e0a87fbf6 | |||
| e43afd5af4 | |||
| 8b095a195a | |||
| f2a066192f | |||
| 11b6a8716e | |||
| e59030ed4b | |||
| a859e72707 | |||
| 4bcf2c8068 | |||
| 55050a17d2 | |||
| fa9a8a7e49 | |||
| ff9320993c | |||
| 93f9df0d5f | |||
| 9f32c5fd87 | |||
| 41f85808e2 | |||
| 9f014c70f7 | |||
| b2fdd27130 | |||
| 6a2a87b91f | |||
| 61e5ce6359 | |||
| fa276949a2 | |||
| d24a86bcdd | |||
| 5524fbf0cb | |||
| afb33aa7c6 | |||
| 924313a0ea | |||
| 9d812ab33a | |||
| 3c7c22ae7c | |||
| b9c9cc5167 | |||
| 756d58b3e4 | |||
| 4a5c213de6 | |||
| d0cecd6a0d | |||
| 3326f8ef4e | |||
| 5e6dfe320f | |||
| a4c3b74434 | |||
| f1d81ffb4d | |||
| a4dcf78c9b | |||
| 8ddad9f183 | |||
| 46a299b83d | |||
| 82b518bd54 | |||
| fcd7ee98a0 | |||
| d1fe91e68a | |||
| b65a4e2220 | |||
| e6bd4e7e94 | |||
| 5ff950015e | |||
| 57ed0d934f | |||
| 515dbabde9 | |||
| ea8852115c | |||
| dda6389ab2 | |||
| 69611fb9eb | |||
| 25a533dbf4 | |||
| 3e189d6421 | |||
| 9bba651886 | |||
| e1a5625f18 | |||
| ff3a738d91 | |||
| 8225bc93d5 | |||
| 59c9e6d1cd | |||
| eae34681f3 | |||
| 098ef8deaf | |||
| 7f10b7219a | |||
| 8cfd505f81 | |||
| 7f29b951c8 | |||
| 75d0d7fd13 | |||
| 808536a3aa | |||
| 5b5ce504b1 | |||
| f2027d03a3 | |||
| d959e46f50 | |||
| a156b5d703 | |||
| 5ee62cfee2 | |||
| 3ca0ab1692 | |||
| 51e1425921 | |||
| b0abe6d088 | |||
| be49385bb0 | |||
| fe26308388 | |||
| 9846bf2598 | |||
| d3c43fdec1 | |||
| cb26d23639 | |||
| 7b991ddc7a | |||
| c685b0c4c5 | |||
| 4e079f6708 | |||
| 62d1c3cb29 | |||
| ed05f04de6 | |||
| aa341ed2b3 | |||
| 18fb6622f5 | |||
| 7f3aba6d1d | |||
| abfee0334d | |||
| e34ac566e1 | |||
| 6550ddd456 | |||
| 68ad658bc5 | |||
| 9838bc7f31 | |||
| dcc1e5b543 | |||
| 01260c7278 | |||
| f2bdb23f9d | |||
| 5bb7fdd634 | |||
| 1131948d33 | |||
| 30c449bfad | |||
| 1236d196ba | |||
| be33225242 | |||
| 2db0e4b8a9 | |||
| 8b3bb67710 | |||
| f9f6462dc2 | |||
| 47b3298e89 | |||
| 4f1c652dc0 | |||
| de9fa79f8a | |||
| f6caf21581 | |||
| b0b8e88c30 | |||
| d020fa143c | |||
| eeb34638cf | |||
| 7f2d1895a1 | |||
| 766bd61981 | |||
| 1102a7c23a | |||
| 358df3cfdb | |||
| bd0dbbb41c | |||
| 2606cf4f13 | |||
| e63b498902 | |||
| 63a3cfe698 | |||
| 78cf115748 | |||
| ac853fc74c | |||
| 1a1d48a2c1 | |||
| a05741f7be | |||
| d704e899a2 |
@@ -19,3 +19,5 @@
|
||||
/bin/*.ini
|
||||
/bin/LuaLibs/*.lua
|
||||
/bin/Images/*.png
|
||||
.vscode/settings.json
|
||||
bin/Images/.placeholder
|
||||
|
||||
+4
-4
@@ -24,14 +24,14 @@ variables:
|
||||
$FileList = Get-ChildItem("*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua54 -o bin\$FileName $FileName
|
||||
echo "lua54 -o bin\$FileName $FileName"
|
||||
lua54 -o bin\$FileName -s $FileName
|
||||
echo "lua54 -o bin\$FileName -s $FileName"
|
||||
}
|
||||
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
|
||||
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
|
||||
lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName
|
||||
echo "lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName"
|
||||
}
|
||||
|
||||
# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
|
||||
|
||||
+68
-8
@@ -1,4 +1,4 @@
|
||||
-- BatchProcess.lua by Egaltech s.r.l. 2023/04/17
|
||||
-- BatchProcess.lua by Egaltech s.r.l. 2025/07/17
|
||||
-- Gestione calcolo batch disposizione e lavorazioni per Pareti
|
||||
-- 2020/07/24 Nuvola di punti riferita allo Zero Tavola.
|
||||
-- 2020/10/28 Corretto spostamento pezzi per rotazioni (0 o 180) e inversioni( 0, 90, 180, o 270).
|
||||
@@ -14,6 +14,7 @@
|
||||
-- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData.
|
||||
-- 2023/04/09 Aggiunta gestione flag per taglio feature con outline (da WD.CUT_WITH_OUTLINE).
|
||||
-- 2023/04/17 Aggiunta gestione flag per rotazione grezzo di 180deg (da WD.RAWPART_ROT).
|
||||
-- 2024/02/20 Tolleranza su altezza pannello in grezzo portata a 0.1 mm.
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
@@ -91,13 +92,49 @@ end
|
||||
-- Funzione per aggiornare dati ausiliari
|
||||
local function UpdateAuxData( sAuxFile)
|
||||
local bModif = false
|
||||
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
|
||||
-- Se definito PROJID, aggiorno
|
||||
local sProjId = EgtGetStringFromIni( 'AuxData', 'PROJID', '', sAuxFile)
|
||||
if sProjId ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'PROJECTNUMBER', sProjId)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito PRODID, aggiorno
|
||||
local sProdId = EgtGetStringFromIni( 'AuxData', 'PRODID', '', sAuxFile)
|
||||
if sProdId ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'PRODID', sProdId)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito LOAD90, aggiorno
|
||||
local sLoad90 = EgtGetStringFromIni( 'AuxData', 'LOAD90', '', sAuxFile)
|
||||
if sLoad90 ~= '' then
|
||||
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
|
||||
EgtSetInfo( BtlInfoId, 'LOAD90', sLoad90)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito REFPOS, aggiorno
|
||||
local sRefPos = EgtGetStringFromIni( 'AuxData', 'REFPOS', '', sAuxFile)
|
||||
if sRefPos ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'REFPOS', sRefPos)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito PANELDELTAX, aggiorno
|
||||
local sPanelDeltaX = EgtGetStringFromIni( 'AuxData', 'PANELDELTAX', '', sAuxFile)
|
||||
if sPanelDeltaX ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'PANELDELTAX', sPanelDeltaX)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito PANELDELTAY, aggiorno
|
||||
local sPanelDeltaY = EgtGetStringFromIni( 'AuxData', 'PANELDELTAY', '', sAuxFile)
|
||||
if sPanelDeltaY ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'PANELDELTAY', sPanelDeltaY)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito PANELDELTAZ, aggiorno
|
||||
local sPanelDeltaZ = EgtGetStringFromIni( 'AuxData', 'PANELDELTAZ', '', sAuxFile)
|
||||
if sPanelDeltaZ ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'PANELDELTAZ', sPanelDeltaZ)
|
||||
bModif = true
|
||||
end
|
||||
return bModif
|
||||
end
|
||||
|
||||
@@ -138,7 +175,6 @@ end
|
||||
-- Carico le librerie
|
||||
_G.package.loaded.WallExec = nil
|
||||
local WE = require( 'WallExec')
|
||||
--local BL = require( 'BeamLib')
|
||||
|
||||
-- Carico i dati globali
|
||||
local WD = require( 'WallData')
|
||||
@@ -232,6 +268,9 @@ if bToProcess then
|
||||
end
|
||||
else
|
||||
dExtraW = 10
|
||||
if WD.DEFAULT_RAW_NO_EXTRA_WIDTH then
|
||||
dExtraW = 0
|
||||
end
|
||||
dRawW = dRawW + dExtraW
|
||||
end
|
||||
end
|
||||
@@ -245,7 +284,7 @@ if bToProcess then
|
||||
end
|
||||
if #vWall == 0 then
|
||||
WALL.ERR = 14
|
||||
WALL.MSG = 'Error no beams in the file : ' .. WALL.FILE
|
||||
WALL.MSG = 'Error no walls in the file : ' .. WALL.FILE
|
||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||
PostErrView( WALL.ERR, WALL.MSG)
|
||||
return
|
||||
@@ -276,6 +315,11 @@ if bToProcess then
|
||||
-- Ne recupero la posizione
|
||||
for i = 1, #vWall do
|
||||
local PosX = EgtGetInfo( vWall[i].Id, 'POSX', 'd')
|
||||
local PosZ = EgtGetInfo( vWall[i].Id, 'POSZ', 'd')
|
||||
if bProj and WD.DEFAULT_RAW_NO_EXTRA_WIDTH and #vWall == 1 then
|
||||
PosX = 0
|
||||
PosZ = 0
|
||||
end
|
||||
vWall[i].PosX = PosX + min( dExtraL, 1200)
|
||||
if WD.USE_POSY then
|
||||
local PosY = EgtGetInfo( vWall[i].Id, 'POSY', 'd')
|
||||
@@ -283,7 +327,6 @@ if bToProcess then
|
||||
else
|
||||
vWall[i].PosY = 0
|
||||
end
|
||||
local PosZ = EgtGetInfo( vWall[i].Id, 'POSZ', 'd')
|
||||
vWall[i].PosZ = PosZ + dExtraW / 2
|
||||
end
|
||||
|
||||
@@ -348,7 +391,7 @@ if bToProcess then
|
||||
local vWallErr = {}
|
||||
for i = 2, #vWall do
|
||||
local dDimH = vWall[i].Box:getDimZ() + vWall[i].PosY
|
||||
if abs( dDimH - dRawH) > 10 * GEO.EPS_SMALL then
|
||||
if abs( dDimH - dRawH) > 100 * GEO.EPS_SMALL then
|
||||
table.insert( vWallErr, i)
|
||||
end
|
||||
end
|
||||
@@ -364,6 +407,12 @@ if bToProcess then
|
||||
PostErrView( WALL.ERR, WALL.MSG)
|
||||
return
|
||||
end
|
||||
|
||||
-- se impostato flag apposito, in vista il grezzo è uguale al pezzo
|
||||
if bProj and WD.DEFAULT_RAW_NO_EXTRA_WIDTH and #vWall == 1 then
|
||||
dRawL = vWall[1].Box:getDimX()
|
||||
dRawW = vWall[1].Box:getDimY()
|
||||
end
|
||||
|
||||
-- Verifico dimensioni massime grezzo
|
||||
if dRawL > WD.MAX_LENGTH + 10 * GEO.EPS_SMALL or dRawW > WD.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > WD.MAX_HEIGHT + 10 * GEO.EPS_SMALL then
|
||||
@@ -494,10 +543,20 @@ else
|
||||
end
|
||||
-- Aggiorno eventuali dati ausiliari
|
||||
UpdateAuxData( sBtmFile)
|
||||
|
||||
-- Anche se non è da riprocessare, imposto nome file CN.
|
||||
-- Se file TS7 importato da altro PC, 'WALL.FILE' è cambiato da un PC all'altro. Di conseguenza si deve aggiornare nome file che si andrà a generare.
|
||||
local _, sName, _ = EgtSplitPath( WALL.FILE)
|
||||
EgtSetInfo( EgtGetLastMachGroup(), 'NcName', sName .. '.cnc')
|
||||
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Aggiorno posizione del grezzo
|
||||
if WE.MoveRaw() then
|
||||
bToRecalc = true
|
||||
end
|
||||
-- Se necessario eseguo aggiornamento con ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or WALL.FLAG == 3 or WALL.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
@@ -561,7 +620,8 @@ if ( WALL.FLAG == 0 and ( bToProcess or bToRecalc)) or WALL.FLAG == 3 or WALL.F
|
||||
end
|
||||
|
||||
-- *** Genero programma CN *** ( se richiesto)
|
||||
if WALL.FLAG == 0 or WALL.FLAG == 4 then
|
||||
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
|
||||
if bIsGenerationEnabled and ( WALL.FLAG == 0 or WALL.FLAG == 4) then
|
||||
EgtOutLog( ' +++ Generating NC part program >>>')
|
||||
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
|
||||
if EgtGetExeVersion then
|
||||
|
||||
+12
-7
@@ -230,7 +230,7 @@ if bToProcess then
|
||||
end
|
||||
if #vWall == 0 then
|
||||
WALL.ERR = 14
|
||||
WALL.MSG = 'Error no beams in the file : ' .. WALL.FILE
|
||||
WALL.MSG = 'Error no walls in the file : ' .. WALL.FILE
|
||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||
PostErrView( WALL.ERR, WALL.MSG)
|
||||
return
|
||||
@@ -275,11 +275,15 @@ if bToProcess then
|
||||
dMinY = ( WD.MINRAWY_HOR_DRILL or 2800)
|
||||
end
|
||||
-- Assegno dimensioni del pannello
|
||||
dPanelLen = vWall[1].Box:getDimX() + 20
|
||||
dPanelWidth = math.max( vWall[1].Box:getDimY() + 20, dMinY)
|
||||
local dExtraW = 10
|
||||
if WD.DEFAULT_RAW_NO_EXTRA_WIDTH then
|
||||
dExtraW = 0
|
||||
end
|
||||
dPanelLen = vWall[1].Box:getDimX() + 2 * dExtraW
|
||||
dPanelWidth = math.max( vWall[1].Box:getDimY() + 2 * dExtraW, dMinY)
|
||||
-- Assegno posizione prima ed unica parete
|
||||
vWall[1].PosX = 10
|
||||
vWall[1].PosZ = 10
|
||||
vWall[1].PosX = dExtraW
|
||||
vWall[1].PosZ = dExtraW
|
||||
vWall[1].Rot = 0
|
||||
vWall[1].Flip = 0
|
||||
end
|
||||
@@ -545,7 +549,7 @@ else
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or WALL.FLAG == 3 or WALL.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
@@ -609,7 +613,8 @@ if ( WALL.FLAG == 0 and ( bToProcess or bToRecalc)) or WALL.FLAG == 3 or WALL.F
|
||||
end
|
||||
|
||||
-- *** Genero programma CN *** ( se richiesto)
|
||||
if WALL.FLAG == 0 or WALL.FLAG == 4 then
|
||||
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
|
||||
if bIsGenerationEnabled and ( WALL.FLAG == 0 or WALL.FLAG == 4) then
|
||||
EgtOutLog( ' +++ Generating NC part program >>>')
|
||||
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
|
||||
if EgtGetExeVersion then
|
||||
|
||||
+27
-24
@@ -1,29 +1,32 @@
|
||||
|
||||
REM Compilazione degli script Wall Egaltech 2023.02.27
|
||||
REM Compilazione degli script Wall Egaltech 2024.03.24
|
||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||
|
||||
REM Compilazione 32 e 64 bit
|
||||
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WallExec.lua LuaLibs\WallExec.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WallLib.lua LuaLibs\WallLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua BatchProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua BatchProcessNew.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\GetWallData.lua GetWallData.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestFlipAndRotate.lua NestFlipAndRotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestProcess.lua NestProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Overturn.lua Overturn.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Process.lua Process.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Rotate.lua Rotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Version.lua Version.lua
|
||||
\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
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WMachiningLib.lua -s LuaLibs\WMachiningLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessCut.lua -s LuaLibs\WProcessCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDoubleCut.lua -s LuaLibs\WProcessDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDrill.lua -s LuaLibs\WProcessDrill.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDtMortise.lua -s LuaLibs\WProcessDtMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WFeatureTopology.lua -s LuaLibs\WFeatureTopology.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessFreeContour.lua -s LuaLibs\WProcessFreeContour.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessLapJoint.lua -s LuaLibs\WProcessLapJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMark.lua -s LuaLibs\WProcessMark.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMortise.lua -s LuaLibs\WProcessMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessSawCut.lua -s LuaLibs\WProcessSawCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessText.lua -s LuaLibs\WProcessText.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessVariant.lua -s LuaLibs\WProcessVariant.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\GetWallData.lua -s GetWallData.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestFlipAndRotate.lua -s NestFlipAndRotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestProcess.lua -s NestProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Overturn.lua -s Overturn.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Process.lua -s Process.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Rotate.lua -s Rotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Version.lua -s Version.lua
|
||||
|
||||
@@ -43,6 +43,7 @@ GWD.NESTING_CORNER = WD.NESTING_CORNER
|
||||
GWD.HOR_DRILL_DIAM = WD.HOR_DRILL_DIAM
|
||||
GWD.MIN_HEIGHT = WD.MIN_HEIGHT
|
||||
GWD.MAX_HEIGHT = WD.MAX_HEIGHT
|
||||
GWD.BTL_PRIORITY = WD.BTL_PRIORITY
|
||||
|
||||
-- Tutto ok
|
||||
GWD.ERR = 0
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,494 @@
|
||||
-- Squaring.lua by Egaltech s.r.l. 2024/10/15
|
||||
-- Libreria squadratura pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local Squaring = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
EgtOutLog( ' Squaring started', 1)
|
||||
|
||||
-- Dati
|
||||
local WD = require( 'WallData')
|
||||
local WM = require( 'WMachiningLib')
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function IsToolOk( Tool, dRawPartHeight)
|
||||
local bIsToolOk = false
|
||||
local bToolExists = false
|
||||
local bToolCanReachDepth = false
|
||||
local dMaxOvermaterial = 0
|
||||
if type( WD.SQUARING_MAX_OVERMATERIAL) == "number" then
|
||||
dMaxOvermaterial = WD.SQUARING_MAX_OVERMATERIAL
|
||||
end
|
||||
|
||||
bToolExists = ( next( Tool) ~= nil)
|
||||
if bToolExists then
|
||||
if Tool.nType == MCH_TY.MILL_NOTIP then
|
||||
bToolCanReachDepth = ( Tool.dThickness > dMaxOvermaterial - 10 * GEO.EPS_SMALL)
|
||||
and ( Tool.dSideDepth > dRawPartHeight - 10 * GEO.EPS_SMALL)
|
||||
else
|
||||
bToolCanReachDepth = Tool.dMaxDepth > dRawPartHeight - 10 * GEO.EPS_SMALL
|
||||
end
|
||||
end
|
||||
bIsToolOk = bToolExists and bToolCanReachDepth
|
||||
|
||||
return bIsToolOk
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.GetTools()
|
||||
-- TODO vedere se questo valore è coerente sulle diverse macchine
|
||||
local dHeadEncumberance = 130
|
||||
|
||||
local Tool = {}
|
||||
local SquaringTools = {}
|
||||
SquaringTools.Blade = {}
|
||||
SquaringTools.Diskmill = {}
|
||||
SquaringTools.Mill = {}
|
||||
SquaringTools.Blade.H1 = {}
|
||||
SquaringTools.Blade.H2 = {}
|
||||
SquaringTools.Blade.H7 = {}
|
||||
SquaringTools.Diskmill.H1 = {}
|
||||
SquaringTools.Diskmill.H7 = {}
|
||||
SquaringTools.Mill.H1 = {}
|
||||
SquaringTools.Mill.H7 = {}
|
||||
|
||||
Tool.sName = EgtTdbGetFirstTool( MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE)
|
||||
while Tool.sName ~= '' do
|
||||
EgtTdbSetCurrTool( Tool.sName)
|
||||
local bIsToolLoadedOnSetup = EgtFindToolInCurrSetup( Tool.sName)
|
||||
local bIsSquaringTool = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SQUARING', 'b') or false
|
||||
|
||||
Tool.nType = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
Tool.dDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
Tool.dMaxMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
Tool.dThickness = EgtIf( ( Tool.nType == MCH_TY.SAW_FLAT or Tool.nType == MCH_TY.SAW_STD), EgtTdbGetCurrToolParam( MCH_TP.THICK), Tool.dMaxMaterial)
|
||||
Tool.dMaxDepth = EgtTdbGetCurrToolMaxDepth() or Tool.dMaxMaterial
|
||||
Tool.sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
Tool.bIsCcw = EgtTdbGetCurrToolParam( MCH_TP.SPEED) < 0
|
||||
Tool.dFeed = EgtTdbGetCurrToolParam( MCH_TP.FEED)
|
||||
Tool.dStartFeed = EgtTdbGetCurrToolParam( MCH_TP.STARTFEED)
|
||||
Tool.dEndFeed = EgtTdbGetCurrToolParam( MCH_TP.ENDFEED)
|
||||
Tool.dTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
|
||||
Tool.dMinFeed = EgtTdbGetCurrToolParam( MCH_TP.MINFEED)
|
||||
Tool.dStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'STEP', 'd') or EgtIf( ( Tool.nType == MCH_TY.SAW_FLAT or Tool.nType == MCH_TY.SAW_STD), ( Tool.dDiameter / 3), ( Tool.dMaxMaterial / 3))
|
||||
Tool.dSideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd') or ( Tool.dDiameter / 3)
|
||||
Tool.dSideDepth = Tool.dDiameter / 2 - dHeadEncumberance
|
||||
|
||||
if bIsToolLoadedOnSetup and Tool.nType and bIsSquaringTool then
|
||||
-- lame
|
||||
if Tool.nType == MCH_TY.SAW_FLAT or Tool.nType == MCH_TY.SAW_STD then
|
||||
SquaringTools.Blade[Tool.sHead] = Tool
|
||||
Tool.bIsPathCw = Tool.bIsCcw
|
||||
Tool.dSideStep = Tool.dStep
|
||||
Tool.dStep = Tool.dThickness
|
||||
-- frese standard
|
||||
elseif Tool.nType == MCH_TY.MILL_STD then
|
||||
SquaringTools.Mill[Tool.sHead] = Tool
|
||||
Tool.bIsPathCw = not Tool.bIsCcw
|
||||
-- truciolatori
|
||||
elseif Tool.nType == MCH_TY.MILL_NOTIP then
|
||||
SquaringTools.Diskmill[Tool.sHead] = Tool
|
||||
Tool.bIsPathCw = Tool.bIsCcw
|
||||
end
|
||||
end
|
||||
|
||||
Tool = {}
|
||||
Tool.sName = EgtTdbGetNextTool( MCH_TF.SAWBLADE + MCH_TF.MILL + MCH_TF.MORTISE)
|
||||
end
|
||||
|
||||
return SquaringTools
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.AreToolsOk( sSquaringTool, SquaringTools, dRawPartHeight)
|
||||
local bAreToolsOk = false
|
||||
|
||||
if sSquaringTool == 'DoubleDiskmill' then
|
||||
bAreToolsOk = ( IsToolOk( SquaringTools.Blade.H2, dRawPartHeight)
|
||||
and IsToolOk( SquaringTools.Diskmill.H1, dRawPartHeight)
|
||||
and IsToolOk( SquaringTools.Diskmill.H7, dRawPartHeight))
|
||||
elseif sSquaringTool == 'DoubleDiskmillAndBlade' then
|
||||
bAreToolsOk = ( IsToolOk( SquaringTools.Blade.H2, dRawPartHeight)
|
||||
and ( IsToolOk( SquaringTools.Diskmill.H1, dRawPartHeight) or IsToolOk( SquaringTools.Diskmill.H7, dRawPartHeight)))
|
||||
elseif sSquaringTool == 'DoubleBlade' then
|
||||
bAreToolsOk = ( IsToolOk( SquaringTools.Blade.H2, dRawPartHeight)
|
||||
and ( IsToolOk( SquaringTools.Blade.H1, dRawPartHeight) or IsToolOk( SquaringTools.Blade.H7, dRawPartHeight)))
|
||||
elseif sSquaringTool == 'Diskmill' then
|
||||
bAreToolsOk = IsToolOk( SquaringTools.Diskmill.H1, dRawPartHeight) or IsToolOk( SquaringTools.Diskmill.H7, dRawPartHeight)
|
||||
elseif sSquaringTool == 'Blade' then
|
||||
bAreToolsOk = IsToolOk( SquaringTools.Blade.H2, dRawPartHeight)
|
||||
elseif sSquaringTool == 'DoubleMill' then
|
||||
bAreToolsOk = IsToolOk( SquaringTools.Mill.H1, dRawPartHeight) and IsToolOk( SquaringTools.Mill.H7, dRawPartHeight)
|
||||
elseif sSquaringTool == 'Mill' then
|
||||
bAreToolsOk = IsToolOk( SquaringTools.Mill.H1, dRawPartHeight) or IsToolOk( SquaringTools.Mill.H7, dRawPartHeight)
|
||||
else
|
||||
error( 'Squaring Tool not recognized')
|
||||
end
|
||||
|
||||
return bAreToolsOk
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.CalculateParameters( sSquaringTool, SquaringTools, RawPart, vPart)
|
||||
local SquaringParameters = {}
|
||||
local sOrigCorner = EgtGetInfo( RawPart.nId, 'ORIGCORNER')
|
||||
local bShrinkToParts = ( WD.SQUARING_TYPE == 2)
|
||||
local bSquaringStartsOnReference = ( type( WD.SQUARING_STARTS_ON_REFERENCE) == "boolean") and ( WD.SQUARING_STARTS_ON_REFERENCE == true)
|
||||
local dOffsetXY = 0
|
||||
local dExtendZ = 0
|
||||
if type( WD.SQUARING_OFFSET_XY) == "number" and ( WD.SQUARING_TYPE < 2) then
|
||||
dOffsetXY = WD.SQUARING_OFFSET_XY
|
||||
end
|
||||
if type( WD.SQUARING_EXTEND_Z) == "number" then
|
||||
dExtendZ = WD.SQUARING_EXTEND_Z
|
||||
end
|
||||
|
||||
local Front = { sSide = 'Front'}
|
||||
local Right = { sSide = 'Right'}
|
||||
local Back = { sSide = 'Back'}
|
||||
local Left = { sSide = 'Left'}
|
||||
local b3Squaring = BBox3d( RawPart.b3)
|
||||
-- se squadratura sui pezzi invece che sul master panel, si costruisce il box minimo che contiene tutti i pezzi
|
||||
if bShrinkToParts then
|
||||
b3Squaring = BBox3d( vPart[1].Box:getCenter())
|
||||
for i = 1, #vPart do
|
||||
b3Squaring:Add( vPart[i].Box)
|
||||
end
|
||||
end
|
||||
local dDimX = b3Squaring:getDimX()
|
||||
local dDimY = b3Squaring:getDimY()
|
||||
local pt1 = b3Squaring:getMin() + Point3d( -dOffsetXY, -dOffsetXY, -dExtendZ)
|
||||
local pt2 = pt1 + Point3d( dDimX + 2 * dOffsetXY, 0, 0)
|
||||
local pt3 = pt2 + Point3d( 0, dDimY + 2 * dOffsetXY,0 )
|
||||
local pt4 = pt3 + Point3d( -dDimX - 2 * dOffsetXY, 0, 0)
|
||||
b3Squaring:Add( pt1)
|
||||
b3Squaring:Add( pt2)
|
||||
b3Squaring:Add( pt3)
|
||||
b3Squaring:Add( pt4)
|
||||
Front.nId = EgtLine( RawPart.nId, pt1, pt2, GDB_RT.GLOB)
|
||||
Right.nId = EgtLine( RawPart.nId, pt2, pt3, GDB_RT.GLOB)
|
||||
Back.nId = EgtLine( RawPart.nId, pt3, pt4, GDB_RT.GLOB)
|
||||
Left.nId = EgtLine( RawPart.nId, pt4, pt1, GDB_RT.GLOB)
|
||||
if not ( sSquaringTool == 'DoubleMill') and not ( sSquaringTool == 'Mill') then
|
||||
EgtModifyCurveExtrusion( Front.nId, -Y_AX(), GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( Right.nId, X_AX(), GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( Back.nId, Y_AX(), GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( Left.nId, -X_AX(), GDB_RT.GLOB)
|
||||
end
|
||||
EgtSetName( Front.nId, 'SquaringGeometry')
|
||||
EgtSetName( Right.nId, 'SquaringGeometry')
|
||||
EgtSetName( Back.nId, 'SquaringGeometry')
|
||||
EgtSetName( Left.nId, 'SquaringGeometry')
|
||||
|
||||
-- in base al caso si assegna l'utensile al lato
|
||||
if sSquaringTool == 'DoubleDiskmill' then
|
||||
Left.Tool = SquaringTools.Diskmill.H1
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Diskmill.H1
|
||||
Front.ToolDouble = SquaringTools.Diskmill.H7
|
||||
Front.sSide = 'Front+Back'
|
||||
elseif sSquaringTool == 'DoubleDiskmillAndBlade' then
|
||||
Left.Tool = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Blade.H2
|
||||
Front.ToolDouble = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
Front.sSide = 'Front+Back'
|
||||
elseif sSquaringTool == 'DoubleBlade' then
|
||||
Left.Tool = SquaringTools.Blade.H2
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Blade.H2
|
||||
Front.ToolDouble = SquaringTools.Blade.H1 or SquaringTools.Blade.H7
|
||||
Front.sSide = 'Front+Back'
|
||||
elseif sSquaringTool == 'Diskmill' then
|
||||
Left.Tool = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
Back.Tool = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Diskmill.H1 or SquaringTools.Diskmill.H7
|
||||
elseif sSquaringTool == 'Blade' then
|
||||
Left.Tool = SquaringTools.Blade.H2
|
||||
Back.Tool = SquaringTools.Blade.H2
|
||||
Right.Tool = SquaringTools.Blade.H2
|
||||
Front.Tool = SquaringTools.Blade.H2
|
||||
elseif sSquaringTool == 'DoubleMill' then
|
||||
Left.Tool = SquaringTools.Mill.H1
|
||||
Right.Tool = SquaringTools.Mill.H1
|
||||
Front.Tool = SquaringTools.Mill.H1
|
||||
Front.ToolDouble = SquaringTools.Mill.H7
|
||||
Front.sSide = 'Front+Back'
|
||||
elseif sSquaringTool == 'Mill' then
|
||||
Left.Tool = SquaringTools.Mill.H1 or SquaringTools.Mill.H7
|
||||
Back.Tool = SquaringTools.Mill.H1 or SquaringTools.Mill.H7
|
||||
Right.Tool = SquaringTools.Mill.H1 or SquaringTools.Mill.H7
|
||||
Front.Tool = SquaringTools.Mill.H1 or SquaringTools.Mill.H7
|
||||
end
|
||||
|
||||
-- l'ordinamento delle linee dipende dal verso di percorrenza e, se attivato, dal riferimento utilizzato
|
||||
-- con doppio l'ordine cambia
|
||||
-- lato lungo lavorato in doppio
|
||||
if not Back.Tool then
|
||||
for i = 1, 3 do
|
||||
SquaringParameters[i] = {}
|
||||
end
|
||||
if Front.Tool.bIsPathCw then
|
||||
if bSquaringStartsOnReference and ( sOrigCorner == 'BL' or sOrigCorner == 'BM') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Left
|
||||
SquaringParameters[3] = Right
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TR' or sOrigCorner == 'TN') then
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'BR' or sOrigCorner == 'BN') then
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TL' or sOrigCorner == 'TM') then
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
else
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Left
|
||||
end
|
||||
else
|
||||
if bSquaringStartsOnReference and ( sOrigCorner == 'BL' or sOrigCorner == 'BM') then
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TR' or sOrigCorner == 'TN') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Right
|
||||
SquaringParameters[3] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'BR' or sOrigCorner == 'BN') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Right
|
||||
SquaringParameters[3] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TL' or sOrigCorner == 'TM') then
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
else
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
end
|
||||
end
|
||||
-- doppio non attivo
|
||||
else
|
||||
for i = 1, 4 do
|
||||
SquaringParameters[i] = {}
|
||||
end
|
||||
if Front.Tool.bIsPathCw then
|
||||
if bSquaringStartsOnReference and ( sOrigCorner == 'BL' or sOrigCorner == 'BM') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Left
|
||||
SquaringParameters[3] = Back
|
||||
SquaringParameters[4] = Right
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TR' or sOrigCorner == 'TN') then
|
||||
SquaringParameters[1] = Back
|
||||
SquaringParameters[2] = Right
|
||||
SquaringParameters[3] = Front
|
||||
SquaringParameters[4] = Left
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'BR' or sOrigCorner == 'BN') then
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Left
|
||||
SquaringParameters[4] = Back
|
||||
else
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Back
|
||||
SquaringParameters[3] = Right
|
||||
SquaringParameters[4] = Front
|
||||
end
|
||||
else
|
||||
if bSquaringStartsOnReference and ( sOrigCorner == 'TL' or sOrigCorner == 'TM') then
|
||||
SquaringParameters[1] = Back
|
||||
SquaringParameters[2] = Left
|
||||
SquaringParameters[3] = Front
|
||||
SquaringParameters[4] = Right
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'TR' or sOrigCorner == 'TN') then
|
||||
SquaringParameters[1] = Right
|
||||
SquaringParameters[2] = Back
|
||||
SquaringParameters[3] = Left
|
||||
SquaringParameters[4] = Front
|
||||
elseif bSquaringStartsOnReference and ( sOrigCorner == 'BR' or sOrigCorner == 'BN') then
|
||||
SquaringParameters[1] = Front
|
||||
SquaringParameters[2] = Right
|
||||
SquaringParameters[3] = Back
|
||||
SquaringParameters[4] = Left
|
||||
else
|
||||
SquaringParameters[1] = Left
|
||||
SquaringParameters[2] = Front
|
||||
SquaringParameters[3] = Right
|
||||
SquaringParameters[4] = Back
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return SquaringParameters, b3Squaring
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.AddMachinings( SquaringParameters, b3Squaring, nFirstOperationId)
|
||||
local nNotOkCount = 0
|
||||
local sMsgTotal = ''
|
||||
local dSquaringHeight = b3Squaring:getDimZ()
|
||||
local dExtendPath = 0
|
||||
local dMaxOvermaterial = 0
|
||||
if type( WD.SQUARING_MAX_OVERMATERIAL) == "number" then
|
||||
dMaxOvermaterial = WD.SQUARING_MAX_OVERMATERIAL
|
||||
end
|
||||
local bUseZigZagStep = ( type( WD.SQUARING_USE_ZIGZAG) == "boolean") and ( WD.SQUARING_USE_ZIGZAG == true)
|
||||
|
||||
for i = 1, #SquaringParameters do
|
||||
local dToolRadius = SquaringParameters[i].Tool.dDiameter / 2
|
||||
local vtExtr = EgtCurveExtrusion( SquaringParameters[i].nId, GDB_RT.GLOB)
|
||||
local bIsVerticalMilling = false
|
||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||
bIsVerticalMilling = true
|
||||
end
|
||||
-- calcolo step laterale
|
||||
local MachiningSteps = { nCount = 1, dStep = 0}
|
||||
if not bIsVerticalMilling then
|
||||
MachiningSteps = WM.GetMachiningSteps( dSquaringHeight, SquaringParameters[i].Tool.dSideStep)
|
||||
end
|
||||
|
||||
for j = 1, MachiningSteps.nCount do
|
||||
local nOperationId = EgtCreateMachining( 'SQUARING_' .. SquaringParameters[i].sSide, MCH_OY.MILLING, SquaringParameters[i].Tool.sName)
|
||||
-- geometria
|
||||
EgtSetMachiningGeometry( SquaringParameters[i].nId)
|
||||
-- profondità di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 0)
|
||||
-- workside e inversione
|
||||
if SquaringParameters[i].Tool.bIsPathCw then
|
||||
if SquaringParameters[i].Tool.nType == MCH_TY.MILL_STD then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
if SquaringParameters[i].Tool.nType == MCH_TY.MILL_STD then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
end
|
||||
-- distanza di sicurezza
|
||||
if bIsVerticalMilling then
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, WD.CUT_SIC + dSquaringHeight)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, WD.CUT_SIC)
|
||||
end
|
||||
-- overlap
|
||||
EgtSetMachiningParam( MCH_MP.OVERL, 0)
|
||||
-- tipo di step
|
||||
if bIsVerticalMilling and bUseZigZagStep then
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ZIGZAG)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
|
||||
end
|
||||
-- step
|
||||
if bIsVerticalMilling then
|
||||
EgtSetMachiningParam( MCH_MP.STEP, SquaringParameters[i].Tool.dStep)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
end
|
||||
-- offset radiale
|
||||
local dRadialOffset = 0
|
||||
if not bIsVerticalMilling then
|
||||
dRadialOffset = ( MachiningSteps.nCount - j) * MachiningSteps.dStep
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
|
||||
-- offset longitudinale
|
||||
EgtSetMachiningParam( MCH_MP.OFFSL, 0)
|
||||
-- inversione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
|
||||
-- faceuse
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.NONE)
|
||||
-- angoli suggeriti
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, '')
|
||||
-- asse bloccato
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, '')
|
||||
-- SCC
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
||||
-- calcolo estensione percorso
|
||||
if bIsVerticalMilling then
|
||||
-- per utensili che lavorano di fianco, si deve partire fuori dall'altezza del grezzo
|
||||
dExtendPath = dMaxOvermaterial + dToolRadius + WD.COLL_SIC
|
||||
else
|
||||
-- si calcola l'impronta utensile per uscire quanto basta a garantire il maxOvermaterial, con una distanza di sicurezza
|
||||
dExtendPath = dMaxOvermaterial + WD.COLL_SIC + dToolRadius - ( dToolRadius - sqrt( dToolRadius * dToolRadius - ( ( dToolRadius - dSquaringHeight) * ( dToolRadius - dSquaringHeight))))
|
||||
end
|
||||
-- approccio
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtendPath)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
if bIsVerticalMilling then
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
else
|
||||
-- per utensili che lavorano di fianco, si deve partire fuori dall'altezza del grezzo
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, WD.CUT_SIC + dSquaringHeight)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LICOMPLEN, 0)
|
||||
-- retrazione
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtendPath)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
if bIsVerticalMilling then
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
||||
else
|
||||
-- per utensili che lavorano di fianco, si deve partire fuori dall'altezza del grezzo
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, WD.CUT_SIC + dSquaringHeight)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOCOMPLEN, 0)
|
||||
-- note utente
|
||||
local sUserNotes = ''
|
||||
sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
if SquaringParameters[i].ToolDouble then
|
||||
local dYMirrorAx
|
||||
local b3Tab = EgtGetTableArea()
|
||||
dYMirrorAx = b3Squaring:getCenter():getY() - b3Tab:getMin():getY()
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', 2)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MirrorAx', dYMirrorAx)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'TOOLDOUBLE', SquaringParameters[i].ToolDouble.sName)
|
||||
end
|
||||
if not bIsVerticalMilling then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', 0)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
|
||||
local bOk = EgtApplyMachining( true, false)
|
||||
-- la squadratura va sempre prima delle eventuali altre lavorazioni
|
||||
if nFirstOperationId then
|
||||
EgtRelocateGlob( nOperationId, nFirstOperationId, GDB_IN.BEFORE)
|
||||
end
|
||||
if not bOk then
|
||||
local _, sMsg = EgtGetLastMachMgrError()
|
||||
nNotOkCount = nNotOkCount + 1
|
||||
sMsgTotal = sMsgTotal ..'\n' .. ( sMsg or '')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return ( nNotOkCount < 1), sMsgTotal
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function Squaring.AddScrapRemoval( nFirstOperationId)
|
||||
-- pulizia sfridi alla prima lavorazione dopo la squadratura
|
||||
EgtSetCurrMachining( nFirstOperationId)
|
||||
local sMachiningNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
sMachiningNotes = sMachiningNotes .. 'ScrapRemove=1;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sMachiningNotes)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return Squaring
|
||||
@@ -0,0 +1,253 @@
|
||||
-- WFeatureTopology.lua by Egaltech s.r.l. 2023/06/23
|
||||
-- Libreria per classificazione topologica feature pareti
|
||||
-- 2023/12/11 Modifiche varie per allineamento con Beam.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WFeatureTopology = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico le librerie
|
||||
local WL = require( 'WallLib')
|
||||
|
||||
EgtOutLog( ' WFeatureTopology started', 1)
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
|
||||
local function GetAdjacencyMatrix( Proc)
|
||||
local vAdj = {}
|
||||
for i = 1, Proc.Fct do
|
||||
vAdj[i] = {}
|
||||
for j = 1, Proc.Fct do
|
||||
if i == j then
|
||||
vAdj[i][j] = 0
|
||||
else
|
||||
_, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT)
|
||||
if not vAdj[i][j] then vAdj[i][j] = 0 end
|
||||
end
|
||||
j = j + 1
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
return vAdj
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce gli id delle facce di Proc che hanno il numero di adiacenze nAdj
|
||||
function WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, nAdj)
|
||||
local vAdj = GetAdjacencyMatrix( Proc)
|
||||
local vFacesWithGivenAdj = {}
|
||||
for i = 1, Proc.Fct do
|
||||
local nAdjCount = 0
|
||||
for j = 1, Proc.Fct do
|
||||
if vAdj[i][j] and vAdj[i][j] ~= 0 then
|
||||
nAdjCount = nAdjCount + 1
|
||||
end
|
||||
end
|
||||
if nAdjCount == nAdj then
|
||||
table.insert( vFacesWithGivenAdj, i - 1)
|
||||
end
|
||||
end
|
||||
return vFacesWithGivenAdj
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce true se Proc ha tutti gli angoli concavi (bAllConcave) e, nei casi in cui ha senso, se questi sono esattamente 90 deg (bAllRight)
|
||||
local function AreAllAnglesConcaveOrRight( Proc)
|
||||
local vAdj = GetAdjacencyMatrix( Proc)
|
||||
local bAllConcave, bAllRight = true, true
|
||||
for i = 1, Proc.Fct do
|
||||
for j = 1, Proc.Fct do
|
||||
-- se trovo un angolo convesso restituisco falso e esco subito
|
||||
if vAdj[i][j] and vAdj[i][j] > 0 then
|
||||
bAllConcave = false
|
||||
bAllRight = false
|
||||
break
|
||||
elseif vAdj[i][j] and vAdj[i][j] ~= 0 and vAdj[i][j] + 90 > 500 * GEO.EPS_ANG_SMALL then
|
||||
bAllRight = false
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se 1 faccia oppure 2 facce con angolo convesso non ha senso ritornare valori per bAllRight
|
||||
if Proc.Fct < 2 or ( Proc.Fct == 2 and vAdj[1][2] > 0) then
|
||||
return bAllConcave
|
||||
else
|
||||
return bAllConcave, bAllRight
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce true se almeno una delle dimensioni della feature è maggiore o uguale ad una delle dimensioni principali del pezzo (tolleranza 1 mm)
|
||||
local function IsAnyDimensionLongAsPart( Proc)
|
||||
local bResult = false
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||
if Proc.Box:getDimX() > b3Solid:getDimX() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.Box:getDimY() > b3Solid:getDimY() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.Box:getDimZ() > b3Solid:getDimZ() - 1000 * GEO.EPS_SMALL then
|
||||
bResult = true
|
||||
end
|
||||
return bResult
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- retituisce un vettore con gli indici (0 based) delle facce triangolari (o quasi) di Proc
|
||||
local function GetTriangularFaces( Proc)
|
||||
local vTriangularFaces = {}
|
||||
for i = 1, Proc.Fct do
|
||||
if WL.Is3EdgesApprox( Proc, i - 1) then
|
||||
table.insert( vTriangularFaces, i - 1)
|
||||
end
|
||||
end
|
||||
return vTriangularFaces
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce un vettore contenente gli indici delle facce di Proc parallele ad una delle direzioni principali; il check varia in base alla famiglia topologica
|
||||
local function GetFacesParallelToPart( Proc, sFamily, bIsThrough)
|
||||
local vFacesParallelToPart = {}
|
||||
for i = 0, Proc.Fct - 1 do
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i, GDB_ID.ROOT)
|
||||
if sFamily == 'Rabbet' or sFamily == 'Bevel' or sFamily == 'DoubleBevel' or sFamily == 'Strip' or sFamily == 'Tunnel' or ( sFamily == 'Groove' and bIsThrough) then
|
||||
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||
local bIsTriangularFace = false
|
||||
-- verifico se la faccia è triangolare
|
||||
for j = 1, #vTriangularFaces do
|
||||
if i == vTriangularFaces[j] then
|
||||
bIsTriangularFace = true
|
||||
end
|
||||
end
|
||||
-- se faccia triangolare deve avere la normale parallela ad una direzione principale
|
||||
if bIsTriangularFace then
|
||||
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
-- altrimenti deve avere una componente della normale nulla
|
||||
else
|
||||
if abs( vtN:getX()) < 10 * GEO.EPS_SMALL or abs( vtN:getY()) < 10 * GEO.EPS_SMALL or abs( vtN:getZ()) < 10 * GEO.EPS_SMALL then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
end
|
||||
else
|
||||
-- la normale deve essere parallela ad una direzione principale
|
||||
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
return vFacesParallelToPart
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce una stringa con il nome esteso della topologia della feature
|
||||
-- *famiglia-passante-angoli tutti concavi a 90deg-facce tutte parallele alle dimensioni principali-numero di facce*
|
||||
local function GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, nNumberOfFaces)
|
||||
-- feature passante o cieca
|
||||
local sThrough = '_'
|
||||
if bIsThrough ~= nil then sThrough = EgtIf( bIsThrough, 'Through', 'Blind') end
|
||||
-- tutti gli angoli della feature sono retti oppure no
|
||||
local sAllRightAngles = '_'
|
||||
if bAllRightAngles ~= nil then sAllRightAngles = EgtIf( bAllRightAngles, 'RightAngles', 'NotRightAngles') end
|
||||
-- tutte le dimensioni della feature sono parallele agli assi principali del pezzo oppure no
|
||||
local sParallel = '_'
|
||||
if bIsParallel ~= nil then sParallel = EgtIf( bIsParallel, 'Parallel', 'NotParallel') end
|
||||
|
||||
local sLongName = sFamily .. '-' .. sThrough .. '-' .. sAllRightAngles .. '-' .. sParallel .. '-' .. nNumberOfFaces
|
||||
return sLongName
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- riconosce se Proc è una delle topologie standard e, in caso positivo, ne scrive le caratteristiche in campi specifici della Proc stessa restituendo true
|
||||
function WFeatureTopology.Classify( Proc, b3Raw)
|
||||
|
||||
if not Proc.AffectedFaces then Proc.AffectedFaces = WL.GetProcessAffectedFaces( Proc) end
|
||||
if not Proc.Box or Proc.Box:isEmpty() then
|
||||
return false
|
||||
end
|
||||
|
||||
local bRecognized = false
|
||||
local sFamily
|
||||
local bIsThrough
|
||||
local bAllRightAngles
|
||||
local bIsParallel
|
||||
local sLongName = ''
|
||||
|
||||
-- SE NON HA TUTTE LE FACCE PIANE RITORNARE NIL!!
|
||||
|
||||
local bAllAnglesConcave
|
||||
bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( Proc)
|
||||
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
|
||||
local vFacesWithOneAdj = WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 1)
|
||||
local vFacesWithTwoAdj = WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 2)
|
||||
local vFacesWithThreeAdj = WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 3)
|
||||
local vFacesWithFourAdj = WFeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 4)
|
||||
local dRawW, dRawH, dRawL = b3Raw:getDimY(), b3Raw:getDimZ(), b3Raw:getDimX()
|
||||
local bIsFeatureCuttingEntireSection = WL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH, dRawL)
|
||||
|
||||
if Proc.IsOutline then
|
||||
sFamily = 'OUTLINE'
|
||||
elseif Proc.Prc == 40 then
|
||||
sFamily = 'DRILLING'
|
||||
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
|
||||
sFamily = 'Cut'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave and #vTriangularFaces == 1 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) then
|
||||
sFamily = 'Rabbet'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and not bAllAnglesConcave and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'DoubleBevel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and #vTriangularFaces == 2 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 3 then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithThreeAdj == 2 then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithTwoAdj == 4 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Tunnel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct >= 4 and #vFacesWithOneAdj == 2 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Strip'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 5 and bAllAnglesConcave and #vFacesWithFourAdj == 1 then
|
||||
sFamily = 'Pocket'
|
||||
bIsThrough = false
|
||||
end
|
||||
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily, bIsThrough)
|
||||
bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
|
||||
|
||||
if sFamily == 'OUTLINE' or sFamily == 'DRILLING' then
|
||||
Proc.Topology = sFamily
|
||||
Proc.TopologyLongName = sFamily
|
||||
bRecognized = true
|
||||
elseif sFamily then
|
||||
sLongName = GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, Proc.Fct)
|
||||
Proc.Topology, Proc.IsThrough, Proc.AllRightAngles, Proc.IsParallel, Proc.TopologyLongName = sFamily, bIsThrough, bAllRightAngles, bIsParallel, sLongName
|
||||
bRecognized = true
|
||||
else
|
||||
Proc.Topology = 'OTHER'
|
||||
Proc.TopologyLongName = 'OTHER'
|
||||
end
|
||||
|
||||
return bRecognized
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return WFeatureTopology
|
||||
+135
-14
@@ -1,9 +1,12 @@
|
||||
-- MachiningLib.lua by Egaltech s.r.l. 2022/01/12
|
||||
-- MachiningLib.lua by Egaltech s.r.l. 2023/10/18
|
||||
-- Libreria ricerca lavorazioni per Pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
-- 2023/03/09 Piccola correzione alla SideDepth in FindMilling
|
||||
-- In FindMilling aggiunta gestione spessore e massimo materiale nel caso di lam
|
||||
-- 2023/05/25 Aggiunta funzione AddMachining che incapsula EgtAddMachining trascrivendo le priorità btl dalle feature alle lavorazioni.
|
||||
-- 2023/10/18 In SetCurrMachiningAndTool sostituito controllo di utensile attivo con controllo utensile nel setup corrente.
|
||||
-- 2023/11/14 Modifiche sostanziali per l'aggiunta delle lavorazioni in doppio e per il miglioramento nella gestione delle tasche.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WMachiningLib = {}
|
||||
|
||||
-- Include
|
||||
@@ -30,7 +33,7 @@ local function SetCurrMachiningAndTool( sMachName)
|
||||
local sTool = EgtTdbGetToolFromUUID( sTuuid)
|
||||
if not sTool then return false end
|
||||
if not EgtTdbSetCurrTool( sTool) then return false end
|
||||
return EgtTdbGetCurrToolParam( MCH_TP.ACTIVE)
|
||||
return EgtFindToolInCurrSetup( sTool)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -53,7 +56,7 @@ function WMachiningLib.FindCutting( sType, dDepth, nTool_ID)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, dMaxMat, bTipFeed, dMinSideElev)
|
||||
function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, dMaxMat, bTipFeed, dMinSideElev, sHead)
|
||||
for i = 1, #Millings do
|
||||
local Milling = Millings[i]
|
||||
if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then
|
||||
@@ -67,6 +70,7 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, d
|
||||
local dTTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
|
||||
local dTMaxDepthOnSide = EgtIf( bIsBlade, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiam - dTDiamTh)))
|
||||
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
|
||||
local sMyHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
if nMchType == MCH_MY.MILLING and
|
||||
( not sTuuid or sTuuid == sMyTuuid) and
|
||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
||||
@@ -74,7 +78,8 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, d
|
||||
( not dMaxMat or dTMaxMat < dMaxMat + GEO.EPS_SMALL) and
|
||||
( not bTipFeed or dTTipFeed > 1) and
|
||||
( not dMinSideElev or dTMaxDepthOnSide > dMinSideElev - GEO.EPS_SMALL) and
|
||||
( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) then
|
||||
( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) and
|
||||
( not sHead or sHead == sMyHead) then
|
||||
return Milling.Name, dTMaxDepth, dTMaxMat, dTDiam
|
||||
end
|
||||
end
|
||||
@@ -97,18 +102,32 @@ function WMachiningLib.FindNailing( nType)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function WMachiningLib.FindPocketing( sType, dMaxDiam, dDepth, nTool_ID)
|
||||
function WMachiningLib.FindPocketing( sType, dMaxDiam, dDepth, nTool_ID, sHead, bExcludeNoTipFeed, dDistanceToNearestPart)
|
||||
if not dMaxDiam then dMaxDiam = 999 end
|
||||
for i = 1, #Pocketings do
|
||||
local Pocketing = Pocketings[i]
|
||||
if Pocketing.On and Pocketing.Type == sType and SetCurrMachiningAndTool( Pocketing.Name) then
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth())
|
||||
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
|
||||
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
|
||||
local sMyHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local bHasTipFeed = ( EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) ~= 0)
|
||||
-- attacco con rampa molto lunga e step basso, utilizzabile anche con frese che non lavorano di testa
|
||||
local bIsSpecialLeadIn = ( EgtMdbGetCurrMachiningParam( MCH_MP.LEADINTYPE) == MCH_POCK_LI.ZIGZAG or MCH_POCK_LI.HELIX) and
|
||||
( ( EgtMdbGetCurrMachiningParam( MCH_MP.LITANG) or 0) > dTDiam - 1 - 10 * GEO.EPS_SMALL) and
|
||||
( ( EgtMdbGetCurrMachiningParam( MCH_MP.LIELEV) or 999) <= 2)
|
||||
local bIsSpiralOut = EgtMdbGetCurrMachiningParam( MCH_MP.SUBTYPE) == MCH_POCK_SUB.SPIRALOUT
|
||||
-- se ho un altro pezzo troppo vicino riduco il diametro massimo utensile
|
||||
if dDistanceToNearestPart then
|
||||
dMaxDiam = min( dMaxDiam, EgtIf( bIsSpiralOut, dDistanceToNearestPart * 2 + 5, dDistanceToNearestPart + 5))
|
||||
end
|
||||
if nMchType == MCH_MY.POCKETING and
|
||||
( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
|
||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
||||
( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) then
|
||||
( not nTool_ID or nTool_ID == 0 or nTool_ID == nMyTool_ID) and
|
||||
( not sHead or sHead == sMyHead) and
|
||||
( not bExcludeNoTipFeed or bHasTipFeed or bIsSpecialLeadIn) then
|
||||
return Pocketing.Name, dTDiam, dTMaxDepth
|
||||
end
|
||||
end
|
||||
@@ -129,18 +148,27 @@ function WMachiningLib.FindSawing( sType)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function WMachiningLib.FindDrilling( dDiam, dDepth, sHead, bOnlyPockets)
|
||||
function WMachiningLib.FindDrilling( dDiam, dDepth, sHead, bOnlyPockets, bUseMultiDrill, DrillingsToAvoid)
|
||||
if bOnlyPockets == nil or not bOnlyPockets then
|
||||
-- ricerca sulle forature, dal diametro maggiore al minore
|
||||
for i = #Drillings, 1, -1 do
|
||||
local Drilling = Drillings[i]
|
||||
if Drilling.On and Drilling.Type == 'Drill' and SetCurrMachiningAndTool( Drilling.Name) then
|
||||
if Drilling.On and EgtIf( bUseMultiDrill, Drilling.Type == 'MultiDrill', Drilling.Type == 'Drill') and SetCurrMachiningAndTool( Drilling.Name) then
|
||||
local bIsToAvoid = false
|
||||
if DrillingsToAvoid then
|
||||
for j = 1, #DrillingsToAvoid do
|
||||
if Drilling.Name == DrillingsToAvoid[j] then
|
||||
bIsToAvoid = true
|
||||
end
|
||||
end
|
||||
end
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
local sMyHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
if nMchType == MCH_MY.DRILLING and
|
||||
dTDiam < dDiam + 10 * GEO.EPS_SMALL and dTDiam > dDiam - WD.DRILL_TOL - 10 * GEO.EPS_SMALL and
|
||||
( not bIsToAvoid) and
|
||||
( not dDiam or ( dTDiam < dDiam + 10 * GEO.EPS_SMALL and dTDiam > dDiam - WD.DRILL_TOL - 10 * GEO.EPS_SMALL)) and
|
||||
( not dDepth or dTMaxMat > dDepth - GEO.EPS_SMALL) and
|
||||
(( not sHead and sMyHead ~= 'H5' and sMyHead ~= 'H6') or sHead == sMyHead) then
|
||||
return Drilling.Name, Drilling.Type, dTMaxMat
|
||||
@@ -148,16 +176,29 @@ function WMachiningLib.FindDrilling( dDiam, dDepth, sHead, bOnlyPockets)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se MultiDrill non si prova il DrillPocket
|
||||
if bUseMultiDrill then
|
||||
return
|
||||
end
|
||||
-- ricerca sulle svuotature, dal diametro maggiore al minore
|
||||
for i = #Drillings, 1, -1 do
|
||||
local Drilling = Drillings[i]
|
||||
if Drilling.On and Drilling.Type == 'Pocket' and SetCurrMachiningAndTool( Drilling.Name) then
|
||||
local bIsToAvoid = false
|
||||
if DrillingsToAvoid then
|
||||
for j = 1, #DrillingsToAvoid do
|
||||
if Drilling.Name == DrillingsToAvoid[j] then
|
||||
bIsToAvoid = true
|
||||
end
|
||||
end
|
||||
end
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth())
|
||||
local sMyHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
if nMchType == MCH_MY.POCKETING and
|
||||
dTDiam < dDiam - 10 * GEO.EPS_SMALL and
|
||||
( not bIsToAvoid) and
|
||||
( not dDiam or ( dTDiam < dDiam - 10 * GEO.EPS_SMALL)) and
|
||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
||||
( ( not sHead and sMyHead ~= 'H5' and sMyHead ~= 'H6') or sHead == sMyHead) then
|
||||
return Drilling.Name, Drilling.Type, dTMaxDepth
|
||||
@@ -173,12 +214,92 @@ 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
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- incapsulo EgtAddMachining e trascrivo alcune informazioni utili nelle note dell'operazione
|
||||
function WMachiningLib.AddMachining( Proc, sName, sMachining)
|
||||
local nMchId, sFinalName = EgtAddMachining( sName, sMachining)
|
||||
if type( Proc) == 'table' then
|
||||
local nPriority = EgtGetInfo( Proc.Id or GDB_ID.NULL, 'PRIORITY', 'i')
|
||||
EgtSetInfo( nMchId or GDB_ID.NULL, 'PRIORITY', nPriority)
|
||||
EgtSetInfo( nMchId or GDB_ID.NULL, 'ISOUTLINE', Proc.IsOutline)
|
||||
end
|
||||
return nMchId, sFinalName
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- verifica se utensile sToolMasterName e gemello sToolDoubleName sono compatibili con la specchiatura
|
||||
function WMachiningLib.IsToolDoubleOk( sToolMasterName, sToolDoubleName)
|
||||
local bIsToolDoubleOk = false
|
||||
-- dimensioni utensile master
|
||||
EgtTdbSetCurrTool( sToolMasterName)
|
||||
local bIsBlade = ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0) or false
|
||||
local dTMaxMat = EgtIf( bIsBlade, EgtTdbGetCurrToolParam( MCH_TP.THICK), EgtTdbGetCurrToolParam( MCH_TP.MAXMAT))
|
||||
local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth())
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0
|
||||
local bHasTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) ~= 0
|
||||
local dTMaxDepthOnSide = EgtIf( bIsBlade, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiam - dTDiamTh)))
|
||||
local bIsPrimaryHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) == 'H1'
|
||||
-- dimensioni utensile double
|
||||
EgtTdbSetCurrTool( sToolDoubleName)
|
||||
local bIsBladeDouble = ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0) or false
|
||||
local dTMaxMatDouble = EgtIf( bIsBladeDouble, EgtTdbGetCurrToolParam( MCH_TP.THICK), EgtTdbGetCurrToolParam( MCH_TP.MAXMAT))
|
||||
local dTMaxDepthDouble = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMatDouble, EgtTdbGetCurrToolMaxDepth())
|
||||
local dTDiamDouble = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTDiamThDouble = EgtTdbGetCurrToolThDiam() or 0
|
||||
local bHasTipFeedDouble = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) ~= 0
|
||||
local dTMaxDepthOnSideDouble = EgtIf( bIsBladeDouble, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dTDiamDouble - dTDiamThDouble)))
|
||||
-- controllo che siano uguali ( permetto una leggera differenza di lunghezza)
|
||||
local dMaxLengthDifference = 6.5
|
||||
bIsToolDoubleOk = bIsPrimaryHead and
|
||||
( bIsBlade == bIsBladeDouble) and
|
||||
( dTMaxMatDouble > dTMaxMat - 100 * GEO.EPS_SMALL) and
|
||||
( dTMaxDepthDouble > dTMaxDepth - dMaxLengthDifference) and
|
||||
( abs( dTDiam - dTDiamDouble) < 100 * GEO.EPS_SMALL) and
|
||||
( abs( dTDiamTh - dTDiamThDouble) < 100 * GEO.EPS_SMALL) and
|
||||
( bHasTipFeed == bHasTipFeedDouble) and
|
||||
( abs( dTMaxDepthOnSide - dTMaxDepthOnSideDouble) < GEO.EPS_SMALL) and
|
||||
EgtFindToolInCurrSetup( sToolDoubleName)
|
||||
return bIsToolDoubleOk
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- verifica se la lavorazione sMachining è adatta alla specchiatura
|
||||
function WMachiningLib.IsMachiningOkForDouble( sMachining)
|
||||
local bDoubleOk = false
|
||||
if sMachining and EgtMdbSetCurrMachining( sMachining) then
|
||||
-- recupero l'utensile della lavorazione
|
||||
local sToolMasterName = EgtMdbGetCurrMachiningParam( MCH_MP.TOOL)
|
||||
if EgtTdbSetCurrTool( sToolMasterName or '') then
|
||||
-- cerco eventuale utensile in doppio
|
||||
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
||||
if sToolDoubleName and EgtTdbSetCurrTool( sToolDoubleName) then
|
||||
bDoubleOk = WMachiningLib.IsToolDoubleOk( sToolMasterName, sToolDoubleName)
|
||||
end
|
||||
end
|
||||
end
|
||||
return bDoubleOk
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WMachiningLib.GetMachiningSteps( dMachiningDepth, dStep)
|
||||
local MachiningSteps = {}
|
||||
MachiningSteps.dStep = 0
|
||||
MachiningSteps.nCount = ceil( ( dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep)
|
||||
if MachiningSteps.nCount > 1 then
|
||||
MachiningSteps.dStep = ( dMachiningDepth - dStep) / ( MachiningSteps.nCount - 1)
|
||||
end
|
||||
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return WMachiningLib
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-- WProcessCut.lua by Egaltech s.r.l. 2020/11/25
|
||||
-- Gestione calcolo taglio di testa o longitudinale per Pareti
|
||||
-- 2023/07/26 Angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default sempre -0.5).
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPC = {}
|
||||
@@ -31,7 +32,7 @@ function WPC.Classify( Proc, b3Raw)
|
||||
if Proc.Fct ~= 1 then return false end
|
||||
-- controllo la normale
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
|
||||
if vtN:getZ() < - 0.5 then return false end
|
||||
if vtN:getZ() < ( WD.CUT_VZ_MIN or - 0.5) then return false end
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -40,29 +41,29 @@ end
|
||||
-- return nFlip0, nFlip1
|
||||
function WPC.FlipClassify( Proc)
|
||||
-- verifico abbia una sola faccia
|
||||
if Proc.Fct ~= 1 then return 0, 0 end
|
||||
if Proc.Fct ~= 1 then return 0, 0 end
|
||||
-- controllo la normale
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
|
||||
local vtNZ = vtN:getZ()
|
||||
if vtNZ > - GEO.EPS_SMALL then
|
||||
nFlip0 = 100
|
||||
elseif vtNZ < -0.5 then
|
||||
elseif vtNZ < ( WD.CUT_VZ_MIN or - 0.5) then
|
||||
nFlip0 = 0
|
||||
else
|
||||
nFlip0 = 50
|
||||
end
|
||||
nFlip0 = 50
|
||||
end
|
||||
|
||||
if - vtNZ > - GEO.EPS_SMALL then
|
||||
nFlip1 = 100
|
||||
elseif - vtNZ < -0.5 then
|
||||
elseif - vtNZ < ( WD.CUT_VZ_MIN or - 0.5) then
|
||||
nFlip1 = 0
|
||||
else
|
||||
nFlip1 = 50
|
||||
end
|
||||
end
|
||||
|
||||
--nFlip0 = EgtIf( vtN:getZ() < -0.5, 0, 100)
|
||||
--nFlip1 = EgtIf( - vtN:getZ() < -0.5, 0, 100)
|
||||
return nFlip0, nFlip1
|
||||
return nFlip0, nFlip1
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- WProcessDoubleCut.lua by Egaltech s.r.l. 2023/04/17
|
||||
-- Gestione calcolo doppi tagli di lama per Pareti
|
||||
-- 2023/04/17 Quando si chiama LapJoint si trasforma il Gruppo da 1 a 3 e da 2 a 4.
|
||||
-- 2023/11/14 Aggiunta funzione IdentifyStrict per il riconoscimento della sola feature L011.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPDC = {}
|
||||
@@ -24,19 +25,28 @@ function WPDC.Identify( Proc)
|
||||
( Proc.Grp == 0 and Proc.Prc == 12))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della sola feature L011
|
||||
function WPDC.IdentifyStrict( Proc)
|
||||
return ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 11
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Classificazione della feature
|
||||
function WPDC.Classify( Proc, b3Raw)
|
||||
-- se una faccia, uso la classificazione dei tagli singoli
|
||||
if Proc.Fct == 1 then return Cut.Classify( Proc, b3Raw) end
|
||||
|
||||
-- se più di due facce non si fa
|
||||
if Proc.Fct > 2 then return false end
|
||||
-- dati delle facce
|
||||
|
||||
-- se due facce si verifica solamente se le facce non sono troppo orientate verso il basso (per due facce unite sul lato lungo il check è fatto nella LapJoint)
|
||||
local vtN = {}
|
||||
vtN[1] = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
|
||||
vtN[2] = EgtSurfTmFacetNormVersor( Proc.Id, 1, GDB_ID.ROOT)
|
||||
-- verifico se è lavorabile da sopra o di fianco
|
||||
return ( vtN[1]:getZ() >= - 0.01 or vtN[2]:getZ() >= - 0.01)
|
||||
local bIsMachinable = ( vtN[1]:getZ() >= ( WD.CUT_VZ_MIN or - 0.5)) and ( vtN[2]:getZ() >= ( WD.CUT_VZ_MIN or - 0.5))
|
||||
|
||||
return bIsMachinable
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -59,9 +69,8 @@ function WPDC.Make( Proc, nRawId, b3Raw)
|
||||
-- se singola faccia, passo a quella lavorazione
|
||||
if Proc.Fct == 1 then return Cut.Make( Proc, nRawId, b3Raw) end
|
||||
-- altrimenti due facce e passo alla LapJoint
|
||||
local LapProc = { PartId = Proc.PartId, Id = Proc.Id, Grp = Proc.Grp + 2, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Diam = Proc.Diam, Fcs = Proc.Fcs, Fce = Proc.Fce, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
return LapJoint.Make( LapProc, nRawId, b3Raw)
|
||||
Proc.Grp = Proc.Grp + 2
|
||||
return LapJoint.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
+240
-51
@@ -8,6 +8,8 @@
|
||||
-- 2022/01/29 DS Corretta gestione ingombro portautensili per fori inclinati da sopra.
|
||||
-- 2022/02/22 ES Aggiunta gestione prefori.
|
||||
-- 2022/03/08 DS Vanno accettati fori orizzontali sul bordo anche senza foratori orizzontali speciali.
|
||||
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
|
||||
-- 2023/11/14 Aggiunta gestione forature in doppio.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPD = {}
|
||||
@@ -25,6 +27,9 @@ local WM = require( 'WMachiningLib')
|
||||
-- Parametri Q
|
||||
local sContourOnly = 'Q01' -- 0=no, 1=si
|
||||
|
||||
-- Per forature MultiDrill, lista lavorazioni già provate
|
||||
local TriedDrillings = {}
|
||||
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
@@ -54,7 +59,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Classificazione della feature
|
||||
function WPD.Classify( Proc, b3Raw)
|
||||
function WPD.Classify( Proc, b3Raw, bUseMultiDrill)
|
||||
|
||||
-- recupero e verifico l'entità foro
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
|
||||
@@ -73,6 +78,10 @@ function WPD.Classify( Proc, b3Raw)
|
||||
-- è lavorabile se non troppo inclinato
|
||||
return ( abs( vtExtr:getZ()) >= WD.DRILL_VZ_MIN)
|
||||
end
|
||||
-- multiforatore (cabinet)
|
||||
if bUseMultiDrill then
|
||||
return true
|
||||
end
|
||||
-- se con direzione asse Y e macchina con foratore orizzontale del giusto diametro
|
||||
if WD.HOR_DRILL_DIAM and abs( dDiam - WD.HOR_DRILL_DIAM) < WD.DRILL_TOL and AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then
|
||||
return true
|
||||
@@ -155,6 +164,41 @@ function WPD.RotateClassify( Proc)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsToolDoubleOk( sToolMasterName, sToolDoubleName)
|
||||
local bIsToolDoubleOk = false
|
||||
-- dimensioni utensile master
|
||||
EgtTdbSetCurrTool( sToolMasterName)
|
||||
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
-- dimensioni utensile double
|
||||
EgtTdbSetCurrTool( sToolDoubleName)
|
||||
local dTMaxMatDouble = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
local dTDiamDouble = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
-- controllo che siano uguali
|
||||
bIsToolDoubleOk = ( dTMaxMatDouble > dTMaxMat - 100 * GEO.EPS_SMALL) and
|
||||
( abs( dTDiam - dTDiamDouble) < 100 * GEO.EPS_SMALL) and
|
||||
EgtFindToolInCurrSetup( sToolDoubleName)
|
||||
return bIsToolDoubleOk
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsMachiningOkForDouble( sMachining)
|
||||
local bDoubleOk = false
|
||||
if sMachining and EgtMdbSetCurrMachining( sMachining) then
|
||||
-- recupero l'utensile della lavorazione
|
||||
local sToolMasterName = EgtMdbGetCurrMachiningParam( MCH_MP.TOOL)
|
||||
if EgtTdbSetCurrTool( sToolMasterName or '') then
|
||||
-- cerco eventuale utensile in doppio
|
||||
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
||||
if sToolDoubleName and EgtTdbSetCurrTool( sToolDoubleName) then
|
||||
bDoubleOk = IsToolDoubleOk( sToolMasterName, sToolDoubleName)
|
||||
end
|
||||
end
|
||||
end
|
||||
return bDoubleOk
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsHorizLongDrill( Proc)
|
||||
-- recupero e verifico l'entità foro
|
||||
@@ -218,7 +262,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function WPD.Make( Proc, nRawId, b3Raw)
|
||||
function WPD.Make( Proc, nRawId, b3Raw, bUseMultiDrill, DrillingsToAvoid)
|
||||
-- recupero e verifico l'entità foro
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
|
||||
if AuxId then AuxId = AuxId + Proc.Id end
|
||||
@@ -235,7 +279,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)
|
||||
-- verifico che il foro non sia fattibile solo da sotto
|
||||
local bToInvert = ( vtExtr:getZ() < -0.1)
|
||||
if bToInvert and ( not bOpen or Proc.Flg ~= 1) then
|
||||
if bToInvert and ( not bOpen or Proc.Flg > 1) then
|
||||
local sErr = 'Error : drilling from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
@@ -262,46 +306,74 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
end
|
||||
end
|
||||
local sDrilling, nType = WM.FindDrilling( dDiam, dLen, sHead)
|
||||
if not sDrilling then
|
||||
sDrilling, nType = WM.FindDrilling( dDiam, nil, sHead)
|
||||
end
|
||||
if sHead and not sDrilling then
|
||||
sDrilling, nType = WM.FindDrilling( dDiam, dLen)
|
||||
local sDrilling, nType
|
||||
if bUseMultiDrill then
|
||||
sDrilling, nType = WM.FindDrilling( nil, nil, nil, nil, true, TriedDrillings)
|
||||
if not sDrilling then
|
||||
sDrilling, nType = WM.FindDrilling( dDiam)
|
||||
return false
|
||||
end
|
||||
else
|
||||
local bUseDLenToFindDrilling = true
|
||||
sDrilling, nType = WM.FindDrilling( dDiam, dLen, sHead)
|
||||
if not sDrilling then
|
||||
bUseDLenToFindDrilling = false
|
||||
sDrilling, nType = WM.FindDrilling( dDiam, nil, sHead)
|
||||
end
|
||||
-- se Proc è settata per essere specchiata cerco la lavorazione adatta e verifico possa essere effettivamente specchiata
|
||||
if Proc.Double and Proc.Double == 2 then
|
||||
local sDrillingBackup = sDrilling
|
||||
sDrilling = WM.FindDrilling( dDiam, EgtIf( bUseDLenToFindDrilling, dLen, nil), 'H1')
|
||||
if not IsMachiningOkForDouble( sDrilling) then
|
||||
Proc.Double = 0
|
||||
sDrilling = sDrillingBackup
|
||||
end
|
||||
end
|
||||
if sHead and not sDrilling then
|
||||
sDrilling, nType = WM.FindDrilling( dDiam, dLen)
|
||||
if not sDrilling then
|
||||
sDrilling, nType = WM.FindDrilling( dDiam)
|
||||
end
|
||||
if sDrilling then sHead = '' end
|
||||
end
|
||||
if sDrilling then sHead = '' end
|
||||
end
|
||||
local bAngledContourDrill = false
|
||||
local nAngledContourDrillId = GDB_ID.NULL
|
||||
local dReduceDepth = 0
|
||||
local bUseTabs = false
|
||||
-- se trovata svuotatura, verifico se richiesta invece contornatura
|
||||
if nType == 'Pocket' then
|
||||
-- recupero eventuale flag per fare sola contornatura
|
||||
local nContourOnly = ( EgtGetInfo( Proc.Id, sContourOnly, 'i') or 0)
|
||||
if nContourOnly == 1 then
|
||||
-- imposto riduzione profondita' per evitare distacco pezzo interno
|
||||
dReduceDepth = 5
|
||||
-- se inclinato e passante
|
||||
if abs( vtExtr:getZ()) >= WD.DRILL_VZ_MIN and abs( vtExtr:getZ()) < 0.999 and Proc.Fcs > 0 and Proc.Fce > 0 then
|
||||
-- gruppo ausiliario per preforo
|
||||
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
|
||||
-- ricavo contorno inferiore della superficie
|
||||
local nAngledCircleId, nAngledCircleCnt = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
local dMinZ = 10000
|
||||
local nMinCircleId = GDB_ID.NULL
|
||||
for Circleindex = 1, nAngledCircleCnt do
|
||||
local b3Circle = EgtGetBBoxGlob( nAngledCircleId + Circleindex -1, GDB_BB.EXACT)
|
||||
if b3Circle:getMin():getZ() < dMinZ then
|
||||
nMinCircleId = nAngledCircleId + Circleindex -1
|
||||
-- se passante
|
||||
if Proc.Fcs > 0 and Proc.Fce > 0 then
|
||||
-- se inclinato
|
||||
if abs( vtExtr:getZ()) >= WD.DRILL_VZ_MIN and abs( vtExtr:getZ()) < 0.999 then
|
||||
-- gruppo ausiliario per preforo
|
||||
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
|
||||
-- ricavo contorno inferiore della superficie
|
||||
local nAngledCircleId, nAngledCircleCnt = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
local dMinZ = 10000
|
||||
local nMinCircleId = GDB_ID.NULL
|
||||
for Circleindex = 1, nAngledCircleCnt do
|
||||
local b3Circle = EgtGetBBoxGlob( nAngledCircleId + Circleindex -1, GDB_BB.EXACT)
|
||||
if b3Circle:getMin():getZ() < dMinZ then
|
||||
nMinCircleId = nAngledCircleId + Circleindex -1
|
||||
end
|
||||
end
|
||||
-- estrudo
|
||||
EgtModifyCurveExtrusion( nMinCircleId, vtExtr, GDB_RT.GLOB)
|
||||
EgtModifyCurveThickness( nMinCircleId, dLen)
|
||||
bAngledContourDrill = true
|
||||
nAngledContourDrillId = nMinCircleId
|
||||
-- se non inclinato e abbastanza grande uso i tab
|
||||
-- TODO se si risolve il problema dei tabs non funzionanti sotto ai 200 mm rimuovere il check sul diametro
|
||||
elseif dDiam > 100 - 10 * GEO.EPS_SMALL then
|
||||
bUseTabs = true
|
||||
-- se non inclinato e piccolo non arrivo sul fondo
|
||||
else
|
||||
dReduceDepth = 5
|
||||
end
|
||||
-- estrudo
|
||||
EgtModifyCurveExtrusion( nMinCircleId, vtExtr, GDB_RT.GLOB)
|
||||
EgtModifyCurveThickness( nMinCircleId, dLen)
|
||||
bAngledContourDrill = true
|
||||
nAngledContourDrillId = nMinCircleId
|
||||
end
|
||||
sDrilling = WM.FindMilling( 'FreeContour', dLen, nil, nil, nil, nil, true)
|
||||
if sDrilling then
|
||||
@@ -375,7 +447,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local sName = EgtIf( sHead == 'H5' or sHead == 'H6', 'LhDrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sDrilling)
|
||||
local nMchId = WM.AddMachining( Proc, sName, sDrilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
||||
EgtOutLog( sErr)
|
||||
@@ -389,11 +461,29 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
-- aggiungo geometria
|
||||
if bAngledContourDrill then
|
||||
EgtSetMachiningGeometry( nAngledContourDrillId)
|
||||
elseif bUseMultiDrill then
|
||||
if Proc.SkippedGeometries and #Proc.SkippedGeometries > 0 then
|
||||
EgtSetMachiningGeometry( Proc.SkippedGeometries)
|
||||
else
|
||||
local HolesGeometries = {}
|
||||
-- aggiungo foro principale
|
||||
table.insert( HolesGeometries, { AuxId, -1})
|
||||
-- aggiungo eventuali altre geometrie connesse
|
||||
if Proc.OtherGeometries and #Proc.OtherGeometries > 0 then
|
||||
for i = 1, #Proc.OtherGeometries do
|
||||
-- recupero geometria da lavorare
|
||||
local OtherAuxId = Proc.OtherGeometries[i].Id + EgtGetInfo( Proc.OtherGeometries[i].Id, 'AUXID', 'i')
|
||||
local Geometry = { OtherAuxId, -1}
|
||||
table.insert( HolesGeometries, Geometry)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningGeometry( HolesGeometries)
|
||||
end
|
||||
else
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
end
|
||||
-- eventuale inversione
|
||||
if nType == 'Drill' then
|
||||
if nType == 'Drill' or nType == 'MultiDrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
|
||||
@@ -431,7 +521,9 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.ADIR_ZP
|
||||
if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
if bUseMultiDrill then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
@@ -445,37 +537,134 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
EgtOutLog( sMyWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- Note utente
|
||||
local sUserNotes = ''
|
||||
if bUseMultiDrill then
|
||||
local sDepth = 'TH'
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, sDepth)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
end
|
||||
-- leggo eventuali note esistenti della lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
-- se foratura o svuotatura, dichiarazione nessuna generazione sfridi per Vmill
|
||||
if nType == 'Drill' or nType == 'Pocket' then
|
||||
sUserNotes = 'VMRS=0;'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
end
|
||||
-- se foratura
|
||||
if nType == 'Drill' then
|
||||
-- aggiungo alle note massima elevazione (coincide con affondamento)
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dDepth, 1) .. ';'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDepth, 1))
|
||||
-- se foro passante, aggiungo questa qualifica alle note
|
||||
if bOpen then
|
||||
sUserNotes = sUserNotes .. 'Open=1;'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'Open', 1)
|
||||
end
|
||||
end
|
||||
-- se lavorazione in doppio aggiungo le rispettive note
|
||||
if Proc.Double and Proc.Double == 2 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MirrorAx', Proc.MirrorAx)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if bUseTabs then
|
||||
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
|
||||
EgtSetMachiningParam( MCH_MP.LEAVETAB, true)
|
||||
EgtSetMachiningParam( MCH_MP.TABHEIGHT, EgtClamp( dStep, 0.15 * dDepth, 0.25 * dDepth ))
|
||||
EgtSetMachiningParam( MCH_MP.TABLEN, EgtClamp( 2 * dDiamT, 0.1 * dDiam, 0.2 * dDiam ))
|
||||
EgtSetMachiningParam( MCH_MP.TABANGLE, 45)
|
||||
EgtSetMachiningParam( MCH_MP.TABDIST, 100)
|
||||
EgtSetMachiningParam( MCH_MP.TABMIN, 3)
|
||||
EgtSetMachiningParam( MCH_MP.TABMAX, 3)
|
||||
end
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
else
|
||||
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||
if EgtIsMachiningEmpty() then
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sWarn
|
||||
else
|
||||
sMyWarn = (sMyWarn or sWarn)
|
||||
local bOk = EgtApplyMachining( true, false)
|
||||
|
||||
-- in caso di fori raggruppati vengono restituiti gli eventuali fori saltati
|
||||
local SkippedGeometries = {}
|
||||
SkippedGeometries = EgtGetMachiningSkippedGeometry()
|
||||
local sMsgMaster
|
||||
if bUseMultiDrill and SkippedGeometries and #SkippedGeometries > 0 then
|
||||
if ( Proc.SkippedGeometries and ( #SkippedGeometries == #Proc.SkippedGeometries))
|
||||
or ( Proc.OtherGeometries and ( #SkippedGeometries == #Proc.OtherGeometries + 1))
|
||||
or ( not Proc.OtherGeometries and #SkippedGeometries == 1) then
|
||||
EgtRemoveOperation( nMchId)
|
||||
end
|
||||
Proc.SkippedGeometries = SkippedGeometries
|
||||
table.insert( TriedDrillings, sDrilling)
|
||||
-- per provare tutte le MultiDrill disponibili si passano quelle già fatte come lavorazioni da ignorare
|
||||
bOk = WPD.Make( Proc, nRawId, b3Raw, true, TriedDrillings)
|
||||
-- non trovata lavorazione, si prova con le lavorazioni singole
|
||||
if not bOk then
|
||||
local bOkMaster = true
|
||||
for i = #Proc.SkippedGeometries, 1, -1 do
|
||||
local sErr
|
||||
if Proc.OtherGeometries then
|
||||
for j = 1, #Proc.OtherGeometries do
|
||||
local AuxIdOtherGeometry = EgtGetInfo( Proc.OtherGeometries[j].Id, 'AUXID', 'i') or 0
|
||||
if AuxIdOtherGeometry then AuxIdOtherGeometry = AuxIdOtherGeometry + Proc.OtherGeometries[j].Id end
|
||||
if Proc.SkippedGeometries[i][1] == AuxIdOtherGeometry then
|
||||
bOk, sErr = WPD.Make( Proc.OtherGeometries[j], nRawId, b3Raw, false)
|
||||
if bOk then
|
||||
Proc.OtherGeometries[j].bOk = true
|
||||
else
|
||||
Proc.OtherGeometries[j].bOk = false
|
||||
end
|
||||
Proc.OtherGeometries[j].sMsg = sErr
|
||||
break
|
||||
end
|
||||
end
|
||||
-- se nelle altre geometrie non è stato trovato, potrebbe essere la principale
|
||||
local AuxIdProc = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
|
||||
if AuxIdProc then AuxIdProc = AuxIdProc + Proc.Id end
|
||||
if Proc.SkippedGeometries[i][1] == AuxIdProc then
|
||||
bOk, sErr = WPD.Make( Proc, nRawId, b3Raw, false)
|
||||
if not bOk then
|
||||
bOkMaster = false
|
||||
end
|
||||
sMsgMaster = sErr
|
||||
end
|
||||
-- se non ci sono altre geometrie quella da fare è sicuramente la Proc principale
|
||||
else
|
||||
bOk, sErr = WPD.Make( Proc, nRawId, b3Raw, false)
|
||||
if not bOk then
|
||||
bOkMaster = false
|
||||
end
|
||||
sMsgMaster = sErr
|
||||
end
|
||||
if bOk then
|
||||
table.remove( Proc.SkippedGeometries, i)
|
||||
end
|
||||
end
|
||||
bOk = bOkMaster
|
||||
end
|
||||
end
|
||||
-- se presenti geometrie aggiuntive, aggiunta informazioni per output statistiche
|
||||
if Proc.OtherGeometries and #Proc.OtherGeometries > 0 then
|
||||
for i = 1, #Proc.OtherGeometries do
|
||||
if Proc.OtherGeometries[i].bOk == nil then
|
||||
Proc.OtherGeometries[i].bOk = true
|
||||
Proc.OtherGeometries[i].sMsg = ''
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not bUseMultiDrill then
|
||||
if not bOk then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
else
|
||||
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||
if EgtIsMachiningEmpty() then
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sWarn
|
||||
else
|
||||
sMyWarn = (sMyWarn or sWarn)
|
||||
end
|
||||
end
|
||||
else
|
||||
return bOk, sMsgMaster
|
||||
end
|
||||
|
||||
-- se preforo inclinato impostato, inclinazione oltre limite impostato e foro non orizzontale
|
||||
if WD.PREDRILL_DIAM and WD.PREDRILL_DIAM > 0 and vtExtr:getZ() < ( WD.PREDRILL_MINANGLE or 0.707) and vtExtr:getZ() > 0.1 then
|
||||
-- gruppo ausiliario per preforo
|
||||
@@ -505,7 +694,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
||||
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sDrilling)
|
||||
local nMchId = WM.AddMachining( Proc, sName, sDrilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
||||
EgtOutLog( sErr)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
-- Gestione calcolo mortase a coda di rondine per Pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
|
||||
local WPDM= {}
|
||||
|
||||
-- Include
|
||||
@@ -159,7 +160,7 @@ function WPDM.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
||||
local nMchFId = WM.AddMachining( Proc, sName, sPocketing)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||
EgtOutLog( sErr)
|
||||
@@ -189,7 +190,7 @@ function WPDM.Make( Proc, nRawId, b3Raw)
|
||||
for i = nPass, 1, -1 do
|
||||
-- inserisco la lavorazione di contornatura
|
||||
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
|
||||
local nMchFId = EgtAddMachining( sNameF, sMilling)
|
||||
local nMchFId = WM.AddMachining( Proc, sNameF, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+543
-435
File diff suppressed because it is too large
Load Diff
+928
-552
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
-- WProcessMark.lua by Egaltech s.r.l. 2021/04/20
|
||||
-- Gestione calcolo marcatura per Pareti
|
||||
-- 2023/01/05 Permesse le marcature laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
|
||||
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPMK = {}
|
||||
@@ -107,7 +108,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
-- inserisco la lavorazione di fresatura
|
||||
local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
||||
local nMchFId = WM.AddMachining( Proc, sName, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
@@ -131,7 +132,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
|
||||
if AuxId then
|
||||
-- inserisco la lavorazione di fresatura
|
||||
local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchF2Id = EgtAddMachining( sName, sMilling)
|
||||
local nMchF2Id = WM.AddMachining( Proc, sName, sMilling)
|
||||
if not nMchF2Id then
|
||||
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30
|
||||
-- Gestione calcolo mortase per Pareti
|
||||
-- 2023/01/05 Permesse le mortase laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
|
||||
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPM = {}
|
||||
@@ -250,7 +251,7 @@ function WPM.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
||||
local nMchFId = WM.AddMachining( Proc, sName, sPocketing)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||
EgtOutLog( sErr)
|
||||
|
||||
@@ -29,7 +29,11 @@ function WPSC.Classify( Proc, b3Raw)
|
||||
if not AuxId then return false end
|
||||
AuxId = AuxId + Proc.Id
|
||||
local vtDir = EgtSV( AuxId, GDB_ID.ROOT)
|
||||
return ( vtDir:getZ() > 0.5)
|
||||
local vtDirZ = vtDir:getZ()
|
||||
if Proc.IsThrough then
|
||||
vtDirZ = abs( vtDir:getZ())
|
||||
end
|
||||
return ( vtDirZ > 0.5)
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-- WProcessText.lua by Egaltech s.r.l. 2021/04/20
|
||||
-- Gestione calcolo testi per Travi
|
||||
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPT = {}
|
||||
@@ -77,7 +78,7 @@ function WPT.Make( Proc, nRawId, b3Raw)
|
||||
end
|
||||
-- inserisco la lavorazione di fresatura
|
||||
local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
||||
local nMchFId = WM.AddMachining( Proc, sName, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+49
-34
@@ -1,5 +1,6 @@
|
||||
-- WProcessVariant.lua by Egaltech s.r.l. 2021/08/27
|
||||
-- Gestione calcolo Feature Custom (Variant) per Pareti
|
||||
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPV = {}
|
||||
@@ -51,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
|
||||
@@ -62,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 = EgtAddMachining( 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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
+863
-84
File diff suppressed because it is too large
Load Diff
+259
-1
@@ -1,5 +1,8 @@
|
||||
-- WallLib.lua by Egaltech s.r.l. 2022/04/04
|
||||
-- WallLib.lua by Egaltech s.r.l. 2023/10/16
|
||||
-- Libreria globale per Pareti
|
||||
-- 2023/06/26 Spostata qui Is3EdgesApprox da FreeContour. Ora cerca autonomamente il gruppo se non viene passato.
|
||||
-- 2023/11/14 Aggiunte funzioni GetProcessAffectedFaces, GetProcessDistanceToNearestParts, GetProcessDistanceToRawPart.
|
||||
-- 2023/12/11 Aggiunta funzione IsFeatureCuttingEntireSection (allineamento Topology con Beam).
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WallLib = {}
|
||||
@@ -316,5 +319,260 @@ function WallLib.GetNearestOrthoOpposite( vtRef, vtNorm)
|
||||
return nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function WallLib.TestElleShape3( nIdGeom, nNumFacet)
|
||||
-- valida solo nel caso di tre facce
|
||||
if nNumFacet ~= 3 then return false end
|
||||
-- determino se L con una faccia terminale o U con tre facce
|
||||
local bIsL = true
|
||||
for i = 1, 3 do
|
||||
local vFacAdj = EgtSurfTmFacetAdjacencies( nIdGeom, i - 1)[1]
|
||||
-- le conto
|
||||
local nCount = 0
|
||||
for j = 1, #vFacAdj do
|
||||
if vFacAdj[j] >= 0 then
|
||||
nCount = nCount + 1
|
||||
end
|
||||
end
|
||||
if nCount == 1 then
|
||||
bIsL = false
|
||||
break
|
||||
end
|
||||
end
|
||||
return bIsL
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function WallLib.TestElleShape4( nIdGeom, nNumFacet)
|
||||
-- valida solo nel caso di quattro facce
|
||||
if nNumFacet ~= 4 then return false end
|
||||
-- determino se L con due facce terminali o O
|
||||
local nFac3Adj = 0
|
||||
local dMinArea3 = GEO.INFINITO * GEO.INFINITO
|
||||
local dMaxArea2 = 0
|
||||
for i = 1, 4 do
|
||||
local vFacAdj = EgtSurfTmFacetAdjacencies( nIdGeom, i - 1)[1]
|
||||
-- le conto
|
||||
local nCount = 0
|
||||
for j = 1, #vFacAdj do
|
||||
if vFacAdj[j] >= 0 then
|
||||
nCount = nCount + 1
|
||||
end
|
||||
end
|
||||
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( nIdGeom, i - 1, GDB_ID.ROOT)
|
||||
local dArea = dH * dV
|
||||
if nCount == 2 then
|
||||
dMaxArea2 = max( dMaxArea2, dArea)
|
||||
elseif nCount == 3 then
|
||||
dMinArea3 = min( dMinArea3, dArea)
|
||||
nFac3Adj = nFac3Adj + 1
|
||||
end
|
||||
end
|
||||
if nFac3Adj ~= 2 then return false end
|
||||
-- verifico se L profonda oppure lunga
|
||||
if dMinArea3 < dMaxArea2 then
|
||||
return 1
|
||||
else
|
||||
return 2
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
|
||||
function WallLib.Is3EdgesApprox( Proc, nFacet, nAddGrpId)
|
||||
nAddGrpId = nAddGrpId or WallLib.GetAddGroup( Proc.PartId)
|
||||
-- recupero il contorno della faccia
|
||||
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
|
||||
if not nContourId then return false end
|
||||
EgtMergeCurvesInCurveCompo( nContourId)
|
||||
-- recupero il numero di lati del contorno
|
||||
local _, nEntityCount = EgtCurveDomain( nContourId)
|
||||
if not nEntityCount then return false end
|
||||
-- se sono già tre, ho finito
|
||||
if nEntityCount == 3 then return true end
|
||||
-- rimuovo i lati molto corti dal conteggio totale
|
||||
local nEdges = nEntityCount
|
||||
for i = 1, nEntityCount do
|
||||
local dLength = EgtCurveCompoLength( nContourId, i - 1)
|
||||
if dLength < 15 then nEdges = nEdges - 1 end
|
||||
end
|
||||
-- verifico il numero significativo di lati
|
||||
local bResult = ( nEdges == 3)
|
||||
-- cancello tutti i contorni appena creati
|
||||
EgtErase( EgtTableFill( nContourId, nContourCnt))
|
||||
if bResult then
|
||||
EgtOutLog( 'FreeContour : Face with ' .. tostring( nEntityCount) .. ' edges skipped (approx 3 edges)')
|
||||
end
|
||||
return bResult
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce le facce della parte interessate dalla feature Proc
|
||||
function WallLib.GetProcessAffectedFaces( Proc)
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||
local b3Part = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||
local vtFacesAffected = { Top = false, Bottom = false, Front = false, Back = false, Left = false, Right = false}
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
if Proc.Box:getMax():getZ() > b3Part:getMax():getZ() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Top = true
|
||||
end
|
||||
if Proc.Box:getMin():getZ() < b3Part:getMin():getZ() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Bottom = true
|
||||
end
|
||||
if Proc.Box:getMin():getY() < b3Part:getMin():getY() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Front = true
|
||||
end
|
||||
if Proc.Box:getMax():getY() > b3Part:getMax():getY() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Back = true
|
||||
end
|
||||
if Proc.Box:getMin():getX() < b3Part:getMin():getX() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Left = true
|
||||
end
|
||||
if Proc.Box:getMax():getX() > b3Part:getMax():getX() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Right = true
|
||||
end
|
||||
end
|
||||
|
||||
return vtFacesAffected
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce le distanze XY tra la feature Proc e le altre parti più vicine, secondo le direzioni Y-/Y+/X-/X+
|
||||
function WallLib.GetProcessDistanceToNearestParts( Proc)
|
||||
local b3Proc = Proc.Box
|
||||
local ptMinProc = b3Proc:getMin()
|
||||
local ptMaxProc = b3Proc:getMax()
|
||||
local vtDistances = { Front = 0, Back = 0, Left = 0, Right = 0}
|
||||
if Proc.AffectedFaces.Front then
|
||||
vtDistances.Front = GEO.INFINITO
|
||||
end
|
||||
if Proc.AffectedFaces.Back then
|
||||
vtDistances.Back = GEO.INFINITO
|
||||
end
|
||||
if Proc.AffectedFaces.Left then
|
||||
vtDistances.Left = GEO.INFINITO
|
||||
end
|
||||
if Proc.AffectedFaces.Right then
|
||||
vtDistances.Right = GEO.INFINITO
|
||||
end
|
||||
local nRawId = EgtGetFirstRawPart()
|
||||
local nPartId = EgtGetFirstPartInRawPart( nRawId)
|
||||
while nPartId do
|
||||
if Proc.PartId ~= nPartId then
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( nPartId, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( nBoxSolidId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
b3Solid:expand( - 10 * GEO.EPS_SMALL)
|
||||
local ptMinPart = b3Solid:getMin()
|
||||
local ptMaxPart = b3Solid:getMax()
|
||||
if Proc.AffectedFaces.Front then
|
||||
if OverlapsXY( b3Proc, b3Solid) then
|
||||
vtDistances.Front = 0
|
||||
elseif OverlapsX( b3Proc, b3Solid) then
|
||||
if ptMaxPart:getY() < ptMinProc:getY() + 100 * GEO.EPS_SMALL then
|
||||
vtDistances.Front = min( vtDistances.Front, max( 0, ptMinProc:getY() - ptMaxPart:getY()))
|
||||
end
|
||||
end
|
||||
end
|
||||
if Proc.AffectedFaces.Back then
|
||||
if OverlapsXY( b3Proc, b3Solid) then
|
||||
vtDistances.Back = 0
|
||||
elseif OverlapsX( b3Proc, b3Solid) then
|
||||
if ptMaxProc:getY() < ptMinPart:getY() + 100 * GEO.EPS_SMALL then
|
||||
vtDistances.Back = min( vtDistances.Back, max( 0, ptMinPart:getY() - ptMaxProc:getY()))
|
||||
end
|
||||
end
|
||||
end
|
||||
if Proc.AffectedFaces.Left then
|
||||
if OverlapsXY( b3Proc, b3Solid) then
|
||||
vtDistances.Left = 0
|
||||
elseif OverlapsY( b3Proc, b3Solid) then
|
||||
if ptMaxPart:getX() < ptMinProc:getX() + 100 * GEO.EPS_SMALL then
|
||||
vtDistances.Left = min( vtDistances.Left, max( 0, ptMinProc:getX() - ptMaxPart:getX()))
|
||||
end
|
||||
end
|
||||
end
|
||||
if Proc.AffectedFaces.Right then
|
||||
if OverlapsXY( b3Proc, b3Solid) then
|
||||
vtDistances.Right = 0
|
||||
elseif OverlapsY( b3Proc, b3Solid) then
|
||||
if ptMaxProc:getX() < ptMinPart:getX() + 100 * GEO.EPS_SMALL then
|
||||
vtDistances.Right = min( vtDistances.Right, max( 0, ptMinPart:getX() - ptMaxProc:getX()))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
nPartId = EgtGetNextPartInRawPart( nPartId)
|
||||
end
|
||||
|
||||
return vtDistances
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce le distanze XY tra la feature Proc e il termine del grezzo, secondo le direzioni Y-/Y+/X-/X+
|
||||
function WallLib.GetProcessDistanceToRawPart( Proc, b3Raw)
|
||||
local b3Proc = Proc.Box
|
||||
local ptMinProc = b3Proc:getMin()
|
||||
local ptMaxProc = b3Proc:getMax()
|
||||
local ptMinRaw = b3Raw:getMin()
|
||||
local ptMaxRaw = b3Raw:getMax()
|
||||
local vtDistances = { Front = GEO.INFINITO, Back = GEO.INFINITO, Left = GEO.INFINITO, Right = GEO.INFINITO}
|
||||
if EnclosesXY( b3Raw, b3Proc) then
|
||||
vtDistances.Front = max( 0, ptMinProc:getY() - ptMinRaw:getY())
|
||||
vtDistances.Back = max( 0, ptMaxRaw:getY() - ptMaxProc:getY())
|
||||
vtDistances.Left = max( 0, ptMinProc:getX() - ptMinRaw:getX())
|
||||
vtDistances.Right = max( 0, ptMaxRaw:getX() - ptMaxProc:getX())
|
||||
end
|
||||
|
||||
return vtDistances
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WallLib.GetNailLockOutAreas( vProc)
|
||||
local vNLO = {}
|
||||
for i = 1, #vProc do
|
||||
if vProc[i].LockOut == 1 then
|
||||
local AuxId = EgtGetInfo( vProc[i].Id, 'AUXID', 'i')
|
||||
if AuxId then AuxId = AuxId + vProc[i].Id end
|
||||
if AuxId then
|
||||
local nAddGrpId = WallLib.GetAddGroup( vProc[i].PartId)
|
||||
local nSfrId = EgtSurfFlatRegion( nAddGrpId, {AuxId})
|
||||
if nSfrId then
|
||||
table.insert( vNLO, nSfrId)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return vNLO
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della parete, rappresentata dalle sue dimensioni W, H e L
|
||||
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
|
||||
|
||||
@@ -157,9 +157,9 @@ local bManualRot = EgtGetInfo( NFAR.PARTID, "MANUALROT", 'b')
|
||||
|
||||
-- FLIP
|
||||
local FlipFeatureStates, bLapJoints = ClassifyFlip( vPartProc, b3Part)
|
||||
local bFlip
|
||||
|
||||
if not bManualFlip then
|
||||
local bFlip
|
||||
-- analizzo stati flip delle feature
|
||||
local nFlip0Min = 100
|
||||
local nFlip0Cnt = 0
|
||||
@@ -440,7 +440,7 @@ if not bManualRot then
|
||||
-- setto info nel pezzo
|
||||
if nRotate > 0 then
|
||||
local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - nRotate
|
||||
local nTotRot = nPartRot - EgtIf( bFlip, -nRotate, nRotate)
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( NFAR.PARTID, "ROTATED", nTotRot)
|
||||
EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1)
|
||||
|
||||
+176
-48
@@ -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
|
||||
@@ -1128,9 +1132,10 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
||||
if nRotate >= 360 then
|
||||
nRotate = nRotate - 360
|
||||
end
|
||||
if nRotate > 0 then
|
||||
if nRotate > 0 then
|
||||
local bPartFlip = ( ( EgtGetInfo( nPartId, "INVERTED", 'i') or 0) == 180)
|
||||
local nPartRot = EgtGetInfo( nPartId, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - nRotate
|
||||
local nTotRot = nPartRot - EgtIf( bPartFlip, -nRotate, nRotate)
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( nPartId, "ROTATED", nTotRot)
|
||||
EgtSetInfo( nPartId, "MODIFIEDFORNEST", 1)
|
||||
@@ -1325,8 +1330,9 @@ local function ComputeRestrictedZones( RawParts)
|
||||
bOnOppositeSide = true
|
||||
-- aggiorno le info di rotazione
|
||||
if res.nRotate > 0 then
|
||||
local bPartFlip = ( ( EgtGetInfo( AngleClassification[nInd].PartId, "INVERTED", 'i') or 0) == 180)
|
||||
local nPartRot = EgtGetInfo( AngleClassification[nInd].PartId, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - res.nRotate
|
||||
local nTotRot = nPartRot - EgtIf( bPartFlip, -res.nRotate, res.nRotate)
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( AngleClassification[nInd].PartId, "ROTATED", nTotRot)
|
||||
EgtSetInfo( AngleClassification[nInd].PartId, "MODIFIEDFORNEST", 1)
|
||||
@@ -1507,7 +1513,6 @@ local function AddParts(RawParts, vPartsDoneManually)
|
||||
bRotNest = false
|
||||
elseif EgtExistsInfo( nPartId, "NestRot") then
|
||||
nStepRotNest = EgtGetInfo( nPartId, "NestStepRot", 'i')
|
||||
nRotate = EgtGetInfo( nPartId, "NestRot", 'i')
|
||||
bRotNest = EgtGetInfo( nPartId, "NestAllowRot", 'b')
|
||||
-- verifico se rotazione è valida (pezzo è contenuto nel grezzo)
|
||||
local bValidRotationInRaw = b3Part:getDimX() < RawParts[1].Len - 2 * NEST.KERF + GEO.EPS_SMALL and b3Part:getDimY() < dRawMaxWidth - 2 * NEST.KERF + GEO.EPS_SMALL
|
||||
@@ -1628,7 +1633,7 @@ local function AddParts(RawParts, vPartsDoneManually)
|
||||
if bOnEdge or bOnAngle then
|
||||
local nBoxLayerId = EgtGetFirstNameInGroup( nPartId, "Box")
|
||||
local nBoxId = EgtGetFirstNameInGroup( nBoxLayerId, "Box")
|
||||
local b3Part = EgtGetBBoxGlob(nBoxId, GDB_BB.STANDARD)
|
||||
local b3Part = EgtGetBBoxGlob(nBoxId, GDB_BB.STANDARD)
|
||||
|
||||
-- punto di riferimento sul pezzo
|
||||
local ptRef
|
||||
@@ -1682,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()
|
||||
|
||||
@@ -1690,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
|
||||
@@ -1806,40 +1929,39 @@ if bNestingOk then
|
||||
end
|
||||
end
|
||||
|
||||
-- aggiungo pezzi nestati a mano
|
||||
nPartCount = 0
|
||||
for nInd = 1, #vDoneManually do
|
||||
if vDoneManually[nInd].SheetId == nId then
|
||||
vDoneManually[nInd].Done = 1
|
||||
for nInd2 = 1, #(vDoneManually[nInd].Parts) do
|
||||
nPartCount = nPartCount + 1
|
||||
local nPartDuploId = EgtDuploNew( vDoneManually[nInd].Parts[nInd2].Id)
|
||||
|
||||
-- aggiungo le curve corrispondenti alle aree di lavorazione del pezzo
|
||||
local sToolOutlines = EgtGetInfo( vDoneManually[nInd].Parts[nInd2].Id, "ToolOutlines", 's')
|
||||
if sToolOutlines then
|
||||
-- recupero o creo il gruppo per gli outlines
|
||||
local nToolOutlinesGrp = EgtGetFirstNameInGroup( nPartDuploId, "ToolOutlines")
|
||||
if not nToolOutlinesGrp then
|
||||
nToolOutlinesGrp = EgtGroup( nPartDuploId)
|
||||
EgtSetName( nToolOutlinesGrp, "ToolOutlines")
|
||||
EgtSetStatus( nToolOutlinesGrp, GDB_ST.ON)
|
||||
end
|
||||
|
||||
for str in string.gmatch(sToolOutlines, "([^"..",".."]+)") do
|
||||
EgtCopyGlob( tonumber(str), nToolOutlinesGrp)
|
||||
-- aggiungo pezzi nestati a mano
|
||||
nPartCount = 0
|
||||
for nInd = 1, #vDoneManually do
|
||||
if vDoneManually[nInd].SheetId == nId then
|
||||
vDoneManually[nInd].Done = 1
|
||||
for nInd2 = 1, #(vDoneManually[nInd].Parts) do
|
||||
nPartCount = nPartCount + 1
|
||||
local nPartDuploId = EgtDuploNew( vDoneManually[nInd].Parts[nInd2].Id)
|
||||
|
||||
-- aggiungo le curve corrispondenti alle aree di lavorazione del pezzo
|
||||
local sToolOutlines = EgtGetInfo( vDoneManually[nInd].Parts[nInd2].Id, "ToolOutlines", 's')
|
||||
if sToolOutlines then
|
||||
-- recupero o creo il gruppo per gli outlines
|
||||
local nToolOutlinesGrp = EgtGetFirstNameInGroup( nPartDuploId, "ToolOutlines")
|
||||
if not nToolOutlinesGrp then
|
||||
nToolOutlinesGrp = EgtGroup( nPartDuploId)
|
||||
EgtSetName( nToolOutlinesGrp, "ToolOutlines")
|
||||
EgtSetStatus( nToolOutlinesGrp, GDB_ST.ON)
|
||||
end
|
||||
|
||||
for str in string.gmatch(sToolOutlines, "([^"..",".."]+)") do
|
||||
EgtCopyGlob( tonumber(str), nToolOutlinesGrp)
|
||||
end
|
||||
end
|
||||
|
||||
-- applico flip, rotazione e traslazione pezzo e box da nesting
|
||||
EgtSetInfo( nMachGroup, "PART" .. nPartCount, nPartDuploId .. "," .. EgtNumToString( vDoneManually[nInd].Parts[nInd2].posX, 3) .. "," .. EgtNumToString( vDoneManually[nInd].Parts[nInd2].posY, 3) .. "," .. 0 .."," .. 0)
|
||||
EgtSetInfo( nPartDuploId, "POSX", vDoneManually[nInd].Parts[nInd2].posX)
|
||||
EgtSetInfo( nPartDuploId, "POSY", vDoneManually[nInd].Parts[nInd2].posY)
|
||||
end
|
||||
|
||||
-- applico flip, rotazione e traslazione pezzo e box da nesting
|
||||
EgtSetInfo( nMachGroup, "PART" .. nPartCount, nPartDuploId .. "," .. EgtNumToString( vDoneManually[nInd].Parts[nInd2].posX, 3) .. "," .. EgtNumToString( vDoneManually[nInd].Parts[nInd2].posY, 3) .. "," .. 0 .."," .. 0)
|
||||
EgtSetInfo( nPartDuploId, "POSX", vDoneManually[nInd].Parts[nInd2].posX)
|
||||
EgtSetInfo( nPartDuploId, "POSY", vDoneManually[nInd].Parts[nInd2].posY)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- altrimenti pezzo
|
||||
else
|
||||
@@ -1884,15 +2006,21 @@ if bNestingOk then
|
||||
EgtSetInfo( nPartDuploId, "POSX", ptPos:getX() + dXCorr)
|
||||
EgtSetInfo( nPartDuploId, "POSY", ptPos:getY() + dYCorr)
|
||||
|
||||
local nPartRot = EgtGetInfo( nId, "ROTATED", 'i') or 0
|
||||
local nTotRot = dAngRot - nPartRot
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( nPartDuploId, "ROT", nTotRot)
|
||||
|
||||
local nPartFlip = EgtGetInfo( nId, "INVERTED", 'i')
|
||||
local nPartFlip = EgtGetInfo( nId, "INVERTED", 'i') or 0
|
||||
nPartFlip = EgtIf( nPartFlip == 180, 1, 0)
|
||||
local nTotFlip = EgtIf( nPartFlip ~= nFlag, 180, 0)
|
||||
EgtSetInfo( nPartDuploId, "FLIP", nTotFlip)
|
||||
|
||||
local bPartFlip = ( nTotFlip == 180)
|
||||
local nPartRot = EgtGetInfo( nId, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - EgtIf( bPartFlip, -dAngRot, dAngRot)
|
||||
if nTotRot < 0 then
|
||||
nTotRot = nTotRot + 360
|
||||
elseif nTotRot >= 360 then
|
||||
nTotRot = nTotRot - 360
|
||||
end
|
||||
EgtSetInfo( nPartDuploId, "ROT", nTotRot)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+8
-4
@@ -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()
|
||||
|
||||
+202
@@ -1,4 +1,206 @@
|
||||
==== 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.
|
||||
|
||||
Versione 2.7g1 (09/07/2025)
|
||||
- Fixed : in FreeContour corretta scelta del lato da lavorare in caso si abbiano lati inclinati
|
||||
|
||||
Versione 2.7f2 (06/06/2025)
|
||||
- Fixed : in Lapjoint migliorie alle svuotature
|
||||
|
||||
Versione 2.7f1 (05/06/2025)
|
||||
- Added : gestita forzatura freecontour di fresa per macchine senza lama (costante WallData FORCE_MILL_CONTOUR)
|
||||
- Modif : migliorata DoubleCut
|
||||
- Fixed : corretta BatchProcess per caso in cui il nome del file cnc generato non era corretto
|
||||
|
||||
Versione 2.7d1 (14/04/2025)
|
||||
- Added : in DoubleCut aggiunta Q06 per forzare utilizzo lama
|
||||
|
||||
Versione 2.7b1 (03/03/2025)
|
||||
- Added : gestione multidrill
|
||||
|
||||
Versione 2.7a2 (23/01/2025)
|
||||
- Fixed : in Ts7 corretto un problema che portava a rotazioni errate, introdotto con 2.7a1
|
||||
- Fixed : in squadratura piccole correzioni
|
||||
|
||||
Versione 2.7a1 (21/01/2025)
|
||||
- Modif : in Ts7 aggiunta scrittura id progetto e produzione in Btm
|
||||
|
||||
Versione 2.6l1 (11/12/2024)
|
||||
- Modif : modificato il calcolo feature passante per gorge
|
||||
- Modif : in pulizia spigoli si riporta correttamente la collisione sulla feature specifica
|
||||
- Fixed : in pulizia spigoli correzioni varie
|
||||
- Fixed : in LapJoint correzioni varie
|
||||
|
||||
Versione 2.6k3 (27/11/2024)
|
||||
- Modif : migliorato calcolo approccio e retrazione in Sidemill/Sidegroove
|
||||
|
||||
Versione 2.6k2 (19/11/2024)
|
||||
- Modif : in Nesting riportata allo stato precedente la tolleranza posizionamento pannelli sul bordo
|
||||
|
||||
Versione 2.6k1 (14/11/2024)
|
||||
- Added : aggiunta squadratura master panel
|
||||
- Modif : L010 si inseriscono con lama anche se il percorso è breve
|
||||
- Fixed : in Nesting corretto errore in posizionamento pannelli che devono stare necessariamente sul bordo della tavola
|
||||
|
||||
Versione 2.6j2 (04/11/2024)
|
||||
- Modif : Modificato limite dimensione tasca per utilizzo lama come SideGroove
|
||||
|
||||
Versione 2.6j1 (29/10/2024)
|
||||
- Fixed : in Nesting e Flip/Rot corretto problema in rotazione pezzi che causava ribaltamenti non voluti nella copia grezzo
|
||||
|
||||
Versione 2.6i2 (30/09/2024)
|
||||
- Modif : aggiunta nota altezza sottopezzo, per pareti a layer
|
||||
|
||||
Versione 2.6i1 (25/09/2024)
|
||||
- Fixed : in NestProcess correzione in lettura array per cambio dll di lettura
|
||||
|
||||
Versione 2.6h2 (28/08/2024)
|
||||
- Modif : Aggiunto controllo licenza/chiave per abilitazione generazione PartProgram
|
||||
- Fixed : in FreeContour corretto caso in cui si chiedevano informazioni sulla faccia non presenti.
|
||||
|
||||
Versione 2.6h1 (20/08/2024)
|
||||
- Modif : in LapJoint, se fresa Side trovata ma non applicabile, si considera come se non trovata
|
||||
- Modif : in Collect analisi facce limitata a feature che ne hanno meno di 50
|
||||
- Modif : aggiunti nuovi parametri alla chiamata della funzione GetChainSawStartAngs da WallData della macchina
|
||||
|
||||
Versione 2.6g2 (19/07/2024)
|
||||
- Modif : in BatchProcess e BatchProcessNew si forza ricalcolo ogni volta che si è in situazione di CHECK o CHECK + GENERATE
|
||||
|
||||
Versione 2.6g1 (17/07/2024)
|
||||
- Modif : in ProcessDrill, se foro verticale passante e diametro inferiore a 100 mm, riduzione affondamento di 5 mm sostituito con tab
|
||||
- Fixed : correzioni a utilizzo DEFAULT_RAW_NO_EXTRA_WIDTH
|
||||
|
||||
Versione 2.6f1 (21/06/2024)
|
||||
- Added : in BatchProcess e BatchProcessNew aggiunto DEFAULT_RAW_NO_EXTRA_WIDTH per eliminare il sovramateriale grezzo in vista
|
||||
|
||||
Versione 2.6e2 (24/05/2024)
|
||||
- Modif : in LapJoint se non si trova una lavorazione di tipo side si cerca una pocketing
|
||||
- Fixed : in BatchProcessNew se generazione non abilitata si salta questa fase invece di restituire errore
|
||||
- Fixed : piccoli errori in LapJoint e DoubleCut.
|
||||
|
||||
Versione 2.6e1 (03/03/5/2024)
|
||||
- Fixed : correzione per assegnazione a SawCut di flag passante (bIsThrough).
|
||||
|
||||
Versione 2.6c3 (26/03/2024)
|
||||
- Modif : modifica per richiamare le nuove funzioni di Test interferenza solidi superfici nel controllo validità lavorazione pulizia spigoli interni
|
||||
- Modif : in compilazione vengono eliminate le info di debug
|
||||
- Fixed : in processSawCut si ignora verso vettore se taglio passante.
|
||||
|
||||
Versione 2.6b2 (21/02/2024)
|
||||
- Added : aggiunta gestione spostamento pannello rispetto a origine da dato BTL di TS3v7.
|
||||
|
||||
Versione 2.6b1 (20/02/2024)
|
||||
- Modif : In BatchProcess tolleranza su altezza pannello in grezzo portata a 0.1 mm
|
||||
- Fixed : in LapJoint piccola correzione ai casi in cui si utilizza il SIDESTEP.
|
||||
|
||||
Versione 2.5l2 (21/12/2023)
|
||||
- Fixed : in FreeContour -> MakeByPocket corretto un bug che provocava la cancellazione della feature dopo averla lavorata
|
||||
|
||||
Versione 2.5l1 (13/12/2023)
|
||||
- Modif : modifiche a WallExec, WallLib, FeatureTopology per allineamento Topology con Beam
|
||||
- Modif : in FreeContour -> MakeByPocket aggiunta la possibilità di svuotare tasche passanti
|
||||
- Modif : in FreeContour -> MakeByPocket in tasche speciali cliente 90480029 forzato step unico
|
||||
|
||||
Versione 2.5k1 (14/11/2023)
|
||||
- Added : aggiunte lavorazioni in doppio.
|
||||
- Modif : miglioramenti vari alla lavorazione tasche, in particolare in presenza di pezzi vicini.
|
||||
|
||||
Versione 2.5j3 (23/10/2023)
|
||||
- Added : aggiunta gestione aree vietate per chiodature (LockOut for Nail)
|
||||
- Modif : in FreeContour conversione automatica di facce non fattibili con lama per limiti di orientamento in facce da fare con fresa.
|
||||
- Modif : in LapJoint aggiunta segnalazione lavorazione tipo Side non trovata.
|
||||
- Modif : migliorata funzione Is3EdgesApprox in WallLib
|
||||
- Modif : nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente
|
||||
- Fixed : in FreeContour correzione a MakeCustomPath per calcolare correttamente puliture spigoli di tipo 2 (Clean 30) e 3 (Gola di Scarico)
|
||||
|
||||
Versione 2.5i3 (21/09/2023)
|
||||
- Modif : per pulizia corner di FreeContour disabilitato metodo con tunnel ed esteso metodo con tre punti
|
||||
- Modif : in LapJoint aggiornata pulizia corner come FreeContour
|
||||
- Fixed : in FreeContour e Lapjoint, in MakeByMill, modificato SCC per correggere caso con lama su testa fresa.
|
||||
|
||||
Versione 2.5i2 (20/09/2023)
|
||||
- Modif : in LapJoint con una sola faccia controllo lavorabilità ora come per FreeContour
|
||||
- Modif : in CleanCorner ora AuxDir (SCC) sempre Z+
|
||||
- Fixed : in FreeContour piccola correzione alla pulizia corner
|
||||
- Fixed : corretta impostazione allargamento aree disposizone grezzi su tavola.
|
||||
|
||||
Versione 2.5i1 (12/09/2023)
|
||||
- Fixed : correzioni per pulizia corner in FreeContour.
|
||||
|
||||
Versione 2.5h1 (01/08/2023)
|
||||
- Modif : in sideGroove migliorato il controllo che la testa non scenda sotto al livello del grezzo (ora considera anche il diametro minimo della testa e non interviene se la lavorazione è spostata a dopo il taglio outline).
|
||||
- Fixed : corretto bug in MachiningLib -> AddMachining che contempla il caso in cui Proc non sia una tabella
|
||||
|
||||
Versione 2.5g3 (26/07/2023)
|
||||
- Modif : Nei tagli di lama angolo Z minimo ora gestito tramite costante da WallData CUT_VZ_MIN (default -0.5)
|
||||
- Modif : Nelle fresature di ripresa angoli dei contorni migliorata la scelta della fresa secondaria in caso non sia disponibile una fresa di lunghezza sufficiente.
|
||||
|
||||
Versione 2.5g2 (25/07/2023)
|
||||
- Added : aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile.
|
||||
|
||||
Versione 2.5g1 (04/07/2023)
|
||||
- Modif : per posizione default del grezzo ora si assegna 0 per lasciare il compito a WD.GetOrigCorner di macchina.
|
||||
|
||||
Versione 2.5f3 (30/06/2023)
|
||||
- Modif : in LapJoint aggiunta lettura di eventuali note di lavorazione esistenti.
|
||||
|
||||
Versione 2.5f2 (28/06/2023)
|
||||
- Added : aggiunte due nuove origini (TN e BN che come X usano WD.NEW_REF), in totale ora sono 8.
|
||||
|
||||
Versione 2.5f1 (13/06/2023)
|
||||
- Added : aggiunta gestione priorità da btl
|
||||
- Added : aggiunta gestione lavorazione per lamatura speciale affondata con Tool_ID specifico.
|
||||
|
||||
Versione 2.5e1 (04/05/2023)
|
||||
- Modif : modifiche per gestione traduzione messaggi
|
||||
|
||||
Versione 2.5d2 (20/04/2023)
|
||||
- Added : in TS3v7 aggiunta gestione flag per taglio feature con outline (da parametro macchina WD.CUT_WITH_OUTLINE)
|
||||
- Added : in TS3v7 aggiunta gestione flag per rotazione grezzo di 180deg (da parametro macchina WD.RAWPART_ROT)
|
||||
- Modif : in LapJoint con lavorazione di lato se MCH_SCC.ADIR_NEAR fallisce si riprova con MCH_SCC.ADIR_FAR
|
||||
- Fixed : in FreeContour e assimilati aggiunta pulitura spigoli Q05=1 anche su sole fresature
|
||||
- Fixed : in LapJoint e assimilati corretta ricerca utensile in lavorazione 'SideGroove'
|
||||
- Fixed : in FreeContour e LapJoint la lavorazione CleanCorner viene sempre forzata con lato di lavoro in centro
|
||||
- Fixed : in LapJoint razionalizzata gestione parametri Q ed eliminta gestione forzatura lama non usata.
|
||||
|
||||
Versione 2.5d1 (06/04/23)
|
||||
- Added : in nesting aggiunti valori di default per alcuni parametri letti dal WallData.
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
-- Version.lua by Egalware s.r.l. 2023/05/04
|
||||
-- Version.lua by Egalware s.r.l. 2026/03/30
|
||||
-- Gestione della versione di Wall
|
||||
|
||||
NAME = 'Wall'
|
||||
VERSION = '2.5e1'
|
||||
MIN_EXE = '2.5b3'
|
||||
VERSION = '3.1d2'
|
||||
MIN_EXE = '3.1c1'
|
||||
|
||||
Reference in New Issue
Block a user