Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| a21d93cc6b | |||
| 89f553a49f | |||
| 577362c6d2 | |||
| de14fb91ce | |||
| 564de1d22d | |||
| 2051a327a5 | |||
| 4237f50b5f | |||
| c01fa1f08a | |||
| a0bd97e7aa |
+5
-7
@@ -13,12 +13,10 @@
|
|||||||
/Debug64
|
/Debug64
|
||||||
/Release64
|
/Release64
|
||||||
/ipch
|
/ipch
|
||||||
/bin
|
|
||||||
/obj
|
/obj
|
||||||
/.vs
|
/.vs
|
||||||
/32/*.lua
|
/bin/*.lua
|
||||||
/32/LuaLibs/*.lua
|
/bin/*.ini
|
||||||
/32/Images/*.png
|
/bin/LuaLibs/*.lua
|
||||||
/64/*.lua
|
/bin/Images/*.png
|
||||||
/64/LuaLibs/*.lua
|
.vscode/settings.json
|
||||||
/64/Images/*.png
|
|
||||||
|
|||||||
+33
-64
@@ -2,96 +2,67 @@ variables:
|
|||||||
VERS_MAIN: '1.0'
|
VERS_MAIN: '1.0'
|
||||||
APP_NAME: 'Wall'
|
APP_NAME: 'Wall'
|
||||||
NEW_REL: ''
|
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_SHARE_Z: '\\10.74.82.201\Artifacts'
|
||||||
NET_USERQ: 'steamw\egalware'
|
NET_USERQ: 'steamw\egalware'
|
||||||
|
|
||||||
#Note compilazione LUA:
|
#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
|
# helper compilazione LUA a 32 e 64 bit
|
||||||
.LuaCompile32: &LuaCompile32
|
.LuaCompile: &LuaCompile
|
||||||
- |
|
- |
|
||||||
Set-Alias lua53 C:\Tools\Lua32\luac53
|
Set-Alias lua54 C:\Tools\Lua32\luac54
|
||||||
echo "Copia file *.ini"
|
echo "Copia file *.ini"
|
||||||
$FileList = Get-ChildItem("*.ini")
|
$FileList = Get-ChildItem("*.ini")
|
||||||
ForEach ($File in $FileList) {
|
ForEach ($File in $FileList) {
|
||||||
$FileName = Split-Path $File -leaf
|
$FileName = Split-Path $File -leaf
|
||||||
Copy-Item -Path $FileName -Destination 32\$FileName
|
Copy-Item -Path $FileName -Destination bin\$FileName
|
||||||
echo "Copy-Item -Path $FileName -Destination 32\$FileName"
|
echo "Copy-Item -Path $FileName -Destination bin\$FileName"
|
||||||
}
|
}
|
||||||
echo "Compilazione file *.lua 32bit"
|
echo "Compilazione file *.lua 32/64bit"
|
||||||
$FileList = Get-ChildItem("*.lua")
|
$FileList = Get-ChildItem("*.lua")
|
||||||
ForEach ($File in $FileList) {
|
ForEach ($File in $FileList) {
|
||||||
$FileName = Split-Path $File -leaf
|
$FileName = Split-Path $File -leaf
|
||||||
lua53 -o 32\$FileName $FileName
|
lua54 -o bin\$FileName $FileName
|
||||||
echo "lua53 -o 32\$FileName $FileName"
|
echo "lua54 -o bin\$FileName $FileName"
|
||||||
}
|
}
|
||||||
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
||||||
ForEach ($File in $FileList) {
|
ForEach ($File in $FileList) {
|
||||||
$FileName = Split-Path $File -leaf
|
$FileName = Split-Path $File -leaf
|
||||||
lua53 -o 32\LuaLibs\$FileName LuaLibs\$FileName
|
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
|
||||||
echo "lua53 -o 32\LuaLibs\$FileName LuaLibs\$FileName"
|
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
|
||||||
}
|
}
|
||||||
|
|
||||||
# helper compilazione LUA a 64 bit
|
# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
|
||||||
.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
|
|
||||||
.CodeReplicaR: &CodeReplicaR
|
.CodeReplicaR: &CodeReplicaR
|
||||||
- |
|
- |
|
||||||
net use R: /delete
|
net use X: /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
|
|
||||||
SLEEP 2
|
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 X:\ delle cartelle bin
|
||||||
# helper copia script verso cartella di rete R:\ delle cartelle 32 e 64
|
|
||||||
.ReplicaR: &ReplicaR
|
.ReplicaR: &ReplicaR
|
||||||
- |
|
- |
|
||||||
net use R: /delete
|
net use X: /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
|
|
||||||
SLEEP 2
|
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
|
.ReplicaZ: &ReplicaZ
|
||||||
- |
|
- |
|
||||||
net use Z: /delete
|
net use Z: /delete
|
||||||
|
SLEEP 2
|
||||||
net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||||
ROBOCOPY /MIR 32 Z:\EgtData\$env:APP_NAME\32
|
ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin
|
||||||
ROBOCOPY /MIR 64 Z:\EgtData\$env:APP_NAME\64
|
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\bin\Images
|
||||||
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\32\Images
|
|
||||||
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\64\Images
|
|
||||||
SLEEP 2
|
SLEEP 2
|
||||||
net use Z: /delete
|
net use Z: /delete
|
||||||
|
|
||||||
@@ -100,15 +71,13 @@ stages:
|
|||||||
|
|
||||||
LuaCompile:build:
|
LuaCompile:build:
|
||||||
stage: build
|
stage: build
|
||||||
# only:
|
only:
|
||||||
# - main
|
- main
|
||||||
# - master
|
- master
|
||||||
tags:
|
tags:
|
||||||
- win
|
- win
|
||||||
script:
|
script:
|
||||||
- *LuaCompile32
|
- *LuaCompile
|
||||||
- *LuaCompile64
|
|
||||||
- *CodeReplicaR
|
- *CodeReplicaR
|
||||||
- *ReplicaR
|
- *ReplicaR
|
||||||
- *ReplicaZ
|
- *ReplicaZ
|
||||||
|
|
||||||
|
|||||||
+12
-3
@@ -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
|
-- Gestione calcolo batch disposizione e lavorazioni per Pareti
|
||||||
-- 2020/07/24 Nuvola di punti riferita allo Zero Tavola.
|
-- 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).
|
-- 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/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/04/28 In info generazione aggiunta indicazione se 64bit.
|
||||||
-- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData.
|
-- 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
|
-- Intestazioni
|
||||||
require( 'EgtBase')
|
require( 'EgtBase')
|
||||||
@@ -179,9 +181,11 @@ if bToProcess then
|
|||||||
if bBtl then
|
if bBtl then
|
||||||
-- cancello eventuale vecchio progetto omonimo
|
-- cancello eventuale vecchio progetto omonimo
|
||||||
EgtEraseFile( sNgeFile)
|
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
|
-- eseguo import
|
||||||
EgtNewFile()
|
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.ERR = 13
|
||||||
WALL.MSG = 'Error importing BTL file : ' .. WALL.FILE
|
WALL.MSG = 'Error importing BTL file : ' .. WALL.FILE
|
||||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||||
@@ -241,7 +245,7 @@ if bToProcess then
|
|||||||
end
|
end
|
||||||
if #vWall == 0 then
|
if #vWall == 0 then
|
||||||
WALL.ERR = 14
|
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)
|
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||||
PostErrView( WALL.ERR, WALL.MSG)
|
PostErrView( WALL.ERR, WALL.MSG)
|
||||||
return
|
return
|
||||||
@@ -393,6 +397,11 @@ if bToProcess then
|
|||||||
return
|
return
|
||||||
end
|
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
|
-- Imposto Nome file CN
|
||||||
local _, sName, _ = EgtSplitPath( WALL.FILE)
|
local _, sName, _ = EgtSplitPath( WALL.FILE)
|
||||||
EgtSetInfo( EgtGetCurrMachGroup(), 'NcName', sName .. '.cnc')
|
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
|
-- Gestione calcolo batch disposizione e lavorazioni per Pareti
|
||||||
-- 2021/01/15 Per nuova interfaccia Egt.
|
-- 2021/01/15 Per nuova interfaccia Egt.
|
||||||
-- 2021/11/10 Aggiunta modifica per gestione modifiche manuali come in Beam.
|
-- 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/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/04/28 In info generazione aggiunta indicazione se 64bit.
|
||||||
-- 2022/05/02 Consentito allargamento area disponibile per grezzi su tavola da WallData.
|
-- 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
|
-- Intestazioni
|
||||||
require( 'EgtBase')
|
require( 'EgtBase')
|
||||||
@@ -45,6 +46,18 @@ EgtOutLog( sLog)
|
|||||||
local sLogFile = EgtChangePathExtension( WALL.FILE, '.txt')
|
local sLogFile = EgtChangePathExtension( WALL.FILE, '.txt')
|
||||||
EgtEraseFile( sLogFile)
|
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
|
-- Funzioni per scrittura su file di log specifico
|
||||||
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
||||||
local hFile = io.open( sLogFile, 'a')
|
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:write( 'TASKID=' .. tostring( nTaskId or 0) .. '\n')
|
||||||
hFile:close()
|
hFile:close()
|
||||||
end
|
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 function WriteTimeToLogFile( dTime)
|
||||||
local hFile = io.open( sLogFile, 'a')
|
local hFile = io.open( sLogFile, 'a')
|
||||||
@@ -228,7 +230,7 @@ if bToProcess then
|
|||||||
end
|
end
|
||||||
if #vWall == 0 then
|
if #vWall == 0 then
|
||||||
WALL.ERR = 14
|
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)
|
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||||
PostErrView( WALL.ERR, WALL.MSG)
|
PostErrView( WALL.ERR, WALL.MSG)
|
||||||
return
|
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
|
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)
|
ResetMachGroup( vWall)
|
||||||
local sOut = BWMessageId( 1, 'Grezzo (%s x %s x %s) oltre il limite della macchina (%s x %s x %s)',
|
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( dRawL, 2), EgtNumToString( dRawW, 2), EgtNumToString( dRawH, 2),
|
||||||
EgtNumToString( WD.MAX_LENGTH, 2), EgtNumToString( WD.MAX_WIDTH, 2), EgtNumToString( WD.MAX_HEIGHT, 2)})
|
EgtNumToString( WD.MAX_LENGTH, 2), EgtNumToString( WD.MAX_WIDTH, 2), EgtNumToString( WD.MAX_HEIGHT, 2)})
|
||||||
WALL.ERR = 17
|
WALL.ERR = 17
|
||||||
WALL.MSG = sOut
|
WALL.MSG = sOut
|
||||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||||
@@ -395,8 +397,9 @@ if bToProcess then
|
|||||||
-- Verifico dimensioni minime del grezzo
|
-- 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
|
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)
|
ResetMachGroup( vWall)
|
||||||
local sOut = 'Grezzo (' .. EgtNumToString( dRawL, 2) .. ' x ' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' ..
|
local sOut = BWMessageId( 2, 'Grezzo (%s x %s x %s) sotto il limite della macchina (%s x %s x %s)',
|
||||||
'sotto il limite della macchina ('..EgtNumToString( WD.MIN_LENGTH, 2)..' x '..EgtNumToString( WD.MIN_WIDTH, 2)..' x '..EgtNumToString( WD.MIN_HEIGHT, 2)..')'
|
{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.ERR = 17
|
||||||
WALL.MSG = sOut
|
WALL.MSG = sOut
|
||||||
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
WriteErrToLogFile( WALL.ERR, WALL.MSG)
|
||||||
|
|||||||
+25
-49
@@ -1,53 +1,29 @@
|
|||||||
|
|
||||||
REM Compilazione degli script Wall Egaltech 2022.05.09
|
REM Compilazione degli script Wall Egaltech 2023.02.27
|
||||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
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\luac54 -o bin\LuaLibs\WallExec.lua LuaLibs\WallExec.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WallLib.lua LuaLibs\WallLib.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WallLib.lua LuaLibs\WallLib.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WMachiningLib.lua LuaLibs\WMachiningLib.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessCut.lua LuaLibs\WProcessCut.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMortise.lua LuaLibs\WProcessMortise.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessSawCut.lua LuaLibs\WProcessSawCut.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessText.lua LuaLibs\WProcessText.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessVariant.lua LuaLibs\WProcessVariant.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\BatchProcess.lua BatchProcess.lua
|
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua BatchProcess.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\BatchProcessNew.lua BatchProcessNew.lua
|
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua BatchProcessNew.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\GetWallData.lua GetWallData.lua
|
\EgtProg\Dll32\luac54 -o bin\GetWallData.lua GetWallData.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\NestFlipAndRotate.lua NestFlipAndRotate.lua
|
\EgtProg\Dll32\luac54 -o bin\NestFlipAndRotate.lua NestFlipAndRotate.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\NestProcess.lua NestProcess.lua
|
\EgtProg\Dll32\luac54 -o bin\NestProcess.lua NestProcess.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\Overturn.lua Overturn.lua
|
\EgtProg\Dll32\luac54 -o bin\Overturn.lua Overturn.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\Process.lua Process.lua
|
\EgtProg\Dll32\luac54 -o bin\Process.lua Process.lua
|
||||||
\EgtProg\Dll32\luac53 -o 32\Rotate.lua Rotate.lua
|
\EgtProg\Dll32\luac54 -o bin\Rotate.lua Rotate.lua
|
||||||
|
\EgtProg\Dll32\luac54 -o bin\Version.lua Version.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
|
|
||||||
|
|||||||
+3
-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
|
-- Recupero dati da file WallData.lua di macchina
|
||||||
|
|
||||||
-- Intestazioni
|
-- Intestazioni
|
||||||
@@ -37,6 +37,8 @@ local WD = require( 'WallData')
|
|||||||
-- Assegno valori di interesse
|
-- Assegno valori di interesse
|
||||||
GWD.SIMUL_VIEW_DIR = WD.SIMUL_VIEW_DIR
|
GWD.SIMUL_VIEW_DIR = WD.SIMUL_VIEW_DIR
|
||||||
GWD.ORIG_CORNER = WD.ORIG_CORNER
|
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.NESTING_CORNER = WD.NESTING_CORNER
|
||||||
GWD.HOR_DRILL_DIAM = WD.HOR_DRILL_DIAM
|
GWD.HOR_DRILL_DIAM = WD.HOR_DRILL_DIAM
|
||||||
GWD.MIN_HEIGHT = WD.MIN_HEIGHT
|
GWD.MIN_HEIGHT = WD.MIN_HEIGHT
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
-- MachiningLib.lua by Egaltech s.r.l. 2022/01/12
|
-- MachiningLib.lua by Egaltech s.r.l. 2022/01/12
|
||||||
-- Libreria ricerca lavorazioni per Pareti
|
-- 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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local WMachiningLib = {}
|
local WMachiningLib = {}
|
||||||
@@ -55,14 +58,15 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuid, nTool_ID, dMaxDiam, d
|
|||||||
for i = 1, #Millings do
|
for i = 1, #Millings do
|
||||||
local Milling = Millings[i]
|
local Milling = Millings[i]
|
||||||
if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then
|
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 nMchType = EgtMdbGetCurrMachiningParam( MCH_MP.TYPE)
|
||||||
local sMyTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
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 dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, dTMaxMat, EgtTdbGetCurrToolMaxDepth())
|
||||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||||
local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0
|
local dTDiamTh = EgtTdbGetCurrToolThDiam() or 0
|
||||||
local dTTipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED)
|
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')
|
local nMyTool_ID = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
|
||||||
if nMchType == MCH_MY.MILLING and
|
if nMchType == MCH_MY.MILLING and
|
||||||
( not sTuuid or sTuuid == sMyTuuid) and
|
( not sTuuid or sTuuid == sMyTuuid) and
|
||||||
@@ -177,5 +181,14 @@ function WMachiningLib.FindSurfacing( sType)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- incapsulo EgtAddMachining e trascrivo le priorità all'interno delle note della lavorazione
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
function WMachiningLib.AddMachining( nProcId, sName, sMachining)
|
||||||
|
local nMchId, sFinalName = EgtAddMachining( sName, sMachining)
|
||||||
|
local nPriority = EgtGetInfo( nProcId, 'PRIORITY', 'i')
|
||||||
|
EgtSetInfo( nMchId, 'PRIORITY', nPriority)
|
||||||
|
return nMchId, sFinalName
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
return WMachiningLib
|
return WMachiningLib
|
||||||
|
|||||||
@@ -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
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local WPDC = {}
|
local WPDC = {}
|
||||||
@@ -58,7 +59,9 @@ function WPDC.Make( Proc, nRawId, b3Raw)
|
|||||||
-- se singola faccia, passo a quella lavorazione
|
-- se singola faccia, passo a quella lavorazione
|
||||||
if Proc.Fct == 1 then return Cut.Make( Proc, nRawId, b3Raw) end
|
if Proc.Fct == 1 then return Cut.Make( Proc, nRawId, b3Raw) end
|
||||||
-- altrimenti due facce e passo alla LapJoint
|
-- 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
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
-- 2022/01/29 DS Corretta gestione ingombro portautensili per fori inclinati da sopra.
|
-- 2022/01/29 DS Corretta gestione ingombro portautensili per fori inclinati da sopra.
|
||||||
-- 2022/02/22 ES Aggiunta gestione prefori.
|
-- 2022/02/22 ES Aggiunta gestione prefori.
|
||||||
-- 2022/03/08 DS Vanno accettati fori orizzontali sul bordo anche senza foratori orizzontali speciali.
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local WPD = {}
|
local WPD = {}
|
||||||
@@ -137,7 +138,7 @@ function WPD.RotateClassify( Proc)
|
|||||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||||
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
|
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
|
||||||
-- se foro orizzontale con punta lunga
|
-- 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
|
-- se orientato perpendicolare ad X
|
||||||
if AreSameOrOppositeVectorApprox( vtExtr, X_AX()) then
|
if AreSameOrOppositeVectorApprox( vtExtr, X_AX()) then
|
||||||
nRot0 = 0
|
nRot0 = 0
|
||||||
@@ -375,7 +376,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = EgtIf( sHead == 'H5' or sHead == 'H6', 'LhDrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
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.Id, sName, sDrilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -505,7 +506,7 @@ function WPD.Make( Proc, nRawId, b3Raw)
|
|||||||
|
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'PreDrill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchId = EgtAddMachining( sName, sDrilling)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sDrilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
-- Gestione calcolo mortase a coda di rondine per Pareti
|
-- Gestione calcolo mortase a coda di rondine per Pareti
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- 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= {}
|
local WPDM= {}
|
||||||
|
|
||||||
-- Include
|
-- Include
|
||||||
@@ -159,7 +160,7 @@ function WPDM.Make( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di svuotatura
|
-- inserisco la lavorazione di svuotatura
|
||||||
local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -189,7 +190,7 @@ function WPDM.Make( Proc, nRawId, b3Raw)
|
|||||||
for i = nPass, 1, -1 do
|
for i = nPass, 1, -1 do
|
||||||
-- inserisco la lavorazione di contornatura
|
-- inserisco la lavorazione di contornatura
|
||||||
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
|
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
|
||||||
local nMchFId = EgtAddMachining( sNameF, sMilling)
|
local nMchFId = WM.AddMachining( Proc.Id, sNameF, sMilling)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
+151
-59
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/08/29
|
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/04/17
|
||||||
-- Gestione calcolo profilo libero per Pareti
|
-- Gestione calcolo profilo libero per Pareti
|
||||||
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
|
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
|
||||||
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
|
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
|
||||||
@@ -13,6 +13,13 @@
|
|||||||
-- 2022/08/05 Aggiunta segnalazione aree vietate non gestite.
|
-- 2022/08/05 Aggiunta segnalazione aree vietate non gestite.
|
||||||
-- 2022/08/29 Corretta gestione tipo Pocket senza fondo (sono lavorabili da entrambe le parti con fresatura).
|
-- 2022/08/29 Corretta gestione tipo Pocket senza fondo (sono lavorabili da entrambe le parti con fresatura).
|
||||||
-- 2022/12/13 Aggiunta la funzione Is3EdgesApprox per riconoscere come 3 lati anche facce con lati aggiuntivi molto corti (<15 mm)
|
-- 2022/12/13 Aggiunta la funzione Is3EdgesApprox per riconoscere come 3 lati anche facce con lati aggiuntivi molto corti (<15 mm)
|
||||||
|
-- 2022/12/14 Aggiunto l'accorciamento della lama in caso di facce vicine orientate verso il basso
|
||||||
|
-- 2023/02/28 In lavorazioni con sega a catena per invertire lato mandrino ora Invert + Left invece di MCH_SCC.OPPOSITE.
|
||||||
|
-- 2023/03/08 In lavorazione con fresa, se imposto Tool_ID non si controlla più possa lavorare di testa.
|
||||||
|
-- 2023/04/14 Aggiunta pulitura spigoli Q05=1 anche su sole fresature.
|
||||||
|
-- 2023/04/17 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/06 Aggiunta gestione lavorazione per lamatura speciale affondata con Tool_ID specifico.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local WPF = {}
|
local WPF = {}
|
||||||
@@ -61,6 +68,7 @@ function WPF.Classify( Proc, b3Raw)
|
|||||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||||
-- recupero il tipo di lavorazione
|
-- recupero il tipo di lavorazione
|
||||||
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
|
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
|
||||||
|
local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
|
||||||
-- se tasca
|
-- se tasca
|
||||||
if bPocket then
|
if bPocket then
|
||||||
-- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva)
|
-- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva)
|
||||||
@@ -81,10 +89,10 @@ function WPF.Classify( Proc, b3Raw)
|
|||||||
-- se penna o chiodatura va sempre bene (vengono sempre riportati sopra)
|
-- se penna o chiodatura va sempre bene (vengono sempre riportati sopra)
|
||||||
elseif nCntType == 10 or nCntType == 20 then
|
elseif nCntType == 10 or nCntType == 20 then
|
||||||
return true
|
return true
|
||||||
-- se altrimenti profilo verticale che non interessa tutta la sezione
|
-- se altrimenti profilo verticale che non interessa tutta la sezione e non caso speciale con lamatura affondata
|
||||||
elseif Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2 then
|
elseif ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2) and ( not nTool_ID or ( nTool_ID ~= ( WD.RECESSED_COUNTERBORE_TOOLID or 0)) or ( not EgtCurveIsACircle( AuxId))) then
|
||||||
return false
|
return false
|
||||||
-- altrimenti è profilo verticale che interessa tutta la sezione
|
-- altrimenti è profilo verticale che interessa tutta la sezione o caso speciale con lamatura affondata
|
||||||
else
|
else
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -296,7 +304,7 @@ local function ReorderFaces( nIdSurf, nNumFacet)
|
|||||||
end
|
end
|
||||||
-- ordino le facce in modo da avere una sequenza di facce concatenate
|
-- ordino le facce in modo da avere una sequenza di facce concatenate
|
||||||
for i = 1, #vAdj - 1 do
|
for i = 1, #vAdj - 1 do
|
||||||
-- recupero l'angolo con la faccia precedente
|
-- recupero l'angolo con la faccia successiva
|
||||||
local bAdj, _, _, _ = EgtSurfTmFacetsContact( nIdSurf, i-1, i, GDB_ID.ROOT)
|
local bAdj, _, _, _ = EgtSurfTmFacetsContact( nIdSurf, i-1, i, GDB_ID.ROOT)
|
||||||
-- se non ho adiacenza
|
-- se non ho adiacenza
|
||||||
if not bAdj then
|
if not bAdj then
|
||||||
@@ -1012,7 +1020,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
|
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
|
||||||
local nMchId = EgtAddMachining( sName, sMilling)
|
local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1038,10 +1046,11 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
|||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10)
|
||||||
-- setto affondamento 0
|
-- setto affondamento 0
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, 0)
|
EgtSetMachiningParam( MCH_MP.DEPTH, 0)
|
||||||
|
-- forzo lato correzione a centrato
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
||||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||||
local sUserNotes = 'VMRS=0;'
|
local sUserNotes = 'VMRS=0;'
|
||||||
-- aggiungo alle note massima elevazione
|
-- aggiungo alle note massima elevazione
|
||||||
-- sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';'
|
|
||||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';'
|
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';'
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
if not EgtApplyMachining( true, false) then
|
if not EgtApplyMachining( true, false) then
|
||||||
@@ -1281,13 +1290,19 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
|||||||
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), dFreeLen) or dMaxDepth
|
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), dFreeLen) or dMaxDepth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- verifico se la facce hanno alcuni lati molto corti e possono quindi essere approssimate a 3 lati
|
||||||
|
for currentFace = 1, #vFace do
|
||||||
|
if Is3EdgesApprox( Proc, vFace[currentFace].Fac, nAddGrpId) then
|
||||||
|
vFace[currentFace].Is3EdgesApprox = true
|
||||||
|
end
|
||||||
|
end
|
||||||
-- verifico se ciclo chiuso
|
-- verifico se ciclo chiuso
|
||||||
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
|
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
|
||||||
-- ciclo di inserimento delle fresate sulle facce del contorno in esame
|
-- ciclo di inserimento delle fresate sulle facce del contorno in esame
|
||||||
local i = 1
|
local i = 1
|
||||||
-- se faccia finale con fine non lavorato, forzo partenza da prima faccia non tutta saltata (tipo 4)
|
-- se faccia finale con fine non lavorato, forzo partenza da prima faccia non tutta saltata (tipo 4)
|
||||||
if bClosed and ( ( vFace[#vFace].Type == 4 and vFace[#vFace].Edges > 3) or ( vFace[#vFace].Type & 2) ~= 0) then
|
if bClosed and ( ( vFace[#vFace].Type == 4 and ( vFace[#vFace].Edges > 3 and not vFace[#vFace].Is3EdgesApprox)) or ( vFace[#vFace].Type & 2) ~= 0) then
|
||||||
while i <= #vFace and vFace[i].Type == 4 and vFace[i].Edges > 3 and abs( vFace[i].SideAng) < 0.1 do
|
while i <= #vFace and vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and abs( vFace[i].SideAng) < 0.1 do
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1300,7 +1315,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
|||||||
if ( vFace[i].Type & 1) ~= 0 and ( not j or vFace[j].Type == 0 or vFace[j].Type == 1 or abs( vFace[i].SideAng) > 0.1 or abs( vFace[j].SideAng) > 0.1) then
|
if ( vFace[i].Type & 1) ~= 0 and ( not j or vFace[j].Type == 0 or vFace[j].Type == 1 or abs( vFace[i].SideAng) > 0.1 or abs( vFace[j].SideAng) > 0.1) then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
||||||
local nMchId = EgtAddMachining( sName, sMilling)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1350,6 +1365,10 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local dEal = vFace[i].Whisk - vFace[i].Len
|
local dEal = vFace[i].Whisk - vFace[i].Len
|
||||||
|
-- se faccia precedente inclinata verso il basso prolungo il finale per adeguarmi all percorso della lama
|
||||||
|
if j and vFace[j].Norm:getZ() < -0.017 then
|
||||||
|
dEal = dEal - vFace[j].Width * vFace[j].Norm:getZ()
|
||||||
|
end
|
||||||
-- se angolo interno prima e faccia precedente inclinata verso l'alto oltre 16.1deg
|
-- se angolo interno prima e faccia precedente inclinata verso l'alto oltre 16.1deg
|
||||||
if vFace[i].PrevAng < -30 and j and vFace[j].Norm:getZ() < 0.96078 and vFace[j].Norm:getZ() > 0 then
|
if vFace[i].PrevAng < -30 and j and vFace[j].Norm:getZ() < 0.96078 and vFace[j].Norm:getZ() > 0 then
|
||||||
dEal = dEal + vFace[j].Width * vFace[j].Norm:getZ()
|
dEal = dEal + vFace[j].Width * vFace[j].Norm:getZ()
|
||||||
@@ -1386,13 +1405,11 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
|||||||
return 0, sErr
|
return 0, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- verifico se la faccia ha alcuni lati molto corti e può essere approssimata ad una 3 lati
|
|
||||||
local bIs3EdgesApprox = Is3EdgesApprox( Proc, vFace[i].Fac, nAddGrpId)
|
|
||||||
-- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura
|
-- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura
|
||||||
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not bIs3EdgesApprox)) then
|
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox)) then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
||||||
local nMchId = EgtAddMachining( sName, sMilling)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1430,7 +1447,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
|||||||
local LastJ
|
local LastJ
|
||||||
i = i + 1
|
i = i + 1
|
||||||
local j = EgtIf( i <= #vFace, i, EgtIf( bAllType4 or not bClosed, nil, 1))
|
local j = EgtIf( i <= #vFace, i, EgtIf( bAllType4 or not bClosed, nil, 1))
|
||||||
while j and ( ( vFace[j].Type & 1) ~= 0 or ( vFace[j].Type == 4 and vFace[j].Edges > 3)) and abs( vFace[j].SideAng) < 0.1 and abs( vFace[OrigI].SideAng) < 0.1 do
|
while j and ( ( vFace[j].Type & 1) ~= 0 or ( vFace[j].Type == 4 and ( vFace[j].Edges > 3 and not vFace[j].Is3EdgesApprox))) and abs( vFace[j].SideAng) < 0.1 and abs( vFace[OrigI].SideAng) < 0.1 do
|
||||||
table.insert( vGeom, { Proc.Id, vFace[j].Fac})
|
table.insert( vGeom, { Proc.Id, vFace[j].Fac})
|
||||||
LastJ = j
|
LastJ = j
|
||||||
dEal = EgtIf( ( vFace[j].Type & 1) ~= 0, vFace[j].Whisk - vFace[j].Len, 0)
|
dEal = EgtIf( ( vFace[j].Type & 1) ~= 0, vFace[j].Whisk - vFace[j].Len, 0)
|
||||||
@@ -1441,13 +1458,13 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
|||||||
j = EgtIf( j + 1 <= #vFace, j + 1, EgtIf( bAllType4 or not bClosed, nil, 1))
|
j = EgtIf( j + 1 <= #vFace, j + 1, EgtIf( bAllType4 or not bClosed, nil, 1))
|
||||||
end
|
end
|
||||||
-- se faccia singola è da fare tutta senza oltrepassare estremi
|
-- se faccia singola è da fare tutta senza oltrepassare estremi
|
||||||
if #vFace == 1 and vFace[OrigI].Type == 4 and vFace[OrigI].Edges > 3 then
|
if #vFace == 1 and vFace[OrigI].Type == 4 and ( vFace[OrigI].Edges > 3 and not vFace[OrigI].Is3EdgesApprox) then
|
||||||
dSal = -dMillDiam / 2
|
dSal = -dMillDiam / 2
|
||||||
dEal = -dMillDiam / 2
|
dEal = -dMillDiam / 2
|
||||||
-- altrimenti va verificato
|
-- altrimenti va verificato
|
||||||
else
|
else
|
||||||
-- se lavorazione completa su faccia iniziale
|
-- se lavorazione completa su faccia iniziale
|
||||||
if vFace[OrigI].Type == 4 and vFace[OrigI].Edges > 3 then
|
if vFace[OrigI].Type == 4 and ( vFace[OrigI].Edges > 3 and not vFace[OrigI].Is3EdgesApprox) then
|
||||||
-- se angolo interno prima
|
-- se angolo interno prima
|
||||||
if vFace[OrigI].PrevAng < -30 then
|
if vFace[OrigI].PrevAng < -30 then
|
||||||
local dSinA = -sin( vFace[OrigI].PlPrevAng + 90)
|
local dSinA = -sin( vFace[OrigI].PlPrevAng + 90)
|
||||||
@@ -1468,7 +1485,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
|||||||
-- se lavorazione completa o finale su faccia finale
|
-- se lavorazione completa o finale su faccia finale
|
||||||
local LastFace = ( LastJ or OrigI)
|
local LastFace = ( LastJ or OrigI)
|
||||||
local OrigK = EgtIf( LastFace < #vFace, LastFace + 1, EgtIf( bClosed, 1, nil))
|
local OrigK = EgtIf( LastFace < #vFace, LastFace + 1, EgtIf( bClosed, 1, nil))
|
||||||
if ( vFace[LastFace].Type == 4 and vFace[LastFace].Edges > 3) or ( LastFace == OrigI and ( vFace[LastFace].Type & 2) ~= 0) then
|
if ( vFace[LastFace].Type == 4 and ( vFace[LastFace].Edges > 3 and not vFace[LastFace].Is3EdgesApprox)) or ( LastFace == OrigI and ( vFace[LastFace].Type & 2) ~= 0) then
|
||||||
-- se angolo interno dopo
|
-- se angolo interno dopo
|
||||||
if OrigK and vFace[OrigK].PrevAng < -30 then
|
if OrigK and vFace[OrigK].PrevAng < -30 then
|
||||||
local dSinA = -sin( vFace[OrigK].PlPrevAng + 90)
|
local dSinA = -sin( vFace[OrigK].PlPrevAng + 90)
|
||||||
@@ -1593,7 +1610,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
|||||||
if vFace[i].Split then
|
if vFace[i].Split then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_M'
|
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_M'
|
||||||
local nMchId = EgtAddMachining( sName, sMilling)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1684,7 +1701,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
|||||||
if ( vFace[i].Type & 1) ~= 0 then
|
if ( vFace[i].Type & 1) ~= 0 then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
||||||
local nMchId = EgtAddMachining( sName, sSawing)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sSawing)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1705,23 +1722,22 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
|||||||
local dEal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
|
local dEal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||||
-- percorso da non invertire
|
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
|
||||||
-- assegno utilizzo faccia
|
-- assegno utilizzo faccia
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
|
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
|
||||||
-- imposto angolo 3° asse rot
|
-- imposto angolo 3° asse rot
|
||||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, sRot3Ang)
|
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, sRot3Ang)
|
||||||
-- assegno affondamento
|
-- assegno affondamento
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
-- assegno lato di lavoro
|
-- assegno lato di lavoro e inversione direzione movimento
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
|
||||||
-- posizione braccio porta testa
|
|
||||||
if vFace[i].Norm:getX() < 0.018 then
|
if vFace[i].Norm:getX() < 0.018 then
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.OPPOSITE)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, dSawThick)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
end
|
end
|
||||||
|
-- posizione braccio porta testa
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not EgtApplyMachining( true, false) then
|
if not EgtApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
@@ -1730,10 +1746,10 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se fine faccia non tagliato completamente o faccia non tagliata completamente e abbastanza lunga, inserisco un ripasso con sega a catena
|
-- se fine faccia non tagliato completamente o faccia non tagliata completamente e abbastanza lunga, inserisco un ripasso con sega a catena
|
||||||
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and vFace[i].Edges > 3 and vFace[i].Len > dSawDiam + 1) then
|
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and vFace[i].Len > dSawDiam + 1) then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
||||||
local nMchId = EgtAddMachining( sName, sSawing)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sSawing)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1757,23 +1773,22 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||||
-- percorso da non invertire
|
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
|
||||||
-- assegno utilizzo faccia
|
-- assegno utilizzo faccia
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
|
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
|
||||||
-- imposto angolo 3° asse rot
|
-- imposto angolo 3° asse rot
|
||||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, sRot3Ang)
|
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, sRot3Ang)
|
||||||
-- assegno affondamento
|
-- assegno affondamento
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
-- assegno lato di lavoro
|
-- assegno lato di lavoro e inversione direzione movimento
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
|
||||||
-- posizione braccio porta testa
|
|
||||||
if vFace[i].Norm:getX() < 0.018 then
|
if vFace[i].Norm:getX() < 0.018 then
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.OPPOSITE)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, dSawThick)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
end
|
end
|
||||||
|
-- posizione braccio porta testa
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not EgtApplyMachining( true, false) then
|
if not EgtApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
@@ -1791,6 +1806,8 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||||
|
-- verifico se ciclo chiuso
|
||||||
|
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
|
||||||
-- ciclo di inserimento dei tagli sulle facce del contorno in esame
|
-- ciclo di inserimento dei tagli sulle facce del contorno in esame
|
||||||
for i = 1, #vFace do
|
for i = 1, #vFace do
|
||||||
-- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito
|
-- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito
|
||||||
@@ -1799,9 +1816,11 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
|||||||
if not bToSkip and vFace[i].Type ~= 4 then
|
if not bToSkip and vFace[i].Type ~= 4 then
|
||||||
-- indice del successivo
|
-- indice del successivo
|
||||||
local j = EgtIf( i < #vFace, i + 1, 1)
|
local j = EgtIf( i < #vFace, i + 1, 1)
|
||||||
|
-- indice del precedente
|
||||||
|
local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil))
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i)
|
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i)
|
||||||
local nMchId = EgtAddMachining( sName, sCutting)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sCutting)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1842,7 +1861,14 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
|||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, nLeadIn)
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, nLeadIn)
|
||||||
local dSal = 0
|
local dSal = 0
|
||||||
if ( not bInvert and vFace[i].PrevAng < -0.1) or ( bInvert and vFace[j].PrevAng < -0.1) then
|
if ( not bInvert and vFace[i].PrevAng < -0.1) or ( bInvert and vFace[j].PrevAng < -0.1) then
|
||||||
dSal = -WHISK_SAFE
|
-- se faccia precedente inclinata verso il basso
|
||||||
|
if not bInvert and h and vFace[h].Norm:getZ() < -0.017 then
|
||||||
|
dSal = vFace[h].Width * vFace[h].Norm:getZ() - WHISK_SAFE
|
||||||
|
elseif bInvert and j and vFace[j].Norm:getZ() < -0.017 then
|
||||||
|
dSal = vFace[j].Width * vFace[j].Norm:getZ() - WHISK_SAFE
|
||||||
|
else
|
||||||
|
dSal = -WHISK_SAFE
|
||||||
|
end
|
||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||||
-- assegno i dati di uscita (sicurezza solo se angolo interno)
|
-- assegno i dati di uscita (sicurezza solo se angolo interno)
|
||||||
@@ -1853,7 +1879,14 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
|||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, nLeadOut)
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, nLeadOut)
|
||||||
local dEal = 0
|
local dEal = 0
|
||||||
if ( not bInvert and vFace[j].PrevAng < -0.1) or ( bInvert and vFace[i].PrevAng < -0.1) then
|
if ( not bInvert and vFace[j].PrevAng < -0.1) or ( bInvert and vFace[i].PrevAng < -0.1) then
|
||||||
dEal = -WHISK_SAFE
|
-- se faccia precedente inclinata verso il basso
|
||||||
|
if not bInvert and j and vFace[j].Norm:getZ() < -0.017 then
|
||||||
|
dEal = vFace[j].Width * vFace[j].Norm:getZ() - WHISK_SAFE
|
||||||
|
elseif bInvert and h and vFace[h].Norm:getZ() < -0.017 then
|
||||||
|
dEal = vFace[h].Width * vFace[h].Norm:getZ() - WHISK_SAFE
|
||||||
|
else
|
||||||
|
dEal = -WHISK_SAFE
|
||||||
|
end
|
||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
@@ -1986,8 +2019,7 @@ local function MakeByCut( Proc, nRawId, b3Raw)
|
|||||||
if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or
|
if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or
|
||||||
( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then
|
( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then
|
||||||
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
|
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
|
||||||
sMlErr, nAddGrpId, dThick, nNewProc, 0,
|
sMlErr, nAddGrpId, dThick, nNewProc, 0, true)
|
||||||
true)
|
|
||||||
if not bMcok then return bMcok, sMcErr end
|
if not bMcok then return bMcok, sMcErr end
|
||||||
else
|
else
|
||||||
-- messaggi nel log
|
-- messaggi nel log
|
||||||
@@ -2009,7 +2041,7 @@ local function MakeByCut( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- altrimenti provo con la sega a catena
|
-- altrimenti provo con la sega a catena
|
||||||
elseif sSawing then
|
elseif sSawing then
|
||||||
local nCsOk, sCSErr, dThick = AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
local nCsOk, sCsErr, dThick = AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
||||||
if nCsOk == 0 then return false, sCsErr end
|
if nCsOk == 0 then return false, sCsErr end
|
||||||
bDone = ( dThick ~= nil)
|
bDone = ( dThick ~= nil)
|
||||||
-- se ci sono almeno due facce e lavorato almeno un angolo
|
-- se ci sono almeno due facce e lavorato almeno un angolo
|
||||||
@@ -2017,8 +2049,7 @@ local function MakeByCut( Proc, nRawId, b3Raw)
|
|||||||
-- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante e spessore sotto il limite
|
-- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante e spessore sotto il limite
|
||||||
if nConeCut == 1 and nCsOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then
|
if nConeCut == 1 and nCsOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then
|
||||||
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
|
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
|
||||||
sCSErr, nAddGrpId, nil, nNewProc, 0,
|
sCSErr, nAddGrpId, nil, nNewProc, 0, true)
|
||||||
true)
|
|
||||||
if not bMcok then return bMcok, sMcErr end
|
if not bMcok then return bMcok, sMcErr end
|
||||||
else
|
else
|
||||||
if nConeCut == 1 then
|
if nConeCut == 1 then
|
||||||
@@ -2048,8 +2079,7 @@ local function MakeByCut( Proc, nRawId, b3Raw)
|
|||||||
if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or
|
if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or
|
||||||
( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then
|
( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then
|
||||||
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
|
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
|
||||||
sMlErr, nAddGrpId, dThick, nNewProc, 0,
|
sMlErr, nAddGrpId, dThick, nNewProc, 0, true)
|
||||||
true)
|
|
||||||
if not bMcok then return bMcok, sMcErr end
|
if not bMcok then return bMcok, sMcErr end
|
||||||
else
|
else
|
||||||
-- messaggi nel log
|
-- messaggi nel log
|
||||||
@@ -2098,8 +2128,11 @@ local function MakeByMill( Proc, nRawId, b3Raw)
|
|||||||
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
||||||
local bToolInv = ( vtExtr:getZ() < -0.1)
|
local bToolInv = ( vtExtr:getZ() < -0.1)
|
||||||
local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
|
local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
|
||||||
|
-- lettura parametri (probabile/i parametro/i Q)
|
||||||
|
local nConeCut = VerifyCornerType( Proc)
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMilling = WM.FindMilling( 'FreeContour', nil, nil, nTool_ID, nil, nil, true)
|
local bTipFeed = EgtIf( nTool_ID, false, true)
|
||||||
|
local sMilling = WM.FindMilling( 'FreeContour', nil, nil, nTool_ID, nil, nil, bTipFeed)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : milling not found in library'
|
local sErr = 'Error : milling not found in library'
|
||||||
if nTool_ID then sErr = sErr .. ' (Tool_ID=' .. tostring( nTool_ID) .. ')' end
|
if nTool_ID then sErr = sErr .. ' (Tool_ID=' .. tostring( nTool_ID) .. ')' end
|
||||||
@@ -2107,27 +2140,27 @@ local function MakeByMill( Proc, nRawId, b3Raw)
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
|
local dMillDiam = 20
|
||||||
local dMaxDepth = 0
|
local dMaxDepth = 0
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
|
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||||
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth
|
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- eventuale spezzatura sul tratto più lungo se curva chiusa
|
|
||||||
--BL.PutStartOnLonger( AuxId)
|
|
||||||
-- verifiche per affondamento
|
-- verifiche per affondamento
|
||||||
if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then
|
if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then
|
||||||
dDepth = min( dDepth, b3Raw:getDimZ()) + WD.CUT_EXTRA
|
dDepth = min( dDepth, b3Raw:getDimZ())
|
||||||
end
|
end
|
||||||
if dDepth > dMaxDepth then
|
dDepth = dDepth + WD.CUT_EXTRA
|
||||||
-- lo limito e tolgo eventuali Tabs
|
local bReducedDepth = ( dDepth > dMaxDepth)
|
||||||
|
if bReducedDepth then
|
||||||
dDepth = dMaxDepth
|
dDepth = dMaxDepth
|
||||||
EgtSetMachiningParam( MCH_MP.LEAVETAB, false)
|
|
||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchId = EgtAddMachining( sName, sMilling)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -2142,6 +2175,8 @@ local function MakeByMill( Proc, nRawId, b3Raw)
|
|||||||
if bToolInv then
|
if bToolInv then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
end
|
end
|
||||||
|
-- tolgo i Tabs se non passante o devo rimuovere lo sfrido
|
||||||
|
if bReducedDepth or nConeCut == 1 then EgtSetMachiningParam( MCH_MP.LEAVETAB, false) end
|
||||||
-- assegno affondamento
|
-- assegno affondamento
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
-- assegno lato di lavoro
|
-- assegno lato di lavoro
|
||||||
@@ -2152,6 +2187,37 @@ local function MakeByMill( Proc, nRawId, b3Raw)
|
|||||||
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then
|
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- se lamatura affondata speciale, setto attacco e stacco al centro
|
||||||
|
local bIsRecessedCounterBore = ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() + 10 * GEO.EPS_SMALL) and
|
||||||
|
( nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID or 0) and
|
||||||
|
( EgtCurveIsACircle( AuxId))
|
||||||
|
if bIsRecessedCounterBore then
|
||||||
|
local _, _, _, dContourRadius = EgtCurveIsACircle( AuxId)
|
||||||
|
-- setto attacco
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||||
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIPERP, dContourRadius - 0.5 * dMillDiam)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||||
|
-- setto stacco
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.LINEAR)
|
||||||
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOPERP, dContourRadius - 0.5 * dMillDiam)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||||
|
-- imposto step
|
||||||
|
local dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
|
||||||
|
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||||
|
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
|
||||||
|
local nStep = ceil( ( dDepth - dMaxMat) / dStep)
|
||||||
|
dStep = max( ( dDepth - dMaxMat) / max( nStep, 1), 0)
|
||||||
|
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.STEP, dStep)
|
||||||
|
-- imposto elevazione
|
||||||
|
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';')
|
||||||
|
end
|
||||||
|
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.ADIR_ZP
|
local nSCC = MCH_SCC.ADIR_ZP
|
||||||
if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||||
@@ -2164,6 +2230,32 @@ local function MakeByMill( Proc, nRawId, b3Raw)
|
|||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMchId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
-- se abilitata la lavorazione corner con stop macchina, ci sono almeno due facce e fresata passante per consentire eliminazione sfrido
|
||||||
|
if nConeCut == 1 and Proc.Fct >= 2 and not bReducedDepth then
|
||||||
|
-- gruppo ausiliario
|
||||||
|
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
|
||||||
|
-- recupero i dati di tutte le facce
|
||||||
|
local vFace, dMaxWidth, nNewProc = GetFacesData( Proc, bOpposite, false, dMillDiam, dMaxDepth, (dMillDiam/2), nAddGrpId, b3Raw)
|
||||||
|
-- se affondamento non superiore al limite
|
||||||
|
if dDepth <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then
|
||||||
|
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
|
||||||
|
dMillDiam, nAddGrpId, nil, nNewProc, 0, true)
|
||||||
|
if not bMcok then return bMcok, sMcErr end
|
||||||
|
else
|
||||||
|
EgtErase( nNewProc)
|
||||||
|
if nConeCut == 1 then
|
||||||
|
local sErr = 'Clean corner 60° not applid because thickness: ' .. EgtNumToString( dThick, 2) ..
|
||||||
|
' is bigger than parameter MAX_CLEAN_CRN60: ' .. EgtNumToString( WD.MAX_CLEAN_CRN60 , 2)
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif nConeCut == 2 then
|
||||||
|
local sErr = 'Clean corner 30° is not applied on milling'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
elseif nConeCut == 3 then
|
||||||
|
local sErr = 'Clean corner with undercut is not applied on milling'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2201,7 +2293,7 @@ local function MakeByMark( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchId = EgtAddMachining( sName, sMilling)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -2266,7 +2358,7 @@ local function MakeByNail( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Nail_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Nail_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchId = EgtAddMachining( sName, sNailing)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sNailing)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sNailing
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sNailing
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -2405,7 +2497,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di svuotatura
|
-- inserisco la lavorazione di svuotatura
|
||||||
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- WProcessLapJoint.lua by Egaltech s.r.l. 2022/11/15
|
-- WProcessLapJoint.lua by Egaltech s.r.l. 2023/04/17
|
||||||
-- Gestione calcolo mezzo-legno per Pareti
|
-- 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/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.
|
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
|
||||||
@@ -10,8 +10,17 @@
|
|||||||
-- 2022/02/03 DS Gorge larga come gambo più sicurezza.
|
-- 2022/02/03 DS Gorge larga come gambo più sicurezza.
|
||||||
-- 2022/02/04 DS In svuotatura aggiunta gestione WD.MAXDIAM_POCK_CORNER in presenza di almeno un angolo interno.
|
-- 2022/02/04 DS In svuotatura aggiunta gestione WD.MAXDIAM_POCK_CORNER in presenza di almeno un angolo interno.
|
||||||
-- 2022/09/30 In MakeSideGrooveByMill sistemato il calcolo del massimo sottosquadro dell'utensile per determinare la fattibilità della tasca.
|
-- 2022/09/30 In MakeSideGrooveByMill sistemato il calcolo del massimo sottosquadro dell'utensile per determinare la fattibilità della tasca.
|
||||||
|
-- 2022/10/05 In MakeSideGrooveByMill implementata l'inversione dello step se la tasca guarda verso il basso
|
||||||
-- 2022/11/15 DS Con lama massima inclinazione 60deg.
|
-- 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/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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local WPL = {}
|
local WPL = {}
|
||||||
@@ -31,11 +40,10 @@ local WHISK_SAFE = 5
|
|||||||
local MIN_LEN_CUT = 30
|
local MIN_LEN_CUT = 30
|
||||||
|
|
||||||
-- variabili assegnazione parametri Q
|
-- variabili assegnazione parametri Q
|
||||||
local Q_FORCE_BLADE = '' -- i
|
|
||||||
local Q_SIDE_MILL = '' -- d
|
local Q_SIDE_MILL = '' -- d
|
||||||
local Q_CORNER_CUT = '' -- i
|
local Q_CORNER_CUT = '' -- i
|
||||||
|
|
||||||
-- variabile settaggio doppia lavorazione su angoo > 90
|
-- variabile settaggio doppia lavorazione su angolo > 90
|
||||||
local bMakeTwinCut = true
|
local bMakeTwinCut = true
|
||||||
-- angolo sottosquadra ammesso per fresa cono 30°
|
-- angolo sottosquadra ammesso per fresa cono 30°
|
||||||
local dAngleSmall = 70
|
local dAngleSmall = 70
|
||||||
@@ -56,20 +64,19 @@ end
|
|||||||
local function AssignQIdent( Proc)
|
local function AssignQIdent( Proc)
|
||||||
|
|
||||||
-- reset assegnazione parametri Q
|
-- reset assegnazione parametri Q
|
||||||
Q_FORCE_BLADE = ''
|
|
||||||
Q_SIDE_MILL = ''
|
Q_SIDE_MILL = ''
|
||||||
Q_CORNER_CUT = ''
|
Q_CORNER_CUT = ''
|
||||||
|
|
||||||
if Proc.Grp == 0 and Proc.Prc == 12 then
|
if Proc.Prc == 11 then
|
||||||
Q_FORCE_BLADE = 'Q01' -- i
|
Q_SIDE_MILL = 'Q02' -- i
|
||||||
|
Q_CORNER_CUT = 'Q05' -- i
|
||||||
|
elseif Proc.Prc == 12 then
|
||||||
Q_SIDE_MILL = 'Q02' -- i
|
Q_SIDE_MILL = 'Q02' -- i
|
||||||
Q_CORNER_CUT = '' -- i
|
Q_CORNER_CUT = '' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then
|
||||||
Q_FORCE_BLADE = '' -- i
|
|
||||||
Q_SIDE_MILL = 'Q08' -- i
|
Q_SIDE_MILL = 'Q08' -- i
|
||||||
Q_CORNER_CUT = 'Q05' -- i
|
Q_CORNER_CUT = 'Q05' -- i
|
||||||
else
|
else
|
||||||
Q_FORCE_BLADE = 'Q01' -- i
|
|
||||||
Q_SIDE_MILL = 'Q03' -- i
|
Q_SIDE_MILL = 'Q03' -- i
|
||||||
Q_CORNER_CUT = 'Q05' -- i
|
Q_CORNER_CUT = 'Q05' -- i
|
||||||
end
|
end
|
||||||
@@ -79,11 +86,6 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function EvaluateQParam( Proc)
|
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 :
|
-- Verifico se utilizzare la fresa di lato :
|
||||||
-- 0 : niente
|
-- 0 : niente
|
||||||
-- 1 : utilizzo fresa di lato (alla faccia selezionata)
|
-- 1 : utilizzo fresa di lato (alla faccia selezionata)
|
||||||
@@ -96,7 +98,7 @@ local function EvaluateQParam( Proc)
|
|||||||
-- 3 : scarico corner (tipo foro).
|
-- 3 : scarico corner (tipo foro).
|
||||||
local nTypeCornerCut = EgtGetInfo( Proc.Id, Q_CORNER_CUT, 'i') or 0
|
local nTypeCornerCut = EgtGetInfo( Proc.Id, Q_CORNER_CUT, 'i') or 0
|
||||||
|
|
||||||
return nTypeCornerCut, nUseSideMillAsBlade, bForceUseBlade
|
return nTypeCornerCut, nUseSideMillAsBlade
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
@@ -140,6 +142,26 @@ function WPL.Classify( Proc, b3Raw)
|
|||||||
bAllowNegativeFace = true
|
bAllowNegativeFace = true
|
||||||
end
|
end
|
||||||
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
|
-- 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
|
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
|
Proc.Stype = 1
|
||||||
@@ -153,7 +175,7 @@ function WPL.Classify( Proc, b3Raw)
|
|||||||
Proc.Stype = 2
|
Proc.Stype = 2
|
||||||
return ( vtN2:getZ() >= WD.NZ_MINA or ( dMinNz < -0.866 and Proc.Fct >= 3 and vtN2:getZ() > - 0.01))
|
return ( vtN2:getZ() >= WD.NZ_MINA or ( dMinNz < -0.866 and Proc.Fct >= 3 and vtN2:getZ() > - 0.01))
|
||||||
-- se tre facce
|
-- se tre facce
|
||||||
elseif Proc.Fct == 3 then
|
elseif Proc.Fct == 3 and nFacesWithMoreThanOneAdj < 2 then
|
||||||
-- verifico se U da sopra
|
-- verifico se U da sopra
|
||||||
-- dati della faccia
|
-- dati della faccia
|
||||||
local nFac2 = EgtIf( nFacInd == 0, 1, 0)
|
local nFac2 = EgtIf( nFacInd == 0, 1, 0)
|
||||||
@@ -963,7 +985,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
|
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
|
||||||
local nMchId = EgtAddMachining( sName, sMilling)
|
local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -989,10 +1011,11 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
|||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 10)
|
||||||
-- setto affondamento 0
|
-- setto affondamento 0
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, 0)
|
EgtSetMachiningParam( MCH_MP.DEPTH, 0)
|
||||||
|
-- forzo lato correzione a centrato
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
||||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||||
local sUserNotes = 'VMRS=0;'
|
local sUserNotes = 'VMRS=0;'
|
||||||
-- aggiungo alle note massima elevazione
|
-- aggiungo alle note massima elevazione
|
||||||
-- sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';'
|
|
||||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';'
|
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( 0.0, 1) .. ';'
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
if not EgtApplyMachining( true, false) then
|
if not EgtApplyMachining( true, false) then
|
||||||
@@ -1253,7 +1276,7 @@ local function MakeByChainSaw( Proc, nFacet, nRawId, b3Raw, dElev, dH, dV)
|
|||||||
for i = 1, nStep do
|
for i = 1, nStep do
|
||||||
-- Applico la lavorazione con sega a catena a questa faccia
|
-- Applico la lavorazione con sega a catena a questa faccia
|
||||||
local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
|
local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
|
||||||
local nMchFId = EgtAddMachining( sName, sSawing)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sSawing)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1340,7 +1363,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di contornatura
|
-- inserisco la lavorazione di contornatura
|
||||||
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1357,6 +1380,13 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
|
|||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) -- -dMillDiam/2 + dAddLen)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) -- -dMillDiam/2 + dAddLen)
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, dSideDist + WD.CUT_SIC)
|
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
|
-- imposto posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.ADIR_ZP
|
local nSCC = MCH_SCC.ADIR_ZP
|
||||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||||
@@ -1399,7 +1429,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
sMilling = sCustomMach
|
sMilling = sCustomMach
|
||||||
-- altrimenti la cerco
|
-- altrimenti la cerco
|
||||||
else
|
else
|
||||||
sMilling = WM.FindMilling( 'SideGroove')
|
sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV))
|
||||||
end
|
end
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : SideGroove not found in library'
|
local sErr = 'Error : SideGroove not found in library'
|
||||||
@@ -1703,7 +1733,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di fresatura
|
-- inserisco la lavorazione di fresatura
|
||||||
local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
|
local sNameGorge = 'Gorge_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
|
||||||
local nMchFId = EgtAddMachining( sNameGorge, sMillingGorge)
|
local nMchFId = WM.AddMachining( Proc.Id, sNameGorge, sMillingGorge)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge
|
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sMillingGorge
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1754,7 +1784,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
nNm = nNm + 1
|
nNm = nNm + 1
|
||||||
-- inserisco la lavorazione di taglio sfrido gorge
|
-- inserisco la lavorazione di taglio sfrido gorge
|
||||||
local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
|
local sNameGorge = 'GorgeCut_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. tostring( nFacet) .. '_' .. tostring( nNm)
|
||||||
local nMchFId = EgtAddMachining( sNameGorge, sCuttingGorge)
|
local nMchFId = WM.AddMachining( Proc.Id, sNameGorge, sCuttingGorge)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge
|
local sErr = 'Error adding machining ' .. sNameGorge .. '-' .. sCuttingGorge
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1803,11 +1833,17 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- se la groove è rivolta verso il basso (-85°) lavoro a salire con step negativo
|
||||||
|
local bUpwardMilling = false
|
||||||
|
if Proc.Fct == 2 and vtN2:getZ() < -0.996 then
|
||||||
|
bUpwardMilling = true
|
||||||
|
end
|
||||||
|
|
||||||
local dStepOri
|
local dStepOri
|
||||||
if not bExcludeSideMill then
|
if not bExcludeSideMill then
|
||||||
-- inserisco la lavorazione di ribasso o gola
|
-- inserisco la lavorazione di ribasso o gola
|
||||||
local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = EgtIf( bEnablePreMill ~= nil, 'SideMill_', 'Mill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1821,10 +1857,6 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
|
EgtSetMachiningGeometry( {{ Proc.Id, nFacet}})
|
||||||
-- imposto posizione braccio porta testa
|
-- 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
|
local nSCC = MCH_SCC.ADIR_NEAR
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- imposto modo di lavorare la faccia
|
-- imposto modo di lavorare la faccia
|
||||||
@@ -1843,6 +1875,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if bUpwardMilling then
|
||||||
|
dStep = -dStep
|
||||||
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.STEP, dStep)
|
EgtSetMachiningParam( MCH_MP.STEP, dStep)
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
|
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
|
||||||
-- setto il lato di lavoro standard
|
-- setto il lato di lavoro standard
|
||||||
@@ -1914,9 +1949,14 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
end
|
end
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not EgtApplyMachining( true, false) then
|
if not EgtApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
-- provo a invertire posizione braccio porta testa
|
||||||
EgtSetOperationMode( nMchFId, false)
|
nSCC = MCH_SCC.ADIR_FAR
|
||||||
return false, sErr
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
|
if not EgtApplyMachining( true, false) then
|
||||||
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
sWarn = 'Warning in LapJoint : upside down groove with obtuse angle not completed'
|
sWarn = 'Warning in LapJoint : upside down groove with obtuse angle not completed'
|
||||||
@@ -1927,7 +1967,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then
|
if dAng and dAng > -90 + 10 * GEO.EPS_SMALL and not bExcludeFinishing then
|
||||||
-- inserisco la lavorazione di contornatura
|
-- inserisco la lavorazione di contornatura
|
||||||
local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -1955,6 +1995,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
|||||||
dMaxElev = max( ( nStepOtherFace + 1) * dStepOtherFace - GEO.EPS_SMALL, 0)
|
dMaxElev = max( ( nStepOtherFace + 1) * dStepOtherFace - GEO.EPS_SMALL, 0)
|
||||||
dDepthOtherFace = dElevOtherFacet
|
dDepthOtherFace = dElevOtherFacet
|
||||||
end
|
end
|
||||||
|
if bUpwardMilling then
|
||||||
|
dStepOtherFace = -dStepOtherFace
|
||||||
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.STEP, dStepOtherFace)
|
EgtSetMachiningParam( MCH_MP.STEP, dStepOtherFace)
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
|
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
|
||||||
if bMachFromDn then
|
if bMachFromDn then
|
||||||
@@ -2112,7 +2155,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di svuotatura
|
-- inserisco la lavorazione di svuotatura
|
||||||
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -2189,7 +2232,7 @@ local function MakeOneFace( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- eseguo il taglio di lama
|
-- eseguo il taglio di lama
|
||||||
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id)
|
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id)
|
||||||
local nMchId = EgtAddMachining( sName, sCutting)
|
local nMchId = WM.AddMachining( Proc.Id, sName, sCutting)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -2233,7 +2276,8 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
|
|||||||
-- se equivalente ad un contorno
|
-- se equivalente ad un contorno
|
||||||
if abs( ptP1:getZ() - ptP2:getZ()) > 0.9 * b3Raw:getDimZ() then
|
if abs( ptP1:getZ() - ptP2:getZ()) > 0.9 * b3Raw:getDimZ() then
|
||||||
-- verifico ordinamento (esterno a destra)
|
-- verifico ordinamento (esterno a destra)
|
||||||
if ( vtN[1] ^ ( ptP1 - ptC[1])) * Z_AX() < 0 then
|
local ptPM = ( ptP1 + ptP2) / 2
|
||||||
|
if ( vtN[1] ^ ( ptPM - ptC[1])) * Z_AX() < 0 then
|
||||||
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
||||||
end
|
end
|
||||||
-- applico lavorazione di contorno libero
|
-- applico lavorazione di contorno libero
|
||||||
@@ -2466,7 +2510,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
|
|||||||
for i = 1, 2 do
|
for i = 1, 2 do
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( Proc.Id) .. '_' .. tostring( i)
|
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.Id, sName, sCutting)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -2510,15 +2554,17 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( 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
|
-- 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
|
-- recupero elevazione faccia in feature
|
||||||
local dSideElev = WL.GetFaceElevation( Proc.Id, nFacInd)
|
local dSideElev = WL.GetFaceElevation( Proc.Id, nFacInd)
|
||||||
-- se abilitata lavorazione ribasso con fresa di fianco e parametro Q03 abilitato
|
-- 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 sMillOnSide, dTMaxDepth, dMaxMat, dDiam = WM.FindMilling( 'SideMill', nil, nil, nil, nil, min( dH, dV), nil, dSideElev)
|
||||||
local _, nUseMillOnSide = EvaluateQParam( Proc)
|
local _, nUseMillOnSide = EvaluateQParam( Proc)
|
||||||
-- se ho abilitata lavorazione di fresa di fianco
|
-- 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
|
-- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH
|
||||||
local dMaxDepthOnSide = 0
|
local dMaxDepthOnSide = 0
|
||||||
local dMillDiam = 0
|
local dMillDiam = 0
|
||||||
@@ -2560,15 +2606,17 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- fresatura (se definita)
|
-- fresatura (se definita)
|
||||||
local sMilling = WM.FindMilling( 'SideGroove')
|
local sMilling = WM.FindMilling( 'SideGroove', nil, nil, nil, nil, min( dH, dV))
|
||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dMaxMat = 1000
|
local dMaxMat = 1000
|
||||||
local dMaxDepthOnSide = 0
|
local dMaxDepthOnSide = 0
|
||||||
|
local bIsBlade = false
|
||||||
if sMilling and EgtMdbSetCurrMachining( sMilling) then
|
if sMilling and EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
local dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||||
if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then
|
bIsBlade = EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE ~= 0
|
||||||
|
if bIsBlade then
|
||||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat
|
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat
|
||||||
dMaxDepthOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
dMaxDepthOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||||
else
|
else
|
||||||
@@ -2581,12 +2629,12 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
end
|
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)
|
return MakeSideGrooveByMill( Proc, nFacInd, nRawId, b3Raw, sMilling)
|
||||||
-- altrimenti sega a catena
|
-- altrimenti sega a catena
|
||||||
else
|
else
|
||||||
return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV)
|
return MakeByChainSaw( Proc, nFacInd, nRawId, b3Raw, dElev, dH, dV)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)
|
local nFacet = EgtIf( bPckt or vtN:getZ() >= WD.NZ_MINA, nFacInd, nFacInd2)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
-- WProcessMark.lua by Egaltech s.r.l. 2021/04/20
|
-- WProcessMark.lua by Egaltech s.r.l. 2021/04/20
|
||||||
-- Gestione calcolo marcatura per Pareti
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local WPMK = {}
|
local WPMK = {}
|
||||||
@@ -33,8 +35,13 @@ function WPMK.Classify( Proc, b3Raw)
|
|||||||
if not vtN then
|
if not vtN then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
-- verifico se la marcatura è lavorabile (solo da sopra)
|
-- verifico se la marcatura è lavorabile (solo da sopra o dal lato se con offset Z)
|
||||||
return ( vtN:getZ() > WD.NZ_MINA)
|
local dMinZRaw = b3Raw:getMin():getZ()
|
||||||
|
local b3Tab = EgtGetTableArea()
|
||||||
|
local dMaxZTable = b3Tab:getMax():getZ()
|
||||||
|
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||||
|
local MIN_Z_OFFSET = 100
|
||||||
|
return EgtIf( dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL, vtN:getZ() > WD.NZ_MINA, vtN:getZ() > -0.1)
|
||||||
end
|
end
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
@@ -79,11 +86,18 @@ function WPMK.Make( Proc, nRawId, b3Raw)
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- verifico che la marcatura non sia orientata verso il basso
|
-- verifico se la marcatura è lavorabile (solo da sopra o dal lato se con offset Z)
|
||||||
if vtExtr:getZ() < WD.NZ_MINA then
|
local dMinZRaw = b3Raw:getMin():getZ()
|
||||||
local sErr = 'Error : Mark from bottom impossible'
|
local b3Tab = EgtGetTableArea()
|
||||||
EgtOutLog( sErr)
|
local dMaxZTable = b3Tab:getMax():getZ()
|
||||||
return false, sErr
|
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||||
|
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'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMilling = WM.FindMilling( 'Text')
|
local sMilling = WM.FindMilling( 'Text')
|
||||||
@@ -94,7 +108,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di fresatura
|
-- inserisco la lavorazione di fresatura
|
||||||
local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Decor_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -118,7 +132,7 @@ function WPMK.Make( Proc, nRawId, b3Raw)
|
|||||||
if AuxId then
|
if AuxId then
|
||||||
-- inserisco la lavorazione di fresatura
|
-- inserisco la lavorazione di fresatura
|
||||||
local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchF2Id = EgtAddMachining( sName, sMilling)
|
local nMchF2Id = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchF2Id then
|
if not nMchF2Id then
|
||||||
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
-- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30
|
-- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30
|
||||||
-- Gestione calcolo mortase per Pareti
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local WPM = {}
|
local WPM = {}
|
||||||
@@ -45,8 +47,13 @@ function WPM.Classify( Proc, b3Raw)
|
|||||||
return true
|
return true
|
||||||
-- altrimenti è chiusa
|
-- altrimenti è chiusa
|
||||||
else
|
else
|
||||||
-- verifico se la mortasa è lavorabile da sopra
|
-- verifico se la mortasa è lavorabile da sopra o dal lato se con offset Z
|
||||||
return ( vtN:getZ() > WD.NZ_MINA)
|
local dMinZRaw = b3Raw:getMin():getZ()
|
||||||
|
local b3Tab = EgtGetTableArea()
|
||||||
|
local dMaxZTable = b3Tab:getMax():getZ()
|
||||||
|
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||||
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -182,11 +189,18 @@ function WPM.Make( Proc, nRawId, b3Raw)
|
|||||||
local bForceOneSide
|
local bForceOneSide
|
||||||
local bRevertSide
|
local bRevertSide
|
||||||
if bClosedBtm then
|
if bClosedBtm then
|
||||||
-- verifico che la mortasa non sia orientata verso il basso (limite -5 deg)
|
-- verifico se la mortasa è lavorabile da sopra o dal lato se con offset Z
|
||||||
if vtN:getZ() < WD.NZ_MINA then
|
local dMinZRaw = b3Raw:getMin():getZ()
|
||||||
local sErr = 'Error : Mortise from bottom impossible'
|
local b3Tab = EgtGetTableArea()
|
||||||
EgtOutLog( sErr)
|
local dMaxZTable = b3Tab:getMax():getZ()
|
||||||
return false, sErr
|
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||||
|
local MIN_Z_OFFSET = 100
|
||||||
|
if vtExtr:getZ() < WD.NZ_MINA then
|
||||||
|
if dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL or vtExtr:getZ() <= -0.1 then
|
||||||
|
local sErr = 'Error : Mortise from bottom impossible'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- altrimenti passante
|
-- altrimenti passante
|
||||||
else
|
else
|
||||||
@@ -237,7 +251,7 @@ function WPM.Make( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di svuotatura
|
-- inserisco la lavorazione di svuotatura
|
||||||
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sPocketing)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
-- WProcessText.lua by Egaltech s.r.l. 2021/04/20
|
-- WProcessText.lua by Egaltech s.r.l. 2021/04/20
|
||||||
-- Gestione calcolo testi per Travi
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local WPT = {}
|
local WPT = {}
|
||||||
@@ -77,7 +78,7 @@ function WPT.Make( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di fresatura
|
-- inserisco la lavorazione di fresatura
|
||||||
local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Text_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sMilling)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
-- WProcessVariant.lua by Egaltech s.r.l. 2021/08/27
|
-- WProcessVariant.lua by Egaltech s.r.l. 2021/08/27
|
||||||
-- Gestione calcolo Feature Custom (Variant) per Pareti
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local WPV = {}
|
local WPV = {}
|
||||||
@@ -71,7 +72,7 @@ local function MakeCode_1( Proc, nRawId, b3Raw)
|
|||||||
end
|
end
|
||||||
-- inserisco la lavorazione di finitura superficie
|
-- inserisco la lavorazione di finitura superficie
|
||||||
local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'SurfFin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sSurfFin)
|
local nMchFId = WM.AddMachining( Proc.Id, sName, sSurfFin)
|
||||||
if not nMchFId then
|
if not nMchFId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sSurfFin
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
+68
-32
@@ -1,5 +1,6 @@
|
|||||||
-- WallExec.lua by Egaltech s.r.l. 2022/05/12
|
-- WallExec.lua by Egaltech s.r.l. 2023/03/06
|
||||||
-- Libreria esecuzione lavorazioni per Pareti
|
-- Libreria esecuzione lavorazioni per Pareti
|
||||||
|
-- 2023/05/25 Aggiunto ordinamento in base a prioritò da btl.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local WallExec = {}
|
local WallExec = {}
|
||||||
@@ -75,22 +76,22 @@ function WallExec.ProcessWalls( dRawL, dRawW, dRawH, vWall, bMachGroupOk, bNewPr
|
|||||||
end
|
end
|
||||||
if sOrigCorner == 'TL' then
|
if sOrigCorner == 'TL' then
|
||||||
nCorner = MCH_CR.TL
|
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
|
elseif sOrigCorner == 'BL' then
|
||||||
nCorner = MCH_CR.BL
|
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
|
elseif sOrigCorner == 'TR' then
|
||||||
nCorner = MCH_CR.TR
|
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
|
elseif sOrigCorner == 'BR' then
|
||||||
nCorner = MCH_CR.BR
|
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
|
elseif sOrigCorner == 'TM' then
|
||||||
nCorner = MCH_CR.TR
|
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
|
elseif sOrigCorner == 'BM' then
|
||||||
nCorner = MCH_CR.BR
|
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))
|
||||||
end
|
end
|
||||||
-- Impostazione dell'attrezzaggio di default
|
-- Impostazione dell'attrezzaggio di default
|
||||||
EgtImportSetup()
|
EgtImportSetup()
|
||||||
@@ -409,7 +410,7 @@ local function ContainsStartName( nOperId, StartNames)
|
|||||||
end
|
end
|
||||||
|
|
||||||
------ Ordinamento dei tagli, delle fresature e delle forature -------
|
------ 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
|
-- dichiarazione tabella
|
||||||
local TabCut = {}
|
local TabCut = {}
|
||||||
-- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate
|
-- Recupero gli identificativi delle lavorazioni e annullo eventuali allungamenti e Id di altre lavorazioni rappresentate
|
||||||
@@ -419,6 +420,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à)
|
-- 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
|
if EgtGetOperationPhase( nOperId) == nPhase and ( nType & nOperType) == nOperType and
|
||||||
( not nPartId or EgtGetInfo( nOperId, 'Part', 'i') == nPartId) 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 StartNames or ( bExistName and ContainsStartName( nOperId, StartNames)) or
|
||||||
( not bExistName and not ContainsStartName( nOperId, StartNames))) and
|
( not bExistName and not ContainsStartName( nOperId, StartNames))) and
|
||||||
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or
|
( not sInfo or ( bExistInfo and EgtGetInfo( nOperId, sInfo, 'i') == 1) or
|
||||||
@@ -535,17 +537,17 @@ local function SortMach( nPhase, PrevMch, nPartId, nType, StartNames, bExistName
|
|||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
local function SortMachinings( nPhase, PrevMch, nPartId)
|
local function SortMachinings( nPhase, PrevMch, nPartId, nPriority)
|
||||||
-- Chiodature
|
-- 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
|
-- 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
|
-- 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
|
-- 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
|
-- 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 ***
|
-- -- Forature ***
|
||||||
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false)
|
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', false)
|
||||||
-- -- Svuotature ***
|
-- -- Svuotature ***
|
||||||
@@ -553,30 +555,32 @@ local function SortMachinings( nPhase, PrevMch, nPartId)
|
|||||||
-- -- Fresature che sono rifiniture di spigoli
|
-- -- Fresature che sono rifiniture di spigoli
|
||||||
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
|
-- PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'Clean_'}, false, 'MOVE_AFTER', false, false, true)
|
||||||
-- Lavorazioni di superficie
|
-- 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
|
-- 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
|
-- 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
|
-- 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
|
-- 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
|
-- 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)
|
-- Qui rimozione sfridi (se ci sono lavorazioni successive)
|
||||||
-- Fresature dei lapjoint che necessitano di gorge
|
if not nPriority then
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true)
|
-- Fresature dei lapjoint che necessitano di gorge
|
||||||
-- Tagli con sega a catena che vanno fatti dopo i tagli con lama
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, { 'SideMill_'}, true, 'MOVE_AFTER', true, false, true, true)
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true)
|
-- Tagli con sega a catena che vanno fatti dopo i tagli con lama
|
||||||
-- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MORTISING, { 'Csaw_'}, true)
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true)
|
-- Fresature (puliture di spigoli) che vanno fatte dopo i tagli con lama
|
||||||
-- Forature che vanno fatte dopo i tagli con lama
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.MILLING, nil, nil, 'MOVE_AFTER', true)
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
|
-- Forature che vanno fatte dopo i tagli con lama
|
||||||
-- Svuotature che vanno fatte dopo i tagli con lama
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.DRILLING, nil, nil, 'MOVE_AFTER', true)
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
|
-- Svuotature che vanno fatte dopo i tagli con lama
|
||||||
-- Lavorazioni di superficie che vanno fatte dopo i tagli con lama
|
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_OY.POCKETING, nil, nil, 'MOVE_AFTER', true)
|
||||||
PrevMch = SortMach( nPhase, PrevMch, nPartId, MCH_MY.SURFFINISHING, 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
|
return PrevMch
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -641,6 +645,38 @@ function WallExec.ProcessFeatures()
|
|||||||
-- riordino le lavorazioni tra tutti i pezzi
|
-- riordino le lavorazioni tra tutti i pezzi
|
||||||
local nPhase = 1
|
local nPhase = 1
|
||||||
local PrevMch = EgtGetPhaseDisposition( nPhase)
|
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
|
||||||
|
|
||||||
SortMachinings( nPhase, PrevMch)
|
SortMachinings( nPhase, PrevMch)
|
||||||
-- Aggiornamento finale di tutto
|
-- Aggiornamento finale di tutto
|
||||||
EgtSetCurrPhase( 1)
|
EgtSetCurrPhase( 1)
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ local Text = require( 'WProcessText')
|
|||||||
-- Carico i dati globali
|
-- Carico i dati globali
|
||||||
local WD = require( 'WallData')
|
local WD = require( 'WallData')
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
local function ClassifyFlip( vPartProc, b3Part)
|
local function ClassifyFlip( vPartProc, b3Part)
|
||||||
|
|
||||||
local FlipFeatureStates = {}
|
local FlipFeatureStates = {}
|
||||||
@@ -132,7 +133,7 @@ local function ClassifyFlip( vPartProc, b3Part)
|
|||||||
return FlipFeatureStates, bLapJoints
|
return FlipFeatureStates, bLapJoints
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
local function ClassifyRotation( vPartProc)
|
local function ClassifyRotation( vPartProc)
|
||||||
|
|
||||||
local RotateFeatureStates = {}
|
local RotateFeatureStates = {}
|
||||||
@@ -144,12 +145,11 @@ local function ClassifyRotation( vPartProc)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return RotateFeatureStates
|
return RotateFeatureStates
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
-------------------------------------------------------------------
|
||||||
|
-------------------------------------------------------------------
|
||||||
local vPartProc = WE.CollectFeatures( NFAR.PARTID)
|
local vPartProc = WE.CollectFeatures( NFAR.PARTID)
|
||||||
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
local b3Part = EgtGetBBoxGlob( NFAR.PARTID, GDB_BB.STANDARD)
|
||||||
local bManualFlip = EgtGetInfo( NFAR.PARTID, "MANUALFLIP", 'b')
|
local bManualFlip = EgtGetInfo( NFAR.PARTID, "MANUALFLIP", 'b')
|
||||||
@@ -217,7 +217,7 @@ end
|
|||||||
|
|
||||||
-- rimuovo parametri Q
|
-- rimuovo parametri Q
|
||||||
local b3PartInside = BBox3d( b3Part)
|
local b3PartInside = BBox3d( b3Part)
|
||||||
b3PartInside:expand( - WD.INSIDE_RAW_TOL)
|
b3PartInside:expand( - ( WD.INSIDE_RAW_TOL or 30))
|
||||||
for nInd = 1, #vPartProc do
|
for nInd = 1, #vPartProc do
|
||||||
local Proc = vPartProc[nInd]
|
local Proc = vPartProc[nInd]
|
||||||
|
|
||||||
@@ -275,6 +275,7 @@ end
|
|||||||
|
|
||||||
-- ROTATION
|
-- ROTATION
|
||||||
nRotate = 0
|
nRotate = 0
|
||||||
|
|
||||||
-- venatura
|
-- venatura
|
||||||
EgtRemoveInfo( NFAR.PARTID, "HasGrainDirection")
|
EgtRemoveInfo( NFAR.PARTID, "HasGrainDirection")
|
||||||
local bGrain = false
|
local bGrain = false
|
||||||
|
|||||||
+105
-290
@@ -60,9 +60,21 @@ local FreeContour = require( 'WProcessFreeContour')
|
|||||||
-- Carico i dati globali
|
-- Carico i dati globali
|
||||||
local WD = require( 'WallData')
|
local WD = require( 'WallData')
|
||||||
|
|
||||||
|
-- Recupero alcuni dati dal WallData o li setto a valori di default
|
||||||
|
local s_dSideMillDiamDown = WD.SIDEMILL_DIAM_DOWN or 350
|
||||||
|
local s_dSideMillDiamUp = WD.SIDEMILL_DIAM_UP or 65
|
||||||
|
local s_dHorDrillLen = WD.HOR_DRILL_LEN or 1780
|
||||||
|
local s_dHorDrillDiam = WD.HOR_DRILL_DIAM or 35
|
||||||
|
local s_sOrigCorner = WD.ORIG_CORNER or 'TL'
|
||||||
|
local s_dIntRulli = WD.INTRULLI or 1200
|
||||||
|
local s_dMinRawYHorDrill = WD.MINRAWY_HOR_DRILL or 2800
|
||||||
|
local s_dNestHoleMinArea = WD.NEST_HOLE_MIN_AREA or 200000
|
||||||
|
local s_dInsideRawTol = WD.INSIDE_RAW_TOL or 30
|
||||||
|
|
||||||
-- lista dei pezzi con flip o rotazione
|
-- lista dei pezzi con flip o rotazione
|
||||||
local PartStates = {}
|
local PartStates = {}
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzioni per scrittura su file di log specifico
|
-- Funzioni per scrittura su file di log specifico
|
||||||
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
||||||
local hFile = io.open( sLogFile, 'a')
|
local hFile = io.open( sLogFile, 'a')
|
||||||
@@ -74,12 +86,14 @@ local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
|||||||
hFile:close()
|
hFile:close()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
local function WriteTimeToLogFile( dTime)
|
local function WriteTimeToLogFile( dTime)
|
||||||
local hFile = io.open( sLogFile, 'a')
|
local hFile = io.open( sLogFile, 'a')
|
||||||
hFile:write( 'TIME=' .. EgtNumToString( dTime) .. '\n')
|
hFile:write( 'TIME=' .. EgtNumToString( dTime) .. '\n')
|
||||||
hFile:close()
|
hFile:close()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione per gestire visualizzazione dopo errore
|
-- Funzione per gestire visualizzazione dopo errore
|
||||||
local function PostErrView( nErr, sMsg)
|
local function PostErrView( nErr, sMsg)
|
||||||
if nErr ~= 0 and ( NEST.FLAG == 1 or NEST.FLAG == 2 or NEST.FLAG == 5) then
|
if nErr ~= 0 and ( NEST.FLAG == 1 or NEST.FLAG == 2 or NEST.FLAG == 5) then
|
||||||
@@ -89,6 +103,7 @@ local function PostErrView( nErr, sMsg)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione per gestire visualizzazione dopo warning
|
-- Funzione per gestire visualizzazione dopo warning
|
||||||
local function PostWarnView( nWarn, sMsg)
|
local function PostWarnView( nWarn, sMsg)
|
||||||
if nWarn ~= 0 and ( NEST.FLAG == 1 or NEST.FLAG == 2 or NEST.FLAG == 5) then
|
if nWarn ~= 0 and ( NEST.FLAG == 1 or NEST.FLAG == 2 or NEST.FLAG == 5) then
|
||||||
@@ -98,6 +113,7 @@ local function PostWarnView( nWarn, sMsg)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione per aggiornare dati ausiliari
|
-- Funzione per aggiornare dati ausiliari
|
||||||
local function UpdateAuxData( sAuxFile)
|
local function UpdateAuxData( sAuxFile)
|
||||||
local bModif = false
|
local bModif = false
|
||||||
@@ -111,6 +127,7 @@ local function UpdateAuxData( sAuxFile)
|
|||||||
return bModif
|
return bModif
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione per trovare nome MachGroup
|
-- Funzione per trovare nome MachGroup
|
||||||
local function NewMachGroupName()
|
local function NewMachGroupName()
|
||||||
local nMachGroupId = EgtGetFirstMachGroup()
|
local nMachGroupId = EgtGetFirstMachGroup()
|
||||||
@@ -127,6 +144,7 @@ local function NewMachGroupName()
|
|||||||
return nMaxMachGroup + 1
|
return nMaxMachGroup + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione che crea il rettangolo della lavorazione
|
-- Funzione che crea il rettangolo della lavorazione
|
||||||
local function CreateToolRectangle( ptP1, dValP1, ptP2, dValP2, vtFace, dValFace, nOutlineGrp)
|
local function CreateToolRectangle( ptP1, dValP1, ptP2, dValP2, vtFace, dValFace, nOutlineGrp)
|
||||||
local dExtra = 5
|
local dExtra = 5
|
||||||
@@ -141,6 +159,7 @@ local function CreateToolRectangle( ptP1, dValP1, ptP2, dValP2, vtFace, dValFace
|
|||||||
return nId
|
return nId
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione che verifica se la lavorazione è lap joint dal basso ed eventualmente ne calcola l'area di lavorazione
|
-- Funzione che verifica se la lavorazione è lap joint dal basso ed eventualmente ne calcola l'area di lavorazione
|
||||||
local function IdentifyLJFromBottom( Proc, bCompute, nOutlineGrp)
|
local function IdentifyLJFromBottom( Proc, bCompute, nOutlineGrp)
|
||||||
|
|
||||||
@@ -162,12 +181,11 @@ local function IdentifyLJFromBottom( Proc, bCompute, nOutlineGrp)
|
|||||||
if bCompute then
|
if bCompute then
|
||||||
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||||
-- creo il rettangolo della lavorazione
|
-- creo il rettangolo della lavorazione
|
||||||
nRectId = CreateToolRectangle( ptP1, WD.SIDEMILL_DIAM_DOWN / 2, ptP2, WD.SIDEMILL_DIAM_DOWN / 2, vtFace, WD.SIDEMILL_DIAM_DOWN, nOutlineGrp)
|
nRectId = CreateToolRectangle( ptP1, s_dSideMillDiamDown / 2, ptP2, s_dSideMillDiamDown / 2, vtFace, s_dSideMillDiamDown, nOutlineGrp)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
elseif Proc.Fct == 3 then
|
elseif Proc.Fct == 3 then
|
||||||
local nFacInd, dElev, nFacInd2 = WL.GetFaceWithMostAdj( Proc.Id, Proc.PartId)
|
local nFacInd, dElev, nFacInd2 = WL.GetFaceWithMostAdj( Proc.Id, Proc.PartId)
|
||||||
|
|
||||||
@@ -181,7 +199,7 @@ local function IdentifyLJFromBottom( Proc, bCompute, nOutlineGrp)
|
|||||||
if abs( ptP1:getZ() - ptP2:getZ()) < GEO.EPS_SMALL then
|
if abs( ptP1:getZ() - ptP2:getZ()) < GEO.EPS_SMALL then
|
||||||
bLJFromBottom = true
|
bLJFromBottom = true
|
||||||
if bCompute then
|
if bCompute then
|
||||||
nRectId = CreateToolRectangle( ptP1, WD.SIDEMILL_DIAM_DOWN / 2, ptP2, WD.SIDEMILL_DIAM_DOWN / 2, vtFace, WD.SIDEMILL_DIAM_DOWN, nOutlineGrp)
|
nRectId = CreateToolRectangle( ptP1, s_dSideMillDiamDown / 2, ptP2, s_dSideMillDiamDown / 2, vtFace, s_dSideMillDiamDown, nOutlineGrp)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -209,8 +227,8 @@ local function IdentifyLJFromBottom( Proc, bCompute, nOutlineGrp)
|
|||||||
if AreSamePointApprox( ptP2, ptP3) or AreSamePointApprox( ptP2, ptP4) then
|
if AreSamePointApprox( ptP2, ptP3) or AreSamePointApprox( ptP2, ptP4) then
|
||||||
ptP1, ptP2 = ptP2, ptP1
|
ptP1, ptP2 = ptP2, ptP1
|
||||||
end
|
end
|
||||||
local dVal = EgtIf( NEST.MACH_AREA_IGNORE_3rdFACE == 1, WD.SIDEMILL_DIAM_DOWN / 2, 0)
|
local dVal = EgtIf( NEST.MACH_AREA_IGNORE_3rdFACE == 1, s_dSideMillDiamDown / 2, 0)
|
||||||
nRectId = CreateToolRectangle( ptP1, dVal, ptP2, WD.SIDEMILL_DIAM_DOWN / 2, vtFace, WD.SIDEMILL_DIAM_DOWN, nOutlineGrp)
|
nRectId = CreateToolRectangle( ptP1, dVal, ptP2, s_dSideMillDiamDown / 2, vtFace, s_dSideMillDiamDown, nOutlineGrp)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -237,7 +255,7 @@ local function IdentifyLJFromBottom( Proc, bCompute, nOutlineGrp)
|
|||||||
if AreSamePointApprox( ptP2, ptP3) or AreSamePointApprox( ptP2, ptP4) then
|
if AreSamePointApprox( ptP2, ptP3) or AreSamePointApprox( ptP2, ptP4) then
|
||||||
ptP1, ptP2 = ptP2, ptP1
|
ptP1, ptP2 = ptP2, ptP1
|
||||||
end
|
end
|
||||||
nRectId = CreateToolRectangle( ptP1, 0, ptP2, WD.SIDEMILL_DIAM_DOWN / 2, vtFace, WD.SIDEMILL_DIAM_DOWN, nOutlineGrp)
|
nRectId = CreateToolRectangle( ptP1, 0, ptP2, s_dSideMillDiamDown / 2, vtFace, s_dSideMillDiamDown, nOutlineGrp)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -249,11 +267,10 @@ local function IdentifyLJFromBottom( Proc, bCompute, nOutlineGrp)
|
|||||||
if vtFace:getZ() < -dMinCompZ then vtFace = vtFace2 end
|
if vtFace:getZ() < -dMinCompZ then vtFace = vtFace2 end
|
||||||
if bCompute then
|
if bCompute then
|
||||||
local bAdj, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacInd, nFacInd2, GDB_ID.ROOT)
|
local bAdj, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacInd, nFacInd2, GDB_ID.ROOT)
|
||||||
nRectId = CreateToolRectangle( ptP1, 0, ptP2, 0, vtFace, WD.SIDEMILL_DIAM_DOWN, nOutlineGrp)
|
nRectId = CreateToolRectangle( ptP1, 0, ptP2, 0, vtFace, s_dSideMillDiamDown, nOutlineGrp)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -264,13 +281,14 @@ local function IdentifyLJFromBottom( Proc, bCompute, nOutlineGrp)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione che verifica se la lavorazione è lap joint da sopra ed eventualmente ne calcola l'area di lavorazione
|
-- Funzione che verifica se la lavorazione è lap joint da sopra ed eventualmente ne calcola l'area di lavorazione
|
||||||
local function IdentifyLJFromTop( Proc, bCompute, nOutlineGrp)
|
local function IdentifyLJFromTop( Proc, bCompute, nOutlineGrp)
|
||||||
|
|
||||||
local bLJFromTop = false
|
local bLJFromTop = false
|
||||||
local vtFace, nRectId
|
local vtFace, nRectId
|
||||||
|
|
||||||
if not WD.SIDEMILL_DIAM_UP or WD.SIDEMILL_DIAM_UP < GEO.EPS_SMALL then return end
|
if s_dSideMillDiamUp < GEO.EPS_SMALL then return end
|
||||||
|
|
||||||
local dMinComp = 0.95
|
local dMinComp = 0.95
|
||||||
if Proc.Fct == 2 then
|
if Proc.Fct == 2 then
|
||||||
@@ -291,8 +309,8 @@ local function IdentifyLJFromTop( Proc, bCompute, nOutlineGrp)
|
|||||||
elseif vtFace:getY() > dMinComp or vtFace:getY() < - dMinComp then
|
elseif vtFace:getY() > dMinComp or vtFace:getY() < - dMinComp then
|
||||||
dDim = b3Face:getDimY()
|
dDim = b3Face:getDimY()
|
||||||
end
|
end
|
||||||
local dValFace = max( dDim + WD.SIDEMILL_DIAM_UP / 2, WD.SIDEMILL_DIAM_UP)
|
local dValFace = max( dDim + s_dSideMillDiamUp / 2, s_dSideMillDiamUp)
|
||||||
local dVal = WD.SIDEMILL_DIAM_UP / 2
|
local dVal = s_dSideMillDiamUp / 2
|
||||||
if NEST.MACH_AREA_USE_OTHER_DIAM == 1 then
|
if NEST.MACH_AREA_USE_OTHER_DIAM == 1 then
|
||||||
dVal = NEST.MACH_AREA_OTHER_DIAM / 2
|
dVal = NEST.MACH_AREA_OTHER_DIAM / 2
|
||||||
end
|
end
|
||||||
@@ -314,7 +332,7 @@ local function IdentifyLJFromTop( Proc, bCompute, nOutlineGrp)
|
|||||||
local nOtherFace = EgtIf( nFacInd == 0, 1, 0)
|
local nOtherFace = EgtIf( nFacInd == 0, 1, 0)
|
||||||
local vtNOther = EgtSurfTmFacetNormVersor( Proc.Id, nOtherFace, GDB_ID.ROOT)
|
local vtNOther = EgtSurfTmFacetNormVersor( Proc.Id, nOtherFace, GDB_ID.ROOT)
|
||||||
local vtDir = EgtIf( AreSameOrOppositeVectorApprox( vtNOther, X_AX()), Y_AX(), X_AX())
|
local vtDir = EgtIf( AreSameOrOppositeVectorApprox( vtNOther, X_AX()), Y_AX(), X_AX())
|
||||||
local dVal = WD.SIDEMILL_DIAM_UP / 2 + 5
|
local dVal = s_dSideMillDiamUp / 2 + 5
|
||||||
local ptMin = b3Face:getMin() - dVal * vtDir
|
local ptMin = b3Face:getMin() - dVal * vtDir
|
||||||
local ptMax = b3Face:getMax() + dVal * vtDir
|
local ptMax = b3Face:getMax() + dVal * vtDir
|
||||||
-- nRectId = EgtRectangle2P( nOutlineGrp, Point3d(ptMax:getX(), ptMax:getY(), 0), Point3d( ptMin:getX(), ptMin:getY(), 0))
|
-- nRectId = EgtRectangle2P( nOutlineGrp, Point3d(ptMax:getX(), ptMax:getY(), 0), Point3d( ptMin:getX(), ptMin:getY(), 0))
|
||||||
@@ -352,8 +370,8 @@ local function IdentifyLJFromTop( Proc, bCompute, nOutlineGrp)
|
|||||||
elseif vtFace:getY() > dMinComp or vtFace:getY() < - dMinComp then
|
elseif vtFace:getY() > dMinComp or vtFace:getY() < - dMinComp then
|
||||||
dDim = b3Face:getDimY()
|
dDim = b3Face:getDimY()
|
||||||
end
|
end
|
||||||
local dValFace = max( dDim + WD.SIDEMILL_DIAM_UP / 2, WD.SIDEMILL_DIAM_UP)
|
local dValFace = max( dDim + s_dSideMillDiamUp / 2, s_dSideMillDiamUp)
|
||||||
local dVal = WD.SIDEMILL_DIAM_UP / 2
|
local dVal = s_dSideMillDiamUp / 2
|
||||||
if NEST.MACH_AREA_USE_OTHER_DIAM == 1 then
|
if NEST.MACH_AREA_USE_OTHER_DIAM == 1 then
|
||||||
dVal = NEST.MACH_AREA_OTHER_DIAM / 2
|
dVal = NEST.MACH_AREA_OTHER_DIAM / 2
|
||||||
end
|
end
|
||||||
@@ -370,6 +388,7 @@ local function IdentifyLJFromTop( Proc, bCompute, nOutlineGrp)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione che crea le regioni occupate dalle lavorazioni
|
-- Funzione che crea le regioni occupate dalle lavorazioni
|
||||||
local function ComputeToolOutlines( nPartId)
|
local function ComputeToolOutlines( nPartId)
|
||||||
|
|
||||||
@@ -419,7 +438,7 @@ local function ComputeToolOutlines( nPartId)
|
|||||||
local dDiam = 2 * EgtArcRadius( AuxId)
|
local dDiam = 2 * EgtArcRadius( AuxId)
|
||||||
|
|
||||||
-- verifico se la lunghezza del foro è maggiore della lunghezza della punta
|
-- verifico se la lunghezza del foro è maggiore della lunghezza della punta
|
||||||
if bOpen and AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) and dLen > WD.HOR_DRILL_LEN - 1 then
|
if bOpen and AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) and dLen > s_dHorDrillLen - 1 then
|
||||||
local ptP1 = Proc.Box:getMin()
|
local ptP1 = Proc.Box:getMin()
|
||||||
local ptP2 = Proc.Box:getMax()
|
local ptP2 = Proc.Box:getMax()
|
||||||
local dExtra = 10
|
local dExtra = 10
|
||||||
@@ -451,49 +470,47 @@ local function ComputeToolOutlines( nPartId)
|
|||||||
dVal = ( NEST.OFFSET + 0.1) * dCosAlpha
|
dVal = ( NEST.OFFSET + 0.1) * dCosAlpha
|
||||||
end
|
end
|
||||||
|
|
||||||
local frLoc, dDimX, dDimY = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nInd, GDB_ID.ROOT)
|
local frLoc, dDimX, dDimY = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nInd, GDB_ID.ROOT)
|
||||||
local b3Face = EgtSurfTmGetFacetBBoxRef( Proc.Id, nInd, GDB_BB.STANDARD, frLoc)
|
local b3Face = EgtSurfTmGetFacetBBoxRef( Proc.Id, nInd, GDB_BB.STANDARD, frLoc)
|
||||||
local ptA = b3Face:getMin()
|
local ptA = b3Face:getMin()
|
||||||
local ptC = b3Face:getMax()
|
local ptC = b3Face:getMax()
|
||||||
local ptB = ptA + dDimY * Y_AX()
|
local ptB = ptA + dDimY * Y_AX()
|
||||||
local ptD = ptA + dDimX * X_AX()
|
local ptD = ptA + dDimX * X_AX()
|
||||||
ptA:toGlob( frLoc)
|
ptA:toGlob( frLoc)
|
||||||
ptB:toGlob( frLoc)
|
ptB:toGlob( frLoc)
|
||||||
ptC:toGlob( frLoc)
|
ptC:toGlob( frLoc)
|
||||||
ptD:toGlob( frLoc)
|
ptD:toGlob( frLoc)
|
||||||
|
|
||||||
local ptP1, ptP2
|
local ptP1, ptP2
|
||||||
if bUnderCut then
|
if bUnderCut then
|
||||||
ptP1 = EgtIf( ptA:getZ() > ptC:getZ(), ptA, ptC)
|
ptP1 = EgtIf( ptA:getZ() > ptC:getZ(), ptA, ptC)
|
||||||
ptP2 = EgtIf( ptB:getZ() > ptD:getZ(), ptB, ptD)
|
ptP2 = EgtIf( ptB:getZ() > ptD:getZ(), ptB, ptD)
|
||||||
else
|
else
|
||||||
ptP1 = EgtIf( ptA:getZ() < ptC:getZ(), ptA, ptC)
|
ptP1 = EgtIf( ptA:getZ() < ptC:getZ(), ptA, ptC)
|
||||||
ptP2 = EgtIf( ptB:getZ() < ptD:getZ(), ptB, ptD)
|
ptP2 = EgtIf( ptB:getZ() < ptD:getZ(), ptB, ptD)
|
||||||
end
|
end
|
||||||
|
|
||||||
local vtDir = ptP2 - ptP1
|
local vtDir = ptP2 - ptP1
|
||||||
vtDir:normalize()
|
vtDir:normalize()
|
||||||
ptP1 = ptP1 - vtDir * 0.5 * NEST.OFFSET
|
ptP1 = ptP1 - vtDir * 0.5 * NEST.OFFSET
|
||||||
ptP2 = ptP2 + vtDir * 0.5 * NEST.OFFSET
|
ptP2 = ptP2 + vtDir * 0.5 * NEST.OFFSET
|
||||||
local vtNxy = Vector3d( vtN:getX(), vtN:getY(), 0)
|
local vtNxy = Vector3d( vtN:getX(), vtN:getY(), 0)
|
||||||
vtNxy:normalize()
|
vtNxy:normalize()
|
||||||
local ptP4 = ptP2 + dVal * vtNxy
|
local ptP4 = ptP2 + dVal * vtNxy
|
||||||
|
|
||||||
local nRectId = EgtRectangle3P( nOutlineGrp, ptP1, ptP4, ptP2)
|
|
||||||
EgtSetColor( nRectId, EgtStdColor("AQUA"))
|
|
||||||
if nRectId ~= GDB_ID.NULL then table.insert( ToolOutlineId, nRectId) end
|
|
||||||
|
|
||||||
|
local nRectId = EgtRectangle3P( nOutlineGrp, ptP1, ptP4, ptP2)
|
||||||
|
EgtSetColor( nRectId, EgtStdColor("AQUA"))
|
||||||
|
if nRectId ~= GDB_ID.NULL then table.insert( ToolOutlineId, nRectId) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return ToolOutlineId
|
return ToolOutlineId
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
local function ClassifyDrillsOnLateralFaces( nPartId, dMinSheetWidth)
|
local function ClassifyDrillsOnLateralFaces( nPartId, dMinSheetWidth)
|
||||||
|
|
||||||
local dDeltaRaw = WD.MAX_WIDTH - dMinSheetWidth + NEST.KERF
|
local dDeltaRaw = WD.MAX_WIDTH - dMinSheetWidth + NEST.KERF
|
||||||
@@ -518,11 +535,11 @@ local function ClassifyDrillsOnLateralFaces( nPartId, dMinSheetWidth)
|
|||||||
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then break end
|
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then break end
|
||||||
-- verifico se diametro compatibile con la punta
|
-- verifico se diametro compatibile con la punta
|
||||||
local dDiam = 2 * EgtArcRadius( AuxId)
|
local dDiam = 2 * EgtArcRadius( AuxId)
|
||||||
if abs( dDiam - WD.HOR_DRILL_DIAM) < WD.DRILL_TOL + GEO.EPS_SMALL then
|
if abs( dDiam - s_dHorDrillDiam) < WD.DRILL_TOL + GEO.EPS_SMALL then
|
||||||
local ptDrill = EgtCP( AuxId, GDB_RT.GLOB)
|
local ptDrill = EgtCP( AuxId, GDB_RT.GLOB)
|
||||||
local dLen = abs( EgtCurveThickness( AuxId))
|
local dLen = abs( EgtCurveThickness( AuxId))
|
||||||
local bLong = dLen > WD.HOR_DRILL_LEN - 1
|
local bLong = dLen > s_dHorDrillLen - 1
|
||||||
local bOnlyOnRef = dLen + dDeltaRaw > WD.HOR_DRILL_LEN - GEO.EPS_SMALL and not bLong
|
local bOnlyOnRef = dLen + dDeltaRaw > s_dHorDrillLen - GEO.EPS_SMALL and not bLong
|
||||||
|
|
||||||
-- faccia Front
|
-- faccia Front
|
||||||
local dTol = GEO.EPS_SMALL
|
local dTol = GEO.EPS_SMALL
|
||||||
@@ -632,13 +649,12 @@ local function ClassifyDrillsOnLateralFaces( nPartId, dMinSheetWidth)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if NEST.DRILL_MACH_AREA == 0 then
|
if NEST.DRILL_MACH_AREA == 0 then
|
||||||
DrillOnFaces[sDrillFace].long = false
|
DrillOnFaces[sDrillFace].long = false
|
||||||
end
|
end
|
||||||
|
|
||||||
if nMax > 0 then
|
if nMax > 0 then
|
||||||
DrillClassif = { sCase = sDrillFace, bClosed = DrillOnFaces[sDrillFace].closed, bLong = DrillOnFaces[sDrillFace].long, bOnlyOnRef = DrillOnFaces[sDrillFace].OnlyOnRef }
|
DrillClassif = { sCase = sDrillFace, bClosed = DrillOnFaces[sDrillFace].closed, bLong = DrillOnFaces[sDrillFace].long, bOnlyOnRef = DrillOnFaces[sDrillFace].OnlyOnRef}
|
||||||
end
|
end
|
||||||
|
|
||||||
local DrillClassif2
|
local DrillClassif2
|
||||||
@@ -646,13 +662,14 @@ local function ClassifyDrillsOnLateralFaces( nPartId, dMinSheetWidth)
|
|||||||
if NEST.DRILL_MACH_AREA == 0 then
|
if NEST.DRILL_MACH_AREA == 0 then
|
||||||
DrillOnFaces[sDrillFace2].long = false
|
DrillOnFaces[sDrillFace2].long = false
|
||||||
end
|
end
|
||||||
DrillClassif2 = { sCase = sDrillFace2, bClosed = DrillOnFaces[sDrillFace2].closed, bLong = DrillOnFaces[sDrillFace2].long, bOnlyOnRef = DrillOnFaces[sDrillFace2].OnlyOnRef }
|
DrillClassif2 = { sCase = sDrillFace2, bClosed = DrillOnFaces[sDrillFace2].closed, bLong = DrillOnFaces[sDrillFace2].long, bOnlyOnRef = DrillOnFaces[sDrillFace2].OnlyOnRef}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return DrillClassif, DrillClassif2
|
return DrillClassif, DrillClassif2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
local function ClassifyLapJointsFromBottom( nPartId)
|
local function ClassifyLapJointsFromBottom( nPartId)
|
||||||
|
|
||||||
local res = { Nbr = 0, sCase = '', bParall = false}
|
local res = { Nbr = 0, sCase = '', bParall = false}
|
||||||
@@ -735,7 +752,7 @@ local function ClassifyLapJointsFromBottom( nPartId)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
local function CreateDefectOnAngle( nPartId, RawPart, bDrillLong, bOnOppositeAng)
|
local function CreateDefectOnAngle( nPartId, RawPart, bDrillLong, bOnOppositeAng)
|
||||||
|
|
||||||
local PartTab = {}
|
local PartTab = {}
|
||||||
@@ -747,7 +764,7 @@ local function CreateDefectOnAngle( nPartId, RawPart, bDrillLong, bOnOppositeAng
|
|||||||
EgtSetStatus( nOutlineGrp, GDB_ST.OFF)
|
EgtSetStatus( nOutlineGrp, GDB_ST.OFF)
|
||||||
end
|
end
|
||||||
|
|
||||||
local dExtraMachArea = WD.SIDEMILL_DIAM_DOWN -- per tenere conto dell'area di lavorazione
|
local dExtraMachArea = s_dSideMillDiamDown -- per tenere conto dell'area di lavorazione
|
||||||
local dExtra = NEST.KERF
|
local dExtra = NEST.KERF
|
||||||
|
|
||||||
-- local b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
-- local b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
||||||
@@ -763,25 +780,25 @@ local function CreateDefectOnAngle( nPartId, RawPart, bDrillLong, bOnOppositeAng
|
|||||||
|
|
||||||
-- calcolo i punti che definiscono il rettangolo
|
-- calcolo i punti che definiscono il rettangolo
|
||||||
local ptP1, ptP2
|
local ptP1, ptP2
|
||||||
if ( WD.ORIG_CORNER == 'TL' and not bOnOppositeAng) or ( WD.ORIG_CORNER == 'BL' and bOnOppositeAng) then
|
if ( s_sOrigCorner == 'TL' and not bOnOppositeAng) or ( s_sOrigCorner == 'BL' and bOnOppositeAng) then
|
||||||
-- angolo TL
|
-- angolo TL
|
||||||
ptP1 = Point3d( 0, RawPart.Width - b3PartY - dExtra, 0)
|
ptP1 = Point3d( 0, RawPart.Width - b3PartY - dExtra, 0)
|
||||||
ptP2 = Point3d( b3PartX + dExtra, RawPart.Width, 0)
|
ptP2 = Point3d( b3PartX + dExtra, RawPart.Width, 0)
|
||||||
PartTab.posX = NEST.KERF
|
PartTab.posX = NEST.KERF
|
||||||
PartTab.posY = RawPart.Width - b3Part:getDimY() - NEST.KERF
|
PartTab.posY = RawPart.Width - b3Part:getDimY() - NEST.KERF
|
||||||
elseif ( WD.ORIG_CORNER == 'BL' and not bOnOppositeAng) or ( WD.ORIG_CORNER == 'TL' and bOnOppositeAng) then
|
elseif ( s_sOrigCorner == 'BL' and not bOnOppositeAng) or ( s_sOrigCorner == 'TL' and bOnOppositeAng) then
|
||||||
-- angolo BL
|
-- angolo BL
|
||||||
ptP1 = Point3d( 0, 0, 0)
|
ptP1 = Point3d( 0, 0, 0)
|
||||||
ptP2 = Point3d( b3PartX + dExtra, b3PartY + dExtra, 0)
|
ptP2 = Point3d( b3PartX + dExtra, b3PartY + dExtra, 0)
|
||||||
PartTab.posX = NEST.KERF
|
PartTab.posX = NEST.KERF
|
||||||
PartTab.posY = NEST.KERF
|
PartTab.posY = NEST.KERF
|
||||||
elseif ( WD.ORIG_CORNER == 'TR' and not bOnOppositeAng) or ( WD.ORIG_CORNER == 'BR' and bOnOppositeAng) then
|
elseif ( s_sOrigCorner == 'TR' and not bOnOppositeAng) or ( s_sOrigCorner == 'BR' and bOnOppositeAng) then
|
||||||
-- angolo TR
|
-- angolo TR
|
||||||
ptP1 = Point3d( RawPart.Len - b3PartX - dExtra, RawPart.Width - b3PartY - dExtra, 0)
|
ptP1 = Point3d( RawPart.Len - b3PartX - dExtra, RawPart.Width - b3PartY - dExtra, 0)
|
||||||
ptP2 = Point3d( RawPart.Len, RawPart.Width, 0)
|
ptP2 = Point3d( RawPart.Len, RawPart.Width, 0)
|
||||||
PartTab.posX = RawPart.Len - b3Part:getDimX() - NEST.KERF
|
PartTab.posX = RawPart.Len - b3Part:getDimX() - NEST.KERF
|
||||||
PartTab.posY = RawPart.Width - b3Part:getDimY() - NEST.KERF
|
PartTab.posY = RawPart.Width - b3Part:getDimY() - NEST.KERF
|
||||||
elseif ( WD.ORIG_CORNER == 'BR' and not bOnOppositeAng) or ( WD.ORIG_CORNER == 'TR' and bOnOppositeAng) then
|
elseif ( s_sOrigCorner == 'BR' and not bOnOppositeAng) or ( s_sOrigCorner == 'TR' and bOnOppositeAng) then
|
||||||
-- angolo BR
|
-- angolo BR
|
||||||
ptP1 = Point3d( RawPart.Len - b3PartX - dExtra, 0, 0)
|
ptP1 = Point3d( RawPart.Len - b3PartX - dExtra, 0, 0)
|
||||||
ptP2 = Point3d( RawPart.Len, b3PartY + dExtra, 0)
|
ptP2 = Point3d( RawPart.Len, b3PartY + dExtra, 0)
|
||||||
@@ -794,10 +811,9 @@ local function CreateDefectOnAngle( nPartId, RawPart, bDrillLong, bOnOppositeAng
|
|||||||
EgtSetName( PartTab.DefectId, "Defect")
|
EgtSetName( PartTab.DefectId, "Defect")
|
||||||
|
|
||||||
return PartTab
|
return PartTab
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
local function RotateOptimalCase( nPartId, nAngle, nAngleValidRot, RawPart, nPnt1, nPnt2)
|
local function RotateOptimalCase( nPartId, nAngle, nAngleValidRot, RawPart, nPnt1, nPnt2)
|
||||||
|
|
||||||
local bOptimal = false
|
local bOptimal = false
|
||||||
@@ -826,9 +842,9 @@ local function RotateOptimalCase( nPartId, nAngle, nAngleValidRot, RawPart, nPnt
|
|||||||
end
|
end
|
||||||
|
|
||||||
return nAnglePnt, nRotate, bOptimal
|
return nAnglePnt, nRotate, bOptimal
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
local function RotateOptimalCaseDrill( nPartId, bCanRotate, nPnt1, nPnt2)
|
local function RotateOptimalCaseDrill( nPartId, bCanRotate, nPnt1, nPnt2)
|
||||||
|
|
||||||
local nRotate = 0
|
local nRotate = 0
|
||||||
@@ -846,7 +862,7 @@ local function RotateOptimalCaseDrill( nPartId, bCanRotate, nPnt1, nPnt2)
|
|||||||
return nAnglePnt, nRotate
|
return nAnglePnt, nRotate
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Funzione che classifica i pezzi in base alla loro necessità di stare negli angoli
|
-- Funzione che classifica i pezzi in base alla loro necessità di stare negli angoli
|
||||||
local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheetWidth)
|
local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheetWidth)
|
||||||
|
|
||||||
@@ -942,8 +958,8 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
|||||||
-- se non ho venature e fori scelgo una posizione che non faccia cadere il pezzo
|
-- se non ho venature e fori scelgo una posizione che non faccia cadere il pezzo
|
||||||
if not bDrill and not bOnly180Rot and not bLockedRot then
|
if not bDrill and not bOnly180Rot and not bLockedRot then
|
||||||
b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
||||||
local bIsValid = b3Part:getDimX() > ( WD.INTRULLI or 1200)
|
local bIsValid = b3Part:getDimX() > s_dIntRulli
|
||||||
local bRotatedIsValid = b3Part:getDimY() > ( WD.INTRULLI or 1200)
|
local bRotatedIsValid = b3Part:getDimY() > s_dIntRulli
|
||||||
if not bIsValid and not bRotatedIsValid then
|
if not bIsValid and not bRotatedIsValid then
|
||||||
EgtSetInfo( nPartId, "REDUCECUT", 1)
|
EgtSetInfo( nPartId, "REDUCECUT", 1)
|
||||||
elseif not bIsValid or not bRotatedIsValid then
|
elseif not bIsValid or not bRotatedIsValid then
|
||||||
@@ -956,7 +972,6 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- lap joints
|
-- lap joints
|
||||||
local ResLapJoints = ClassifyLapJointsFromBottom( nPartId)
|
local ResLapJoints = ClassifyLapJointsFromBottom( nPartId)
|
||||||
b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
||||||
@@ -964,7 +979,7 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
|||||||
|
|
||||||
if ResLapJoints.Nbr > 0 and bLockedRot then
|
if ResLapJoints.Nbr > 0 and bLockedRot then
|
||||||
b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
||||||
if b3Part:getDimX() > ( WD.INTRULLI or 1200) then
|
if b3Part:getDimX() > s_dIntRulli then
|
||||||
EgtSetInfo( nPartId, "REDUCECUT", 1)
|
EgtSetInfo( nPartId, "REDUCECUT", 1)
|
||||||
end
|
end
|
||||||
local PartAngleClassification = { PartId = tostring( nPartId), Angle = 100, nRotate = 0, bDrill = true, bLongDrill = true}
|
local PartAngleClassification = { PartId = tostring( nPartId), Angle = 100, nRotate = 0, bDrill = true, bLongDrill = true}
|
||||||
@@ -1050,7 +1065,6 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
|||||||
nAngle = 100
|
nAngle = 100
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- no fori
|
-- no fori
|
||||||
else
|
else
|
||||||
if ResLapJoints.Nbr == 0 then
|
if ResLapJoints.Nbr == 0 then
|
||||||
@@ -1108,10 +1122,8 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
|||||||
nAngle, nRotate2 = RotateOptimalCase( nPartId, 0, 90, RawPart, 100, 100)
|
nAngle, nRotate2 = RotateOptimalCase( nPartId, 0, 90, RawPart, 100, 100)
|
||||||
nRotate = nRotate + nRotate2
|
nRotate = nRotate + nRotate2
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- aggiorno le info di rotazione del pezzo
|
-- aggiorno le info di rotazione del pezzo
|
||||||
if nRotate >= 360 then
|
if nRotate >= 360 then
|
||||||
nRotate = nRotate - 360
|
nRotate = nRotate - 360
|
||||||
@@ -1130,7 +1142,7 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
|||||||
|
|
||||||
local PartAngleClassification = { PartId = tostring( nPartId), Angle = nAngle, nRotate = nRotate, bDrill = bDrill, bLongDrill = bLongDrill, bManual = bManual}
|
local PartAngleClassification = { PartId = tostring( nPartId), Angle = nAngle, nRotate = nRotate, bDrill = bDrill, bLongDrill = bLongDrill, bManual = bManual}
|
||||||
|
|
||||||
local bCanBeOnOtherEdge = not bDrill or ( bDrill and RawPart.Width >= WD.MINRAWY_HOR_DRILL)
|
local bCanBeOnOtherEdge = not bDrill or ( bDrill and RawPart.Width > s_dMinRawYHorDrill - GEO.EPS_SMALL)
|
||||||
if bOnly180Rot then
|
if bOnly180Rot then
|
||||||
if bCanBeOnOtherEdge then
|
if bCanBeOnOtherEdge then
|
||||||
EgtSetInfo( nPartId, "NestAllowRot", 1)
|
EgtSetInfo( nPartId, "NestAllowRot", 1)
|
||||||
@@ -1143,14 +1155,14 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet
|
|||||||
|
|
||||||
-- verifico se il pezzo cade (caso di foro)
|
-- verifico se il pezzo cade (caso di foro)
|
||||||
b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
|
||||||
if b3Part:getDimX() > ( WD.INTRULLI or 1200) then
|
if b3Part:getDimX() > s_dIntRulli then
|
||||||
EgtSetInfo( nPartId, "REDUCECUT", 1)
|
EgtSetInfo( nPartId, "REDUCECUT", 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
return PartAngleClassification
|
return PartAngleClassification
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
local function ComputeRestrictedZones( RawParts)
|
local function ComputeRestrictedZones( RawParts)
|
||||||
|
|
||||||
local dTotArea = 0
|
local dTotArea = 0
|
||||||
@@ -1206,7 +1218,6 @@ local function ComputeRestrictedZones( RawParts)
|
|||||||
end
|
end
|
||||||
nAnglesNbrEstimate = nAnglesNbrEstimate + nAngelsNbrCorrection
|
nAnglesNbrEstimate = nAnglesNbrEstimate + nAngelsNbrCorrection
|
||||||
|
|
||||||
|
|
||||||
-- classificazione dei pezzi in base alla loro necessità di stare negli angoli
|
-- classificazione dei pezzi in base alla loro necessità di stare negli angoli
|
||||||
local nTotParts = 0
|
local nTotParts = 0
|
||||||
for _ in pairs( PART) do nTotParts = nTotParts + 1 end
|
for _ in pairs( PART) do nTotParts = nTotParts + 1 end
|
||||||
@@ -1215,7 +1226,7 @@ local function ComputeRestrictedZones( RawParts)
|
|||||||
for nPartId, nCount in pairs( PART) do
|
for nPartId, nCount in pairs( PART) do
|
||||||
nPartIndex = nPartIndex + 1
|
nPartIndex = nPartIndex + 1
|
||||||
local bManualRot = EgtGetInfo( nPartId, "MANUALROT", 'b')
|
local bManualRot = EgtGetInfo( nPartId, "MANUALROT", 'b')
|
||||||
local PartClassif = ClassifyAngles(tonumber(nPartId), RawParts[nMaxSheet], WD.ORIG_CORNER, bManualRot, dMinSheetWidth)
|
local PartClassif = ClassifyAngles(tonumber(nPartId), RawParts[nMaxSheet], s_sOrigCorner, bManualRot, dMinSheetWidth)
|
||||||
if PartClassif then
|
if PartClassif then
|
||||||
for nI = 1, nCount do
|
for nI = 1, nCount do
|
||||||
local newTab = {PartId = PartClassif.PartId, Angle = PartClassif.Angle, nRotate = PartClassif.nRotate, bDrill = PartClassif.bDrill, bLongDrill = PartClassif.bLongDrill, bManual = PartClassif.bManual}
|
local newTab = {PartId = PartClassif.PartId, Angle = PartClassif.Angle, nRotate = PartClassif.nRotate, bDrill = PartClassif.bDrill, bLongDrill = PartClassif.bLongDrill, bManual = PartClassif.bManual}
|
||||||
@@ -1230,7 +1241,6 @@ local function ComputeRestrictedZones( RawParts)
|
|||||||
|
|
||||||
table.sort( AngleClassification, function(a, b) return a.Angle > b.Angle end)
|
table.sort( AngleClassification, function(a, b) return a.Angle > b.Angle end)
|
||||||
|
|
||||||
|
|
||||||
local vManuallyDone = {}
|
local vManuallyDone = {}
|
||||||
local vPartsManuallyDone = {}
|
local vPartsManuallyDone = {}
|
||||||
for nInd = 1, #vSheetNbrEstimate do
|
for nInd = 1, #vSheetNbrEstimate do
|
||||||
@@ -1260,7 +1270,7 @@ local function ComputeRestrictedZones( RawParts)
|
|||||||
if dPartWidth < vFilledSheets[nInd2].Width then
|
if dPartWidth < vFilledSheets[nInd2].Width then
|
||||||
-- verifico se il grezzo aveva già un pezzo in un angolo
|
-- verifico se il grezzo aveva già un pezzo in un angolo
|
||||||
if abs( vFilledSheets[nInd2].Width - vFilledSheets[nInd2].OrigWidth) < GEO.EPS_SMALL then
|
if abs( vFilledSheets[nInd2].Width - vFilledSheets[nInd2].OrigWidth) < GEO.EPS_SMALL then
|
||||||
vFilledSheets[nInd2].Width = vFilledSheets[nInd2].Width - dPartWidth - WD.SIDEMILL_DIAM_DOWN
|
vFilledSheets[nInd2].Width = vFilledSheets[nInd2].Width - dPartWidth - s_dSideMillDiamDown
|
||||||
else
|
else
|
||||||
-- se il grezzo aveva già un pezzo nell'angolo, dopo il pezzo corrente non ne posso mettere altri
|
-- se il grezzo aveva già un pezzo nell'angolo, dopo il pezzo corrente non ne posso mettere altri
|
||||||
vFilledSheets[nInd2].Width = 0
|
vFilledSheets[nInd2].Width = 0
|
||||||
@@ -1283,7 +1293,8 @@ local function ComputeRestrictedZones( RawParts)
|
|||||||
local bOnlyOnRef = EgtGetInfo( AngleClassification[nInd].PartId, "OnlyOnRefSide", 'b')
|
local bOnlyOnRef = EgtGetInfo( AngleClassification[nInd].PartId, "OnlyOnRefSide", 'b')
|
||||||
local bCanBeOnOtherAngle = not bOnlyOnRef and
|
local bCanBeOnOtherAngle = not bOnlyOnRef and
|
||||||
( not AngleClassification[nInd].bDrill or
|
( not AngleClassification[nInd].bDrill or
|
||||||
( AngleClassification[nInd].bDrill and not AngleClassification[nInd].bLongDrill and RawParts[vManuallyDone[nInd2].RawPartId].Width >= WD.MINRAWY_HOR_DRILL))
|
( AngleClassification[nInd].bDrill and not AngleClassification[nInd].bLongDrill and
|
||||||
|
RawParts[vManuallyDone[nInd2].RawPartId].Width > s_dMinRawYHorDrill - GEO.EPS_SMALL))
|
||||||
|
|
||||||
if #(vManuallyDone[nInd2].Parts) == 0 then
|
if #(vManuallyDone[nInd2].Parts) == 0 then
|
||||||
-- verifico che il pezzo stia in questo grezzo
|
-- verifico che il pezzo stia in questo grezzo
|
||||||
@@ -1298,16 +1309,16 @@ local function ComputeRestrictedZones( RawParts)
|
|||||||
if not vManuallyDone[nInd2].Parts[1].bLongDrill then
|
if not vManuallyDone[nInd2].Parts[1].bLongDrill then
|
||||||
-- oriento il pezzo in modo ottimale per andare su quell'angolo
|
-- oriento il pezzo in modo ottimale per andare su quell'angolo
|
||||||
local sRefOrig
|
local sRefOrig
|
||||||
if WD.ORIG_CORNER == 'TL' then sRefOrig = 'BL' end
|
if s_sOrigCorner == 'TL' then sRefOrig = 'BL' end
|
||||||
if WD.ORIG_CORNER == 'BL' then sRefOrig = 'TL' end
|
if s_sOrigCorner == 'BL' then sRefOrig = 'TL' end
|
||||||
if WD.ORIG_CORNER == 'TR' then sRefOrig = 'BR' end
|
if s_sOrigCorner == 'TR' then sRefOrig = 'BR' end
|
||||||
if WD.ORIG_CORNER == 'BR' then sRefOrig = 'TR' end
|
if s_sOrigCorner == 'BR' then sRefOrig = 'TR' end
|
||||||
local bManTmp
|
local bManTmp
|
||||||
local res = ClassifyAngles( AngleClassification[nInd].PartId, RawParts[vManuallyDone[nInd2].RawPartId], sRefOrig, bManTmp, dMinSheetWidth)
|
local res = ClassifyAngles( AngleClassification[nInd].PartId, RawParts[vManuallyDone[nInd2].RawPartId], sRefOrig, bManTmp, dMinSheetWidth)
|
||||||
-- verifico sia compatibile con pezzo già inserito
|
-- verifico sia compatibile con pezzo già inserito
|
||||||
local b3OtherPart = EgtGetBBoxGlob( vManuallyDone[nInd2].Parts[1].Id, GDB_BB.STANDARD)
|
local b3OtherPart = EgtGetBBoxGlob( vManuallyDone[nInd2].Parts[1].Id, GDB_BB.STANDARD)
|
||||||
local b3Part = EgtGetBBoxGlob( AngleClassification[nInd].PartId, GDB_BB.STANDARD)
|
local b3Part = EgtGetBBoxGlob( AngleClassification[nInd].PartId, GDB_BB.STANDARD)
|
||||||
local dExtra = 2 * NEST.KERF + WD.SIDEMILL_DIAM_DOWN + 1
|
local dExtra = 2 * NEST.KERF + s_dSideMillDiamDown + 1
|
||||||
-- se è compatibile assegno questa rotazione al pezzo
|
-- se è compatibile assegno questa rotazione al pezzo
|
||||||
if b3Part:getDimY() + b3OtherPart:getDimY() + dExtra < RawParts[vManuallyDone[nInd2].RawPartId].Width then
|
if b3Part:getDimY() + b3OtherPart:getDimY() + dExtra < RawParts[vManuallyDone[nInd2].RawPartId].Width then
|
||||||
nIdx = nInd2
|
nIdx = nInd2
|
||||||
@@ -1379,8 +1390,7 @@ local function ComputeRestrictedZones( RawParts)
|
|||||||
return vManuallyDone, vPartsManuallyDone
|
return vManuallyDone, vPartsManuallyDone
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
|
|
||||||
-- Funzione che sposta e aggiunge pezzi per nesting
|
-- Funzione che sposta e aggiunge pezzi per nesting
|
||||||
local function AddRawParts(RawParts, vDoneManually)
|
local function AddRawParts(RawParts, vDoneManually)
|
||||||
|
|
||||||
@@ -1422,12 +1432,12 @@ local function AddRawParts(RawParts, vDoneManually)
|
|||||||
EgtSetName(SheetOutlineId, OUTLINE)
|
EgtSetName(SheetOutlineId, OUTLINE)
|
||||||
|
|
||||||
-- creo foglio per nesting
|
-- creo foglio per nesting
|
||||||
EgtAutoNestAddSheet( SheetPartId, SheetOutlineId, NEST.KERF, 1, RawParts[nIndex].Qty - nTotSheetWithDefects) -- EgtAutoNestAddSheet( SheetId, OutlineId, dKerf, nPriority, nCount)
|
EgtAutoNestAddSheet( SheetPartId, SheetOutlineId, NEST.KERF, 1, RawParts[nIndex].Qty - nTotSheetWithDefects)
|
||||||
|
-- EgtAutoNestAddSheet( SheetId, OutlineId, dKerf, nPriority, nCount)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
|
|
||||||
local function AddParts(RawParts, vPartsDoneManually)
|
local function AddParts(RawParts, vPartsDoneManually)
|
||||||
|
|
||||||
-- cerco la width massima dei grezzi
|
-- cerco la width massima dei grezzi
|
||||||
@@ -1507,54 +1517,6 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- aggiungo stato a lista stati del pezzo
|
|
||||||
-- table.insert( PartStates, { PartId = tonumber(nPartId), Flip = bFlip, Rotate = nRotate})
|
|
||||||
|
|
||||||
|
|
||||||
-- local bFtDown = false
|
|
||||||
-- local vPartProc = WE.CollectFeatures( nPartId, b3Raw)
|
|
||||||
-- for nInd = 1, #vPartProc do
|
|
||||||
-- if LapJoint.Identify( vPartProc[nInd]) then
|
|
||||||
-- local nFacOpt, dMinElev, nFacOpt2, dMinElev2 = WL.GetFaceWithMostAdj( vPartProc[nInd].Id, vPartProc[nInd].PartId)
|
|
||||||
-- if nFacOpt >= 0 then
|
|
||||||
-- local vtN = EgtSurfTmFacetNormVersor( vPartProc[nInd].Id, nFacOpt, GDB_ID.ROOT)
|
|
||||||
-- if vtN:getZ() < -0.09 then
|
|
||||||
-- bFtDown = true
|
|
||||||
-- break
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- LapJoint.FlipClassify(vPartProc[nInd])
|
|
||||||
-- end
|
|
||||||
-- -- ruoto se necessario
|
|
||||||
-- if bFtDown then
|
|
||||||
-- local b3Solid = EgtGetBBoxGlob(nPartId, GDB_BB.IGNORE_TEXT)
|
|
||||||
-- local ptRotCen = b3Solid:getCenter()
|
|
||||||
-- EgtRotate( nPartId, ptRotCen, X_AX(), 180, GDB_RT.GLOB)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- -- recupero le feature di lavorazione della parete
|
|
||||||
-- local bFtDown = false
|
|
||||||
-- local vPartProc = WE.CollectFeatures( nPartId, b3Raw)
|
|
||||||
-- for nInd = 1, #vPartProc do
|
|
||||||
-- if LapJoint.Identify( vPartProc[nInd]) then
|
|
||||||
-- local nFacOpt, dMinElev, nFacOpt2, dMinElev2 = WL.GetFaceWithMostAdj( vPartProc[nInd].Id, vPartProc[nInd].PartId)
|
|
||||||
-- if nFacOpt >= 0 then
|
|
||||||
-- local vtN = EgtSurfTmFacetNormVersor( vPartProc[nInd].Id, nFacOpt, GDB_ID.ROOT)
|
|
||||||
-- if vtN:getZ() < -0.09 then
|
|
||||||
-- bFtDown = true
|
|
||||||
-- break
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- -- ruoto se necessario
|
|
||||||
-- if bFtDown then
|
|
||||||
-- local b3Solid = EgtGetBBoxGlob(nPartId, GDB_BB.IGNORE_TEXT)
|
|
||||||
-- local ptRotCen = b3Solid:getCenter()
|
|
||||||
-- EgtRotate( nPartId, ptRotCen, X_AX(), 180, GDB_RT.GLOB)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- recupero vecchio contorno se già presente
|
-- recupero vecchio contorno se già presente
|
||||||
local nOutlineLayer = EgtGetFirstNameInGroup(nPartId, "Outline")
|
local nOutlineLayer = EgtGetFirstNameInGroup(nPartId, "Outline")
|
||||||
local nOldOutline = EgtGetFirstNameInGroup(nOutlineLayer, 'ON_TMP')
|
local nOldOutline = EgtGetFirstNameInGroup(nOutlineLayer, 'ON_TMP')
|
||||||
@@ -1604,31 +1566,6 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--local frSum = EgtSurfFlatRegion(nOutlineLayer, nOutline)
|
|
||||||
--EgtSaveFile("c:\\Temp\\ProvaNesting.nge")
|
|
||||||
-- -- per ogni contorno creo flat region e le sommo
|
|
||||||
-- for nIndex = 0, nCnt - 1 do
|
|
||||||
-- EgtScale( nOutline + nIndex, GLOB_FRM(), 1, 1, 0, GDB_RT.GLOB)
|
|
||||||
-- EgtModifyCurveExtrusion( nOutline + nIndex, Z_AX(), GDB_RT.GLOB)
|
|
||||||
-- local frCurr = EgtSurfFlatRegion(nOutlineLayer, nOutline + nIndex)
|
|
||||||
-- if frCurr then
|
|
||||||
-- if frSum then
|
|
||||||
-- EgtSurfFrAdd(frSum, frCurr)
|
|
||||||
-- else
|
|
||||||
-- frSum = frCurr
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- EgtErase(frCurr)
|
|
||||||
-- end
|
|
||||||
-- --EgtSaveFile("c:/Temp/ProvaNesting.nge")
|
|
||||||
-- -- calcolo contorno della flat region somma
|
|
||||||
-- nCurrOutline = EgtExtractSurfFrChunkLoops(frSum, 0, nOutlineLayer)
|
|
||||||
-- EgtErase(frSum)
|
|
||||||
-- -- cancello contorni
|
|
||||||
-- for nIndex = 0, nCnt do
|
|
||||||
-- EgtErase(nOutline + nIndex)
|
|
||||||
-- end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if nCurrOutline and nCurrOutline ~= GDB_ID.NULL then
|
if nCurrOutline and nCurrOutline ~= GDB_ID.NULL then
|
||||||
@@ -1642,37 +1579,6 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
EgtOutLog("Impossible creating silhouette for part " .. tostring(nPartId))
|
EgtOutLog("Impossible creating silhouette for part " .. tostring(nPartId))
|
||||||
nCnt = 1
|
nCnt = 1
|
||||||
end
|
end
|
||||||
--if nCnt == 0 then
|
|
||||||
-- -- se non ho trovato contorno, lo recupero dal Box
|
|
||||||
-- local nBoxLayer = EgtGetFirstNameInGroup(nPartId, "Box")
|
|
||||||
-- local nBox = EgtGetFirstNameInGroup(nBoxLayer, "Box")
|
|
||||||
-- local BBox = EgtGetBBoxGlob(nBox, GDB_BB.STANDARD)
|
|
||||||
-- nOutline = EgtRectangle2P(nOutlineLayer, Point3d( BBox:getMin():getX(), BBox:getMin():getY(), 0), Point3d( BBox:getMax():getX(), BBox:getMax():getY(), 0), GDB_RT.GLOB)
|
|
||||||
-- EgtOutLog("Impossible creating silhouette for part " .. tostring(nPartId))
|
|
||||||
--else
|
|
||||||
-- --EgtScale( nOutline, GLOB_FRM(), 1, 1, 0, GDB_RT.GLOB)
|
|
||||||
-- --EgtModifyCurveExtrusion( nOutline, Z_AX(), GDB_RT.GLOB)
|
|
||||||
-- --EgtSaveFile("c:/Temp/ProvaNesting.nge")
|
|
||||||
-- EgtScale( nOutline, GLOB_FRM(), 1, 1, 0, GDB_RT.GLOB)
|
|
||||||
-- EgtModifyCurveExtrusion( nOutline, Z_AX(), GDB_RT.GLOB)
|
|
||||||
-- local frSum = EgtSurfFlatRegion(nOutlineLayer, nOutline)
|
|
||||||
-- EgtSaveFile("c:\\Temp\\ProvaNesting.nge")
|
|
||||||
-- -- per ogni contorno creo flat region e le sommo
|
|
||||||
-- for nIndex = 1, nCnt - 1 do
|
|
||||||
-- EgtScale( nOutline + nIndex, GLOB_FRM(), 1, 1, 0, GDB_RT.GLOB)
|
|
||||||
-- EgtModifyCurveExtrusion( nOutline + nIndex, Z_AX(), GDB_RT.GLOB)
|
|
||||||
-- local frCurr = EgtSurfFlatRegion(nOutlineLayer, nOutline + nIndex)
|
|
||||||
-- if frCurr then
|
|
||||||
-- EgtSurfFrAdd(frSum, frCurr)
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- -- calcolo contorno della flat region somma
|
|
||||||
-- nOutline = EgtExtractSurfFrChunkLoops(frSum, 0, nOutlineLayer)
|
|
||||||
-- -- cancello contorni successivi
|
|
||||||
-- for nIndex = 1, nCnt do
|
|
||||||
-- EgtErase(nOutline + nIndex)
|
|
||||||
-- end
|
|
||||||
--end
|
|
||||||
|
|
||||||
EgtSetName( nOutline, 'ON_TMP')
|
EgtSetName( nOutline, 'ON_TMP')
|
||||||
EgtSetStatus( nOutline, 0)
|
EgtSetStatus( nOutline, 0)
|
||||||
@@ -1685,81 +1591,6 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
nCnt = #vOutlinesIds
|
nCnt = #vOutlinesIds
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--[[ local nOutline
|
|
||||||
local nTrimesh
|
|
||||||
local bFirst = true
|
|
||||||
local bSecond = false
|
|
||||||
local bUseBox = false
|
|
||||||
nTrimesh = EgtGetFirstNameInGroup( nOutlineLayer, "1-Out")
|
|
||||||
if not nTrimesh then
|
|
||||||
nTrimesh = EgtGetFirstNameInGroup( nOutlineLayer, "2-Out")
|
|
||||||
end
|
|
||||||
if not nTrimesh then
|
|
||||||
nTrimesh = EgtGetFirstNameInGroup( nOutlineLayer, "3-Out")
|
|
||||||
end
|
|
||||||
if not nTrimesh then
|
|
||||||
nTrimesh = EgtGetFirstNameInGroup( nOutlineLayer, "4-Out")
|
|
||||||
end
|
|
||||||
-- se trovato contorno
|
|
||||||
if nTrimesh then
|
|
||||||
-- recupero la curva associata
|
|
||||||
local nAuxId = EgtGetInfo(nTrimesh, "AUXID", 'i')
|
|
||||||
nOutline = nTrimesh + nAuxId
|
|
||||||
-- verifico che il contorno sia verticale
|
|
||||||
local nFacetCount = EgtSurfTmFacetCount(nTrimesh)
|
|
||||||
for nIndex = 0, nFacetCount - 1 do
|
|
||||||
local vtNorm = EgtSurfTmFacetNormVersor(nTrimesh, nIndex, GDB_ID.ROOT)
|
|
||||||
if abs( vtNorm:getZ()) > 10 * GEO.EPS_SMALL then
|
|
||||||
bUseBox = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se due compo o una e lati inclinati
|
|
||||||
if bUseBox then
|
|
||||||
-- calcolo box della trimesh
|
|
||||||
local b3Outline = EgtGetBBoxGlob(nTrimesh, GDB_BB.IGNORE_TEXT)
|
|
||||||
local ptP1 = Point3d( b3Outline:getMin():getX(), b3Outline:getMin():getY(), 0)
|
|
||||||
local ptP2 = Point3d( b3Outline:getMax():getX(), b3Outline:getMax():getY(), 0)
|
|
||||||
-- creo outline del box
|
|
||||||
nOutline = EgtRectangle2P(nOutlineLayer, ptP1, ptP2, GDB_RT.GLOB)
|
|
||||||
EgtSetStatus(nOutline, GDB_ST.OFF)
|
|
||||||
end
|
|
||||||
-- altrimenti cerco la regione sopra
|
|
||||||
else
|
|
||||||
-- cancello precedenti contorni calcolati
|
|
||||||
local nOldONId = EgtGetFirstNameInGroup( nOutlineLayer, 'ON_TMP')
|
|
||||||
if nOldONId then
|
|
||||||
EgtErase( nOldONId)
|
|
||||||
end
|
|
||||||
-- cerco la regione sopra
|
|
||||||
local nReg
|
|
||||||
for i = 1, 4 do
|
|
||||||
local sRegName = string.format( '%d-Top', i)
|
|
||||||
nReg = EgtGetFirstNameInGroup( nOutlineLayer, sRegName)
|
|
||||||
if nReg then
|
|
||||||
local vtNorm = EgtSurfFrNormVersor( nReg, GDB_ID.ROOT)
|
|
||||||
if vtNorm:getZ() > 0.99 then break end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if not nReg then
|
|
||||||
EgtOutLog("Errore: regione superiore non trovata")
|
|
||||||
end
|
|
||||||
-- recupero contorno della regione
|
|
||||||
local OutId, nCnt = EgtExtractSurfFrChunkLoops( nReg, 0, nOutlineLayer)
|
|
||||||
if OutId and nCnt > 1 then
|
|
||||||
for i = 2, nCnt do
|
|
||||||
EgtErase( OutId + i - 1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if OutId then
|
|
||||||
EgtSetName( OutId, 'ON_TMP')
|
|
||||||
nOutline = OutId
|
|
||||||
end
|
|
||||||
end
|
|
||||||
]]--
|
|
||||||
|
|
||||||
|
|
||||||
-- calcolo aree lavorazione
|
-- calcolo aree lavorazione
|
||||||
local nToolOutlineIds = ComputeToolOutlines( nPartId)
|
local nToolOutlineIds = ComputeToolOutlines( nPartId)
|
||||||
if bFlipNest and #nToolOutlineIds > 0 then
|
if bFlipNest and #nToolOutlineIds > 0 then
|
||||||
@@ -1774,7 +1605,7 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
-- aggiungo finestre
|
-- aggiungo finestre
|
||||||
for nInd = 1, nCnt - 1 do
|
for nInd = 1, nCnt - 1 do
|
||||||
local _, _, dArea = EgtCurveArea( nOutline + nInd)
|
local _, _, dArea = EgtCurveArea( nOutline + nInd)
|
||||||
if dArea and dArea > WD.NEST_HOLE_MIN_AREA then
|
if dArea and dArea > s_dNestHoleMinArea then
|
||||||
EgtModifyCurveExtrusion( nOutline + nInd, Z_AX(), GDB_RT.GLOB)
|
EgtModifyCurveExtrusion( nOutline + nInd, Z_AX(), GDB_RT.GLOB)
|
||||||
EgtAutoNestAddHoleToPart( nPartId, nOutline + nInd)
|
EgtAutoNestAddHoleToPart( nPartId, nOutline + nInd)
|
||||||
end
|
end
|
||||||
@@ -1802,7 +1633,7 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
-- punto di riferimento sul pezzo
|
-- punto di riferimento sul pezzo
|
||||||
local ptRef
|
local ptRef
|
||||||
local dval = 10
|
local dval = 10
|
||||||
if ( WD.ORIG_CORNER == 'TL' or WD.ORIG_CORNER == 'TR') then
|
if ( s_sOrigCorner == 'TL' or s_sOrigCorner == 'TR') then
|
||||||
ptRef = Point3d( b3Part:getMax():getX() - b3Part:getDimX() / 2, b3Part:getMax():getY() - dval, 0)
|
ptRef = Point3d( b3Part:getMax():getX() - b3Part:getDimX() / 2, b3Part:getMax():getY() - dval, 0)
|
||||||
else
|
else
|
||||||
ptRef = Point3d( b3Part:getMin():getX() + b3Part:getDimX() / 2, b3Part:getMin():getY() + dval, 0)
|
ptRef = Point3d( b3Part:getMin():getX() + b3Part:getDimX() / 2, b3Part:getMin():getY() + dval, 0)
|
||||||
@@ -1811,7 +1642,7 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
-- vincolo StripY
|
-- vincolo StripY
|
||||||
local bOnlyOnRefSide = EgtGetInfo( nPartId, "OnlyOnRefSide", 'b')
|
local bOnlyOnRefSide = EgtGetInfo( nPartId, "OnlyOnRefSide", 'b')
|
||||||
if bOnlyOnRefSide then
|
if bOnlyOnRefSide then
|
||||||
if WD.ORIG_CORNER == 'BL' or WD.ORIG_CORNER == 'BR' then
|
if s_sOrigCorner == 'BL' or s_sOrigCorner == 'BR' then
|
||||||
EgtAutoNestSetStripYconstraintToPart( nPartId, ptRef, NEST.KERF + dval + dStripYCorr, 100000)
|
EgtAutoNestSetStripYconstraintToPart( nPartId, ptRef, NEST.KERF + dval + dStripYCorr, 100000)
|
||||||
else
|
else
|
||||||
EgtAutoNestSetStripYconstraintToPart( nPartId, ptRef, - 1000, dRawMaxWidth + 1000 - ( NEST.KERF + dval - dStripYCorr))
|
EgtAutoNestSetStripYconstraintToPart( nPartId, ptRef, - 1000, dRawMaxWidth + 1000 - ( NEST.KERF + dval - dStripYCorr))
|
||||||
@@ -1822,7 +1653,7 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
|
|
||||||
-- se sull'angolo aggiungo anche vincolo StripX
|
-- se sull'angolo aggiungo anche vincolo StripX
|
||||||
if bOnAngle then
|
if bOnAngle then
|
||||||
if WD.ORIG_CORNER == 'TL' or WD.ORIG_CORNER == 'BL' then
|
if s_sOrigCorner == 'TL' or s_sOrigCorner == 'BL' then
|
||||||
EgtAutoNestSetStripXconstraintToPart( nPartId, ptRef, NEST.KERF + b3Part:getDimX() / 2 + dStripXCorr, 100000)
|
EgtAutoNestSetStripXconstraintToPart( nPartId, ptRef, NEST.KERF + b3Part:getDimX() / 2 + dStripXCorr, 100000)
|
||||||
else
|
else
|
||||||
EgtAutoNestSetStripXconstraintToPart( nPartId, ptRef, -100, RawParts[1].Len + 100 - NEST.KERF - b3Part:getDimX() / 2 + dStripXCorr)
|
EgtAutoNestSetStripXconstraintToPart( nPartId, ptRef, -100, RawParts[1].Len + 100 - NEST.KERF - b3Part:getDimX() / 2 + dStripXCorr)
|
||||||
@@ -1840,6 +1671,8 @@ local function AddParts(RawParts, vPartsDoneManually)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
------------------------------------------------------------------
|
||||||
|
------------------------------------------------------------------
|
||||||
-- Inizializzo contatori errori e avvisi
|
-- Inizializzo contatori errori e avvisi
|
||||||
local nErrCnt = 0
|
local nErrCnt = 0
|
||||||
local nWarnCnt = 0
|
local nWarnCnt = 0
|
||||||
@@ -1973,7 +1806,7 @@ if bNestingOk then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- aggiungo pezzi nestati a mano
|
-- aggiungo pezzi nestati a mano
|
||||||
nPartCount = 0
|
nPartCount = 0
|
||||||
for nInd = 1, #vDoneManually do
|
for nInd = 1, #vDoneManually do
|
||||||
if vDoneManually[nInd].SheetId == nId then
|
if vDoneManually[nInd].SheetId == nId then
|
||||||
@@ -2006,7 +1839,6 @@ if bNestingOk then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- altrimenti pezzo
|
-- altrimenti pezzo
|
||||||
@@ -2019,22 +1851,7 @@ if bNestingOk then
|
|||||||
if nMachGroup and nMachGroup ~= GDB_ID.NULL then
|
if nMachGroup and nMachGroup ~= GDB_ID.NULL then
|
||||||
-- creo pezzo copia
|
-- creo pezzo copia
|
||||||
local nPartDuploId = EgtDuploNew( nId)
|
local nPartDuploId = EgtDuploNew( nId)
|
||||||
-- applico flip e rotazioni fatte durante verifica posizionamento pezzo
|
|
||||||
-- local b3Part = EgtGetBBoxGlob( nPartDuploId, GDB_BB.STANDARD)
|
|
||||||
local nPartInd
|
local nPartInd
|
||||||
-- for nInd = 1, #PartStates do
|
|
||||||
-- if PartStates[nInd].PartId == nId then
|
|
||||||
-- -- if PartStates[nInd].Flip then
|
|
||||||
-- -- EgtRotate( nPartDuploId, b3Part:getCenter(), X_AX(), 180, GDB_RT.GLOB)
|
|
||||||
-- -- end
|
|
||||||
-- -- if PartStates[nInd].Rotate and PartStates[nInd].Rotate > 0 then
|
|
||||||
-- -- EgtRotate( nPartDuploId, b3Part:getCenter(), Z_AX(), PartStates[nInd].Rotate, GDB_RT.GLOB)
|
|
||||||
-- -- end
|
|
||||||
-- nPartInd = nInd
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- aggiungo le curve corrispondenti alle aree di lavorazione del pezzo
|
-- aggiungo le curve corrispondenti alle aree di lavorazione del pezzo
|
||||||
local sToolOutlines = EgtGetInfo( nId, "ToolOutlines", 's')
|
local sToolOutlines = EgtGetInfo( nId, "ToolOutlines", 's')
|
||||||
@@ -2076,7 +1893,6 @@ if bNestingOk then
|
|||||||
nPartFlip = EgtIf( nPartFlip == 180, 1, 0)
|
nPartFlip = EgtIf( nPartFlip == 180, 1, 0)
|
||||||
local nTotFlip = EgtIf( nPartFlip ~= nFlag, 180, 0)
|
local nTotFlip = EgtIf( nPartFlip ~= nFlag, 180, 0)
|
||||||
EgtSetInfo( nPartDuploId, "FLIP", nTotFlip)
|
EgtSetInfo( nPartDuploId, "FLIP", nTotFlip)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2133,7 +1949,6 @@ if bNestingOk then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- creo grezzi per ogni gruppo di lavorazione
|
-- creo grezzi per ogni gruppo di lavorazione
|
||||||
local MachGroupToTCnt = EgtGetMachGroupCount()
|
local MachGroupToTCnt = EgtGetMachGroupCount()
|
||||||
local MachGroupIndex = 0
|
local MachGroupIndex = 0
|
||||||
@@ -2159,7 +1974,7 @@ if bNestingOk then
|
|||||||
local nRawPartId = EgtGetFirstRawPart()
|
local nRawPartId = EgtGetFirstRawPart()
|
||||||
-- recupero box grezzo ridotto della tolleranza
|
-- recupero box grezzo ridotto della tolleranza
|
||||||
local b3Raw = EgtGetRawPartBBox( nRawPartId)
|
local b3Raw = EgtGetRawPartBBox( nRawPartId)
|
||||||
b3Raw:expand( - WD.INSIDE_RAW_TOL)
|
b3Raw:expand( - s_dInsideRawTol)
|
||||||
EgtOutLog( 'RawBox='..tostring( b3Raw))
|
EgtOutLog( 'RawBox='..tostring( b3Raw))
|
||||||
|
|
||||||
local nPartDuploId = EgtGetFirstPartInRawPart( nRawPartId)
|
local nPartDuploId = EgtGetFirstPartInRawPart( nRawPartId)
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
==== Wall Update Log ====
|
||||||
|
|
||||||
|
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/05/04
|
||||||
|
-- Gestione della versione di Wall
|
||||||
|
|
||||||
|
NAME = 'Wall'
|
||||||
|
VERSION = '2.5e1'
|
||||||
|
MIN_EXE = '2.5b3'
|
||||||
Reference in New Issue
Block a user