Compare commits
148 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 10bfb3273c | |||
| 1ef5ae8f0c | |||
| 12bb64bacb | |||
| 35fa519eb3 | |||
| fdd6b7f7bb | |||
| 7c2bc2ec5d | |||
| f6286d839a | |||
| 33deb8b5e3 | |||
| 736065eaad | |||
| 09ce7d2d01 | |||
| 84eb8ec1b9 | |||
| a2fc9b4ade | |||
| bb5b13d122 | |||
| ee04bed533 | |||
| 5452ceda9f | |||
| a875f9758b | |||
| c091137ffc | |||
| 9d0206984b | |||
| 84339a5843 | |||
| 780b0addc1 | |||
| 6c1d2e5cc5 | |||
| 1c623206df | |||
| 4034898f6e | |||
| aa7099539e | |||
| 510724a627 | |||
| 23a831cf50 | |||
| b2fe513d2d | |||
| 4e0a87fbf6 | |||
| e43afd5af4 | |||
| 8b095a195a | |||
| f2a066192f | |||
| e59030ed4b | |||
| a859e72707 | |||
| 55050a17d2 | |||
| fa9a8a7e49 | |||
| ff9320993c | |||
| 9f32c5fd87 | |||
| 41f85808e2 | |||
| f1d81ffb4d | |||
| a4dcf78c9b | |||
| 8ddad9f183 | |||
| 82b518bd54 | |||
| fcd7ee98a0 | |||
| d1fe91e68a | |||
| b65a4e2220 | |||
| 515dbabde9 | |||
| ea8852115c | |||
| dda6389ab2 | |||
| 69611fb9eb | |||
| 25a533dbf4 | |||
| 3e189d6421 | |||
| 9bba651886 | |||
| e1a5625f18 | |||
| ff3a738d91 | |||
| 8225bc93d5 | |||
| 59c9e6d1cd | |||
| eae34681f3 | |||
| 098ef8deaf | |||
| 7f10b7219a | |||
| 8cfd505f81 | |||
| 7f29b951c8 | |||
| 75d0d7fd13 | |||
| 808536a3aa | |||
| d959e46f50 | |||
| a156b5d703 | |||
| fe26308388 | |||
| 9846bf2598 | |||
| d3c43fdec1 | |||
| cb26d23639 | |||
| 7b991ddc7a | |||
| c685b0c4c5 | |||
| 62d1c3cb29 | |||
| ed05f04de6 | |||
| aa341ed2b3 | |||
| 18fb6622f5 | |||
| 7f3aba6d1d | |||
| abfee0334d | |||
| e34ac566e1 | |||
| 9838bc7f31 | |||
| dcc1e5b543 | |||
| 01260c7278 | |||
| f2bdb23f9d | |||
| 1131948d33 | |||
| be33225242 | |||
| 2db0e4b8a9 | |||
| 8b3bb67710 | |||
| f9f6462dc2 | |||
| 47b3298e89 | |||
| 4f1c652dc0 | |||
| de9fa79f8a | |||
| f6caf21581 | |||
| b0b8e88c30 | |||
| d020fa143c | |||
| eeb34638cf | |||
| 7f2d1895a1 | |||
| 766bd61981 | |||
| 1102a7c23a | |||
| 358df3cfdb | |||
| bd0dbbb41c | |||
| 2606cf4f13 | |||
| e63b498902 | |||
| 63a3cfe698 | |||
| 78cf115748 | |||
| ac853fc74c | |||
| a5cc30adfc | |||
| 1a1d48a2c1 | |||
| a05741f7be | |||
| 5da9d312d8 | |||
| d704e899a2 | |||
| 5b0a274f00 | |||
| 5fb1ffb86b | |||
| c6cf8c9df3 | |||
| 39d1c1dbd8 | |||
| a0668a0f6d | |||
| 53c68f8126 | |||
| ce835200c2 | |||
| a941ba0d0d | |||
| e475c01057 | |||
| 03647ee74c | |||
| 22f100ff6c | |||
| 3d0d6526ca | |||
| a911191d5b | |||
| aeba5edbad | |||
| 763ca86371 | |||
| e6e9790a9c | |||
| becd669f6d | |||
| 2fb6729240 | |||
| a3ad73b4a0 | |||
| e88e056c89 | |||
| 3853e7c0c7 | |||
| 4c41ecc7cb | |||
| b7384b9635 | |||
| bc5c99422b | |||
| c5e3af9180 | |||
| 714b3be628 | |||
| 29b63c77a6 | |||
| 53af42724b | |||
| 0be8849f2e | |||
| 246f64e4ce | |||
| 4d3669a24b | |||
| de682d511c | |||
| 55e7d9f2e7 | |||
| bf08515edf | |||
| b0b5a7f91d | |||
| 7cded14384 | |||
| 2bf9d01c50 | |||
| c654e00984 | |||
| f9f2b07489 |
+5
-7
@@ -13,12 +13,10 @@
|
||||
/Debug64
|
||||
/Release64
|
||||
/ipch
|
||||
/bin
|
||||
/obj
|
||||
/.vs
|
||||
/32/*.lua
|
||||
/32/LuaLibs/*.lua
|
||||
/32/Images/*.png
|
||||
/64/*.lua
|
||||
/64/LuaLibs/*.lua
|
||||
/64/Images/*.png
|
||||
/bin/*.lua
|
||||
/bin/*.ini
|
||||
/bin/LuaLibs/*.lua
|
||||
/bin/Images/*.png
|
||||
.vscode/settings.json
|
||||
|
||||
+33
-64
@@ -2,96 +2,67 @@ variables:
|
||||
VERS_MAIN: '1.0'
|
||||
APP_NAME: 'Wall'
|
||||
NEW_REL: ''
|
||||
NET_SHARE_R: '\\10.74.82.201\EgwTech'
|
||||
NET_SHARE_X: '\\10.74.82.201\EgwTech'
|
||||
NET_SHARE_Z: '\\10.74.82.201\Artifacts'
|
||||
NET_USERQ: 'steamw\egalware'
|
||||
|
||||
#Note compilazione LUA:
|
||||
# lua53 -o 32\$FileName -s $FileName: -o = output, -s = NON include i debug symbols
|
||||
# lua54 -o bin\$FileName -s $FileName: -o = output, -s = NON include i debug symbols
|
||||
|
||||
# helper compilazione LUA a 32 bit
|
||||
.LuaCompile32: &LuaCompile32
|
||||
# helper compilazione LUA a 32 e 64 bit
|
||||
.LuaCompile: &LuaCompile
|
||||
- |
|
||||
Set-Alias lua53 C:\Tools\Lua32\luac53
|
||||
Set-Alias lua54 C:\Tools\Lua32\luac54
|
||||
echo "Copia file *.ini"
|
||||
$FileList = Get-ChildItem("*.ini")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
Copy-Item -Path $FileName -Destination 32\$FileName
|
||||
echo "Copy-Item -Path $FileName -Destination 32\$FileName"
|
||||
Copy-Item -Path $FileName -Destination bin\$FileName
|
||||
echo "Copy-Item -Path $FileName -Destination bin\$FileName"
|
||||
}
|
||||
echo "Compilazione file *.lua 32bit"
|
||||
echo "Compilazione file *.lua 32/64bit"
|
||||
$FileList = Get-ChildItem("*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua53 -o 32\$FileName $FileName
|
||||
echo "lua53 -o 32\$FileName $FileName"
|
||||
lua54 -o bin\$FileName $FileName
|
||||
echo "lua54 -o bin\$FileName $FileName"
|
||||
}
|
||||
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua53 -o 32\LuaLibs\$FileName LuaLibs\$FileName
|
||||
echo "lua53 -o 32\LuaLibs\$FileName LuaLibs\$FileName"
|
||||
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
|
||||
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
|
||||
}
|
||||
|
||||
# helper compilazione LUA a 64 bit
|
||||
.LuaCompile64: &LuaCompile64
|
||||
- |
|
||||
Set-Alias lua53 C:\Tools\Lua64\luac53
|
||||
echo "Copia file *.ini"
|
||||
$FileList = Get-ChildItem("*.ini")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
Copy-Item -Path $FileName -Destination 64\$FileName
|
||||
echo "Copy-Item -Path $FileName -Destination 64\$FileName"
|
||||
}
|
||||
echo "Compilazione file *.lua 64bit"
|
||||
$FileList = Get-ChildItem("*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua53 -o 64\$FileName $FileName
|
||||
echo "lua53 -o 64\$FileName $FileName"
|
||||
}
|
||||
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua53 -o 64\LuaLibs\$FileName LuaLibs\$FileName
|
||||
echo "lua53 -o 64\LuaLibs\$FileName LuaLibs\$FileName"
|
||||
}
|
||||
|
||||
# Copy-Item -Path $FileName -Destination 64\$FileName
|
||||
# echo "Copy-Item -Path $FileName -Destination 64\$FileName"
|
||||
# helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI
|
||||
# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
|
||||
.CodeReplicaR: &CodeReplicaR
|
||||
- |
|
||||
net use R: /delete
|
||||
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY . R:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
|
||||
net use X: /delete
|
||||
SLEEP 2
|
||||
net use R: /delete
|
||||
net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY . X:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
|
||||
SLEEP 2
|
||||
net use X: /delete
|
||||
|
||||
|
||||
# helper copia script verso cartella di rete R:\ delle cartelle 32 e 64
|
||||
# helper copia script verso cartella di rete X:\ delle cartelle bin
|
||||
.ReplicaR: &ReplicaR
|
||||
- |
|
||||
net use R: /delete
|
||||
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY /MIR 32 R:\EgtData\$env:APP_NAME\32
|
||||
ROBOCOPY /MIR 64 R:\EgtData\$env:APP_NAME\64
|
||||
ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\32\Images
|
||||
ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\64\Images
|
||||
net use X: /delete
|
||||
SLEEP 2
|
||||
net use R: /delete
|
||||
net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY /MIR bin X:\EgtData\$env:APP_NAME\bin
|
||||
ROBOCOPY /MIR Images X:\EgtData\$env:APP_NAME\bin\Images
|
||||
SLEEP 2
|
||||
net use X: /delete
|
||||
|
||||
# helper copia script verso cartella di rete R:\ delle cartelle 32 e 64
|
||||
# helper copia script verso cartella di rete X:\ delle cartelle bin
|
||||
.ReplicaZ: &ReplicaZ
|
||||
- |
|
||||
net use Z: /delete
|
||||
SLEEP 2
|
||||
net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY /MIR 32 Z:\EgtData\$env:APP_NAME\32
|
||||
ROBOCOPY /MIR 64 Z:\EgtData\$env:APP_NAME\64
|
||||
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\32\Images
|
||||
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\64\Images
|
||||
ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin
|
||||
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\bin\Images
|
||||
SLEEP 2
|
||||
net use Z: /delete
|
||||
|
||||
@@ -100,15 +71,13 @@ stages:
|
||||
|
||||
LuaCompile:build:
|
||||
stage: build
|
||||
# only:
|
||||
# - main
|
||||
# - master
|
||||
only:
|
||||
- main
|
||||
- master
|
||||
tags:
|
||||
- win
|
||||
script:
|
||||
- *LuaCompile32
|
||||
- *LuaCompile64
|
||||
- *LuaCompile
|
||||
- *CodeReplicaR
|
||||
- *ReplicaR
|
||||
- *ReplicaZ
|
||||
|
||||
|
||||
+13
-4
@@ -1,4 +1,4 @@
|
||||
-- BatchProcess.lua by Egaltech s.r.l. 2022/05/09
|
||||
-- BatchProcess.lua by Egaltech s.r.l. 2023/04/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).
|
||||
@@ -12,6 +12,8 @@
|
||||
-- 2022/02/24 Se ricalcolo si aggiorna il setup. In ogni caso si verifica prima di simulazione.
|
||||
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
|
||||
-- 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).
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
@@ -179,9 +181,11 @@ if bToProcess then
|
||||
if bBtl then
|
||||
-- cancello eventuale vecchio progetto omonimo
|
||||
EgtEraseFile( sNgeFile)
|
||||
-- flag di importazione
|
||||
local nFlag = EIB_FL.TS3_POS + EIB_FL.USEUATTR + EgtIf( WD.CUT_WITH_OUTLINE, EIB_FL.TRIM_WITH_OUTLINE or 128, EIB_FL.NONE)
|
||||
-- eseguo import
|
||||
EgtNewFile()
|
||||
if not EgtImportBtl( WALL.FILE, EIB_FL.TS3_POS + EIB_FL.USEUATTR) then
|
||||
if not EgtImportBtl( WALL.FILE, nFlag) then
|
||||
WALL.ERR = 13
|
||||
WALL.MSG = 'Error importing BTL file : ' .. WALL.FILE
|
||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||
@@ -241,7 +245,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
|
||||
@@ -392,7 +396,12 @@ if bToProcess then
|
||||
PostErrView( WALL.ERR, WALL.MSG)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- Se richiesto per la macchina, ruoto il grezzo di 180 gradi attorno a Z
|
||||
if WD.RAWPART_ROT and abs( WD.RAWPART_ROT - 180) < 1 then
|
||||
EgtRotateRawPart( EgtGetFirstRawPart() or GDB_ID.NULL, Z_AX(), 180)
|
||||
end
|
||||
|
||||
-- Imposto Nome file CN
|
||||
local _, sName, _ = EgtSplitPath( WALL.FILE)
|
||||
EgtSetInfo( EgtGetCurrMachGroup(), 'NcName', sName .. '.cnc')
|
||||
|
||||
+20
-17
@@ -1,4 +1,4 @@
|
||||
-- BatchProcess.lua by Egaltech s.r.l. 2022/05/09
|
||||
-- BatchProcess.lua by Egaltech s.r.l. 2023/05/04
|
||||
-- Gestione calcolo batch disposizione e lavorazioni per Pareti
|
||||
-- 2021/01/15 Per nuova interfaccia Egt.
|
||||
-- 2021/11/10 Aggiunta modifica per gestione modifiche manuali come in Beam.
|
||||
@@ -7,6 +7,7 @@
|
||||
-- 2022/01/20 Si aggiorna il setup anche quando si creano le lavorazioni (MachGroup vecchio...).
|
||||
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
|
||||
-- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData.
|
||||
-- 2023/05/04 Traduzione messaggi ora fatta direttamente (eliminata codifica $$nn).
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
@@ -45,6 +46,18 @@ EgtOutLog( sLog)
|
||||
local sLogFile = EgtChangePathExtension( WALL.FILE, '.txt')
|
||||
EgtEraseFile( sLogFile)
|
||||
|
||||
-- Funzione per traduzione messaggi
|
||||
local function BWMessageId( nMsgId, sMsg, params)
|
||||
local sFmt
|
||||
if WALL.BW and nMsgId and nMsgId > 0 then
|
||||
sFmt = EgtMsg( 65000 + nMsgId)
|
||||
end
|
||||
if not sFmt or #sFmt == 0 then
|
||||
sFmt = sMsg
|
||||
end
|
||||
return string.format( sFmt, table.unpack( params))
|
||||
end
|
||||
|
||||
-- Funzioni per scrittura su file di log specifico
|
||||
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
||||
local hFile = io.open( sLogFile, 'a')
|
||||
@@ -55,17 +68,6 @@ local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
||||
hFile:write( 'TASKID=' .. tostring( nTaskId or 0) .. '\n')
|
||||
hFile:close()
|
||||
end
|
||||
local function BWMessageId( nMsgId, sMsg, params)
|
||||
if WALL.BW and nMsgId and nMsgId > 0 then
|
||||
local sFinalMsg = '$$' .. nMsgId
|
||||
for Index = 1, #params do
|
||||
sFinalMsg = sFinalMsg .. ',' .. params[Index]
|
||||
end
|
||||
return sFinalMsg
|
||||
else
|
||||
return string.format( sMsg, table.unpack( params))
|
||||
end
|
||||
end
|
||||
|
||||
local function WriteTimeToLogFile( dTime)
|
||||
local hFile = io.open( sLogFile, 'a')
|
||||
@@ -228,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
|
||||
@@ -383,8 +385,8 @@ if bToProcess then
|
||||
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
|
||||
ResetMachGroup( vWall)
|
||||
local sOut = BWMessageId( 1, 'Grezzo (%s x %s x %s) oltre il limite della macchina (%s x %s x %s)',
|
||||
{EgtNumToString( dRawL, 2), EgtNumToString( dRawW, 2), EgtNumToString( dRawH, 2),
|
||||
EgtNumToString( WD.MAX_LENGTH, 2), EgtNumToString( WD.MAX_WIDTH, 2), EgtNumToString( WD.MAX_HEIGHT, 2)})
|
||||
{EgtNumToString( dRawL, 2), EgtNumToString( dRawW, 2), EgtNumToString( dRawH, 2),
|
||||
EgtNumToString( WD.MAX_LENGTH, 2), EgtNumToString( WD.MAX_WIDTH, 2), EgtNumToString( WD.MAX_HEIGHT, 2)})
|
||||
WALL.ERR = 17
|
||||
WALL.MSG = sOut
|
||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||
@@ -395,8 +397,9 @@ if bToProcess then
|
||||
-- Verifico dimensioni minime del grezzo
|
||||
if dRawL < WD.MIN_LENGTH - 10 * GEO.EPS_SMALL or dRawW < WD.MIN_WIDTH - 10 * GEO.EPS_SMALL or dRawH < WD.MIN_HEIGHT - 10 * GEO.EPS_SMALL then
|
||||
ResetMachGroup( vWall)
|
||||
local sOut = 'Grezzo (' .. EgtNumToString( dRawL, 2) .. ' x ' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' ..
|
||||
'sotto il limite della macchina ('..EgtNumToString( WD.MIN_LENGTH, 2)..' x '..EgtNumToString( WD.MIN_WIDTH, 2)..' x '..EgtNumToString( WD.MIN_HEIGHT, 2)..')'
|
||||
local sOut = BWMessageId( 2, 'Grezzo (%s x %s x %s) sotto il limite della macchina (%s x %s x %s)',
|
||||
{EgtNumToString( dRawL, 2), EgtNumToString( dRawW, 2), EgtNumToString( dRawH, 2),
|
||||
EgtNumToString( WD.MIN_LENGTH, 2), EgtNumToString( WD.MIN_WIDTH, 2), EgtNumToString( WD.MIN_HEIGHT, 2)})
|
||||
WALL.ERR = 17
|
||||
WALL.MSG = sOut
|
||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||
|
||||
+26
-49
@@ -1,53 +1,30 @@
|
||||
|
||||
REM Compilazione degli script Wall Egaltech 2022.05.09
|
||||
REM Compilazione degli script Wall Egaltech 2023.09.26
|
||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||
|
||||
REM Compilazione 32 bit
|
||||
REM Compilazione 32 e 64 bit
|
||||
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WallExec.lua LuaLibs\WallExec.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WallLib.lua LuaLibs\WallLib.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\BatchProcess.lua BatchProcess.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\BatchProcessNew.lua BatchProcessNew.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\GetWallData.lua GetWallData.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\NestFlipAndRotate.lua NestFlipAndRotate.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\NestProcess.lua NestProcess.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\Overturn.lua Overturn.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\Process.lua Process.lua
|
||||
\EgtProg\Dll32\luac53 -o 32\Rotate.lua Rotate.lua
|
||||
|
||||
REM Compilazione 64 bit
|
||||
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WallExec.lua LuaLibs\WallExec.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WallLib.lua LuaLibs\WallLib.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\BatchProcess.lua BatchProcess.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\BatchProcessNew.lua BatchProcessNew.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\GetWallData.lua GetWallData.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\NestFlipAndRotate.lua NestFlipAndRotate.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\NestProcess.lua NestProcess.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\Overturn.lua Overturn.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\Process.lua Process.lua
|
||||
\EgtProg\Dll64\luac53 -o 64\Rotate.lua Rotate.lua
|
||||
\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
|
||||
REM \EgtProg\Dll32\luac54 -o bin\LuaLibs\WFeatureTopology.lua LuaLibs\WFeatureTopology.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
|
||||
|
||||
+4
-1
@@ -1,4 +1,4 @@
|
||||
-- GetWallData.lua by Egaltech s.r.l. 2022/06/28
|
||||
-- GetWallData.lua by Egaltech s.r.l. 2023/03/08
|
||||
-- Recupero dati da file WallData.lua di macchina
|
||||
|
||||
-- Intestazioni
|
||||
@@ -37,10 +37,13 @@ local WD = require( 'WallData')
|
||||
-- Assegno valori di interesse
|
||||
GWD.SIMUL_VIEW_DIR = WD.SIMUL_VIEW_DIR
|
||||
GWD.ORIG_CORNER = WD.ORIG_CORNER
|
||||
GWD.DELTA_X = WD.DELTA_X
|
||||
GWD.DELTA_Y = WD.DELTA_Y
|
||||
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
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
-- 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
|
||||
-- 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/06/07 Alla funzione AddMachining aggiunta la scrittura dell'info ISOUTLINE alle lavorazioni.
|
||||
-- 2023/10/18 In SetCurrMachiningAndTool sostituito controllo di utensile attivo con controllo utensile nel setup corrente.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WMachiningLib = {}
|
||||
@@ -28,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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -55,14 +60,15 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, d
|
||||
for i = 1, #Millings do
|
||||
local Milling = Millings[i]
|
||||
if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then
|
||||
local bIsBlade = ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0) or false
|
||||
local nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||
local sMyTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
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 dTTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
|
||||
local dTMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 0, 0.5 * ( dTDiam - dTDiamTh))
|
||||
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')
|
||||
if nMchType == MCH_MY.MILLING and
|
||||
( not sTuuid or sTuuid == sMyTuuid) and
|
||||
@@ -177,5 +183,17 @@ function WMachiningLib.FindSurfacing( sType)
|
||||
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
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
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,5 +1,6 @@
|
||||
-- WProcessDoubleCut.lua by Egaltech s.r.l. 2021/04/28
|
||||
-- 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.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPDC = {}
|
||||
@@ -58,7 +59,9 @@ 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
|
||||
return LapJoint.Make( Proc, nRawId, b3Raw)
|
||||
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)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
-- 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.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPD = {}
|
||||
@@ -137,7 +138,7 @@ function WPD.RotateClassify( Proc)
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
|
||||
-- se foro orizzontale con punta lunga
|
||||
if dDiam <= WD.HOR_DRILL_DIAM + WD.DRILL_TOL and dDiam >= WD.HOR_DRILL_DIAM - WD.DRILL_TOL and vtExtr:getZ() > -0.1 and vtExtr:getZ() < 0.1 then
|
||||
if dDiam <= ( WD.HOR_DRILL_DIAM or 35) + WD.DRILL_TOL and dDiam >= ( WD.HOR_DRILL_DIAM or 35) - WD.DRILL_TOL and vtExtr:getZ() > -0.1 and vtExtr:getZ() < 0.1 then
|
||||
-- se orientato perpendicolare ad X
|
||||
if AreSameOrOppositeVectorApprox( vtExtr, X_AX()) then
|
||||
nRot0 = 0
|
||||
@@ -375,7 +376,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)
|
||||
@@ -505,7 +506,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)
|
||||
|
||||
+386
-306
File diff suppressed because it is too large
Load Diff
+311
-207
@@ -1,4 +1,4 @@
|
||||
-- WProcessLapJoint.lua by Egaltech s.r.l. 2022/12/22
|
||||
-- WProcessLapJoint.lua by Egaltech s.r.l. 2023/10/02
|
||||
-- Gestione calcolo mezzo-legno per Pareti
|
||||
-- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant).
|
||||
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
|
||||
@@ -14,6 +14,22 @@
|
||||
-- 2022/11/15 DS Con lama massima inclinazione 60deg.
|
||||
-- 2022/12/01 Per 2 facce con angolo > 90° implementata lavorazione principale verticale. Se da sopra, aggiunta ripresa del lato inclinato.
|
||||
-- 2022/12/14 Nel caso di 2 facce piccola correzione al modo di ordinare le facce.
|
||||
-- 2023/03/09 Gestito caso riconoscimento errato Stype 3.
|
||||
-- 2023/03/09 In MakeMoreFaces aggiunta la possibilità di lavorare le fessure con la lama.
|
||||
-- 2023/03/17 In MakeByMill gestito correttamente il caso di Workside destro.
|
||||
-- 2023/04/15 Corretta scelta tipo lavorazione 'SideGroove' aggiungendo massimo spessore.
|
||||
-- 2023/04/17 Sistemata gestione parametri Q, eliminando quello non usato di forzatura lama e abilitandoli anche per DoubleCut.
|
||||
-- Lavorazione CleanCorner sempre forzata con lato di lavoro in centro.
|
||||
-- 2023/05/25 Funzioni EgtAddMachining sostituite da WM.AddMachining in modo da trascrivere le priorità da btl alle lavorazioni.
|
||||
-- 2023/06/30 Aggiunta lettura delle note esistenti dalle lavorazioni per evitare di sovrascriverle.
|
||||
-- 2023/07/10 In MakeSideGrooveByMill si impedisce ora di lavorare una groove se la testa deve scendere sotto al limite superiore del grezzo.
|
||||
-- 2023/07/25 Aggiunte passate laterali per SideGroove, se specificato SIDESTEP nelle note utensile.
|
||||
-- 2023/08/01 Migliorato controllo testa sotto al grezzo in SieGroove.
|
||||
-- 2023/08/07 Controllo testa sotto al grezzo in SideGroove escluso se richiesto il move after.
|
||||
-- 2023/09/19 Controllo lavorabilità con una sola faccia ora ha limiti come FreeContour.
|
||||
-- 2023/09/21 Modifica controllo lavorabilità con tre facce tipo tunnel ma non ortogonali tra loro.
|
||||
-- 2023/09/21 In MakeByMill modificato SCC per correggere caso con lama su testa fresa.
|
||||
-- 2023/10/02 Aggiunta segnalazione lavorazione tipo Side non trovata.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPL = {}
|
||||
@@ -33,11 +49,10 @@ local WHISK_SAFE = 5
|
||||
local MIN_LEN_CUT = 30
|
||||
|
||||
-- variabili assegnazione parametri Q
|
||||
local Q_FORCE_BLADE = '' -- i
|
||||
local Q_SIDE_MILL = '' -- d
|
||||
local Q_CORNER_CUT = '' -- i
|
||||
|
||||
-- variabile settaggio doppia lavorazione su angoo > 90
|
||||
-- variabile settaggio doppia lavorazione su angolo > 90
|
||||
local bMakeTwinCut = true
|
||||
-- angolo sottosquadra ammesso per fresa cono 30°
|
||||
local dAngleSmall = 70
|
||||
@@ -58,20 +73,19 @@ end
|
||||
local function AssignQIdent( Proc)
|
||||
|
||||
-- reset assegnazione parametri Q
|
||||
Q_FORCE_BLADE = ''
|
||||
Q_SIDE_MILL = ''
|
||||
Q_CORNER_CUT = ''
|
||||
|
||||
if Proc.Grp == 0 and Proc.Prc == 12 then
|
||||
Q_FORCE_BLADE = 'Q01' -- i
|
||||
if Proc.Prc == 11 then
|
||||
Q_SIDE_MILL = 'Q02' -- i
|
||||
Q_CORNER_CUT = 'Q05' -- i
|
||||
elseif Proc.Prc == 12 then
|
||||
Q_SIDE_MILL = 'Q02' -- i
|
||||
Q_CORNER_CUT = '' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then
|
||||
Q_FORCE_BLADE = '' -- i
|
||||
Q_SIDE_MILL = 'Q08' -- i
|
||||
Q_CORNER_CUT = 'Q05' -- i
|
||||
else
|
||||
Q_FORCE_BLADE = 'Q01' -- i
|
||||
Q_SIDE_MILL = 'Q03' -- i
|
||||
Q_CORNER_CUT = 'Q05' -- i
|
||||
end
|
||||
@@ -81,11 +95,6 @@ end
|
||||
---------------------------------------------------------------------
|
||||
local function EvaluateQParam( Proc)
|
||||
|
||||
local bForceUseBlade = false
|
||||
if #Q_FORCE_BLADE == 0 or EgtGetInfo( Proc.Id, Q_FORCE_BLADE, 'i') == 1 then
|
||||
bForceUseBlade = true
|
||||
end
|
||||
|
||||
-- Verifico se utilizzare la fresa di lato :
|
||||
-- 0 : niente
|
||||
-- 1 : utilizzo fresa di lato (alla faccia selezionata)
|
||||
@@ -98,7 +107,7 @@ local function EvaluateQParam( Proc)
|
||||
-- 3 : scarico corner (tipo foro).
|
||||
local nTypeCornerCut = EgtGetInfo( Proc.Id, Q_CORNER_CUT, 'i') or 0
|
||||
|
||||
return nTypeCornerCut, nUseSideMillAsBlade, bForceUseBlade
|
||||
return nTypeCornerCut, nUseSideMillAsBlade
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -108,8 +117,8 @@ function WPL.Classify( Proc, b3Raw)
|
||||
if Proc.Fct == 1 then
|
||||
-- dati della faccia
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
|
||||
-- verifico se è lavorabile da sopra
|
||||
return vtN:getZ() >= WD.NZ_MINA
|
||||
-- verifico se è lavorabile da sopra o di fianco
|
||||
return vtN:getZ() >= -0.5
|
||||
-- se 2 facce
|
||||
elseif Proc.Fct == 2 then
|
||||
-- dati delle facce
|
||||
@@ -117,7 +126,7 @@ function WPL.Classify( Proc, b3Raw)
|
||||
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.028 or vtN[2]:getZ() >= - 0.028)
|
||||
return ( vtN[1]:getZ() >= -0.028 or vtN[2]:getZ() >= -0.028)
|
||||
-- se più di 2 facce
|
||||
else
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = WL.GetFaceWithMostAdj( Proc.Id, Proc.PartId)
|
||||
@@ -142,6 +151,26 @@ function WPL.Classify( Proc, b3Raw)
|
||||
bAllowNegativeFace = true
|
||||
end
|
||||
end
|
||||
|
||||
-- conto le adiacenze delle facce
|
||||
local vAdj = {}
|
||||
local nFacesWithMoreThanOneAdj = 0
|
||||
for i = 1, Proc.Fct do
|
||||
-- recupero le adiacenze del loop esterno
|
||||
local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, i - 1)[1]
|
||||
-- le conto
|
||||
local nCount = 0
|
||||
for j = 1, #vFacAdj do
|
||||
if vFacAdj[j] >= 0 then
|
||||
nCount = nCount + 1
|
||||
end
|
||||
end
|
||||
vAdj[i] = nCount
|
||||
if nCount > 1 then
|
||||
nFacesWithMoreThanOneAdj = nFacesWithMoreThanOneAdj + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- verifico se la faccia è lavorabile da sopra o di fianco
|
||||
if ( vtN:getZ() >= WD.NZ_MINA or ( dMinNz < -0.866 and Proc.Fct >= 3 and ( vtN:getZ() > - 0.01 or bAllowNegativeFace))) then
|
||||
Proc.Stype = 1
|
||||
@@ -155,7 +184,7 @@ function WPL.Classify( Proc, b3Raw)
|
||||
Proc.Stype = 2
|
||||
return ( vtN2:getZ() >= WD.NZ_MINA or ( dMinNz < -0.866 and Proc.Fct >= 3 and vtN2:getZ() > - 0.01))
|
||||
-- se tre facce
|
||||
elseif Proc.Fct == 3 then
|
||||
elseif Proc.Fct == 3 and nFacesWithMoreThanOneAdj < 2 then
|
||||
-- verifico se U da sopra
|
||||
-- dati della faccia
|
||||
local nFac2 = EgtIf( nFacInd == 0, 1, 0)
|
||||
@@ -166,8 +195,8 @@ function WPL.Classify( Proc, b3Raw)
|
||||
else
|
||||
return false
|
||||
end
|
||||
-- se altrimenti tunnel
|
||||
elseif nFacInd == -1 then
|
||||
-- se altrimenti tunnel o assimilabile
|
||||
elseif nFacInd == -1 or nFacInd == -2 then
|
||||
-- dati delle prime tre facce
|
||||
local vtN = {}
|
||||
vtN[1] = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
|
||||
@@ -782,7 +811,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
-- se devo creare superfice locale
|
||||
if bMakeLocSurf then
|
||||
-- creo superfice locale o esco
|
||||
local nSurfToAdd = MakeLocalSurf( tFacAdj[1][7], tFacAdj[1][8], tFacAdj[1][9], nAddGrpId)
|
||||
local nSurfToAdd = MakeLocalSurf( tFacAdj[7], tFacAdj[8], tFacAdj[9], nAddGrpId)
|
||||
if nSurfToAdd then
|
||||
local nFacCntPre = EgtSurfTmFacetCount( nNewProc)
|
||||
-- creo copia del percorso principale e gli aggiungo la nuova faccia
|
||||
@@ -791,7 +820,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
-- riordino le facce
|
||||
nNewProcLoc = ReorderFacesFromTab( nNewProcLoc, vFace)
|
||||
-- acquisisco il numero della faccia
|
||||
nFacCnt = EgtSurfTmFacetCount( nNewProcLoc)
|
||||
local nFacCnt = EgtSurfTmFacetCount( nNewProcLoc)
|
||||
nFacInd = nFacCnt - 1
|
||||
else
|
||||
local sErr = 'Cannot make local bottom surface'
|
||||
@@ -803,11 +832,11 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
end
|
||||
-- prendo il primo versore
|
||||
local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT)
|
||||
local _, vtN2 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[1][1], GDB_ID.ROOT)
|
||||
local _, vtN3 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[1][2], GDB_ID.ROOT)
|
||||
local _, vtN2 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[1], GDB_ID.ROOT)
|
||||
local _, vtN3 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[2], GDB_ID.ROOT)
|
||||
-- trovo il punto sulla superfice di riferimento
|
||||
local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[1][1], GDB_ID.ROOT)
|
||||
local _, ptLocP3, ptLocP4, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[1][2], GDB_ID.ROOT)
|
||||
local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[1], GDB_ID.ROOT)
|
||||
local _, ptLocP3, ptLocP4, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[2], GDB_ID.ROOT)
|
||||
-- se ho creato faccia locale su copia superficie, cancella la copia
|
||||
if bMakeLocSurf then
|
||||
EgtErase( nNewProcLoc)
|
||||
@@ -815,16 +844,16 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
local nIdIniPoint
|
||||
local nIdEndPoint
|
||||
if ptLocP1 and ptLocP2 then
|
||||
if ( dist( ptLocP1, tFacAdj[1][4]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[1][4]) < GEO.EPS_SMALL) then
|
||||
if ( dist( ptLocP1, tFacAdj[4]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[4]) < GEO.EPS_SMALL) then
|
||||
nIdEndPoint = 4
|
||||
nIdIniPoint = 5
|
||||
elseif ( dist( ptLocP1, tFacAdj[1][5]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[1][5]) < GEO.EPS_SMALL) then
|
||||
elseif ( dist( ptLocP1, tFacAdj[5]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[5]) < GEO.EPS_SMALL) then
|
||||
nIdEndPoint = 5
|
||||
nIdIniPoint = 4
|
||||
end
|
||||
end
|
||||
-- versore direzione
|
||||
local vtExtr = tFacAdj[1][nIdIniPoint] - tFacAdj[1][nIdEndPoint]
|
||||
local vtExtr = tFacAdj[nIdIniPoint] - tFacAdj[nIdEndPoint]
|
||||
vtExtr:normalize()
|
||||
-- versore direzione di uscita
|
||||
local vtExtrExit
|
||||
@@ -853,44 +882,44 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
vtCheck:rotate( Z_AX(), dOffsAng)
|
||||
end
|
||||
-- controllo se c'è collisione con le facce della superfice
|
||||
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
||||
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
||||
dTall1, dTall2, dDiam3, dTall3) then
|
||||
local sErr = 'Collision detect from clean corner tool and surface'
|
||||
EgtOutLog( sErr)
|
||||
return true, ''
|
||||
end
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdIniPoint], tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdIniPoint], tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
-- se uso utensile cono 60°
|
||||
if nTypeConeCut == 1 then
|
||||
-- se offset angolare valido e/o negativo creo il baffo precedente
|
||||
if dOffsAng < ( 100 * GEO.EPS_SMALL) then
|
||||
-- se il punto finale corrisponde con il punto utilizzato in precedenza, uso l'altro
|
||||
if dist( tFacAdj[1][nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
|
||||
if dist( tFacAdj[nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
|
||||
ptApPoint = ptLocP2
|
||||
else
|
||||
ptApPoint = ptLocP1
|
||||
end
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
local dLenTrimExt = dist( tFacAdj[1][nIdEndPoint], ptApPoint) - (( dToolDiam/2) + 0.2)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
local dLenTrimExt = dist( tFacAdj[nIdEndPoint], ptApPoint) - (( dToolDiam/2) + 0.2)
|
||||
-- se la distanza dei due punti della linea è maggiore dal raggio fresa + delta, trimmo al raggio fresa + delta
|
||||
if dLenTrimExt > 10 * GEO.EPS_SMALL then
|
||||
EgtTrimExtendCurveByLen( nAuxId , -dLenTrimExt, ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
-- se ho l'offset angolare ruoto la linea per compensare la rotazione che verrà applicata
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( nAuxId, tFacAdj[1][nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( nAuxId, tFacAdj[nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
-- prendo il nuovo punto finale
|
||||
ptApPoint = EgtEP( nAuxId, GDB_RT.GLOB) + Point3d( 0, 0, dDepthMach)
|
||||
else
|
||||
-- se ho l'offset angolare ruoto la linea per compensare la rotazione che verrà applicata
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( nAuxId, tFacAdj[1][nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( nAuxId, tFacAdj[nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
table.insert( pAuxId, nAuxId)
|
||||
-- creo linea di ritorno
|
||||
nAuxId = EgtLine( nAddGrpId, ptApPoint + Point3d( 0, 0, -dDepthMach), tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
nAuxId = EgtLine( nAddGrpId, ptApPoint + Point3d( 0, 0, -dDepthMach), tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
end
|
||||
end
|
||||
@@ -900,7 +929,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
ptLocP1, ptLocP2 = ptLocP3, ptLocP4
|
||||
if ptLocP1 and ptLocP2 then
|
||||
-- se il punto finale corrisponde con il punto utilizzato in precedenza, uso l'altro
|
||||
if dist( tFacAdj[1][nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
|
||||
if dist( tFacAdj[nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
|
||||
ptApPoint = ptLocP2
|
||||
else
|
||||
ptApPoint = ptLocP1
|
||||
@@ -909,36 +938,36 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
if nTypeConeCut == 1 then
|
||||
-- se offset angolare valido e/o negativo creo il baffo precedente
|
||||
if dOffsAng > -( 100 * GEO.EPS_SMALL) then
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
local dLenTrimExt = dist( tFacAdj[1][nIdEndPoint], ptApPoint) - (( dToolDiam/2) + 0.2)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
local dLenTrimExt = dist( tFacAdj[nIdEndPoint], ptApPoint) - (( dToolDiam/2) + 0.2)
|
||||
-- se la distanza dei due punti della linea è maggiore dal raggio fresa + delta, trimmo al raggio fresa + delta
|
||||
if dLenTrimExt > 10 * GEO.EPS_SMALL then
|
||||
EgtTrimExtendCurveByLen( nAuxId , -dLenTrimExt, ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
-- se ho l'offset angolare ruoto la linea per compensare la rotazione che verrà applicata
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( nAuxId, tFacAdj[1][nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( nAuxId, tFacAdj[nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
-- prendo il nuovo punto finale
|
||||
ptApPoint = EgtEP( nAuxId, GDB_RT.GLOB) + Point3d( 0, 0, dDepthMach)
|
||||
else
|
||||
-- se ho l'offset angolare ruoto la linea per compensare la rotazione che verrà applicata
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( nAuxId, tFacAdj[1][nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( nAuxId, tFacAdj[nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
table.insert( pAuxId, nAuxId)
|
||||
-- creo linea di ritorno
|
||||
nAuxId = EgtLine( nAddGrpId, ptApPoint + Point3d( 0, 0, -dDepthMach), tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
nAuxId = EgtLine( nAddGrpId, ptApPoint + Point3d( 0, 0, -dDepthMach), tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
end
|
||||
-- ultima linea di distacco (5mm in direzione utensile)
|
||||
local pEnd = tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach) + ( 5 * vtExtr)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), pEnd, GDB_RT.GLOB)
|
||||
local pEnd = tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach) + ( 5 * vtExtr)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), pEnd, GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
else
|
||||
-- linea di distacco (2mm in direzione utensile)
|
||||
local pEnd = tFacAdj[1][nIdEndPoint] + ( 2 * vtExtr)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdEndPoint], pEnd, GDB_RT.GLOB)
|
||||
local pEnd = tFacAdj[nIdEndPoint] + ( 2 * vtExtr)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdEndPoint], pEnd, GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
-- ultima linea di risalita in Z
|
||||
local pIni = pEnd
|
||||
@@ -961,11 +990,11 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
EgtModifyCurveExtrusion( AuxId, vtExtr, GDB_RT.GLOB)
|
||||
-- se ho un offset angolare ruoto il percorso
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( AuxId, tFacAdj[1][nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( AuxId, tFacAdj[nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
|
||||
local nMchId = EgtAddMachining( sName, sMilling)
|
||||
local nMchId = WM.AddMachining( nNewProc, sName, sMilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
@@ -979,10 +1008,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.ADIR_YM
|
||||
if vtExtr:getY() > 100 * GEO.EPS_ZERO then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
local nSCC = MCH_SCC.ADIR_ZP
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, 4)
|
||||
@@ -991,11 +1017,15 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10)
|
||||
-- setto affondamento 0
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, 0)
|
||||
-- forzo lato correzione a centrato
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
||||
-- leggo eventuali note esistenti della lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
-- aggiungo alle note massima elevazione
|
||||
-- sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';'
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( 0.0, 1))
|
||||
-- scrivo le note della lavorazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -1067,7 +1097,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
|
||||
local nFacInd, dDimMin, dDimMax, dDepth, nSurfInt
|
||||
local bMakeLocSurf
|
||||
if nFacCnt <= 4 then
|
||||
-- RIMUOVERE
|
||||
if false and nFacCnt <= 4 then
|
||||
-- ottengo le dimensioni apertura, la normale e la faccia inferiore
|
||||
dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId)
|
||||
if nSurfInt then
|
||||
@@ -1084,6 +1115,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- FINE PARTE DA RIMUOVERE
|
||||
else
|
||||
bMakeLocSurf = true
|
||||
end
|
||||
@@ -1103,38 +1135,37 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
while i <= #vFace do
|
||||
-- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura
|
||||
if ( vFace[i].Type & 2) ~= 0 or vFace[i].Type == 4 then
|
||||
-- variabili costruzione geometria
|
||||
local tFacAdj = {}
|
||||
-- variabili costruzione geometria (nFace1, nFace2, tFacAdj)
|
||||
local nFace1 = vFace[i].Fac
|
||||
local nFace2
|
||||
-- ricavo i tre punti per eventuale superficie locale
|
||||
local ptLoc1, ptLoc2, ptLoc3
|
||||
-- punto precedente (punto precedente della faccia [i])
|
||||
ptLoc3 = vFace[i].PPrev
|
||||
-- aggiungo geometria
|
||||
i = i + 1
|
||||
local j = EgtIf( i <= #vFace, i, EgtIf( bClosed, 1, nil))
|
||||
if not j then
|
||||
return true
|
||||
end
|
||||
nFace2 = vFace[j].Fac
|
||||
local j = EgtIf( i < #vFace, i + 1, EgtIf( bClosed, 1, nil))
|
||||
if not j then return true end
|
||||
local nFace2 = vFace[j].Fac
|
||||
-- punto in comune tra le due facce (punto precedente della faccia [j])
|
||||
ptLoc1 = vFace[j].PPrev
|
||||
-- punto precedente (punto precedente della faccia [i])
|
||||
if vFace[i].PPrev then
|
||||
ptLoc3 = vFace[i].PPrev
|
||||
else
|
||||
ptLoc3 = Point3d( vFace[i].Cen:getX(), vFace[i].Cen:getY(), ptLoc1:getZ())
|
||||
end
|
||||
-- punto successivo ( precedente della faccia successiva)
|
||||
j = j + 1
|
||||
local k = EgtIf( j <= #vFace, j, EgtIf( bClosed, 1, nil))
|
||||
local k = EgtIf( j < #vFace, j + 1, EgtIf( bClosed, 1, nil))
|
||||
-- se è un percorso aperto prendo il punto medio della seconda faccia come punto locale 2
|
||||
if not k then
|
||||
ptLoc2 = Point3d( vFace[j-1].Cen:getX(), vFace[j-1].Cen:getY(), ptLoc1:getZ())
|
||||
ptLoc2 = Point3d( vFace[j].Cen:getX(), vFace[j].Cen:getY(), ptLoc1:getZ())
|
||||
else
|
||||
ptLoc2 = vFace[k].PPrev
|
||||
end
|
||||
-- ricavo i punti e l'angolo interno
|
||||
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT)
|
||||
-- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza
|
||||
local tFacAdj = {}
|
||||
if ptP1 and ptP2 and dAng < 0 and dAng < -6 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
table.insert( tFacAdj, { nFace1, nFace2, dLen, ptP1, ptP2, dAng, ptLoc1, ptLoc2, ptLoc3})
|
||||
tFacAdj = { nFace1, nFace2, dLen, ptP1, ptP2, dAng, ptLoc1, ptLoc2, ptLoc3}
|
||||
end
|
||||
-- se ho un elemento creo percorso o percorsi in base al tipo di cono e all'apertura dall'angolo rispetto ai 90°
|
||||
-- con una tolleranza di 2 gradi
|
||||
@@ -1162,9 +1193,9 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
else
|
||||
i = i + 1
|
||||
end
|
||||
-- passo alla successiva
|
||||
i = i + 1
|
||||
end
|
||||
-- cancello la copia della superfice
|
||||
if nNewProc then
|
||||
@@ -1255,7 +1286,7 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV)
|
||||
for i = 1, nStep do
|
||||
-- Applico la lavorazione con sega a catena a questa faccia
|
||||
local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
|
||||
local nMchFId = EgtAddMachining( sName, sSawing)
|
||||
local nMchFId = WM.AddMachining( Proc, sName, sSawing)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
|
||||
EgtOutLog( sErr)
|
||||
@@ -1281,13 +1312,16 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV)
|
||||
-- se necessario, limito l'affondamento
|
||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
dDepth = dMaxDepth - dElev
|
||||
local dDepth = dMaxDepth - dElev
|
||||
EgtOutLog( sWarn)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1))
|
||||
end
|
||||
-- leggo eventuali note esistenti della lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
-- imposto elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 2) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 2))
|
||||
-- scrivo le note della lavorazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -1312,7 +1346,11 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
|
||||
local _, vtRef = EgtSurfTmFacetCenter( Proc.Id, nOthFac, GDB_ID.ROOT)
|
||||
-- recupero la lavorazione
|
||||
local sMilling = WM.FindMilling( 'Side')
|
||||
if not sMilling then return false end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Side not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dMillDiam = 20
|
||||
local dMillLen = 10
|
||||
@@ -1342,7 +1380,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
|
||||
end
|
||||
-- inserisco la lavorazione di contornatura
|
||||
local sName = 'Mill_' .. ( 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)
|
||||
@@ -1359,10 +1397,17 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) -- -dMillDiam/2 + dAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dSideDist + WD.CUT_SIC)
|
||||
-- setto inversione in base al workside
|
||||
local bIsWorkSideRight = ( EgtGetMachiningParam( MCH_MP.WORKSIDE) == MCH_MILL_WS.RIGHT)
|
||||
local bInvert = false
|
||||
if bIsWorkSideRight then
|
||||
bInvert = true
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.ADIR_ZP
|
||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
|
||||
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto modo di lavorare la faccia
|
||||
@@ -1401,13 +1446,15 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
sMilling = sCustomMach
|
||||
-- altrimenti la cerco
|
||||
else
|
||||
sMilling = WM.FindMilling( 'SideGroove')
|
||||
sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV))
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : SideGroove not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local dGrooveMinZ = max( b3Raw:getMin():getZ(), Proc.Box:getMin():getZ())
|
||||
local dRawMaxZ = b3Raw:getMax():getZ()
|
||||
-- recupero i dati dell'utensile
|
||||
local dMillDiam = 20
|
||||
local dMillLen = 10
|
||||
@@ -1416,6 +1463,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
local dMillDiamTh = 999
|
||||
local dMillDiamThStem = 0
|
||||
local dMillLenTh = 0
|
||||
local dSideStep = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
@@ -1426,6 +1474,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
|
||||
dMillDiamThStem = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dMillDiamThStem
|
||||
dMillLenTh = EgtTdbGetCurrToolThLength() or dMillLenTh
|
||||
dSideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd') or dSideStep
|
||||
if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat
|
||||
if not dMaxDepthOnSide or dMaxDepthOnSide < 0.1 then
|
||||
@@ -1437,8 +1486,6 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd')
|
||||
end
|
||||
end
|
||||
local dGrooveMinZ = max( b3Raw:getMin():getZ(), Proc.Box:getMin():getZ())
|
||||
local dRawMaxZ = b3Raw:getMax():getZ()
|
||||
-- se riesco a lavorare il sottosquadro senza arrivare alla parte larga del portautensile uso la sidedepth o il diametro stretto del portautensile come diametro del gambo
|
||||
if ( dMillTotLen - dMillLenTh) > ( abs( dRawMaxZ - dGrooveMinZ) + 1) then
|
||||
if dMaxDepthOnSide and dMaxDepthOnSide > 0 then
|
||||
@@ -1450,7 +1497,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
end
|
||||
end
|
||||
-- se profondità ribasso è maggiore della capacità di sottosquadro dell'utensile
|
||||
if ( not bEnablePreMill and bMachFromDn) and ( dElev >= ( 0.5 * ( dMillDiam - dMillDiamTh))) then
|
||||
if ( not bEnablePreMill and bMachFromDn) and ( dElev > 0.5 * ( dMillDiam - dMillDiamTh) - 10 * GEO.EPS_SMALL) then
|
||||
local sErr = 'Error : Side Elevation (' .. dElev .. ') bigger than max tool side depth (' .. ( 0.5 * ( dMillDiam - dMillDiamTh)) ..')'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
@@ -1462,7 +1509,20 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
return false, sErr
|
||||
end
|
||||
if Proc.Fct == 2 and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + 100 * GEO.EPS_SMALL and dMaxMat > dThick + 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Error : Tool thickness is too big'
|
||||
local sErr = 'Error : Tool thickness is too big'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- dimensioni della testa
|
||||
local dHeadMaxWidth = 250
|
||||
local dHeadMinWidth = 160
|
||||
local dHeadMinWidthHeight = 30
|
||||
-- se la testa scende sotto al limite superiore del grezzo e non c'è sufficiente capacità di sottosquadro
|
||||
-- controllo disattivato se move after
|
||||
if WD.SIDEMILL_BEFORE and not ( bEnablePreMill or bAsEnablePreMill) and
|
||||
( ( dMillTotLen < ( abs( dRawMaxZ - dGrooveMinZ) + 10 * GEO.EPS_SMALL) and ( dElev > 0.5 * ( dMillDiam - dHeadMinWidth) - 10 * GEO.EPS_SMALL)) or
|
||||
( dMillTotLen + dHeadMinWidthHeight < ( abs( dRawMaxZ - dGrooveMinZ) + 10 * GEO.EPS_SMALL) and ( dElev > 0.5 * ( dMillDiam - dHeadMaxWidth) - 10 * GEO.EPS_SMALL))) then
|
||||
local sErr = 'Error : Tool too short, head will collide with rawpart'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -1704,8 +1764,8 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
end
|
||||
end
|
||||
-- inserisco la lavorazione di fresatura
|
||||
local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
|
||||
local nMchFId = EgtAddMachining( sNameGorge, sMillingGorge)
|
||||
local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet)
|
||||
local nMchFId = WM.AddMachining( Proc, sNameGorge, sMillingGorge)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge
|
||||
EgtOutLog( sErr)
|
||||
@@ -1720,7 +1780,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto modo di lavorare la faccia
|
||||
local nFaceUse = WL.GetNearestParalOpposite( Z_AX(), vtN)
|
||||
local nFaceUse = WL.GetNearestParalOpposite( Z_AX())
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- imposto elevazione e step
|
||||
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||
@@ -1755,8 +1815,8 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
for i = 1, nNumStep - 1 do
|
||||
nNm = nNm + 1
|
||||
-- inserisco la lavorazione di taglio sfrido gorge
|
||||
local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
|
||||
local nMchFId = EgtAddMachining( sNameGorge, sCuttingGorge)
|
||||
local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
|
||||
local nMchFId = WM.AddMachining( Proc, sNameGorge, sCuttingGorge)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge
|
||||
EgtOutLog( sErr)
|
||||
@@ -1813,121 +1873,148 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
|
||||
local dStepOri
|
||||
if not bExcludeSideMill then
|
||||
-- inserisco la lavorazione di ribasso o gola
|
||||
local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
local nSideStep = 1
|
||||
if dSideStep > 0 and not ( bEnablePreMill or bAsEnablePreMill) and nModifyLeadInOut < 1 then
|
||||
nSideStep = ceil( dElev / dSideStep)
|
||||
dSideStep = max( dElev / nSideStep, 0)
|
||||
end
|
||||
EgtSetInfo( nMchFId, 'Part', Proc.PartId)
|
||||
-- se ho abilitato la lavorazione di lama per garantire passaggio utensile, setto la nota per spostare la fresatura dopo i tagli di lama
|
||||
if bEnablePreMill or bAsEnablePreMill then
|
||||
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
|
||||
-- imposto posizione braccio porta testa
|
||||
--local nSCC = MCH_SCC.ADIR_ZP
|
||||
--if abs( vtN:getZ()) < GEO.EPS_SMALL then
|
||||
-- nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
|
||||
--end
|
||||
local nSCC = MCH_SCC.ADIR_NEAR
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto modo di lavorare la faccia
|
||||
local nFaceUse = WL.GetNearestParalOpposite( Z_AX(), vtN)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- imposto elevazione e step
|
||||
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||
dStepOri = dStep
|
||||
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
|
||||
local nStep = ceil( ( dThick - dMaxMat) / dStep)
|
||||
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
|
||||
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
|
||||
if nSinglePass and nSinglePass > 0 then
|
||||
dStep = 0
|
||||
if nSinglePass == 1 then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
|
||||
for i = 1, nSideStep do
|
||||
-- inserisco la lavorazione di ribasso o gola
|
||||
local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = WM.AddMachining( Proc, sName, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
if bUpwardMilling then
|
||||
dStep = -dStep
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dStep)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
|
||||
-- setto il lato di lavoro standard
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- modifico ingressi e uscita
|
||||
-- se ho inserito il pretaglio modifico
|
||||
if bEnablePreMill or bAsEnablePreMill then
|
||||
if nModifyLeadInOut > 0 then
|
||||
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
|
||||
if dElev > ( 0.5 * dMillDiam) then
|
||||
if nModifyLeadInOut == 1 then
|
||||
-- setto il tipo di passo a una via
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
|
||||
-- modifico il tipo di uscita
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG)
|
||||
EgtSetInfo( nMchFId, 'Part', Proc.PartId)
|
||||
-- se ho abilitato la lavorazione di lama per garantire passaggio utensile, setto la nota per spostare la fresatura dopo i tagli di lama
|
||||
if bEnablePreMill or bAsEnablePreMill then
|
||||
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.ADIR_NEAR
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto modo di lavorare la faccia
|
||||
local nFaceUse = WL.GetNearestParalOpposite( Z_AX())
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- imposto elevazione e step
|
||||
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||
dStepOri = dStep
|
||||
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
|
||||
local nStep = ceil( ( dThick - dMaxMat) / dStep)
|
||||
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
|
||||
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
|
||||
if nSinglePass and nSinglePass > 0 then
|
||||
dStep = 0
|
||||
if nSinglePass == 1 then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
|
||||
end
|
||||
end
|
||||
if bUpwardMilling then
|
||||
dStep = -dStep
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dStep)
|
||||
-- leggo eventuali note esistenti della lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
-- aggiungo alle note massima elevazione
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3))
|
||||
-- scrivo le note della lavorazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- setto il lato di lavoro standard
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- setto offset radiale per gestire le eventuali passate in orizzontale
|
||||
local dRadialOffset = dSideStep * ( nSideStep - i)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
|
||||
-- modifico ingressi e uscita
|
||||
-- se ho inserito il pretaglio modifico
|
||||
if bEnablePreMill or bAsEnablePreMill then
|
||||
if nModifyLeadInOut > 0 then
|
||||
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
|
||||
if dElev > ( 0.5 * dMillDiam) then
|
||||
if nModifyLeadInOut == 1 then
|
||||
-- setto il tipo di passo a una via
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
|
||||
-- modifico il tipo di uscita
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
-- modifico dati supplementari uscita
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0.5)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd))
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||
end
|
||||
end
|
||||
-- setto allungamenti iniziali e finali
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
|
||||
if bInvertMach then
|
||||
-- setto il lato di lavoro invertito
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
end
|
||||
else
|
||||
-- setto allungamenti iniziali e finali
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
|
||||
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
|
||||
if dElev > ( 0.5 * dMillDiam) then
|
||||
-- setto allungamenti perpendicolari
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
-- modifico dati supplementari uscita
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0.5)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd))
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
||||
end
|
||||
end
|
||||
-- se richiesto, setto la nota per spostare la lavorazione alla fine
|
||||
if not WD.SIDEMILL_BEFORE then
|
||||
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
|
||||
end
|
||||
else
|
||||
if nModifyLeadInOut > 0 then
|
||||
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
|
||||
if dElev > ( 0.5 * dMillDiam) then
|
||||
-- setto il tipo di passo a una via
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
|
||||
end
|
||||
if bInvertMach then
|
||||
-- setto il lato di lavoro invertito
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
end
|
||||
end
|
||||
-- setto allungamenti iniziali e finali
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
|
||||
if bInvertMach then
|
||||
-- setto il lato di lavoro invertito
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- se ho passate orizzontali riduco l'eventuale allungamento settato dall'utente
|
||||
local dLiPerp = EgtGetMachiningParam( MCH_MP.LIPERP)
|
||||
local dLoPerp = EgtGetMachiningParam( MCH_MP.LOPERP)
|
||||
if dLiPerp > 0 then
|
||||
dLiPerp = dLiPerp - dRadialOffset
|
||||
end
|
||||
else
|
||||
-- setto allungamenti iniziali e finali
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
|
||||
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
|
||||
if dElev > ( 0.5 * dMillDiam) then
|
||||
-- setto allungamenti perpendicolari
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
||||
if dLoPerp > 0 then
|
||||
dLoPerp = dLoPerp - dRadialOffset
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
||||
-- se richiesto, setto la nota per spostare la lavorazione alla fine
|
||||
if not WD.SIDEMILL_BEFORE then
|
||||
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
|
||||
end
|
||||
end
|
||||
-- se richiesto, setto la nota per spostare la lavorazione alla fine
|
||||
if not WD.SIDEMILL_BEFORE then
|
||||
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
|
||||
end
|
||||
else
|
||||
if nModifyLeadInOut > 0 then
|
||||
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
|
||||
if dElev > ( 0.5 * dMillDiam) then
|
||||
-- setto il tipo di passo a una via
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
|
||||
end
|
||||
if bInvertMach then
|
||||
-- setto il lato di lavoro invertito
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
-- provo a invertire posizione braccio porta testa
|
||||
nSCC = MCH_SCC.ADIR_FAR
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- setto allungamenti iniziali e finali
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
|
||||
-- se richiesto, setto la nota per spostare la lavorazione alla fine
|
||||
if not WD.SIDEMILL_BEFORE then
|
||||
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
|
||||
end
|
||||
end
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
else
|
||||
sWarn = 'Warning in LapJoint : upside down groove with obtuse angle not completed'
|
||||
@@ -1938,7 +2025,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then
|
||||
-- inserisco la lavorazione di contornatura
|
||||
local sName = 'Mill_Oth_Fac_' .. ( 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)
|
||||
@@ -1970,7 +2057,12 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
dStepOtherFace = -dStepOtherFace
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dStepOtherFace)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
|
||||
-- leggo eventuali note esistenti della lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
-- aggiungo alle note massima elevazione
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3))
|
||||
-- scrivo le note della lavorazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if bMachFromDn then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthOtherFace)
|
||||
@@ -2126,7 +2218,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
|
||||
end
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Pock_' .. ( 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)
|
||||
@@ -2155,8 +2247,12 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- leggo eventuali note della lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
-- imposto elevazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( min( dElev, dMaxDepth), 1) .. ';')
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( min( dElev, dMaxDepth), 1))
|
||||
-- scrivo le note della lavorazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -2196,14 +2292,14 @@ local function MakeOneFace( Proc, nRawId, b3Raw)
|
||||
-- recupero la lavorazione di taglio con lama e i suoi parametri
|
||||
local sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard')
|
||||
-- se non inclinata o capacità di taglio non sufficiente, provo con svuotatura
|
||||
if not sCutting or vtN:getZ() > 0.866 or dSawMaxDepth < dDimV + WD.CUT_SIC then
|
||||
if not sCutting or vtN:getZ() > 0.866 or dSawMaxDepth < dDimV + WD.CUT_EXTRA then
|
||||
-- faccio con svuotatura
|
||||
local nFacet = 0
|
||||
return MakeByPocketing( Proc, nFacet, nRawId, b3Raw)
|
||||
end
|
||||
-- eseguo il taglio di lama
|
||||
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id)
|
||||
local nMchId = EgtAddMachining( sName, sCutting)
|
||||
local nMchId = WM.AddMachining( Proc, sName, sCutting)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
||||
EgtOutLog( sErr)
|
||||
@@ -2481,7 +2577,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
|
||||
for i = 1, 2 do
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) .. '_' .. tostring( i)
|
||||
local nMchId = EgtAddMachining( sName, sCutting)
|
||||
local nMchId = WM.AddMachining( Proc, sName, sCutting)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
||||
EgtOutLog( sErr)
|
||||
@@ -2525,15 +2621,17 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
||||
end
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
local dMaxSlotThicknessForBlade = 25
|
||||
local bIsSmallSlot = ( Proc.Fct == 3 and ( min( dH, dV) < dMaxSlotThicknessForBlade + 10 * GEO.EPS_SMALL) and vtN:getZ() > -0.01)
|
||||
-- se di fianco
|
||||
if not bPckt and Proc.Fct >= 3 and vtN:getZ() < WD.NZ_MINA then
|
||||
if not bPckt and Proc.Fct >= 3 and ( ( vtN:getZ() < WD.NZ_MINA) or bIsSmallSlot) then
|
||||
-- recupero elevazione faccia in feature
|
||||
local dSideElev = WL.GetFaceElevation( Proc.Id, nFacInd)
|
||||
-- se abilitata lavorazione ribasso con fresa di fianco e parametro Q03 abilitato
|
||||
local sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill', nil, nil, nil, nil, min( dH, dV), nil, dSideElev)
|
||||
local _, nUseMillOnSide = EvaluateQParam( Proc)
|
||||
-- se ho abilitata lavorazione di fresa di fianco
|
||||
if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 then
|
||||
if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 and not bIsSmallSlot then
|
||||
-- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH
|
||||
local dMaxDepthOnSide = 0
|
||||
local dMillDiam = 0
|
||||
@@ -2574,16 +2672,22 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
||||
return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, EgtIf( dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, nil, nil, bLikeAsMakeFirstGroove, nSinglePass)
|
||||
end
|
||||
else
|
||||
-- fresatura (se definita)
|
||||
local sMilling = WM.FindMilling( 'SideGroove')
|
||||
-- fresatura (se definita); se disponibile, cerco di usare un utensile che non lavori al limite della capacità di sottosquadro
|
||||
local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, 1.2 * dSideElev)
|
||||
-- se non ho trovato un utensile un po' più grande del sottosquadro richiesto, passo alla ricerca standard
|
||||
if not sMilling then
|
||||
sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV), nil, dSideElev)
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dMaxMat = 1000
|
||||
local dMaxDepthOnSide = 0
|
||||
local bIsBlade = false
|
||||
if sMilling and EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||
if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then
|
||||
local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
||||
bIsBlade = EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0
|
||||
if bIsBlade then
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat
|
||||
dMaxDepthOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
else
|
||||
@@ -2596,7 +2700,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
||||
end
|
||||
end
|
||||
end
|
||||
if sMilling and dElev < dMaxDepthOnSide and dMaxMat <= min( dH, dV) + 20 * GEO.EPS_SMALL then
|
||||
if sMilling and dElev < dMaxDepthOnSide then
|
||||
return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling)
|
||||
-- altrimenti sega a catena
|
||||
else
|
||||
|
||||
@@ -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 = {}
|
||||
@@ -90,7 +91,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
|
||||
local b3Tab = EgtGetTableArea()
|
||||
local dMaxZTable = b3Tab:getMax():getZ()
|
||||
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||
local MIN_Z_OFFSET = 100
|
||||
local MIN_Z_OFFSET = 99.9
|
||||
if vtExtr:getZ() < WD.NZ_MINA then
|
||||
if dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL or vtExtr:getZ() <= -0.1 then
|
||||
local sErr = 'Error : Mark from bottom impossible'
|
||||
@@ -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 = {}
|
||||
@@ -51,7 +52,7 @@ function WPM.Classify( Proc, b3Raw)
|
||||
local b3Tab = EgtGetTableArea()
|
||||
local dMaxZTable = b3Tab:getMax():getZ()
|
||||
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||
local MIN_Z_OFFSET = 100
|
||||
local MIN_Z_OFFSET = 99.9
|
||||
return EgtIf( dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL, vtN:getZ() > WD.NZ_MINA, vtN:getZ() > -0.1)
|
||||
end
|
||||
end
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 = {}
|
||||
@@ -71,7 +72,7 @@ local function MakeCode_1( Proc, nRawId, b3Raw)
|
||||
end
|
||||
-- inserisco la lavorazione di finitura superficie
|
||||
local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sSurfFin)
|
||||
local nMchFId = WM.AddMachining( Proc, sName, sSurfFin)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+128
-44
@@ -1,5 +1,10 @@
|
||||
-- WallExec.lua by Egaltech s.r.l. 2022/05/12
|
||||
-- WallExec.lua by Egaltech s.r.l. 2023/10/16
|
||||
-- Libreria esecuzione lavorazioni per Pareti
|
||||
-- 2023/05/25 Aggiunto ordinamento in base a priorità da btl.
|
||||
-- 2023/06/07 Nel caso di outline con priorità aggiunta la rimozione degli sfridi nella lavorazione successiva.
|
||||
-- 2023/06/27 Aggiunte origini TN e BN.
|
||||
-- 2023/07/04 Se c'è funzione di macchina WD.GetOrigCorner si lascia scegliere posizione default a questa impostando 0 se non c'è 'REFPOS'.
|
||||
-- 2023/10/16 Aggiunta gestione Aree vietate (LockOut) per chiodature.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WallExec = {}
|
||||
@@ -71,31 +76,37 @@ function WallExec.ProcessWalls( dRawL, dRawW, dRawH, vWall, bMachGroupOk, bNewPr
|
||||
local nCorner
|
||||
local sOrigCorner = WD.ORIG_CORNER or 'BR'
|
||||
if WD.GetOrigCorner then
|
||||
sOrigCorner = WD.GetOrigCorner( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'REFPOS', 'i') or 1)
|
||||
sOrigCorner = WD.GetOrigCorner( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'REFPOS', 'i') or 0)
|
||||
end
|
||||
if sOrigCorner == 'TL' then
|
||||
nCorner = MCH_CR.TL
|
||||
OrigOnTab = Point3d( 0, b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( 0 + abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
elseif sOrigCorner == 'BL' then
|
||||
nCorner = MCH_CR.BL
|
||||
OrigOnTab = Point3d( 0, abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( 0 + abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
elseif sOrigCorner == 'TR' then
|
||||
nCorner = MCH_CR.TR
|
||||
OrigOnTab = Point3d( b3Tab:getDimX(), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( b3Tab:getDimX() - abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
elseif sOrigCorner == 'BR' then
|
||||
nCorner = MCH_CR.BR
|
||||
OrigOnTab = Point3d( b3Tab:getDimX(), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( b3Tab:getDimX() - abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
elseif sOrigCorner == 'TM' then
|
||||
nCorner = MCH_CR.TR
|
||||
OrigOnTab = Point3d( WD.MID_REF, b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( WD.MID_REF - abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
elseif sOrigCorner == 'BM' then
|
||||
nCorner = MCH_CR.BR
|
||||
OrigOnTab = Point3d( WD.MID_REF, abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
OrigOnTab = Point3d( WD.MID_REF - abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
elseif sOrigCorner == 'TN' then
|
||||
nCorner = MCH_CR.TL
|
||||
OrigOnTab = Point3d( WD.NEW_REF + abs( WD.DELTA_X or 0), b3Tab:getDimY() - abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
elseif sOrigCorner == 'BN' then
|
||||
nCorner = MCH_CR.BL
|
||||
OrigOnTab = Point3d( WD.NEW_REF + abs( WD.DELTA_X or 0), abs( WD.DELTA_Y or 0), ( WD.DELTA_Z or 0))
|
||||
end
|
||||
-- Impostazione dell'attrezzaggio di default
|
||||
EgtImportSetup()
|
||||
-- Impostazione eventuale allargamento area disponibile per grezzo
|
||||
EgtSetTableAreaOffset( WD.TAB_EXTRA_XP or 0, WD.TAB_EXTRA_XM or 0, WD.TAB_EXTRA_YP or 0, WD.TAB_EXTRA_YM or 0)
|
||||
EgtSetTableAreaOffset( WD.TAB_EXTRA_XP or 0, WD.TAB_EXTRA_YP or 0, WD.TAB_EXTRA_XM or 0, WD.TAB_EXTRA_YM or 0)
|
||||
-- Creazione del grezzo e suo posizionamento in macchina
|
||||
local nRaw = GDB_ID.NULL
|
||||
if nRawOutlineId and nRawOutlineId ~= GDB_ID.NULL then
|
||||
@@ -179,7 +190,8 @@ function WallExec.CollectFeatures( PartId, b3Raw)
|
||||
Proc.CutId = nCutId
|
||||
Proc.TaskId = nTaskId
|
||||
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
Proc.IsOutline = ( Proc.Prc == 251 or Proc.Prc == 252)
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
table.insert( vProc, Proc)
|
||||
-- se foro
|
||||
if Drill.Identify( Proc) then
|
||||
@@ -205,6 +217,16 @@ function WallExec.CollectFeatures( PartId, b3Raw)
|
||||
Proc2.TaskId = Proc.TaskId
|
||||
table.insert( vProc, Proc2)
|
||||
end
|
||||
-- se free contour
|
||||
elseif FreeContour.Identify( Proc) then
|
||||
-- recupero il tipo e il dato della lavorazione
|
||||
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
|
||||
local nCntData = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i') or 0
|
||||
-- imposto se area vietata
|
||||
if nCntType == 200 then
|
||||
Proc.LockOut = EgtIf( ( nCntData == 0 or ( nCntData & 1) ~= 0), 1, -1)
|
||||
end
|
||||
if Proc.LockOut then Proc.Flg = 0 end
|
||||
end
|
||||
else
|
||||
EgtOutLog( ' Feature ' .. tostring( Proc.Id) .. ' is empty (no geometry)')
|
||||
@@ -274,15 +296,15 @@ local function PrintFeatures( vProc)
|
||||
EgtOutLog( ' *** Feature List ***')
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
local sOut = string.format( 'Part=%3d Proc=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Fcse=%1d,%1d Diam=%.2f Fct=%2d Dbl=%2d Dlt=%.1f Box=%s',
|
||||
local sOut = string.format( 'Part=%3d Proc=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Lo=%d Fcse=%1d,%1d Diam=%.2f Fct=%2d Dbl=%2d Dlt=%.1f Box=%s',
|
||||
Proc.PartId, Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId,
|
||||
Proc.Flg, Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, Proc.Double or 0, Proc.Delta or 0, tostring( Proc.Box))
|
||||
Proc.Flg, EgtIf( Proc.LockOut, 1, 0), Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, Proc.Double or 0, Proc.Delta or 0, tostring( Proc.Box))
|
||||
EgtOutLog( sOut)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AddFeatureMachining( Proc, nRawId, b3Raw)
|
||||
local function AddFeatureMachining( Proc, nRawId, b3Raw, vNLO)
|
||||
local bOk = true
|
||||
local sErr = ''
|
||||
EgtOutLog( ' * Process ' .. tostring( Proc.Id) .. ' *', 1)
|
||||
@@ -324,8 +346,8 @@ local function AddFeatureMachining( Proc, nRawId, b3Raw)
|
||||
bOk, sErr = Text.Make( Proc, nRawId, b3Raw)
|
||||
-- se contorno libero, outline o apertura ( 0/3/4-250/251/252-X)
|
||||
elseif FreeContour.Identify( Proc) then
|
||||
-- esecuzione contorno
|
||||
bOk, sErr = FreeContour.Make( Proc, nRawId, b3Raw)
|
||||
-- esecuzione contorno libero
|
||||
bOk, sErr = FreeContour.Make( Proc, nRawId, b3Raw, vNLO)
|
||||
-- se feature custom (Variant)
|
||||
elseif Variant.Identify( Proc) then
|
||||
-- esecuzione
|
||||
@@ -409,7 +431,7 @@ local function ContainsStartName( nOperId, StartNames)
|
||||
end
|
||||
|
||||
------ Ordinamento dei tagli, delle fresature e delle forature -------
|
||||
local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName, sInfo, bExistInfo, bOneWay, bByTool, bByToolAngle)
|
||||
local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName, sInfo, bExistInfo, bOneWay, bByTool, bByToolAngle, nPriority)
|
||||
-- dichiarazione tabella
|
||||
local TabCut = {}
|
||||
-- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate
|
||||
@@ -419,6 +441,7 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
||||
-- Se appartiene alla fase corrente e taglio con lama non da sopra (sempre su 1 sola entità)
|
||||
if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and
|
||||
( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) and
|
||||
( not nPriority or EgtGetInfo( nOperId, 'PRIORITY', 'i') == nPriority ) and
|
||||
( not StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or
|
||||
( not bExistName and not ContainsStartName( nOperId, StartNames))) and
|
||||
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or
|
||||
@@ -535,17 +558,17 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function SortMachinings( nPhase, PrevMch, nPartId)
|
||||
local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
|
||||
-- Chiodature
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Nail_'}, true, nil, nil, nil, true)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Nail_'}, true, nil, nil, nil, true, nil, nPriority)
|
||||
-- Tagli con sega a catena che sono rifiniture di spigoli
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, false)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, false, nil, nil, nil, nil, nil, nPriority)
|
||||
-- Forature orizzontali con punte lunghe
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, { 'LhDrill_'}, true, 'MOVE_AFTER', false, true)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, { 'LhDrill_'}, true, 'MOVE_AFTER', false, true, nil, nil, nPriority)
|
||||
-- Preforature per fori inclinati
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, { 'PreDrill_'}, true, nil, nil, nil, nil, nil, nPriority)
|
||||
-- Forature e Svuotature
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING + MCH_OY.POCKETING + MCH_OY.MILLING, { 'SideMill_', 'Clean_'}, false, 'MOVE_AFTER', false, false, true, nil, nPriority)
|
||||
-- -- Forature ***
|
||||
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false)
|
||||
-- -- Svuotature ***
|
||||
@@ -553,33 +576,56 @@ local function SortMachinings( nPhase, PrevMch, nPartId)
|
||||
-- -- Fresature che sono rifiniture di spigoli
|
||||
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
|
||||
-- Lavorazioni di superficie
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
|
||||
-- Fresature per gole
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Gorge_'}, true, 'MOVE_AFTER', false, nil, nil, nil, nPriority)
|
||||
-- Fresature che sono rifiniture di spigoli
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', false, false, true, true)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', false, false, true, true, nPriority)
|
||||
-- Fresature che sono puliture di spigoli
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, true, 'MOVE_AFTER', false, false, true)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, true, 'MOVE_AFTER', false, false, true, nil, nPriority)
|
||||
-- Tagli per gole
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, { 'GorgeCut_'}, true)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, { 'GorgeCut_'}, true, nil, nil, nil, nil, nil, nPriority)
|
||||
-- Tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING)
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.SAWING, nil, nil, nil, nil, nil, nil, nil, nPriority)
|
||||
-- Qui rimozione sfridi (se ci sono lavorazioni successive)
|
||||
-- Fresature dei lapjoint che necessitano di gorge
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true)
|
||||
-- Tagli con sega a catena che vanno fatti dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true)
|
||||
-- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true)
|
||||
-- Forature che vanno fatte dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
|
||||
-- Svuotature che vanno fatte dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
|
||||
-- Lavorazioni di superficie che vanno fatte dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true)
|
||||
if not nPriority then
|
||||
-- Fresature dei lapjoint che necessitano di gorge
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true)
|
||||
-- Tagli con sega a catena che vanno fatti dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true)
|
||||
-- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true)
|
||||
-- Forature che vanno fatte dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
|
||||
-- Svuotature che vanno fatte dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
|
||||
-- Lavorazioni di superficie che vanno fatte dopo i tagli con lama
|
||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, nil, nil, 'MOVE_AFTER', true)
|
||||
end
|
||||
return PrevMch
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- setto la rimozione sfridi dopo le lavorazioni di outline
|
||||
function InsertScrapRemoval( nPhase)
|
||||
local nCurrentOperationId = EgtGetNextOperation( EgtGetPhaseDisposition( nPhase))
|
||||
local nActiveMachiningId = EgtGetCurrMachining()
|
||||
while nCurrentOperationId do
|
||||
local bIsCurrentOperationOutline = ( EgtGetInfo( nCurrentOperationId or GDB_ID.NULL, 'ISOUTLINE', 'b' ) == true)
|
||||
local bIsCurrentOperationWithPriority = ( ( EgtGetInfo( nCurrentOperationId or GDB_ID.NULL, 'PRIORITY', 'i' ) or 0) > 0)
|
||||
local nNextOperationId = EgtGetNextOperation (nCurrentOperationId)
|
||||
local bIsNextOperationOutline = ( EgtGetInfo( nNextOperationId or GDB_ID.NULL, 'ISOUTLINE', 'b' ) == true)
|
||||
if bIsCurrentOperationOutline and bIsCurrentOperationWithPriority and nNextOperationId and not bIsNextOperationOutline then
|
||||
EgtSetCurrMachining( nNextOperationId)
|
||||
local sMachiningNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
sMachiningNotes = sMachiningNotes .. 'ScrapRemove=1;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sMachiningNotes)
|
||||
end
|
||||
nCurrentOperationId = EgtGetNextOperation( nCurrentOperationId)
|
||||
end
|
||||
EgtSetCurrMachining( nActiveMachiningId or GDB_ID.NULL)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WallExec.ProcessFeatures()
|
||||
-- errori e stato
|
||||
@@ -606,9 +652,11 @@ function WallExec.ProcessFeatures()
|
||||
end
|
||||
-- classifico le feature
|
||||
ClassifyFeatures( vProc, b3Raw)
|
||||
-- Eventuale determinazione delle feature lavorabili in parallelo (implementata nella configurazione macchina)
|
||||
-- recupero l'elenco delle aree vietate alle chiodature
|
||||
local vNLO = WL.GetNailLockOutAreas( vProc)
|
||||
-- Se non ci sono aree vietate alle chiodature, eventuale determinazione delle feature lavorabili in parallelo (implementata nella configurazione macchina)
|
||||
-- si impostano i flag Double (nil/0=no, 1=su X, 2=su Y) e Delta (offset tra T14 e T12 positivo o negativo)
|
||||
if WD.FindFeaturesInDouble then
|
||||
if #vNLO == 0 and WD.FindFeaturesInDouble then
|
||||
WD.FindFeaturesInDouble( vProc, b3Raw)
|
||||
end
|
||||
-- debug
|
||||
@@ -621,7 +669,7 @@ function WallExec.ProcessFeatures()
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 then
|
||||
local bOk, sMsg = AddFeatureMachining( Proc, nRawId, b3Raw)
|
||||
local bOk, sMsg = AddFeatureMachining( Proc, nRawId, b3Raw, vNLO)
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
@@ -630,7 +678,7 @@ function WallExec.ProcessFeatures()
|
||||
else
|
||||
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
end
|
||||
elseif not Proc.Double then
|
||||
elseif not Proc.Double and not Proc.LockOut then
|
||||
local sMsg = 'Feature not machinable by orientation'
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
end
|
||||
@@ -641,8 +689,44 @@ function WallExec.ProcessFeatures()
|
||||
-- riordino le lavorazioni tra tutti i pezzi
|
||||
local nPhase = 1
|
||||
local PrevMch = EgtGetPhaseDisposition( nPhase)
|
||||
|
||||
-- abilitazione ordinamento con priorità da btl: 0 = no, 1 = ordine crescente, 2 = ordine decrescente
|
||||
-- le lavorazioni con priorità 0 o senza priorità saranno lasciate per ultime
|
||||
local nGetPriorityFromBtl = WD.BTL_PRIORITY or 0
|
||||
if nGetPriorityFromBtl > 0 then
|
||||
local vPriority = {}
|
||||
local nOperId = EgtGetNextOperation( PrevMch)
|
||||
local nCurrentPriorityId = 1
|
||||
while nOperId do
|
||||
local nPriority = EgtGetInfo( nOperId or GDB_ID.NULL, 'PRIORITY', 'i')
|
||||
if nPriority and nPriority ~= 0 then
|
||||
vPriority[nCurrentPriorityId] = nPriority
|
||||
nCurrentPriorityId = nCurrentPriorityId + 1
|
||||
end
|
||||
nOperId = EgtGetNextOperation( nOperId)
|
||||
end
|
||||
-- sorting delle priorità
|
||||
-- ordine crescente
|
||||
if nGetPriorityFromBtl == 1 then
|
||||
table.sort( vPriority)
|
||||
-- ordine decrescente
|
||||
else
|
||||
table.sort( vPriority, function( a, b) return a > b end)
|
||||
end
|
||||
-- riordino le lavorazioni per priorità
|
||||
for i = 1, #vPriority do
|
||||
if i == 1 or ( vPriority[i] ~= vPriority[i - 1]) then
|
||||
PrevMch = SortMachinings( nPhase, PrevMch, nil, vPriority[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
-- ordinamento standard
|
||||
SortMachinings( nPhase, PrevMch)
|
||||
|
||||
-- Aggiornamento finale di tutto
|
||||
if nGetPriorityFromBtl > 0 then
|
||||
InsertScrapRemoval( nPhase)
|
||||
end
|
||||
EgtSetCurrPhase( 1)
|
||||
EgtApplyAllMachinings()
|
||||
-- altrimenti macchina travi
|
||||
|
||||
+20
-1
@@ -1,4 +1,4 @@
|
||||
-- WallLib.lua by Egaltech s.r.l. 2022/04/04
|
||||
-- WallLib.lua by Egaltech s.r.l. 2023/10/16
|
||||
-- Libreria globale per Pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -316,5 +316,24 @@ function WallLib.GetNearestOrthoOpposite( vtRef, vtNorm)
|
||||
return nil
|
||||
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
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return WallLib
|
||||
|
||||
+76
-75
@@ -56,21 +56,22 @@ local Text = require( 'WProcessText')
|
||||
-- Carico i dati globali
|
||||
local WD = require( 'WallData')
|
||||
|
||||
-------------------------------------------------------------------
|
||||
local function ClassifyFlip( vPartProc, b3Part)
|
||||
|
||||
local FlipFeatureStates = {}
|
||||
local bLapJoints = false
|
||||
|
||||
for nInd = 1, #vPartProc do
|
||||
if LapJoint.Identify( vPartProc[nInd]) then
|
||||
if LapJoint.Identify( vPartProc[nInd]) then
|
||||
-- setto parametro Q
|
||||
if vPartProc[nInd].Prc == 30 then
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q08", 1)
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q08A", 1)
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q08A", 1)
|
||||
else
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q03", 1)
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q03A", 1)
|
||||
end
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q03A", 1)
|
||||
end
|
||||
bLapJoints = true
|
||||
local nFlip0, nFlip1 = LapJoint.FlipClassify(vPartProc[nInd])
|
||||
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
|
||||
@@ -80,7 +81,7 @@ local function ClassifyFlip( vPartProc, b3Part)
|
||||
local nFlip0, nFlip1 = Drill.FlipClassify(vPartProc[nInd], b3Part)
|
||||
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
|
||||
table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1})
|
||||
end
|
||||
end
|
||||
elseif Cut.Identify( vPartProc[nInd]) then
|
||||
local nFlip0, nFlip1 = Cut.FlipClassify(vPartProc[nInd], b3Part)
|
||||
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
|
||||
@@ -90,7 +91,7 @@ local function ClassifyFlip( vPartProc, b3Part)
|
||||
-- setto parametro Q
|
||||
if vPartProc[nInd].Prc == 12 then
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q02", 1)
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q02A", 1)
|
||||
EgtSetInfo( vPartProc[nInd].Id, "Q02A", 1)
|
||||
end
|
||||
local nFlip0, nFlip1 = DoubleCut.FlipClassify(vPartProc[nInd], b3Part)
|
||||
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
|
||||
@@ -100,7 +101,7 @@ local function ClassifyFlip( vPartProc, b3Part)
|
||||
local nFlip0, nFlip1 = SawCut.FlipClassify(vPartProc[nInd], b3Part)
|
||||
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
|
||||
table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1})
|
||||
end
|
||||
end
|
||||
elseif FreeContour.Identify( vPartProc[nInd]) then
|
||||
local nFlip0, nFlip1 = FreeContour.FlipClassify(vPartProc[nInd], b3Part)
|
||||
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
|
||||
@@ -120,19 +121,19 @@ local function ClassifyFlip( vPartProc, b3Part)
|
||||
local nFlip0, nFlip1 = Mark.FlipClassify(vPartProc[nInd], b3Part)
|
||||
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
|
||||
table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1})
|
||||
end
|
||||
end
|
||||
elseif Text.Identify( vPartProc[nInd]) then
|
||||
local nFlip0, nFlip1 = Text.FlipClassify(vPartProc[nInd], b3Part)
|
||||
if nFlip0 and nFlip1 and nFlip0 ~= nFlip1 then
|
||||
table.insert( FlipFeatureStates, { Flip0 = nFlip0, Flip1 = nFlip1})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return FlipFeatureStates, bLapJoints
|
||||
|
||||
return FlipFeatureStates, bLapJoints
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
local function ClassifyRotation( vPartProc)
|
||||
|
||||
local RotateFeatureStates = {}
|
||||
@@ -144,22 +145,21 @@ local function ClassifyRotation( vPartProc)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return RotateFeatureStates
|
||||
return RotateFeatureStates
|
||||
end
|
||||
|
||||
---
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-------------------------------------------------------------------
|
||||
local vPartProc = WE.CollectFeatures( NFAR.PARTID)
|
||||
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||
local bManualFlip = EgtGetInfo( NFAR.PARTID, "MANUALFLIP", 'b')
|
||||
local bManualRot = EgtGetInfo( NFAR.PARTID, "MANUALROT", 'b')
|
||||
|
||||
-- FLIP
|
||||
|
||||
-- FLIP
|
||||
local FlipFeatureStates, bLapJoints = ClassifyFlip( vPartProc, b3Part)
|
||||
|
||||
if not bManualFlip then
|
||||
local bFlip
|
||||
if not bManualFlip then
|
||||
local bFlip
|
||||
-- analizzo stati flip delle feature
|
||||
local nFlip0Min = 100
|
||||
local nFlip0Cnt = 0
|
||||
@@ -187,16 +187,16 @@ if not bManualFlip then
|
||||
elseif nFlip0Cnt < nFlip1Cnt then
|
||||
bFlip = false
|
||||
elseif bLapJoints then
|
||||
-- se equivalenti ma ci sono lap joints, fisso il flip per non avere problemi con le aree di lavorazione nel nesting
|
||||
bFlip = false
|
||||
-- se equivalenti ma ci sono lap joints, fisso il flip per non avere problemi con le aree di lavorazione nel nesting
|
||||
bFlip = false
|
||||
end
|
||||
elseif nFlip0Min < nFlip1Min then
|
||||
bFlip = true
|
||||
else
|
||||
bFlip = false
|
||||
bFlip = false
|
||||
end
|
||||
|
||||
if bFlip ~= nil then
|
||||
if bFlip ~= nil then
|
||||
-- se una posizione è più conveniente dell'altra setto info nel pezzo
|
||||
EgtSetInfo( NFAR.PARTID, "NestAllowFlip", false)
|
||||
EgtSetInfo( NFAR.PARTID, "NestFlip", bFlip)
|
||||
@@ -206,10 +206,10 @@ if not bManualFlip then
|
||||
|
||||
if bFlip then
|
||||
-- flip pezzo
|
||||
EgtRotate( NFAR.PARTID, b3Part:getCenter(), X_AX(), 180, GDB_RT.GLOB)
|
||||
EgtRotate( NFAR.PARTID, b3Part:getCenter(), X_AX(), 180, GDB_RT.GLOB)
|
||||
-- modifico le info del pezzo
|
||||
local nPartFlip = EgtGetInfo( NFAR.PARTID, "INVERTED", 'i') or 0
|
||||
local nTotFlip = EgtIf( nPartFlip == 180, 0, 180)
|
||||
local nTotFlip = EgtIf( nPartFlip == 180, 0, 180)
|
||||
EgtSetInfo( NFAR.PARTID, "INVERTED", nTotFlip)
|
||||
EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1)
|
||||
end
|
||||
@@ -217,12 +217,12 @@ end
|
||||
|
||||
-- rimuovo parametri Q
|
||||
local b3PartInside = BBox3d( b3Part)
|
||||
b3PartInside:expand( - WD.INSIDE_RAW_TOL)
|
||||
for nInd = 1, #vPartProc do
|
||||
b3PartInside:expand( - ( WD.INSIDE_RAW_TOL or 30))
|
||||
for nInd = 1, #vPartProc do
|
||||
local Proc = vPartProc[nInd]
|
||||
|
||||
if LapJoint.Identify( Proc) then
|
||||
-- cerco la faccia rivolta verso l'alto e la faccia rivolta verso il basso
|
||||
if LapJoint.Identify( Proc) then
|
||||
-- cerco la faccia rivolta verso l'alto e la faccia rivolta verso il basso
|
||||
local nFaceInd = -1
|
||||
local nFaceDownInd = -1
|
||||
for nIdx = 0, Proc.Fct - 1 do
|
||||
@@ -231,8 +231,8 @@ for nInd = 1, #vPartProc do
|
||||
nFaceInd = nIdx
|
||||
elseif vtN:getZ() < - 0.95 then
|
||||
nFaceDownInd = nIdx
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se è lap joint dall'alto
|
||||
if nFaceInd ~= -1 and nFaceDownInd == -1 then
|
||||
local ptCen = EgtSurfTmFacetCenter( Proc.Id, nFaceInd, GDB_ID.ROOT)
|
||||
@@ -241,11 +241,11 @@ for nInd = 1, #vPartProc do
|
||||
-- resetto parametro Q
|
||||
if Proc.Prc == 30 then
|
||||
EgtRemoveInfo( Proc.Id, "Q08")
|
||||
EgtRemoveInfo( Proc.Id, "Q08A")
|
||||
EgtRemoveInfo( Proc.Id, "Q08A")
|
||||
else
|
||||
EgtRemoveInfo( Proc.Id, "Q03")
|
||||
EgtRemoveInfo( Proc.Id, "Q03A")
|
||||
end
|
||||
EgtRemoveInfo( Proc.Id, "Q03A")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -264,21 +264,22 @@ for nInd = 1, #vPartProc do
|
||||
-- resetto parametro Q
|
||||
if Proc.Prc == 12 then
|
||||
EgtRemoveInfo( Proc.Id, "Q02")
|
||||
EgtRemoveInfo( Proc.Id, "Q02A")
|
||||
EgtRemoveInfo( Proc.Id, "Q02A")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- ROTATION
|
||||
nRotate = 0
|
||||
nRotate = 0
|
||||
|
||||
-- venatura
|
||||
EgtRemoveInfo( NFAR.PARTID, "HasGrainDirection")
|
||||
local bGrain = false
|
||||
local sGrainInfo = EgtGetInfo( NFAR.PARTID, "GRAINDIRECTION", 's')
|
||||
local sGrainInfo = EgtGetInfo( NFAR.PARTID, "GRAINDIRECTION", 's')
|
||||
if sGrainInfo then
|
||||
local sGrainAlign = string.sub( sGrainInfo, 7)
|
||||
local sGrainDir = string.sub( sGrainInfo, 1, 5)
|
||||
@@ -286,21 +287,21 @@ if sGrainInfo then
|
||||
EgtSetInfo( NFAR.PARTID, "HasGrainDirection", 1)
|
||||
bGrain = true
|
||||
-- trovo la rotazione ( a meno di 180°) che deve avere il pezzo per essere allineato con la venatura del grezzo
|
||||
local nGrainRot = 0
|
||||
local nGrainRot = 0
|
||||
if ( sGrainDir == "1,0,0" and not NFAR.RAW_GRAIN_DIR_X) or ( sGrainDir == "0,1,0" and NFAR.RAW_GRAIN_DIR_X) then
|
||||
nGrainRot = 90
|
||||
nGrainRot = 90
|
||||
end
|
||||
|
||||
local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0
|
||||
if ( nGrainRot == 0 and ( nPartRot == 90 or nPartRot == 270)) or ( nGrainRot == 90 and ( nPartRot == 0 or nPartRot == 180)) then
|
||||
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB)
|
||||
nRotate = 90
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not bManualRot then
|
||||
if not bManualRot then
|
||||
|
||||
local RotateFeatureStates = ClassifyRotation( vPartProc)
|
||||
|
||||
@@ -346,7 +347,7 @@ if not bManualRot then
|
||||
{ Rot = 90, Score = nRot90Min, ScoreCnt = nRot90Cnt},
|
||||
{ Rot = 180, Score = nRot180Min, ScoreCnt = nRot180Cnt},
|
||||
{ Rot = 270, Score = nRot270Min, ScoreCnt = nRot270Cnt}}
|
||||
local nRotateOpt = 0
|
||||
local nRotateOpt = 0
|
||||
if #RotateFeatureStates > 0 then
|
||||
-- calcolo lato con punteggio minore o molteplicita' piu' alta
|
||||
local nRotMax = MinList[1].Rot
|
||||
@@ -359,7 +360,7 @@ if not bManualRot then
|
||||
nScoreCnt = MinList[nInd].ScoreCnt
|
||||
elseif MinList[nInd].Score == nScoreMax then
|
||||
-- se punteggio > 0 conservo quello con molteplicità più alta, se punteggio = 0 conservo quello con molteplicità più bassa
|
||||
if ( nScoreMax ~= 0 and MinList[nInd].ScoreCnt > nScoreCnt) or ( nScoreMax == 0 and MinList[nInd].ScoreCnt < nScoreCnt) then
|
||||
if ( nScoreMax ~= 0 and MinList[nInd].ScoreCnt > nScoreCnt) or ( nScoreMax == 0 and MinList[nInd].ScoreCnt < nScoreCnt) then
|
||||
nRotMax = MinList[nInd].Rot
|
||||
nScoreMax = MinList[nInd].Score
|
||||
nScoreCnt = MinList[nInd].ScoreCnt
|
||||
@@ -369,7 +370,7 @@ if not bManualRot then
|
||||
nRotateOpt = nRotMax
|
||||
else
|
||||
nRotateOpt = 0
|
||||
end
|
||||
end
|
||||
|
||||
local bRotNest = false
|
||||
local nStepRotNest = 0
|
||||
@@ -387,40 +388,40 @@ if not bManualRot then
|
||||
-- altrimenti permetto tutto
|
||||
bRotNest = true
|
||||
nStepRotNest = 90
|
||||
end
|
||||
end
|
||||
|
||||
-- verifico se ci sono fori lungo Y che bloccano la rotazione
|
||||
local bDrillOnY = ( nStepRotNest == 180)
|
||||
local bDrillOnY = ( nStepRotNest == 180)
|
||||
|
||||
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||
|
||||
if bGrain then
|
||||
-- se venatura eseguo rotazione solo se è di 180°
|
||||
if nRotateOpt == 180 then
|
||||
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), nRotateOpt, GDB_RT.GLOB)
|
||||
if bGrain then
|
||||
-- se venatura eseguo rotazione solo se è di 180°
|
||||
if nRotateOpt == 180 then
|
||||
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), nRotateOpt, GDB_RT.GLOB)
|
||||
nRotate = nRotate + nRotateOpt
|
||||
end
|
||||
nStepRotNest = 180
|
||||
end
|
||||
nStepRotNest = 180
|
||||
else
|
||||
-- eseguo rotazione
|
||||
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), nRotateOpt, GDB_RT.GLOB)
|
||||
nRotate = nRotate + nRotateOpt
|
||||
end
|
||||
|
||||
-- verifico se rotazione è valida ( pezzo contenuto nel grezzo) solo se no venatura
|
||||
if not bGrain then
|
||||
b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||
-- verifico se rotazione è valida ( pezzo contenuto nel grezzo) solo se no venatura
|
||||
if not bGrain then
|
||||
b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||
local bValidRotationForRaw = b3Part:getDimX() < WD.MAX_LENGTH and b3Part:getDimY() < WD.MAX_WIDTH
|
||||
local bRotatedIsValid = b3Part:getDimY() < WD.MAX_LENGTH and b3Part:getDimX() < WD.MAX_WIDTH
|
||||
if not bValidRotationForRaw and bRotatedIsValid then
|
||||
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB)
|
||||
nRotate = nRotate + 90
|
||||
nStepRotNest = 180
|
||||
nRotate = nRotate + 90
|
||||
nStepRotNest = 180
|
||||
end
|
||||
end
|
||||
|
||||
-- se no venatura e non ci sono fori verifico se il pezzo cade
|
||||
if not bGrain and not bDrillOnY then
|
||||
if not bGrain and not bDrillOnY then
|
||||
b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||
local bValidRotation = b3Part:getDimX() > ( WD.INTRULLI or 1200)
|
||||
-- verifico se ruotata resta valida
|
||||
@@ -428,22 +429,22 @@ if not bManualRot then
|
||||
-- se non è valida ma ruotato lo sarebbe, ruoto
|
||||
if not bValidRotation and bRotatedIsValid and nStepRotNest ~= 180 then
|
||||
EgtRotate( NFAR.PARTID, b3Part:getCenter(), Z_AX(), 90, GDB_RT.GLOB)
|
||||
nRotate = nRotate + 90
|
||||
nStepRotNest = 180
|
||||
nRotate = nRotate + 90
|
||||
nStepRotNest = 180
|
||||
elseif bValidRotation and not bRotatedIsValid then
|
||||
-- se fosse valida ma la sua ruotata no, allora blocco lo step nella rotazione del nesting
|
||||
nStepRotNest = 180
|
||||
end
|
||||
nStepRotNest = 180
|
||||
end
|
||||
end
|
||||
|
||||
-- setto info nel pezzo
|
||||
-- setto info nel pezzo
|
||||
if nRotate > 0 then
|
||||
local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0
|
||||
local nTotRot = nPartRot - nRotate
|
||||
nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot)
|
||||
EgtSetInfo( NFAR.PARTID, "ROTATED", nTotRot)
|
||||
EgtSetInfo( NFAR.PARTID, "ROTATED", nTotRot)
|
||||
EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1)
|
||||
end
|
||||
end
|
||||
|
||||
EgtSetInfo( NFAR.PARTID, "NestStepRot", nStepRotNest)
|
||||
EgtSetInfo( NFAR.PARTID, "NestRot", nRotate)
|
||||
@@ -451,4 +452,4 @@ if not bManualRot then
|
||||
end
|
||||
|
||||
|
||||
NFAR.ERR = 0
|
||||
NFAR.ERR = 0
|
||||
+360
-545
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,62 @@
|
||||
==== Wall Update Log ====
|
||||
|
||||
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.
|
||||
@@ -0,0 +1,6 @@
|
||||
-- Version.lua by Egalware s.r.l. 2023/10/11
|
||||
-- Gestione della versione di Wall
|
||||
|
||||
NAME = 'Wall'
|
||||
VERSION = '2.5j3'
|
||||
MIN_EXE = '2.5b3'
|
||||
Reference in New Issue
Block a user