Compare commits
290 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a31c026430 | |||
| 982b07ad32 | |||
| f147f77133 | |||
| 9c5b23d15d | |||
| 62b1c186f7 | |||
| 55f4effbb6 | |||
| 70b9f9fe89 | |||
| 2ff160f555 | |||
| 7ff3a8eba6 | |||
| 59934d0fdf | |||
| df99424632 | |||
| 61b1375c00 | |||
| 07c76f60c8 | |||
| 2c88c295c8 | |||
| f0bd3d2e6f | |||
| a0d3bb9114 | |||
| 8f890f35e2 | |||
| 30e2028ebf | |||
| 04454ac44f | |||
| d73dbfbffb | |||
| b7ec0031e1 | |||
| d5f2422729 | |||
| 1c25ca7667 | |||
| f54cfa7eb3 | |||
| 8cef86ffd5 | |||
| 7402062859 | |||
| 36a663199c | |||
| b628a4200d | |||
| 0d3b3d1f04 | |||
| c490d5d388 | |||
| bc401eef07 | |||
| a93326e3cd | |||
| 6b5d7525a1 | |||
| 111a733365 | |||
| 7ce6ca9f13 | |||
| 6902620f5d | |||
| 7c6b5cf12c | |||
| 9c0d2111f5 | |||
| 19d8be5c9e | |||
| 41a05b4199 | |||
| ab48827689 | |||
| a859f170aa | |||
| 06f7fdb385 | |||
| 36d0e0c198 | |||
| e1dc521fe5 | |||
| 30fc2ab1a4 | |||
| dacf2c5860 | |||
| abb7735f9d | |||
| 2fb4338d50 | |||
| b0150f5b03 | |||
| 5802f26bbf | |||
| 3be500974a | |||
| 199c327151 | |||
| 5b6ed18a8e | |||
| f34367da55 | |||
| 6665209c66 | |||
| ea7e9dedac | |||
| b7b8f30a8c | |||
| 9ea1c502e8 | |||
| 4a4c5e7349 | |||
| 2c1831a678 | |||
| 5c4b609a56 | |||
| 295f8059c4 | |||
| b375b56f21 | |||
| 4a5d097256 | |||
| 9acb252f1b | |||
| 70505bcf29 | |||
| 35337836a5 | |||
| 12bfe2ac27 | |||
| 3ec2618f9b | |||
| b0e307d89d | |||
| 834a1261c5 | |||
| 0eea92b13d | |||
| 29f1af5216 | |||
| b18f7da20a | |||
| e9a82086e3 | |||
| d09069ad78 | |||
| 00078c65c1 | |||
| 303a69cbb3 | |||
| c762706e89 | |||
| 73f90eefe5 | |||
| 4951a4c5c2 | |||
| 688d43e463 | |||
| 300dea8f2c | |||
| ad6c7ef6af | |||
| bc33759c14 | |||
| 36cf8f6de8 | |||
| e6837d160b | |||
| 6c81ad1f1b | |||
| 5cde095b8e | |||
| 76381e27f7 | |||
| 73a970bc20 | |||
| bf6b888d27 | |||
| 4768c065ef | |||
| 133720bc34 | |||
| bad5b4aaa4 | |||
| 21768ed542 | |||
| e80e4e8a5d | |||
| c6566478e6 | |||
| 84d16b12a9 | |||
| 43900018dd | |||
| d6249a1f0f | |||
| 0954e86cc9 | |||
| 79b210def9 | |||
| acdceeb97f | |||
| 641aa5807d | |||
| f3c0987bc1 | |||
| 676815c32b | |||
| bcde9ae19c | |||
| 5004bc97b6 | |||
| c9cefa618e | |||
| dedf1366e6 | |||
| d72943e20b | |||
| 915f8973db | |||
| 6ee0d46ff5 | |||
| a4d06ff6c6 | |||
| bf9d0d2b8f | |||
| 0443133557 | |||
| 5c8f7dee7c | |||
| dabd2d2681 | |||
| 8bdde9e2bf | |||
| 2eccd38463 | |||
| 952190d792 | |||
| 9b32d12934 | |||
| a339d49066 | |||
| 3d58080915 | |||
| 2ef7e457c1 | |||
| 44a36c4acd | |||
| 7a602639ba | |||
| 260b8f36bb | |||
| 397251e9a3 | |||
| 0e0c78edf4 | |||
| 187a211491 | |||
| 5e9ff056c2 | |||
| 1f0905a34a | |||
| dbbdd9f0df | |||
| df1cb76993 | |||
| 6ee6ebd9be | |||
| 868161df0b | |||
| 240f2959fc | |||
| 5e5a4461ac | |||
| 4eec2dcf19 | |||
| c457ff9acf | |||
| 5f9fc0b975 | |||
| 51261d1231 | |||
| 7f807d6114 | |||
| cbccd14b64 | |||
| ac58afc627 | |||
| 1d68e47bdf | |||
| 1d802852bd | |||
| 01386ce711 | |||
| 4c4ae7bb6f | |||
| b66bd700f4 | |||
| 1c93a079bd | |||
| 000454139d | |||
| b460b2c7a4 | |||
| 65c344bb30 | |||
| 587f4c61e2 | |||
| cc63560b19 | |||
| d6813e4efa | |||
| 18ebaf8a16 | |||
| 60c489f70b | |||
| 270bca6bcc | |||
| 8ae94c1de6 | |||
| 3ec836ad9a | |||
| 479a28afb8 | |||
| 9cfccc29d6 | |||
| c344493daf | |||
| 9f68bbfeaf | |||
| 60a3731aa3 | |||
| 8c1b8cb346 | |||
| 3236f8bf73 | |||
| 47f716b3c1 | |||
| 81a12d2e98 | |||
| 3376f50024 | |||
| e3a42ec170 | |||
| d88dea71d8 | |||
| 5942332de8 | |||
| 64020f1f8d | |||
| 4578d461e0 | |||
| c9d25b6ee9 | |||
| 3be734753a | |||
| f0c1c37bc5 | |||
| 8949a511ee | |||
| e7619caaaf | |||
| ec69624941 | |||
| aba419a16e | |||
| 7db7ff1226 | |||
| 40dd008318 | |||
| 30f1a156d6 | |||
| 5e581096aa | |||
| 376f85d1f9 | |||
| 2124c7a25a | |||
| ef37486f34 | |||
| 711e6832c1 | |||
| 6eb3cd6429 | |||
| 091d710014 | |||
| 3f3e4db7f4 | |||
| dc2ea77a42 | |||
| 13c03ff601 | |||
| 9f73a85cd8 | |||
| 61f69ad50a | |||
| 16c3d8467d | |||
| df75f1c760 | |||
| 23afe7b256 | |||
| d5ebc24bf5 | |||
| dd21a0ec16 | |||
| 58c7d86f6b | |||
| 641bf33e4b | |||
| 3af41a8d4d | |||
| 9ec91b1409 | |||
| 79153f9051 | |||
| d486caa1a9 | |||
| e07dfbe0f3 | |||
| 33668827f7 | |||
| 8abea3a099 | |||
| 1ff8907b96 | |||
| 274ad495bc | |||
| 660d25ffc7 | |||
| b51737173e | |||
| fc8dff216d | |||
| 5792c3111d | |||
| cdfbd188fa | |||
| 4e98d2a2a4 | |||
| f4d9224d8d | |||
| 40c277b95d | |||
| 04e487f782 | |||
| 62e2cc8375 | |||
| c78bc69dd1 | |||
| 2db0d38ccb | |||
| 89fb2101bf | |||
| 40f5c67bf5 | |||
| b6de243461 | |||
| cc5d1f3e52 | |||
| 8491922f6d | |||
| aede7c527f | |||
| bab5cb6fd4 | |||
| de6ffa3d73 | |||
| 4c4ac340fb | |||
| bf454d6c0f | |||
| abfbc2184f | |||
| 4bbef85875 | |||
| 09b7496b9d | |||
| 24bc868527 | |||
| 8e8caf511a | |||
| 73cac99934 | |||
| 533575b916 | |||
| 5532174bf6 | |||
| cdab041283 | |||
| e303f8205d | |||
| 9aaaa5c1b1 | |||
| 6ae3f987af | |||
| f03d4c08af | |||
| 90b1215f31 | |||
| 2e25eb86e3 | |||
| 0a1c80d764 | |||
| 1077d19eea | |||
| 1ac895439b | |||
| d74091d7f3 | |||
| 0d8ac98869 | |||
| 8b231d7fd3 | |||
| 36bff56509 | |||
| 29eb50649d | |||
| bd503764ed | |||
| ad63364303 | |||
| 261f4115f4 | |||
| d945e92272 | |||
| 58dd72c963 | |||
| d4ed2d651f | |||
| 82d80616f1 | |||
| 05be6f1d89 | |||
| 0487b0ac9a | |||
| 580ff476e2 | |||
| ce3b623c14 | |||
| 4d57cc7c5b | |||
| fb57f47258 | |||
| dc301910e1 | |||
| 1a1a5192ee | |||
| 2561f79c39 | |||
| 123a983c75 | |||
| b9ceef6f31 | |||
| 39b72e3ab9 | |||
| 750ddd2c05 | |||
| 279a83b1f4 | |||
| e6704addb0 | |||
| 890b2a36e6 | |||
| 4468e24bb9 | |||
| ae4cd29853 | |||
| 478288b018 | |||
| bbd04a33a2 |
@@ -19,3 +19,5 @@
|
||||
/bin/*.ini
|
||||
/bin/LuaLibs/*.lua
|
||||
/bin/Images/*.png
|
||||
.vscode/settings.json
|
||||
bin/Images/.placeholder
|
||||
|
||||
+16
-13
@@ -2,7 +2,7 @@ variables:
|
||||
VERS_MAIN: '1.0'
|
||||
APP_NAME: 'Beam'
|
||||
NEW_REL: ''
|
||||
NET_SHARE_R: '\\10.74.82.201\EgwTech'
|
||||
NET_SHARE_X: '\\10.74.82.201\EgwTech'
|
||||
NET_SHARE_Z: '\\10.74.82.201\Artifacts'
|
||||
NET_USERQ: 'steamw\egalware'
|
||||
|
||||
@@ -34,29 +34,32 @@ variables:
|
||||
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
|
||||
}
|
||||
|
||||
# helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI
|
||||
# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
|
||||
.CodeReplicaR: &CodeReplicaR
|
||||
- |
|
||||
net use R: /delete
|
||||
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY . R:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
|
||||
net use X: /delete
|
||||
SLEEP 2
|
||||
net use R: /delete
|
||||
net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY . X:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
|
||||
SLEEP 2
|
||||
net use X: /delete
|
||||
|
||||
# helper copia script verso cartella di rete R:\ delle cartelle bin
|
||||
# helper copia script verso cartella di rete X:\ delle cartelle bin
|
||||
.ReplicaR: &ReplicaR
|
||||
- |
|
||||
net use R: /delete
|
||||
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY /MIR bin R:\EgtData\$env:APP_NAME\bin
|
||||
ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\bin\Images
|
||||
net use X: /delete
|
||||
SLEEP 2
|
||||
net use R: /delete
|
||||
net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY /MIR bin X:\EgtData\$env:APP_NAME\bin
|
||||
ROBOCOPY /MIR Images X:\EgtData\$env:APP_NAME\bin\Images
|
||||
SLEEP 2
|
||||
net use X: /delete
|
||||
|
||||
# helper copia script verso cartella di rete R:\ delle cartelle bin
|
||||
# helper copia script verso cartella di rete Z:\ delle cartelle bin
|
||||
.ReplicaZ: &ReplicaZ
|
||||
- |
|
||||
net use Z: /delete
|
||||
SLEEP 2
|
||||
net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD
|
||||
ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin
|
||||
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\bin\Images
|
||||
|
||||
+13
-7
@@ -1,4 +1,4 @@
|
||||
-- BatchProcess.lua by Egaltech s.r.l. 2022/04/28
|
||||
-- BatchProcess.lua by Egaltech s.r.l. 2022/05/10
|
||||
-- Gestione calcolo batch disposizione e lavorazioni per Travi
|
||||
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
|
||||
-- 2019/07/16 Aggiunta gestione modalità oltre 10 per impostazione macchina e uscita.
|
||||
@@ -23,6 +23,8 @@
|
||||
-- 2021/06/16 Se disponibile si aggiunge la versione dell'eseguibile alle info del programma CN.
|
||||
-- 2021/08/04 Direzione vista simulazione da BD.SIMUL_VIEW_DIR se esiste.
|
||||
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
|
||||
-- 2023/05/03 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
|
||||
-- 2022/05/10 Dopo aver fatto rotazioni e inversioni dei pezzi cambio chiave Info relative.
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
@@ -266,22 +268,26 @@ if bToProcess then
|
||||
vBeam[i].PosX = PosX
|
||||
end
|
||||
|
||||
-- Eseguo eventuali rotazioni e inversioni testa-coda
|
||||
-- Se non già eseguite, applico eventuali rotazioni e inversioni testa-coda
|
||||
for i = 1, #vBeam do
|
||||
local b3Solid = vBeam[i].Box
|
||||
-- rotazione
|
||||
local dRotAng = EgtGetInfo( vBeam[i].Id, 'ROTATED', 'd')
|
||||
if dRotAng and abs( dRotAng) > GEO.EPS_ANG_SMALL then
|
||||
local dRotAng = EgtGetInfo( vBeam[i].Id, 'ROTATED', 'd') or 0
|
||||
if abs( dRotAng) > GEO.EPS_ANG_SMALL then
|
||||
local ptRotCen = b3Solid:getCenter()
|
||||
EgtRotate( vBeam[i].Id, ptRotCen, X_AX(), dRotAng, GDB_RT.GLOB)
|
||||
b3Solid:rotate( ptRotCen, X_AX(), dRotAng)
|
||||
end
|
||||
EgtRemoveInfo( vBeam[i].Id, 'ROTATED')
|
||||
EgtSetInfo( vBeam[i].Id, 'ROTATED_OK', dRotAng)
|
||||
-- inversione
|
||||
local dInvAng = 180 - ( EgtGetInfo( vBeam[i].Id, 'INVERTED', 'd') or 0)
|
||||
if abs( dInvAng) > GEO.EPS_ANG_SMALL then
|
||||
local ptInvCen = b3Solid:getCenter()
|
||||
EgtRotate( vBeam[i].Id, ptInvCen, Z_AX(), dInvAng, GDB_RT.GLOB)
|
||||
end
|
||||
EgtRemoveInfo( vBeam[i].Id, 'INVERTED')
|
||||
EgtSetInfo( vBeam[i].Id, 'INVERTED_OK', 180 - dInvAng)
|
||||
end
|
||||
|
||||
-- Ne verifico le dimensioni
|
||||
@@ -291,8 +297,8 @@ if bToProcess then
|
||||
for i = 2, #vBeam do
|
||||
local dDimW = vBeam[i].Box:getDimY()
|
||||
local dDimH = vBeam[i].Box:getDimZ()
|
||||
if ( abs( dDimW - dRawW) > 10 * GEO.EPS_SMALL or abs( dDimH - dRawH) > 10 * GEO.EPS_SMALL) and
|
||||
( abs( dDimH - dRawW) > 10 * GEO.EPS_SMALL or abs( dDimW - dRawH) > 10 * GEO.EPS_SMALL) then
|
||||
if ( abs( dDimW - dRawW) > 100 * GEO.EPS_SMALL or abs( dDimH - dRawH) > 100 * GEO.EPS_SMALL) and
|
||||
( abs( dDimH - dRawW) > 100 * GEO.EPS_SMALL or abs( dDimW - dRawH) > 100 * GEO.EPS_SMALL) then
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
end
|
||||
@@ -496,7 +502,7 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
|
||||
BEAM.MSG = 'Axis outstroke ' .. sErr
|
||||
elseif nErr == MCH_SHE.SPECIAL then
|
||||
BEAM.ERR = 24
|
||||
BEAM.MSG = 'Clamp move error ' .. sErr
|
||||
BEAM.MSG = 'Special error ' .. sErr
|
||||
else
|
||||
BEAM.ERR = 25
|
||||
BEAM.MSG = 'General failure (contact supplier)'
|
||||
|
||||
+1
-1
@@ -600,7 +600,7 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
|
||||
BEAM.MSG = 'Axis outstroke ' .. sErr
|
||||
elseif nErr == MCH_SHE.SPECIAL then
|
||||
BEAM.ERR = 24
|
||||
BEAM.MSG = 'Clamp move error ' .. sErr
|
||||
BEAM.MSG = 'Special error ' .. sErr
|
||||
else
|
||||
BEAM.ERR = 25
|
||||
BEAM.MSG = 'General failure (contact supplier)'
|
||||
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
|
||||
REM Compilazione degli script Beam Egaltech 2023.01.11
|
||||
REM Compilazione degli script Beam Egaltech 2023.09.26
|
||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||
|
||||
REM Compilazione 32 e 64 bit
|
||||
@@ -9,6 +9,7 @@ REM Compilazione 32 e 64 bit
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua LuaLibs\DiceCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua LuaLibs\FaceByPocket.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua LuaLibs\FacesBySaw.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FeatureTopology.lua LuaLibs\FeatureTopology.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua LuaLibs\MachiningLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua LuaLibs\ProcessBlockHausFront.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua LuaLibs\ProcessChamfer.lua
|
||||
@@ -50,3 +51,4 @@ REM Compilazione 32 e 64 bit
|
||||
\EgtProg\Dll32\luac54 -o bin\Process.lua Process.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Rotate.lua Rotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Swap.lua Swap.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Version.lua Version.lua
|
||||
|
||||
+143
-80
@@ -1,4 +1,4 @@
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2022/12/28
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2023/03/31
|
||||
-- Libreria esecuzione lavorazioni per Travi
|
||||
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
|
||||
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
|
||||
@@ -41,7 +41,14 @@
|
||||
-- 2022/12/28 Implementata gestione forature e code di rondine in doppio.
|
||||
-- 2023/01/31 Implementata gestione mortase in doppio.
|
||||
-- 2023/01/31 Nelle lavorazioni in doppio aggiunta la minima distanza tra le feature.
|
||||
|
||||
-- 2023/02/17 Ora le forature che intersecano le mortase sono sempre fatte prima della mortasa stessa.
|
||||
-- 2023/02/17 Nelle tasche in doppio, la distanza minima ammessa tra le feature è stata portata a 50.
|
||||
-- 2023/02/20 Ora le mortase a coda di rondine laterali sono sempre fatte prima dei tagli longitudinali.
|
||||
-- 2023/03/31 Corretto ordinamento per fori di coda da lasciare in coda.
|
||||
-- 2023/07/31 Corretto errore nelle mortase in doppio.
|
||||
-- 2023/09/13 Aggiunta ClassifyTopology per la classificazione topologica delle feature. In CollectFeatures aggiunta la raccolta preliminare di alcune informazioni.
|
||||
-- 2022/09/26 Funzione IsFeatureCuttingEntireSection spostata in BeamLib
|
||||
-- 2022/09/26 In ClassifyTopology aggiunto passaggio del parametro nRawId
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamExec = {}
|
||||
@@ -98,6 +105,7 @@ _G.package.loaded.ProcessFreeContour = nil
|
||||
_G.package.loaded.ProcessDecor = nil
|
||||
local ML = require( 'MachiningLib')
|
||||
local BL = require( 'BeamLib')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
local DC = require( 'DiceCut')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local Hcut= require( 'ProcessHeadCut')
|
||||
@@ -243,12 +251,6 @@ local function IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
return false
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
||||
local function IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
|
||||
return ((abs(b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
local dRawW = b3Raw:getDimY()
|
||||
@@ -276,6 +278,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
local nAddMainId = EgtGetInfo( ProcId, 'MAINID', 'i')
|
||||
if nGrp and nPrc and nDo == 1 then
|
||||
local Proc = {}
|
||||
Proc.PartId = PartId
|
||||
Proc.Id = ProcId
|
||||
Proc.Grp = nGrp
|
||||
Proc.Prc = nPrc
|
||||
@@ -293,10 +296,19 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
Proc.MainId = Proc.Id + nAddMainId
|
||||
end
|
||||
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
||||
if b3Raw then
|
||||
-- recupero l'elenco delle facce della parte interessate dalla feature
|
||||
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
||||
-- recupero informazioni sulle facce della feature
|
||||
Proc.Face = {}
|
||||
for i = 1, Proc.Fct do
|
||||
Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT ), Elevation = BL.GetFaceElevation( Proc.Id, i - 1, PartId)}
|
||||
end
|
||||
end
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||
Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
if Proc.Fct == 1 and IsFeatureCuttingEntireSection( Proc.Box , dRawW, dRawH) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
|
||||
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
|
||||
if Proc.Head and Proc.Box:getCenter():getX() < dMachineBeforeIntersectingDrillingsXHead then
|
||||
dMachineBeforeIntersectingDrillingsXHead = Proc.Box:getCenter():getX()
|
||||
nMachineBeforeIntersectingDrillingsIdHead = Proc.Id
|
||||
@@ -320,6 +332,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
Proc.Tail = Drill.IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
-- definisco dati seconda parte
|
||||
local Proc2 = {}
|
||||
Proc2.PartId = PartId
|
||||
Proc2.Id = ProcId
|
||||
Proc2.Grp = nGrp
|
||||
Proc2.Prc = nPrc
|
||||
@@ -339,7 +352,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
end
|
||||
-- se BlockHaus HalfLap
|
||||
elseif Proc.Prc == 37 then
|
||||
local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, PartId)
|
||||
local nFacInd = BL.GetFaceWithMostAdj( Proc, PartId)
|
||||
if nFacInd then
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if vtN then
|
||||
@@ -383,7 +396,7 @@ local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
end
|
||||
if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then
|
||||
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
||||
bHeadFinishingNeeded = not IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
bHeadFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
end
|
||||
end
|
||||
return bHeadFinishingNeeded, nReplacedFeatureId
|
||||
@@ -406,7 +419,7 @@ local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
end
|
||||
if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then
|
||||
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
||||
bTailFinishingNeeded = not IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
bTailFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
end
|
||||
end
|
||||
return bTailFinishingNeeded, nReplacedFeatureId
|
||||
@@ -647,11 +660,11 @@ local function PrintFeatures( vProc, b3Raw)
|
||||
EgtOutLog( ' RawBox=' .. tostring( b3Raw))
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s',
|
||||
local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s TopoName=%s',
|
||||
Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId,
|
||||
Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Side, 'T', 'F'),
|
||||
EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', EgtIf( Proc.AdvTail, 'A', 'F')),
|
||||
Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box))
|
||||
Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box), Proc.TopologyLongName or '')
|
||||
-- info speciali per Block Haus Half Lap
|
||||
if Proc.Prc == 37 then
|
||||
local sSpec = string.format( ' N=%s Hd=%s', tostring( Proc.vtN or V_NULL()), EgtIf( Proc.HeadDir, 'T', 'F'))
|
||||
@@ -694,31 +707,6 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if B1.Head ~= B2.Head then
|
||||
return B1.Head
|
||||
end
|
||||
-- se primo è foro e secondo è un ribasso, il foro va sempre prima
|
||||
if Drill.Identify(B1) and LapJoint.Identify(B2) and
|
||||
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
||||
return true
|
||||
end
|
||||
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo
|
||||
if LapJoint.Identify(B1) and Drill.Identify(B2) and
|
||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||
return false
|
||||
end
|
||||
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
|
||||
if ( Tenon.Identify( B1) or DtTenon.Identify( B1)) and ( Tenon.Identify( B2) or DtTenon.Identify( B2)) and
|
||||
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
||||
return ( ( B1.Prc == 50 or B1.Prc == 55) and B2.Prc == 52)
|
||||
end
|
||||
-- se primo house mortise, secondo mortise e si intersecano, metto prima house mortise
|
||||
if Mortise.Identify( B1) and B1.Prc == 53 and ( Mortise.Identify( B2) or DtMortise.Identify( B2)) and B2.Prc ~= 53 and
|
||||
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
-- se primo mortise, secondo house mortise e si intersecano, metto prima house mortise
|
||||
if ( Mortise.Identify( B1) or DtMortise.Identify( B1)) and B1.Prc ~= 53 and Mortise.Identify( B2) and B2.Prc == 53 and
|
||||
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
||||
return false
|
||||
end
|
||||
-- se entrambi di testa e primo è scasso o mortasa e secondo no va messo dopo
|
||||
if B1.Head and B2.Head and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and
|
||||
not ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) then
|
||||
@@ -729,14 +717,6 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
not ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) then
|
||||
return true
|
||||
end
|
||||
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
|
||||
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
|
||||
return false
|
||||
end
|
||||
-- se secondo è feature di coda e l'altro è separazione o non è feature di coda
|
||||
if B2.Tail and ( Split.Identify( B1) or not B1.Tail) then
|
||||
return true
|
||||
end
|
||||
-- se primo è feature di coda anticipata e l'altro non è feature di coda
|
||||
if B1.AdvTail and ( not Split.Identify( B2) or not B2.Tail) then
|
||||
return false
|
||||
@@ -745,6 +725,14 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if B2.AdvTail and ( not Split.Identify( B1) or not B1.Tail) then
|
||||
return true
|
||||
end
|
||||
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
|
||||
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
|
||||
return false
|
||||
end
|
||||
-- se secondo è feature di coda e l'altro è separazione o non è feature di coda
|
||||
if B2.Tail and ( Split.Identify( B1) or not B1.Tail) then
|
||||
return true
|
||||
end
|
||||
-- se primo è scasso o mortasa di coda e secondo no, sempre dopo
|
||||
if B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and
|
||||
not ( B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2))) then
|
||||
@@ -772,6 +760,16 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if abs( B2.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
|
||||
return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX())
|
||||
end
|
||||
-- se primo è foro e secondo è un ribasso, il foro va sempre prima
|
||||
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and
|
||||
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
||||
return true
|
||||
end
|
||||
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo
|
||||
if (LapJoint.Identify(B1) or Mortise.Identify(B1)) and Drill.Identify(B2) and
|
||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||
return false
|
||||
end
|
||||
-- se primo è foro e l'altro no, lo penalizzo
|
||||
if B1.Prc == 40 and B2.Prc ~= 40 then
|
||||
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
|
||||
@@ -780,6 +778,31 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if B1.Prc ~= 40 and B2.Prc == 40 then
|
||||
return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX())
|
||||
end
|
||||
-- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima
|
||||
if DtMortise.SideIdentify(B1) and ( LongCut.Identify(B2) or Long2Cut.Identify(B2)) and
|
||||
OverlapsX( B1.Box, B2.Box) then
|
||||
return true
|
||||
end
|
||||
-- se primo è taglio longitudinale e seconda è mortasa coda di rondine sul fianco, il taglio longitudinale va sempre dopo
|
||||
if ( LongCut.Identify(B1) or Long2Cut.Identify(B1)) and DtMortise.SideIdentify(B2) and
|
||||
OverlapsX( B1.Box, B2.Box) then
|
||||
return false
|
||||
end
|
||||
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
|
||||
if ( Tenon.Identify( B1) or DtTenon.Identify( B1)) and ( Tenon.Identify( B2) or DtTenon.Identify( B2)) and
|
||||
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
||||
return ( ( B1.Prc == 50 or B1.Prc == 55) and B2.Prc == 52)
|
||||
end
|
||||
-- se primo house mortise, secondo mortise e si intersecano, metto prima house mortise
|
||||
if Mortise.Identify( B1) and B1.Prc == 53 and ( Mortise.Identify( B2) or DtMortise.Identify( B2)) and B2.Prc ~= 53 and
|
||||
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
-- se primo mortise, secondo house mortise e si intersecano, metto prima house mortise
|
||||
if ( Mortise.Identify( B1) or DtMortise.Identify( B1)) and B1.Prc ~= 53 and Mortise.Identify( B2) and B2.Prc == 53 and
|
||||
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
||||
return false
|
||||
end
|
||||
-- se entrambi fori con posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs)
|
||||
if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < dSmallDrillRange then
|
||||
if abs( B1.Diam - B2.Diam) < 1.0 then
|
||||
@@ -960,7 +983,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
||||
local bDownSideOnHeadOk = false
|
||||
|
||||
if Proc.MachineBeforeIntersectingDrillings then
|
||||
table.Insert ( vMachineBeforeIntersectingDrillingsId, Proc.Id)
|
||||
table.insert( vMachineBeforeIntersectingDrillingsId, Proc.Id)
|
||||
end
|
||||
|
||||
-- se senza geometria (già disabilitato)
|
||||
@@ -1123,6 +1146,20 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
||||
return bAllOk, bSomeDown, bSomeSide, bSplitRot
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function ClassifyTopology( vProc, nRawId)
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
local nRecognized = 0
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
if Topology.Classify( Proc, b3Raw) then
|
||||
nRecognized = nRecognized + 1
|
||||
end
|
||||
end
|
||||
|
||||
return nRecognized
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
||||
local bOk = true
|
||||
@@ -1382,16 +1419,14 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Controlla se la feature ProcMirror è la specchiata di Proc, per feature di tipo tasca o simile
|
||||
local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId)
|
||||
|
||||
|
||||
-- recupero i dati geometrici della curva Proc
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
|
||||
local rfDtMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB)
|
||||
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
|
||||
local b3Proc = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
|
||||
-- determino l'asse della curva Proc
|
||||
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
|
||||
|
||||
|
||||
-- recupero e verifico l'entità curva ProcMirror
|
||||
local AuxIdMirror = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i')
|
||||
if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.Id end
|
||||
@@ -1407,35 +1442,49 @@ local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId)
|
||||
local ptBCMirror = EgtGP( AuxIdMirror, GDB_RT.GLOB)
|
||||
local b3DtMrtMirror = EgtGetBBoxRef( ProcMirror.Id, GDB_BB.STANDARD, rfDtMrt)
|
||||
local b3ProcMirror = EgtGetBBoxGlob( ProcMirror.Id, GDB_BB.STANDARD)
|
||||
-- determino l'asse della curva ProcMirror
|
||||
local vtAxMirror = EgtEV( AuxIdMirror, GDB_RT.GLOB) - EgtSV( AuxIdMirror, GDB_RT.GLOB)
|
||||
|
||||
-- verifico se le mortase sono specchiate
|
||||
local bIsMirror = true
|
||||
|
||||
-- verifico se le mortase sono specchiate :
|
||||
-- devono avere estrusioni opposte
|
||||
if not AreOppositeVectorApprox( vtExtr, vtExtrMirror) then
|
||||
return false
|
||||
end
|
||||
-- se di tipo Dt, devono avere l'asse allineato
|
||||
if DtMortise.SideIdentify( Proc) or DtMortise.SideIdentify( ProcMirror) then
|
||||
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
|
||||
local vtAxMirror = EgtEV( AuxIdMirror, GDB_RT.GLOB) - EgtSV( AuxIdMirror, GDB_RT.GLOB)
|
||||
if not AreSameVectorApprox( vtAx, vtAxMirror) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- devono avere il centro allineato, essere equidistanti dalla mezzaria trave e non essere troppo vicine
|
||||
local vtDisplacement = ptBC - ptBCMirror
|
||||
local ptCenRaw = b3Raw:getCenter()
|
||||
local dYMinDistance = EgtIf( ptBC:getY() > ptBCMirror:getY(), abs( b3ProcMirror:getMax():getY() - b3Proc:getMin():getY()), abs( b3Proc:getMax():getY() - b3ProcMirror:getMin():getY()))
|
||||
local dZMinDistance = EgtIf( ptBC:getZ() > ptBCMirror:getZ(), abs( b3ProcMirror:getMax():getZ() - b3Proc:getMin():getZ()), abs( b3Proc:getMax():getZ() - b3ProcMirror:getMin():getZ()))
|
||||
local dMinimumDistanceMirroredFeatures = 60
|
||||
-- controllo che il centro delle due mortase sia allineato, che queste siano equidistanti dalla mezzeria della trave
|
||||
-- e che queste non siano troppo vicine
|
||||
local dMinimumDistanceMirroredFeatures = 50
|
||||
if AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then
|
||||
bIsMirror = abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 500 * GEO.EPS_SMALL and
|
||||
( abs( ptBC:getY() - ptCenRaw:getY()) - abs( ptBCMirror:getY() - ptCenRaw:getY())) < 500 * GEO.EPS_SMALL and
|
||||
dYMinDistance - dMinimumDistanceMirroredFeatures > 10 * GEO.EPS_SMALL
|
||||
local dYMinDistance = max( b3Proc:getMin():getY(), b3ProcMirror:getMin():getY()) - min( b3Proc:getMax():getY(), b3ProcMirror:getMax():getY())
|
||||
if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 500 * GEO.EPS_SMALL and
|
||||
( abs( ptBC:getY() - ptCenRaw:getY()) - abs( ptBCMirror:getY() - ptCenRaw:getY())) < 500 * GEO.EPS_SMALL and
|
||||
dYMinDistance > dMinimumDistanceMirroredFeatures + 10 * GEO.EPS_SMALL) then
|
||||
return false
|
||||
end
|
||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
bIsMirror = abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 500 * GEO.EPS_SMALL and
|
||||
( abs( ptBC:getZ() - ptCenRaw:getZ()) - abs( ptBCMirror:getZ() - ptCenRaw:getZ())) < 500 * GEO.EPS_SMALL and
|
||||
dZMinDistance - dMinimumDistanceMirroredFeatures > 10 * GEO.EPS_SMALL
|
||||
local dZMinDistance = max( b3Proc:getMin():getZ(), b3ProcMirror:getMin():getZ()) - min( b3Proc:getMax():getZ(), b3ProcMirror:getMax():getZ())
|
||||
if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 500 * GEO.EPS_SMALL and
|
||||
( abs( ptBC:getZ() - ptCenRaw:getZ()) - abs( ptBCMirror:getZ() - ptCenRaw:getZ())) < 500 * GEO.EPS_SMALL and
|
||||
dZMinDistance > dMinimumDistanceMirroredFeatures + 10 * GEO.EPS_SMALL) then
|
||||
return false
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
-- devono avere box con le stesse dimensioni
|
||||
if not ( abs( b3DtMrt:getDimX() - b3DtMrtMirror:getDimX()) < 500 * GEO.EPS_SMALL and
|
||||
abs( b3DtMrt:getDimY() - b3DtMrtMirror:getDimY()) < 500 * GEO.EPS_SMALL and
|
||||
abs( b3DtMrt:getDimZ() - b3DtMrtMirror:getDimZ()) < 500 * GEO.EPS_SMALL) then
|
||||
return false
|
||||
end
|
||||
-- controllo che le dimensioni dei due box siano le stesse
|
||||
bIsMirror = bIsMirror and abs( b3DtMrt:getDimX() - b3DtMrtMirror:getDimX()) < 500 * GEO.EPS_SMALL and
|
||||
abs( b3DtMrt:getDimY() - b3DtMrtMirror:getDimY()) < 500 * GEO.EPS_SMALL and
|
||||
abs( b3DtMrt:getDimZ() - b3DtMrtMirror:getDimZ()) < 500 * GEO.EPS_SMALL
|
||||
-- controllo che l'asse delle due mortase sia allineato
|
||||
bIsMirror = bIsMirror and AreSameVectorApprox( vtAx, vtAxMirror)
|
||||
|
||||
return bIsMirror
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -1480,11 +1529,11 @@ local function VerifyMortiseMirrored( Proc, vProc, b3Raw)
|
||||
local sPockType = 'Mortise'
|
||||
local sPocketing
|
||||
if Proc.Prc ~= 53 then
|
||||
sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false)
|
||||
sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false, true)
|
||||
end
|
||||
if not sPocketing then
|
||||
sPockType = 'Pocket'
|
||||
sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false)
|
||||
sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false, true)
|
||||
end
|
||||
if not sPocketing or not EgtMdbSetCurrMachining( sPocketing) then
|
||||
return
|
||||
@@ -1495,7 +1544,7 @@ local function VerifyMortiseMirrored( Proc, vProc, b3Raw)
|
||||
end
|
||||
-- recupero eventuale utensile in doppio e suo diametro
|
||||
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
|
||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
|
||||
return
|
||||
end
|
||||
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
||||
@@ -1564,7 +1613,7 @@ local function VerifyDtMortiseMirrored( Proc, vProc, b3Raw)
|
||||
end
|
||||
-- recupero eventuale utensile in doppio e suo diametro
|
||||
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
|
||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
|
||||
return
|
||||
end
|
||||
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
||||
@@ -1645,7 +1694,7 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
|
||||
local dToolTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
-- recupero eventuale utensile in doppio, suo diametro e massima lavorazione
|
||||
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
|
||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
|
||||
return
|
||||
end
|
||||
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
||||
@@ -1790,6 +1839,8 @@ function BeamExec.ProcessFeatures()
|
||||
if BD.TWO_EQUAL_HEADS or BD.DOWN_HEAD then
|
||||
SetMirroredFeatures( vProc, b3Raw)
|
||||
end
|
||||
-- classifico topologicamente le feature
|
||||
ClassifyTopology( vProc, nRawId)
|
||||
-- le ordino lungo X
|
||||
OrderFeatures( vProc, b3Raw)
|
||||
-- le classifico
|
||||
@@ -1820,11 +1871,15 @@ function BeamExec.ProcessFeatures()
|
||||
nRId = EgtGetNextRawPart( nRId)
|
||||
end
|
||||
EgtSetInfo( nDispId, 'ROT', -2)
|
||||
-- flag feature precedente in doppio
|
||||
local nPrevDouble = 0
|
||||
-- inserisco le lavorazioni da lavorare ribaltate
|
||||
for i = 1, #vProc do
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and Proc.Down then
|
||||
Proc.PrevDouble = nPrevDouble
|
||||
nPrevDouble = Proc.Double
|
||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
@@ -1892,12 +1947,16 @@ function BeamExec.ProcessFeatures()
|
||||
nRId = EgtGetNextRawPart( nRId)
|
||||
end
|
||||
EgtSetInfo( nDispId, 'ROT', -1)
|
||||
-- flag feature precedente in doppio
|
||||
local nPrevDouble = 0
|
||||
-- inserisco le lavorazioni da lavorare ruotate
|
||||
local nSideMchOk = 0
|
||||
for i = 1, #vProc do
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and Proc.Side then
|
||||
Proc.PrevDouble = nPrevDouble
|
||||
nPrevDouble = Proc.Double
|
||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
@@ -1954,11 +2013,15 @@ function BeamExec.ProcessFeatures()
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
end
|
||||
sDownOrSideOrStd = 'STD'
|
||||
-- flag feature precedente in doppio
|
||||
local nPrevDouble = 0
|
||||
-- inserisco le lavorazioni non ribaltate della trave
|
||||
for i = 1, #vProc do
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then
|
||||
Proc.PrevDouble = nPrevDouble
|
||||
nPrevDouble = Proc.Double
|
||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
|
||||
+219
-190
@@ -1,4 +1,4 @@
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2023/01/20
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2023/03/22
|
||||
-- Libreria globale per Travi
|
||||
-- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto.
|
||||
-- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm.
|
||||
@@ -20,6 +20,12 @@
|
||||
-- 2023/01/10 In GetFaceWithMostAdj aggiunta verifica che la feature abbia almeno una faccia aperta.
|
||||
-- 2023/01/20 Modificata PutStartNearestToEdge per gestire lato preferito come Y+, Y-, z*, Z-. Aggiunta funzione GetDistanceToNextPart.
|
||||
-- 2023/01/31 Aggiunta funzione ConvertToClosedCurve, precedentemente parte di ProcessMortise.Make
|
||||
-- 2023/02/22 Modifiche a SetOpenSide, aggiunte ChangeOrOpenStart e CurveWithOnlyStraightLines.
|
||||
-- 2023/06/12 In ChangeOrOpenStart corretta ricerca segmento più lungo.
|
||||
-- 2023/09/13 Aggiunte funzioni Is3EdgesApprox e GetProcessAffectedFaces.
|
||||
-- 2023/09/25 In GetFaceWithMostAdj aggiunta verifica sottosquadro anche per facce non adiacenti.
|
||||
-- 2023/09/26 In GetFaceWithMostAdj gestito primo parametro anche come Proc; gestito caso strip con facce tutte in sottosquadro.
|
||||
-- 2023/09/26 Spostata qui funzione IsFeatureCuttingEntireSection da BeamExec.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamLib = {}
|
||||
@@ -507,7 +513,8 @@ function BeamLib.GetFaceElevationFromPointDir( nSurfId, nPartId, ptC, vtN, nIdGe
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
|
||||
local nSurfId = Proc.Id
|
||||
-- verifica che la superficie non sia chiusa e quindi non lavorabile
|
||||
if EgtSurfIsClosed( nSurfId) then
|
||||
return
|
||||
@@ -519,14 +526,17 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
end
|
||||
-- recupero le normali delle facce
|
||||
local vvtN = {}
|
||||
local vPtC = {}
|
||||
for i = 1, nFacCnt do
|
||||
local vtN = EgtSurfTmFacetNormVersor( nSurfId, i - 1, GDB_ID.ROOT)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, i - 1, GDB_ID.ROOT)
|
||||
vvtN[i] = vtN ;
|
||||
vPtC[i] = ptC
|
||||
end
|
||||
-- adiacenze e sottosquadra delle facce
|
||||
local vAdj = {}
|
||||
local vUcut = {}
|
||||
local vOrtho = {}
|
||||
local nFacesWithUnderCut = 0
|
||||
for i = 1, nFacCnt do
|
||||
-- recupero le adiacenze del loop esterno
|
||||
local vFacAdj = EgtSurfTmFacetAdjacencies( nSurfId, i - 1)[1]
|
||||
@@ -538,7 +548,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
end
|
||||
end
|
||||
vAdj[i] = nCount
|
||||
-- ne determino eventuale sottosquadra ( dal valore passato o - 3deg) e ortogonalità
|
||||
-- ne determino eventuale sottosquadro ( dal valore passato o - 3deg) e ortogonalità, per facce adiacenti
|
||||
local bUcut = false
|
||||
local bOrtho = true
|
||||
for j = 1, #vFacAdj do
|
||||
@@ -554,39 +564,58 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- determino evenutale sottosquadro per facce non adiacenti
|
||||
for j = 1, nFacCnt do
|
||||
local bIsFaceAdjacent = false
|
||||
for k = 1, #vFacAdj do
|
||||
if j - 1 == vFacAdj[k] then
|
||||
bIsFaceAdjacent = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not ( bIsFaceAdjacent or ( j == i)) then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
EgtOutLog( 'Error : missing AddGroup')
|
||||
return 0, 0, 0
|
||||
end
|
||||
-- verifico eventuale intersezione tra la faccia i-1 esima e la proiezione dell'altra sulla stessa
|
||||
local nShadowFacetId = EgtCopySurfTmFacet( nSurfId, j - 1, nAddGrpId)
|
||||
local nMasterContourId = EgtExtractSurfTmFacetLoops( nSurfId, i - 1, nAddGrpId)
|
||||
local nShadowContourId = EgtExtractSurfTmLoops( nShadowFacetId, nAddGrpId)
|
||||
EgtCutSurfTmPlane( nShadowFacetId, vPtC[i], -vvtN[i], false, GDB_RT.GLOB)
|
||||
if nMasterContourId and nShadowContourId then
|
||||
local nMasterSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nMasterContourId)
|
||||
local frOCSMaster = Frame3d( vPtC[i], vvtN[i])
|
||||
EgtScale( nShadowContourId, frOCSMaster, 1, 1, 0, GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( nShadowContourId, vvtN[i], GDB_RT.GLOB)
|
||||
local dResV = vvtN[i] * vvtN[j]
|
||||
EgtOffsetCurve( nShadowContourId, EgtIf( dResV > GEO.EPS_SMALL, - 50, 50) * GEO.EPS_SMALL)
|
||||
local nShadowSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nShadowContourId)
|
||||
local bShadowSurfIsExternal = EgtSurfFrTestExternal( nMasterSurfFlatId, nShadowSurfFlatId)
|
||||
if not bShadowSurfIsExternal then
|
||||
bUcut = true
|
||||
end
|
||||
EgtErase( { nMasterSurfFlatId, nShadowSurfFlatId})
|
||||
end
|
||||
EgtErase( { nMasterContourId, nShadowContourId, nShadowFacetId})
|
||||
end
|
||||
end
|
||||
if bUcut then
|
||||
nFacesWithUnderCut = nFacesWithUnderCut + 1
|
||||
end
|
||||
vUcut[i] = bUcut
|
||||
vOrtho[i] = bOrtho
|
||||
end
|
||||
-- se 4 facce tutte con adiacenza 2, allora è un tunnel
|
||||
if nFacCnt == 4 then
|
||||
if vAdj[1] == 2 and vAdj[2] == 2 and vAdj[3] == 2 and vAdj[4] == 2 then
|
||||
-- se tutte le facce sono ortogonali tra loro esco con un flag che ne indica questa propietà
|
||||
if vOrtho[1] == true and vOrtho[2] == true and vOrtho[3] == true and vOrtho[4] == true then
|
||||
return -1, GEO.INFINITO, true
|
||||
else
|
||||
return -1, GEO.INFINITO
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se 3 facce con una che ha 2 adiacenze e le altre hanno 1 adiacenza, allora è una semi-fessura
|
||||
if bCompare3Fc and nFacCnt == 3 then
|
||||
local nCount2Adc = 0
|
||||
local nCount1Adc = 0
|
||||
-- ottengo il numero di facce con due adiacenze e il numero di facce con una adiacenza
|
||||
for i = 1, #vAdj do
|
||||
if vAdj[i] == 2 then
|
||||
nCount2Adc = nCount2Adc + 1
|
||||
elseif vAdj[i] == 1 then
|
||||
nCount1Adc = nCount1Adc + 1
|
||||
end
|
||||
end
|
||||
-- se il numero di adiacenze corrisponde
|
||||
if nCount2Adc == 1 and nCount1Adc == 2 then
|
||||
if vOrtho[1] == true and vOrtho[2] == true and vOrtho[3] == true then
|
||||
return -1, GEO.INFINITO, true
|
||||
else
|
||||
return -1, GEO.INFINITO
|
||||
end
|
||||
local bEveryFaceHasUndercut = ( nFacesWithUnderCut == nFacCnt)
|
||||
-- tunnel o assimilabile
|
||||
if Proc.Topology == 'Tunnel' or ( bCompare3Fc and Proc.Topology == 'Groove' and Proc.IsThrough) or ( Proc.Topology == 'Strip' and bEveryFaceHasUndercut) then
|
||||
if Proc.IsParallel or Proc.AllRightAngles then
|
||||
return -1, GEO.INFINITO, true
|
||||
else
|
||||
-- non gestito nella LapJoint
|
||||
return -1, GEO.INFINITO
|
||||
end
|
||||
end
|
||||
-- recupero le facce non in sottosquadra e con il maggior numero di adiacenze
|
||||
@@ -754,7 +783,7 @@ function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
if vtN and ( abs( vtN:getY()) < 0.174) then
|
||||
return -0.5
|
||||
else
|
||||
return -0.24
|
||||
return -0.259
|
||||
end
|
||||
else
|
||||
-- N_HorAng < 10°
|
||||
@@ -924,162 +953,82 @@ function BeamLib.CalcCollisionSafety( vtDir)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint)
|
||||
|
||||
function BeamLib.SetOpenSide( nPathInt, b3Solid)
|
||||
-- fondo tra loro le curve compatibili
|
||||
EgtMergeCurvesInCurveCompo( nPathInt)
|
||||
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
||||
local pLastPIni, pLastPEnd
|
||||
|
||||
-- faccio una copia della curva e la esplodo
|
||||
if nStartIdEnt then
|
||||
-- prendo i punti
|
||||
for i = 1, nNumEnt do
|
||||
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
||||
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
||||
-- Se normale lungo la Z considero il box in X e Y
|
||||
if abs(vtOrtho:getZ()) > 0.999 then
|
||||
-- se corrisponde a X
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Y
|
||||
elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- altrimenti se normale lungo la Y considero il box in X e Z
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then
|
||||
-- se corrisponde a X
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Z
|
||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- caso che non dovrebbe mai capitare ma gestito per completezza
|
||||
-- altrimenti se normale lungo la X considero il box in Y e Z
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then
|
||||
-- se corrisponde a Y
|
||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Z
|
||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- se asse Z orizzontale verifico se si avvicina piú a Y
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 then
|
||||
if abs(vtOrtho:getY()) > 0.75 then
|
||||
-- se corrisponde a Z
|
||||
if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
end
|
||||
-- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+
|
||||
elseif abs(vtOrtho:getY()) < 0.001 then
|
||||
if abs(vtOrtho:getZ()) > 0.75 then
|
||||
-- se corrisponde a Y
|
||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se devo cambiare il punto di partenza
|
||||
if nStartPoint then
|
||||
if pLastPIni and pLastPEnd then
|
||||
-- calcolo il punto medio con gli ultimi punti utilizzati
|
||||
local ptPs = ( pLastPIni + pLastPEnd) / 2
|
||||
EgtChangeClosedCurveStartPoint( nPathInt, ptPs, GDB_RT.GLOB)
|
||||
-- se devo eliminare la parte open
|
||||
if nStartPoint == 2 then
|
||||
EgtRemoveCurveCompoCurve( nPathInt, true)
|
||||
EgtRemoveCurveCompoCurve( nPathInt, false)
|
||||
return true
|
||||
end
|
||||
-- vettore indici lati aperti
|
||||
local vOpen = {}
|
||||
-- ciclo sulle curve elementari della composita
|
||||
local _, nNumEnt = EgtCurveDomain( nPathInt)
|
||||
for i = 0, nNumEnt - 1 do
|
||||
-- se segmento di retta
|
||||
if EgtCurveCompoRadius( nPathInt, i) == -1 then
|
||||
-- verifico se giace in uno dei piani limite del pezzo quindi se è un lato aperto
|
||||
local ptIni = EgtUP( nPathInt, i, GDB_RT.GLOB)
|
||||
local ptFin = EgtUP( nPathInt, i + 1, GDB_RT.GLOB)
|
||||
if ( abs( ptIni:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL and abs( ptFin:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL and abs( ptFin:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL and abs( ptFin:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL and abs( ptFin:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL and abs( ptFin:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL and abs( ptFin:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) then
|
||||
-- aggiorno il vettore dei lati aperti
|
||||
table.insert( vOpen, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- assegno gli indici dei lati aperti
|
||||
EgtSetInfo( nPathInt, 'OPEN', vOpen)
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.ChangeOrOpenStart( nPathInt, nStartPoint)
|
||||
-- verifico richiesta
|
||||
if nStartPoint ~= 1 and nStartPoint ~= 2 then
|
||||
return false
|
||||
end
|
||||
-- verifico che la curva sia chiusa
|
||||
if not EgtCurveIsClosed( nPathInt) then
|
||||
return true
|
||||
end
|
||||
-- recupero l'indice del segmento aperto più lungo
|
||||
local nMaxOpen, dMaxLen
|
||||
local vOpen = EgtGetInfo( nPathInt or GDB_ID.NULL, 'OPEN', 'vi')
|
||||
for i = 1, #( vOpen or {}) do
|
||||
-- se primo o più lungo, lo salvo
|
||||
local dLen = EgtCurveCompoLength( nPathInt, vOpen[i])
|
||||
if not dMaxLen or dLen > dMaxLen then
|
||||
dMaxLen = dLen
|
||||
nMaxOpen = vOpen[i]
|
||||
end
|
||||
end
|
||||
-- se esiste tratto aperto
|
||||
if nMaxOpen then
|
||||
-- sposto il punto di inizio a metà del tratto aperto più lungo (la curva deve essere chiusa)
|
||||
EgtChangeClosedCurveStart( nPathInt, nMaxOpen + 0.5)
|
||||
-- aggiorno il vettore dei lati aperti
|
||||
for i = 1, #vOpen do
|
||||
vOpen[i] = vOpen[i] - nMaxOpen
|
||||
end
|
||||
table.insert( vOpen, #vOpen)
|
||||
-- se devo eliminare gli estremi aperti
|
||||
if nStartPoint == 2 then
|
||||
-- elimino gli estremi
|
||||
EgtRemoveCurveCompoCurve( nPathInt, true)
|
||||
EgtRemoveCurveCompoCurve( nPathInt, false)
|
||||
-- aggiorno il vettore dei lati aperti
|
||||
table.remove( vOpen, 1)
|
||||
table.remove( vOpen)
|
||||
for i = 1, #vOpen do
|
||||
vOpen[i] = vOpen[i] - 1
|
||||
end
|
||||
end
|
||||
end
|
||||
-- assegno gli indici modificati dei lati aperti
|
||||
EgtSetInfo( nPathInt, 'OPEN', vOpen)
|
||||
-- restituisco flag percorso aperto
|
||||
return ( not EgtCurveIsClosed( nPathInt))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -1102,15 +1051,13 @@ function BeamLib.ConvertToClosedCurve( Proc, AuxId)
|
||||
-- sistemo i lati aperti
|
||||
local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, 0)[1]
|
||||
if vFacAdj then
|
||||
local sOpen = ''
|
||||
local vOpen = {}
|
||||
for i = 1, #vFacAdj do
|
||||
if vFacAdj[i] < 0 then
|
||||
sOpen = sOpen .. EgtIf( #sOpen > 0, ',', '') .. tostring( i - 1)
|
||||
table.insert( vOpen, i - 1)
|
||||
end
|
||||
end
|
||||
if #sOpen > 0 then
|
||||
EgtSetInfo( AuxId, 'OPEN', sOpen)
|
||||
end
|
||||
EgtSetInfo( AuxId, 'OPEN', vOpen)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1118,5 +1065,87 @@ function BeamLib.ConvertToClosedCurve( Proc, AuxId)
|
||||
return true, bCurveModified
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.CurveWithOnlyStraightLines( nPathInt)
|
||||
-- verifico sia una retta oppure una curva composita
|
||||
local nType = EgtGetType( nPathInt)
|
||||
if nType == GDB_TY.CRV_LINE then
|
||||
return true
|
||||
elseif nType~= GDB_TY.CRV_COMPO then
|
||||
return false
|
||||
end
|
||||
-- ciclo sulle curve elementari della composita
|
||||
local _, nNumEnt = EgtCurveDomain( nPathInt)
|
||||
for i = 0, nNumEnt - 1 do
|
||||
-- se segmento di retta
|
||||
if EgtCurveCompoRadius( nPathInt, i) ~= -1 then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
|
||||
function BeamLib.Is3EdgesApprox( Proc, nFacet, nAddGrpId)
|
||||
nAddGrpId = nAddGrpId or BeamLib.GetAddGroup( Proc.PartId)
|
||||
local bResult = false
|
||||
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
|
||||
if not nContourId then return false end
|
||||
EgtMergeCurvesInCurveCompo( nContourId)
|
||||
-- recupero il numero effettivo di lati
|
||||
local _, nEntityCount = EgtCurveDomain( nContourId)
|
||||
local nEdges = nEntityCount
|
||||
if nEntityCount and nEntityCount == 3 then
|
||||
bResult = true
|
||||
-- rimuovo i lati molto corti dal conteggio totale
|
||||
elseif nEntityCount then
|
||||
for i = 1, nEntityCount do
|
||||
local dLength = EgtCurveCompoLength( nContourId, i - 1)
|
||||
if dLength < 15 then nEdges = nEdges - 1 end
|
||||
end
|
||||
end
|
||||
if nEdges == 3 then bResult = true end
|
||||
-- cancello tutti i contorni appena creati
|
||||
EgtErase( EgtTableFill( nContourId, nContourCnt))
|
||||
return bResult
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce le facce della parte interessate dalla feature Proc
|
||||
function BeamLib.GetProcessAffectedFaces( Proc)
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||
local b3Part = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||
local vtFacesAffected = { Top = false, Bottom = false, Front = false, Back = false, Left = false, Right = false}
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
if Proc.Box:getMax():getZ() > b3Part:getMax():getZ() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Top = true
|
||||
end
|
||||
if Proc.Box:getMin():getZ() < b3Part:getMin():getZ() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Bottom = true
|
||||
end
|
||||
if Proc.Box:getMin():getY() < b3Part:getMin():getY() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Front = true
|
||||
end
|
||||
if Proc.Box:getMax():getY() > b3Part:getMax():getY() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Back = true
|
||||
end
|
||||
if Proc.Box:getMin():getX() < b3Part:getMin():getX() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Left = true
|
||||
end
|
||||
if Proc.Box:getMax():getX() > b3Part:getMax():getX() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Right = true
|
||||
end
|
||||
end
|
||||
|
||||
return vtFacesAffected
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
||||
function BeamLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
|
||||
return ((abs(b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
|
||||
+6
-8
@@ -1,4 +1,4 @@
|
||||
-- DiceCut.lua by Egaltech s.r.l. 2023/01/09
|
||||
-- DiceCut.lua by Egaltech s.r.l. 2023/06/29
|
||||
-- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -144,8 +144,8 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
|
||||
EgtErase( IdAuxLocal)
|
||||
EgtSetGridFrame(Frame3d())
|
||||
-- riferimento intrinseco
|
||||
local asseX = vtO
|
||||
local asseY = asseX ^ vtN
|
||||
local asseX = Vector3d( vtO)
|
||||
local asseY = vtN ^ asseX
|
||||
local Frame = Frame3d( ptC, ptC + asseX, ptC + asseY)
|
||||
-- ingombro della faccia secondo questo riferimento
|
||||
local Box = EgtGetBBoxRef( FacetId, GDB_BB.STANDARD, Frame)
|
||||
@@ -160,12 +160,11 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
|
||||
end
|
||||
|
||||
local N = ceil( dLen / dOffsetEff)
|
||||
local dOffsetRel = dLen / N
|
||||
local dOffsetRel = ( dLen / N) + 10 * GEO.EPS_SMALL
|
||||
local dCopyPlane
|
||||
local dCenOffs = ( Box:getMax():getX() + Box:getMin():getX()) / 2
|
||||
|
||||
if dLen <= dOffsetRel then
|
||||
--dOffsetRel = 0
|
||||
dCopyPlane = 1
|
||||
elseif dLen <= 2 * dOffsetRel then
|
||||
dOffsetRel = dOffsetEff
|
||||
@@ -177,8 +176,7 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
|
||||
dCopyPlane = 0.5
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
return dOffsetRel, dCopyPlane, dCenOffs, ptS
|
||||
end
|
||||
|
||||
@@ -475,7 +473,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
||||
if vtNInner:getZ() > -0.0175 or vtNInner:getZ() < dNzLimDwnUp or abs( vtNInner:getY()) > 0.8 then
|
||||
vtO:rotate( vtNInner, 90)
|
||||
-- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente
|
||||
if ( abs( vtO:getY()) > 3 * abs( vtO:getX()) or BBoxRawPart:getDimZ() > 620) and vtNInner:getZ() > dNzLimDwnUp then
|
||||
if ( abs( vtO:getY()) > 4 * abs( vtO:getX()) or BBoxRawPart:getDimZ() > 620) and vtNInner:getZ() > dNzLimDwnUp then
|
||||
vtO:rotate( vtNInner, 90)
|
||||
-- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra
|
||||
if vtNInner:getZ() < -0.05 then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- FaceByPocket.lua by Egaltech s.r.l. 2022/05/82
|
||||
-- FaceByPocket.lua by Egaltech s.r.l. 2023/04/04
|
||||
-- Gestione svuotatura di feature con una faccia
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -15,7 +15,7 @@ local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, vtN)
|
||||
local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, vtN, dOpenMinSafe)
|
||||
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. nInd
|
||||
@@ -28,11 +28,17 @@ local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, v
|
||||
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||
-- imposto note utente
|
||||
local sNotes = ''
|
||||
-- eventuale massima elevazione
|
||||
if dMaxElev > 0.1 then
|
||||
-- imposto elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 2) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
sNotes = EgtSetValInNotes( sNotes, 'MaxElev', EgtNumToString( dMaxElev, 2))
|
||||
end
|
||||
-- eventuale minima distanza di sicurezza di attacco su lati aperti
|
||||
if dOpenMinSafe then
|
||||
sNotes = EgtSetValInNotes( sNotes, 'OpenMinSafe', dOpenMinSafe)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
@@ -50,7 +56,7 @@ local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, v
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid)
|
||||
function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid, dOpenMinSafe)
|
||||
local bOk = true
|
||||
local sErr
|
||||
-- recupero gruppo per geometria addizionale
|
||||
@@ -84,14 +90,14 @@ function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid)
|
||||
EgtSetName( nAddIdTmp, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( nAddIdTmp, 'TASKID', Proc.TaskId)
|
||||
-- aggiungo lavorazione
|
||||
bOk, sErr = ApplyPocket( Proc, nAddIdTmp, 0, sPocketing, i, dSurfStep, vtN)
|
||||
bOk, sErr = ApplyPocket( Proc, nAddIdTmp, 0, sPocketing, i, dSurfStep, vtN, dOpenMinSafe)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
end
|
||||
-- faccio ultima superfice
|
||||
bOk, sErr = ApplyPocket( Proc, nSurfId, nFacet, sPocketing, 1, EgtIf( nSurfStep > 1, dSurfStep, 0), vtN)
|
||||
bOk, sErr = ApplyPocket( Proc, nSurfId, nFacet, sPocketing, 1, EgtIf( nSurfStep > 1, dSurfStep, 0), vtN, dOpenMinSafe)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
+158
-22
@@ -1,4 +1,4 @@
|
||||
-- FacesBySaw.lua by Egaltech s.r.l. 2022/09/24
|
||||
-- FacesBySaw.lua by Egaltech s.r.l. 2023/09/26
|
||||
-- Gestione taglio con lama di feature con una o due facce
|
||||
-- 2021/01/06 Cambiato limite per attacco Tg con lama e CalcLeadInOutGeom rinominata in CalcLeadInOutPerpGeom.
|
||||
-- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg.
|
||||
@@ -13,6 +13,11 @@
|
||||
-- 2022/04/12 DS Aggiunta gestione speciale cubetti con fresa da sotto.
|
||||
-- 2022/06/29 DS In MakeTwo modificato controllo facce dirette verso il basso.
|
||||
-- 2022/09/08 In MakeOne aggiunto argomento bForceInvert per poter forzare l'inversione del percorso.
|
||||
-- 2023/02/13 Migliorata la direzione di lavoro della lama in modo da essere tendenzialmente opposta all'avanzamento.
|
||||
-- 2023/04/20 Alcune modifiche per gestire tagli con faceuse parallelo.
|
||||
-- 2023/05/18 Imposto in ogni caso dVzLimDwnUp prima anche di bDownHead.
|
||||
-- 2023/06/14 Aggiunta MakeParallelOne e tolti parametri nForceWorkSide, nForceSCC da MakeOne.
|
||||
-- 2023/09/26 Piccola modifica per Turn su bInvert di MakeOne.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FacesBySaw = {}
|
||||
@@ -28,8 +33,125 @@ EgtOutLog( ' FacesBySaw started', 1)
|
||||
local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
-- accetto solo facce perpendicolari all'asse X della trave
|
||||
if not AreSameOrOppositeVectorApprox( vtN, X_AX()) then
|
||||
EgtOutLog( 'Error : MakeParallelOne only for faces perpendicular to XAxis')
|
||||
return false
|
||||
end
|
||||
-- l'uso della faccia deve consentire una scelta robusta del percorso
|
||||
if nFaceUse == MCH_MILL_FU.PARAL_LEFT or
|
||||
nFaceUse == MCH_MILL_FU.PARAL_RIGHT then
|
||||
EgtOutLog( 'Error : MakeParallelOne impossible with PARAL_LEFT or PARAL_RIGHT FaceUse')
|
||||
return false
|
||||
end
|
||||
-- distanza della faccia dall'estremo trave verso cui è rivolta
|
||||
local dDistX = EgtIf( vtN:getX() > 0, b3Raw:getMax():getX() - ptC:getX(), ptC:getX() - b3Raw:getMin():getX())
|
||||
-- lunghezza attacco/uscita perpendicolari
|
||||
local dLiTang = 0
|
||||
local dLiPerp = dDistX + dCutExtra + dCutSic
|
||||
local dLoTang = dLiTang
|
||||
local dLoPerp = dLiPerp
|
||||
-- lunghezza attacco/uscita tangenti
|
||||
local dLi2Tang = dSawDiam / 2 + dCutSic
|
||||
local dLi2Perp = 0
|
||||
local dLo2Tang = dLi2Tang
|
||||
local dLo2Perp = dLi2Perp
|
||||
-- scelgo l'attacco più conveniente
|
||||
local bLioTang
|
||||
local Ktp = 1.1
|
||||
if BD.KIOTP then Ktp = BD.KIOTP end
|
||||
if Ktp * dLi2Tang < dLiPerp then
|
||||
bLioTang = true
|
||||
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
|
||||
if BD.TURN then
|
||||
local dMove = EgtIf( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP, b3Raw:getDimY(), b3Raw:getDimZ())
|
||||
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
|
||||
dLoPerp = BD.COLL_SIC
|
||||
end
|
||||
end
|
||||
-- verifico se la lama ruota in senso antiorario
|
||||
if not EgtMdbSetCurrMachining( sCutting) then
|
||||
return false
|
||||
end
|
||||
local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
|
||||
local bInvert = bForceInvert
|
||||
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
|
||||
if bInvert == nil then
|
||||
bInvert = ( not bIsSawCCW)
|
||||
if not BD.TURN then
|
||||
if bIsSawCCW then
|
||||
bInvert = (( nFaceUse == MCH_MILL_FU.PARAL_FRONT and vtN:getX() > 0) or ( nFaceUse == MCH_MILL_FU.PARAL_BACK and vtN:getX() < 0))
|
||||
else
|
||||
bInvert = (( nFaceUse == MCH_MILL_FU.PARAL_FRONT and vtN:getX() < 0) or ( nFaceUse == MCH_MILL_FU.PARAL_BACK and vtN:getX() > 0))
|
||||
end
|
||||
end
|
||||
end
|
||||
local nWorkSide = EgtIf( bInvert, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)
|
||||
-- posizione braccio
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if BD.TURN then
|
||||
nSCC = EgtIf( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_ZP)
|
||||
else
|
||||
nSCC = EgtIf( vtN:getX() > 0, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
-- inserisco la lavorazione di taglio
|
||||
local sName = 'Cut_' .. ( EgtGetName( nSurfId) or tostring( nSurfId)) .. '_' .. tostring( nFacet + 1)
|
||||
local nMchFId = EgtAddMachining( sName, sCutting)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
sName = EgtGetOperationName( nMchFId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- imposto posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto inversione e lato correzione
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
|
||||
-- affondamento aggiuntivo
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -dCutExtra)
|
||||
-- offset longitudinale
|
||||
EgtSetMachiningParam( MCH_MP.OFFSL, EgtIf( bDownUp, -dCutOffset, dCutOffset))
|
||||
-- imposto attacco/uscita
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
|
||||
if BD.TURN and bLioTang then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
||||
-- imposto allungamenti iniziale e finale
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dAccStart)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dAccEnd)
|
||||
-- eventuali note
|
||||
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true, sName, nMchFId
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
|
||||
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
|
||||
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
|
||||
Par5 == MCH_MILL_FU.PARAL_TOP or
|
||||
Par5 == MCH_MILL_FU.PARAL_FRONT or
|
||||
Par5 == MCH_MILL_FU.PARAL_BACK or
|
||||
Par5 == MCH_MILL_FU.PARAL_LEFT or
|
||||
Par5 == MCH_MILL_FU.PARAL_RIGHT) then
|
||||
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
|
||||
end
|
||||
-- la lama ha asse perpendicolare alla faccia
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
-- risolvo parametro ambiguo
|
||||
@@ -42,8 +164,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
nOrthoOpposite = Par5
|
||||
vtOrthO = BL.GetVersRef( Par5)
|
||||
end
|
||||
-- verifico se testa da sotto
|
||||
-- verifico se testa da sotto oppure se lavorazione sotto con testa da sopra
|
||||
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
|
||||
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
|
||||
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
|
||||
-- linea o bilinea di lavorazione (qui uso nOrthoOpposite per ripetere esattamente il calcolo del Mach)
|
||||
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BL.GetVersRef( nOrthoOpposite), GDB_ID.ROOT)
|
||||
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
|
||||
@@ -52,9 +176,24 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
return true, ''
|
||||
end
|
||||
vtV1 = - vtV1
|
||||
-- verifico se la lama ruota in senso antiorario
|
||||
if not EgtMdbSetCurrMachining( sCutting) then
|
||||
return false
|
||||
end
|
||||
local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
|
||||
local bInvert = bForceInvert
|
||||
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
|
||||
if bInvert == nil then
|
||||
bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||
if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
|
||||
if bIsSawCCW ~= bDownUp then
|
||||
bInvert = ( ptP2:getZ() < ptP1:getZ() + 100 * GEO.EPS_SMALL)
|
||||
else
|
||||
bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||
end
|
||||
else
|
||||
local vtTmp = ptP2 - ptP1 ; vtTmp:normalize()
|
||||
bInvert = ( ( vtOrthO:getX() > 0.1 and vtTmp:getX() < -0.1) or ( vtOrthO:getX() < -0.1 and vtTmp:getX() > 0.1))
|
||||
end
|
||||
end
|
||||
if bInvert then
|
||||
ptP1, ptP2 = ptP2, ptP1
|
||||
@@ -90,9 +229,6 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
vtTg = ptP2 - ptP1 ; vtTg:normalize()
|
||||
end
|
||||
end
|
||||
-- verifico se lavorazione con lama sotto e testa sopra
|
||||
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
|
||||
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
|
||||
local nFaceUse = nOrthoOpposite
|
||||
if bDownUp then nFaceUse = BL.GetOrtupOpposite( nOrthoOpposite) end
|
||||
local bWsRight = ( bInvert ~= bDownUp)
|
||||
@@ -123,30 +259,29 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
-- parametri di attacco/uscita
|
||||
local b3Box = BBox3d( b3Raw)
|
||||
b3Box:expand( dCutSic)
|
||||
local ptP1act = ptP1 + vtN * dCutOffset
|
||||
local ptP2act = ptP2 + vtN * dCutOffset
|
||||
-- attacco perpendicolare
|
||||
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
|
||||
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
|
||||
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
|
||||
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
||||
-- attacco tangente
|
||||
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptP1act, ptP2act, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
|
||||
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
|
||||
local dLenLi2 = abs( dLi2Tang)
|
||||
local dLenLo2 = abs( dLo2Tang)
|
||||
-- scelgo l'attacco più conveniente (se non taglio praticamente longitudinale)
|
||||
local bTurnTang
|
||||
local bLioTang
|
||||
local Ktp = 1.1
|
||||
if BD.KIOTP then Ktp = BD.KIOTP end
|
||||
if ( not bDownUp or abs( vtTg:getY()) > 0.5) and
|
||||
( not bDownHead or abs( vtTg:getZ()) < 0.51) and
|
||||
abs( vtTg:getX()) < 0.9848 and
|
||||
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5) and not bDownHead) or
|
||||
( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 300 and BD.C_SIMM and BD.MAX_HEIGHT > 450) or
|
||||
( Ktp * dLenLi2 < dLenLi and Ktp * dLenLo2 < dLenLo) or Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) then
|
||||
( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 300 and BD.C_SIMM and BD.MAX_HEIGHT > 450 and b3Box:getDimX() > BD.LEN_SHORT_PART) or
|
||||
( abs( vtTg:getZ()) < 0.51 and ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) or Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) then
|
||||
bLioTang = true
|
||||
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
|
||||
if BD.TURN then
|
||||
bTurnTang = true
|
||||
dLoTang = -( dLiTang + dAllStart - dAccStart + dAllEnd - dAccEnd + dLen)
|
||||
local dMove = dist( ptP1, ptP2)
|
||||
dLoTang = -( dLiTang + dAllStart - dAccStart + dAllEnd - dAccEnd + dMove)
|
||||
dLoPerp = BD.COLL_SIC
|
||||
end
|
||||
end
|
||||
@@ -160,8 +295,9 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
end
|
||||
else
|
||||
if bTurnTang then
|
||||
local vtTest = EgtIf( bInvert, vtTg, -vtTg)
|
||||
if bLioTang then
|
||||
--local vtTest = EgtIf( bInvert, vtTg, -vtTg)
|
||||
local vtTest = -vtTg
|
||||
if abs( vtTest:getY()) > abs( vtTest:getZ()) then
|
||||
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
@@ -207,7 +343,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
-- imposto attacco/uscita
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
|
||||
if bTurnTang then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
|
||||
if BD.TURN and bLioTang then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
||||
-- imposto allungamenti iniziale e finale
|
||||
@@ -257,7 +393,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
return false, sErr
|
||||
end
|
||||
local ptM = ( ptT1 + ptT2) / 2
|
||||
local vtTg = ptT2 - ptT1 ;
|
||||
local vtTg = ptT2 - ptT1 ; vtTg:normalize()
|
||||
local bConvex = ( dAngT > 0)
|
||||
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg)
|
||||
local bFaceOk = {}
|
||||
@@ -273,14 +409,14 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
vtRef[1] = vtN[1] ^ vtTg
|
||||
if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end
|
||||
vtRef[1]:normalize()
|
||||
if abs( vtRef[1]:getZ()) < 0.577 and abs( abs( vtRef[1]:getX()) - abs( vtRef[1]:getY())) < 0.1 then
|
||||
if abs( vtTg:getZ()) < 0.708 and abs( vtRef[1]:getZ()) < 0.577 and abs( abs( vtRef[1]:getX()) - abs( vtRef[1]:getY())) < 0.1 then
|
||||
vtRef[1] = ptC[1] - ptM
|
||||
vtRef[1]:normalize()
|
||||
end
|
||||
vtRef[2] = vtN[2] ^ vtTg
|
||||
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
|
||||
vtRef[2]:normalize()
|
||||
if abs( vtRef[2]:getZ()) < 0.577 and abs( abs( vtRef[2]:getX()) - abs( vtRef[2]:getY())) < 0.1 then
|
||||
if abs( vtTg:getZ()) < 0.708 and abs( vtRef[2]:getZ()) < 0.577 and abs( abs( vtRef[2]:getX()) - abs( vtRef[2]:getY())) < 0.1 then
|
||||
vtRef[2] = ptC[2] - ptM
|
||||
vtRef[2]:normalize()
|
||||
end
|
||||
@@ -293,7 +429,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
local nOtInd = 3 - nUpInd
|
||||
-- metto in relazione la scelta facce con il confronto del versore Z con la scelta in base alla grandezza faccia
|
||||
-- se la faccia più grande è messa secondaria e il suo versore Z non è troppo negativo
|
||||
if nOtInd == nBigInd and vtN[nBigInd]:getZ() > -0.5 and vtN[nSmaInd]:getZ() < 0.966 then
|
||||
if nOtInd == nBigInd and (( vtN[nBigInd]:getZ() > -0.5 and vtN[nSmaInd]:getZ() < 0.966) or bDownHead) then
|
||||
nUpInd = nBigInd
|
||||
nOtInd = nSmaInd
|
||||
end
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
-- FeatureTopology.lua by Egaltech s.r.l. 2023/09/12
|
||||
-- Libreria per classificazione topologica feature travi
|
||||
-- 2023/09/26 Aggiunte topologie Strip e Cut.
|
||||
-- 2023/09/27 Modificata GetFacesParallelToPart per tunnel, pocket e groove 3 lati
|
||||
-- 2023/10/16 In GetFacesParallelToPart rimossa Pocket e aggiunto Rabbet al check solo direzione principale
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FeatureTopology = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico le librerie
|
||||
local BL = require( 'BeamLib')
|
||||
|
||||
EgtOutLog( ' FeatureTopology started', 1)
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
|
||||
local function GetAdjacencyMatrix( Proc)
|
||||
local vAdj = {}
|
||||
for i = 1, Proc.Fct do
|
||||
vAdj[i] = {}
|
||||
for j = 1, Proc.Fct do
|
||||
if i == j then
|
||||
vAdj[i][j] = 0
|
||||
else
|
||||
_, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT)
|
||||
if not vAdj[i][j] then vAdj[i][j] = 0 end
|
||||
end
|
||||
j = j + 1
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
return vAdj
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce gli id delle facce di Proc che hanno il numero di adiacenze nAdj
|
||||
function FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, nAdj)
|
||||
local vAdj = GetAdjacencyMatrix( Proc)
|
||||
local vFacesWithGivenAdj = {}
|
||||
for i = 1, Proc.Fct do
|
||||
local nAdjCount = 0
|
||||
for j = 1, Proc.Fct do
|
||||
if vAdj[i][j] and vAdj[i][j] ~= 0 then
|
||||
nAdjCount = nAdjCount + 1
|
||||
end
|
||||
end
|
||||
if nAdjCount == nAdj then
|
||||
table.insert( vFacesWithGivenAdj, i - 1)
|
||||
end
|
||||
end
|
||||
return vFacesWithGivenAdj
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce true se Proc ha tutti gli angoli concavi (bAllConcave) e, nei casi in cui ha senso, se questi sono esattamente 90 deg (bAllRight)
|
||||
local function AreAllAnglesConcaveOrRight( Proc)
|
||||
local vAdj = GetAdjacencyMatrix( Proc)
|
||||
local bAllConcave, bAllRight = true, true
|
||||
for i = 1, Proc.Fct do
|
||||
for j = 1, Proc.Fct do
|
||||
-- se trovo un angolo convesso restituisco falso e esco subito
|
||||
if vAdj[i][j] and vAdj[i][j] > 0 then
|
||||
bAllConcave = false
|
||||
bAllRight = false
|
||||
break
|
||||
elseif vAdj[i][j] and vAdj[i][j] ~= 0 and vAdj[i][j] + 90 > 500 * GEO.EPS_ANG_SMALL then
|
||||
bAllRight = false
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se 1 faccia oppure 2 facce con angolo convesso non ha senso ritornare valori per bAllRight
|
||||
if Proc.Fct < 2 or ( Proc.Fct == 2 and vAdj[1][2] > 0) then
|
||||
return bAllConcave
|
||||
else
|
||||
return bAllConcave, bAllRight
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce true se almeno una delle dimensioni della feature è maggiore o uguale ad una delle dimensioni principali del pezzo (tolleranza 1 mm)
|
||||
local function IsAnyDimensionLongAsPart( Proc)
|
||||
local bResult = false
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||
if Proc.Box:getDimX() > b3Solid:getDimX() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.Box:getDimY() > b3Solid:getDimY() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.Box:getDimZ() > b3Solid:getDimZ() - 1000 * GEO.EPS_SMALL then
|
||||
bResult = true
|
||||
end
|
||||
return bResult
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- retituisce un vettore con gli indici (0 based) delle facce triangolari (o quasi) di Proc
|
||||
local function GetTriangularFaces( Proc)
|
||||
local vTriangularFaces = {}
|
||||
for i = 1, Proc.Fct do
|
||||
if BL.Is3EdgesApprox( Proc, i - 1) then
|
||||
table.insert( vTriangularFaces, i - 1)
|
||||
end
|
||||
end
|
||||
return vTriangularFaces
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce un vettore contenente gli indici delle facce di Proc parallele ad una delle direzioni principali; il check varia in base alla famiglia topologica
|
||||
local function GetFacesParallelToPart( Proc, sFamily, bIsThrough)
|
||||
local vFacesParallelToPart = {}
|
||||
for i = 0, Proc.Fct - 1 do
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i, GDB_ID.ROOT)
|
||||
if sFamily == 'Rabbet' or sFamily == 'Bevel' or sFamily == 'DoubleBevel' or sFamily == 'Strip' or sFamily == 'Tunnel' or ( sFamily == 'Groove' and bIsThrough) then
|
||||
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||
local bIsTriangularFace = false
|
||||
-- verifico se la faccia è triangolare
|
||||
for j = 1, #vTriangularFaces do
|
||||
if i == vTriangularFaces[j] then
|
||||
bIsTriangularFace = true
|
||||
end
|
||||
end
|
||||
-- se faccia triangolare deve avere la normale parallela ad una direzione principale
|
||||
if bIsTriangularFace then
|
||||
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
-- altrimenti deve avere una componente della normale nulla
|
||||
else
|
||||
if abs( vtN:getX()) < 10 * GEO.EPS_SMALL or abs( vtN:getY()) < 10 * GEO.EPS_SMALL or abs( vtN:getZ()) < 10 * GEO.EPS_SMALL then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
end
|
||||
else
|
||||
-- la normale deve essere parallela ad una direzione principale
|
||||
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
return vFacesParallelToPart
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce una stringa con il nome esteso della topologia della feature
|
||||
-- *famiglia-passante-angoli tutti concavi a 90deg-facce tutte parallele alle dimensioni principali-numero di facce*
|
||||
local function GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, nNumberOfFaces)
|
||||
-- feature passante o cieca
|
||||
local sThrough = '_'
|
||||
if bIsThrough ~= nil then sThrough = EgtIf( bIsThrough, 'Through', 'Blind') end
|
||||
-- tutti gli angoli della feature sono retti oppure no
|
||||
local sAllRightAngles = '_'
|
||||
if bAllRightAngles ~= nil then sAllRightAngles = EgtIf( bAllRightAngles, 'RightAngles', 'NotRightAngles') end
|
||||
-- tutte le dimensioni della feature sono parallele agli assi principali del pezzo oppure no
|
||||
local sParallel = '_'
|
||||
if bIsParallel ~= nil then sParallel = EgtIf( bIsParallel, 'Parallel', 'NotParallel') end
|
||||
|
||||
local sLongName = sFamily .. '-' .. sThrough .. '-' .. sAllRightAngles .. '-' .. sParallel .. '-' .. nNumberOfFaces
|
||||
return sLongName
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- riconosce se Proc è una delle topologie standard e, in caso positivo, ne scrive le caratteristiche in campi specifici della Proc stessa restituendo true
|
||||
function FeatureTopology.Classify( Proc, b3Raw)
|
||||
|
||||
if not Proc.Box or Proc.Box:isEmpty() then
|
||||
return false
|
||||
end
|
||||
|
||||
local bRecognized = false
|
||||
local sFamily
|
||||
local bIsThrough
|
||||
local bAllRightAngles
|
||||
local bIsParallel
|
||||
local sLongName = ''
|
||||
|
||||
-- SE NON HA TUTTE LE FACCE PIANE RITORNARE NIL!!
|
||||
|
||||
local bAllAnglesConcave
|
||||
bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( Proc)
|
||||
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
|
||||
local vFacesWithOneAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 1)
|
||||
local vFacesWithTwoAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 2)
|
||||
local vFacesWithThreeAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 3)
|
||||
local vFacesWithFourAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 4)
|
||||
local dRawW, dRawH = b3Raw:getDimY(), b3Raw:getDimZ()
|
||||
local bIsFeatureCuttingEntireSection = BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
|
||||
if Proc.IsOutline then
|
||||
sFamily = 'OUTLINE'
|
||||
elseif Proc.Prc == 40 then
|
||||
sFamily = 'DRILLING'
|
||||
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
|
||||
sFamily = 'Cut'
|
||||
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave and #vTriangularFaces == 1 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave then
|
||||
sFamily = 'Rabbet'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and not bAllAnglesConcave and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'DoubleBevel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and #vTriangularFaces == 2 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 3 then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithThreeAdj == 2 then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithTwoAdj == 4 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Tunnel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct >= 4 and #vFacesWithOneAdj == 2 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Strip'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 5 and bAllAnglesConcave and #vFacesWithFourAdj == 1 then
|
||||
sFamily = 'Pocket'
|
||||
bIsThrough = false
|
||||
end
|
||||
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily, bIsThrough)
|
||||
bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
|
||||
|
||||
if sFamily == 'OUTLINE' or sFamily == 'DRILLING' then
|
||||
Proc.Topology = sFamily
|
||||
Proc.TopologyLongName = sFamily
|
||||
bRecognized = true
|
||||
elseif sFamily then
|
||||
sLongName = GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, Proc.Fct)
|
||||
Proc.Topology, Proc.IsThrough, Proc.AllRightAngles, Proc.IsParallel, Proc.TopologyLongName = sFamily, bIsThrough, bAllRightAngles, bIsParallel, sLongName
|
||||
bRecognized = true
|
||||
else
|
||||
Proc.Topology = 'OTHER'
|
||||
Proc.TopologyLongName = 'OTHER'
|
||||
end
|
||||
|
||||
return bRecognized
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return FeatureTopology
|
||||
@@ -6,6 +6,7 @@
|
||||
-- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile.
|
||||
-- 2022/12/28 Per FindMilling e FindDrilling possibilità di escludere la testa H2 dalla ricerca utensile.
|
||||
-- 2023/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile.
|
||||
-- 2023/07/28 Aggiunta gestione del tipo di foratura "Drill_AT".
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local MachiningLib = {}
|
||||
@@ -107,7 +108,7 @@ local function SetCurrMachiningAndTool( sMachName)
|
||||
local sTool = EgtTdbGetToolFromUUID( sTuuid)
|
||||
if not sTool then return false end
|
||||
if not EgtTdbSetCurrTool( sTool) then return false end
|
||||
local bActive = EgtTdbGetCurrToolParam( MCH_TP.ACTIVE)
|
||||
local bActive = EgtFindToolInCurrSetup( sTool)
|
||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local nHead = tonumber( sHead:sub( 2, #sHead))
|
||||
local bH2 = ( nHead >= 21 and nHead <= 29)
|
||||
@@ -176,7 +177,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function VerifyTool( MachiningType, sType, Params, bH2)
|
||||
if MachiningType == MCH_MY.DRILLING then
|
||||
if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'AngleDrill') then
|
||||
if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'Drill_AT') or EgtStartsWith( sType, 'AngleDrill') then
|
||||
return VerifyDrill( Params.Diam, Params.Depth, bH2)
|
||||
elseif EgtStartsWith( sType, 'Pocket') then
|
||||
return VerifyDrillPocket( Params.Diam, Params.Depth, bH2)
|
||||
@@ -213,7 +214,7 @@ end
|
||||
function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
||||
if MachiningType == MCH_MY.DRILLING then
|
||||
local _, sOrigType = EgtEndsWith( sType, '_H2')
|
||||
return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'AngleDrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen
|
||||
return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'Drill_AT' or sOrigType == 'AngleDrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen
|
||||
elseif MachiningType == MCH_MY.SAWING then
|
||||
return MachiningName, ToolParams.H2
|
||||
elseif MachiningType == MCH_MY.MILLING then
|
||||
@@ -379,9 +380,9 @@ function MachiningLib.FindCutting( sType, bTopHead, bDownHead)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2)
|
||||
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Drill', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2)
|
||||
if not MachiningName or MachiningName == '' then
|
||||
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission)
|
||||
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Drill_AT', 'Drill'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2)
|
||||
if ( not MachiningName or MachiningName == '') and not bAngleTransmission then
|
||||
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Pocket', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead)
|
||||
end
|
||||
if MachiningName and MachiningName ~= '' then
|
||||
|
||||
+99
-46
@@ -1,4 +1,4 @@
|
||||
-- ProcessCut.lua by Egaltech s.r.l. 2022/12/19
|
||||
-- ProcessCut.lua by Egaltech s.r.l. 2023/08/01
|
||||
-- Gestione calcolo singoli tagli di lama per Travi
|
||||
-- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito.
|
||||
-- 2021/06/06 Correzioni per tagli con testa da sotto.
|
||||
@@ -18,6 +18,10 @@
|
||||
-- 2022/08/30 Modificata la condizione che determina l'utilizzo della testa da sotto. Ora controlla se la trave è più grande del doppio della massima larghezza del cubetto.
|
||||
-- 2022/09/23 Corretta la condizione per cui è richiesto l'aggiornamento del grezzo.
|
||||
-- 2023/01/26 Migliorata la direzione di lavoro della lama in alcuni casi in cui il truciolo veniva scaricato dal lato errato.
|
||||
-- 2023/06/19 Aggiunti tagli speciali per evitare il rischio che il cubetto rimanga appoggiato al motore.
|
||||
-- 2023/08/01 Correzione su offset per taglio doppio di lato.
|
||||
-- 2023/08/01 In caso di pezzi alti su macchina tipo PF i tagli doppi di lato non vengono usati, si usa il metodo standard.
|
||||
-- 2023/09/12 In MakeFromTop abbassato a 590 mm il limite per convertire in LongCut.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessCut = {}
|
||||
@@ -172,7 +176,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -195,7 +199,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true, nil
|
||||
@@ -212,7 +216,7 @@ local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
||||
if vtN:getZ() > 0.5 then
|
||||
dOffs = dOffs - 0.6 * Proc.Box:getDimX()
|
||||
elseif vtN:getZ() < -0.5 then
|
||||
dOffs = dOffs - 0.2 * Proc.Box:getDimX()
|
||||
dOffs = dOffs - EgtIf( BD.PRESS_ROLLER, 0.4, 0.2) * Proc.Box:getDimX()
|
||||
elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then
|
||||
dOffs = dOffs - 0.3 * Proc.Box:getDimX()
|
||||
end
|
||||
@@ -222,7 +226,7 @@ local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
||||
if vtN:getZ() > 0.5 then
|
||||
dOffs = dOffs - 0.6 * Proc.Box:getDimX()
|
||||
elseif vtN:getZ() < -0.5 then
|
||||
dOffs = dOffs - 0.2 * Proc.Box:getDimX()
|
||||
dOffs = dOffs - EgtIf( BD.PRESS_ROLLER, 0.4, 0.2) * Proc.Box:getDimX()
|
||||
elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then
|
||||
dOffs = dOffs - 0.3 * Proc.Box:getDimX()
|
||||
end
|
||||
@@ -246,14 +250,15 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
if bFromBottom == nil then
|
||||
bFromBottom = ( vtN:getZ() > 0.25 and b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and vtN:getX() < 0 and abs( vtN:getY()) < 0.259)
|
||||
end
|
||||
local dMinFeatureLengthForLongCut = 590.000
|
||||
-- verifico se da considerare taglio lungo ( non da sotto, inclinato non più di 30deg, largo come la trave e abbastanza lungo)
|
||||
local bLongCut = ( not bDownCut and vtN:getZ() > 0.865 and
|
||||
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and
|
||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
|
||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > dMinFeatureLengthForLongCut))
|
||||
-- verifico se da considerare taglio lungo dal lato, solo per macchine tipo PF1250, inclinato non più di 30deg
|
||||
local bLongCutFromSide = ( not bDownCut and ( BD.C_SIMM and BD.DOWN_HEAD and ( abs(vtN:getY()) > 0.865) and
|
||||
Proc.Box:getDimZ() > b3Solid:getDimZ() - 10 * GEO.EPS_SMALL) and
|
||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
|
||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > dMinFeatureLengthForLongCut))
|
||||
-- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10
|
||||
local bNoDicing = EgtGetInfo( Proc.Id, 'Q04', 'i') == 1
|
||||
if bNoDicing then
|
||||
@@ -395,6 +400,19 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
if bCustDiceCut and #vCuts == 0 then
|
||||
return false, -1
|
||||
end
|
||||
|
||||
-- per caso speciale in cui c'è il rischio che il cubetto rimanga appoggiato sul motore, faccio solo i tagli perpendicolari seguiti da due tagli verticali laterali
|
||||
local bDangerousReliefCut = false
|
||||
-- verifico che i tagli perpendicolari siano perpendicolari al lato più vicino a Z
|
||||
local nFirstPerpendicularCut = ( #vCuts > 0 and ( vCuts[1][1] or vCuts[3][1]))
|
||||
if nFirstPerpendicularCut then
|
||||
local frFace = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
local vtTemp = EgtSurfTmFacetNormVersor( nFirstPerpendicularCut, 0, GDB_ID.ROOT) ^ frFace:getVersX()
|
||||
if not ( vtTemp:isSmall()) and not ( bDownCut or bFromBottom) and not bLongCut and ( not BD.C_SIMM or b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL) then
|
||||
bDangerousReliefCut = true
|
||||
end
|
||||
end
|
||||
|
||||
--DC.PrintOrderCut( vCuts)
|
||||
if #vCuts > 0 then
|
||||
-- sistemo posizione nel DB e nome
|
||||
@@ -405,8 +423,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
|
||||
if ( i % 2) == 1 then
|
||||
local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
|
||||
if ( vtN:getY() > 0.707 and vtO:getY() < -0.05) or
|
||||
( vtN:getY() < -0.707 and vtO:getY() > 0.05) then
|
||||
if ( vtN:getY() > 0.766 and vtO:getY() < -0.05) or
|
||||
( vtN:getY() < -0.766 and vtO:getY() > 0.05) then
|
||||
EgtInvertSurf( vCuts[i][j])
|
||||
bOrthInv = true
|
||||
end
|
||||
@@ -453,44 +471,77 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
end
|
||||
end
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
-- se taglio dal basso
|
||||
if bDownCut then
|
||||
-- se strato pari composto da 1 o 2 elementi
|
||||
if ( i % 2) == 0 and #vCuts[i] <= 2 then
|
||||
-- il primo elemento prende la direzione prevista, il secondo quella opposta
|
||||
local vtNewOrthoO = Vector3d( vtOrthoO)
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if j ~= 1 then
|
||||
vtNewOrthoO = -vtOrthoO
|
||||
if not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.708 end
|
||||
local dDiceFaceMaxH = 0
|
||||
local dDiceFaceMinH = GEO.INFINITO
|
||||
if ( i % 2) == 0 and bDangerousReliefCut then
|
||||
for j = 1, #vCuts[i] do
|
||||
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][j], 0)
|
||||
dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH)
|
||||
-- calcolo lato orizzontale minore ipotizzando sia un trapezio
|
||||
local dDiceFaceH2 = ( 2 * EgtSurfArea( vCuts[i][j]) ) / dDiceFaceV - dDiceFaceH
|
||||
dDiceFaceMinH = min( dDiceFaceMinH, dDiceFaceH2)
|
||||
end
|
||||
end
|
||||
-- caso speciale con rischio cubetto sul motore
|
||||
if ( i % 2) == 0 and bDangerousReliefCut and ( dMaxDepth > dDiceFaceMaxH - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN) then
|
||||
local bDoubleCut = false
|
||||
local dCutExtra = BD.CUT_EXTRA
|
||||
if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then
|
||||
bDoubleCut = true
|
||||
dCutExtra = - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN
|
||||
end
|
||||
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
|
||||
local nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
|
||||
if Proc.Tail then
|
||||
nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1
|
||||
end
|
||||
if bDoubleCut then
|
||||
local bOk, sErr = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut1, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw)
|
||||
if not bOk2 then return false, sErr2 end
|
||||
-- caso standard
|
||||
else
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
-- se taglio dal basso
|
||||
if bDownCut then
|
||||
-- se strato pari composto da 1 o 2 elementi
|
||||
if ( i % 2) == 0 and #vCuts[i] <= 2 then
|
||||
-- il primo elemento prende la direzione prevista, il secondo quella opposta
|
||||
local vtNewOrthoO = Vector3d( vtOrthoO)
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if j ~= 1 then
|
||||
vtNewOrthoO = -vtOrthoO
|
||||
if not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.708 end
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
-- tutti gli altri casi vengono saltati
|
||||
-- caso generale
|
||||
else
|
||||
-- in generale sta sollevato di pochissimo
|
||||
local dExtraCut = -0.1
|
||||
-- se tagli paralleli
|
||||
if ( i % 2) == 0 then
|
||||
-- se non ci sono tagli ortogonali devo affondare
|
||||
if bNoPerpCuts then
|
||||
dExtraCut = BD.CUT_EXTRA
|
||||
-- se altrimenti tagli ortogonali invertiti, devo approfondire dello spessore lama
|
||||
elseif bOrthInv then
|
||||
dExtraCut = dSawThick
|
||||
-- se ultimo taglio, devo affondare
|
||||
elseif j == #vCuts[i] then
|
||||
dExtraCut = BD.CUT_EXTRA
|
||||
end
|
||||
end
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- tutti gli altri casi vengono saltati
|
||||
-- caso generale
|
||||
else
|
||||
-- in generale sta sollevato di pochissimo
|
||||
local dExtraCut = -0.1
|
||||
-- se tagli paralleli
|
||||
if ( i % 2) == 0 then
|
||||
-- se non ci sono tagli ortogonali devo affondare
|
||||
if bNoPerpCuts then
|
||||
dExtraCut = BD.CUT_EXTRA
|
||||
-- se altrimenti tagli ortogonali invertiti, devo approfondire dello spessore lama
|
||||
elseif bOrthInv then
|
||||
dExtraCut = dSawThick
|
||||
-- se ultimo taglio, devo affondare
|
||||
elseif j == #vCuts[i] then
|
||||
dExtraCut = BD.CUT_EXTRA
|
||||
end
|
||||
end
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -507,7 +558,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
local vtOrthoO
|
||||
if bFromBottom and dCutV < dMaxVertDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
|
||||
vtOrthoO = -Z_AX()
|
||||
elseif bHorizCut and ( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or vtN:getX() > 0 or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
|
||||
elseif bHorizCut and ( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
|
||||
vtOrthoO = Z_AX()
|
||||
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
|
||||
vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
@@ -767,7 +818,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
||||
-- recupero la lavorazione
|
||||
local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide')
|
||||
local sCutting
|
||||
sCutting, bDownHead = ML.FindCutting( sCutType, bTopHead, bDownHead)
|
||||
local bH2
|
||||
sCutting, bH2 = ML.FindCutting( sCutType, bTopHead, bDownHead)
|
||||
bDownHead = bH2 and bDownHead
|
||||
if not sCutting then
|
||||
local sErr = 'Error : cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2022/07/11
|
||||
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2023/03/22
|
||||
-- Gestione calcolo doppi tagli di lama per Travi
|
||||
-- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250
|
||||
-- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250.
|
||||
-- 2023/03/22 Eliminata SetOpenSide locale, si usa quella di libreria.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDoubleCut = {}
|
||||
@@ -160,7 +161,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -183,7 +184,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
@@ -222,39 +223,6 @@ local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bP
|
||||
return bUsePocketing, sPocketing, dMaxDepth, dToolDiam
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
||||
-- fondo tra loro le curve compatibili
|
||||
EgtMergeCurvesInCurveCompo( nPathInt)
|
||||
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
||||
local pLastPIni, pLastPEnd
|
||||
-- faccio una copia della curva e la esplodo
|
||||
if nStartIdEnt then
|
||||
-- ciclo i lati della curva e controllo per ognuno se giace in uno dei piani limite del pezzo: se sì allora il lato è aperto
|
||||
for i = 1, nNumEnt do
|
||||
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
||||
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- scrivo nelle proprietà della curva quali sono i lati aperti
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
-- se ci sono già altri lati aperti
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
-- se è l'unico
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Solid)
|
||||
local nFirstMachId
|
||||
@@ -287,7 +255,7 @@ local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Sol
|
||||
-- e assegno l'estrusione
|
||||
nPathInt = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId)
|
||||
EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB)
|
||||
SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
||||
BL.SetOpenSide( nPathInt, b3Solid)
|
||||
-- variabili per parametri lavorazione
|
||||
local dMachDepth
|
||||
local dElev = 0
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- ProcessDovetail.lua by Egaltech s.r.l. 2021/02/04
|
||||
-- Gestione calcolo giunzione coda di rondine
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDovetail = {}
|
||||
@@ -280,7 +281,7 @@ function ProcessDovetail.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||
end
|
||||
-- deve avere la normale principale diretta verso la testa
|
||||
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
@@ -341,7 +342,7 @@ function ProcessDovetail.IsTailFeature( Proc, b3Raw)
|
||||
end
|
||||
end
|
||||
-- deve avere la normale principale diretta verso la coda
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
@@ -933,10 +934,10 @@ local function MachSideFaces( Proc, nPartId, b3Raw, nFacetCnt, bForceUseRough,
|
||||
end
|
||||
else
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, sin(dSideAngle))
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, sin(dSideAngle))
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
-- provo eliminando i sottosquadra
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, -2)
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, -2)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MachSideFaces could not find reference face'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+32
-13
@@ -1,4 +1,4 @@
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2022/11/30
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2023/09/26
|
||||
-- Gestione calcolo forature per Travi
|
||||
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
|
||||
-- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto.
|
||||
@@ -16,6 +16,9 @@
|
||||
-- 2022/10/25 Nella funzione Split aggiunto il controllo che le facce di ingresso e uscita siano differenti (potrebbe succedere per fori molto corti). Modifica importatore in futuro.
|
||||
-- 2022/11/23 Aggiunta la gestione dei fori con angolo < 30 gradi, per i quali si usa la testa della macchina per accorciare l'utile di lavoro.
|
||||
-- 2022/12/28 Implementata gestione forature in doppio
|
||||
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
|
||||
-- 2023/07/28 Aggiunta gestione rinvio 90deg solo per forature da sotto esattamente verticali.
|
||||
-- 2023/09/26 Se errore in applicazione lavorazione si inverte e riprova solo se foratura singola su foro aperto.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDrill = {}
|
||||
@@ -155,16 +158,25 @@ function ProcessDrill.Classify( Proc, b3Raw)
|
||||
ptCen = ptCen + vtExtr * dLen
|
||||
end
|
||||
end
|
||||
-- verifico se foro annegato nel pezzo e quindi non lavorabile
|
||||
if Proc.Fcs == 0 and Proc.Fce == 0 then
|
||||
return false, false, false
|
||||
end
|
||||
-- verifico se troppo inclinato e quindi non lavorabile
|
||||
if not ( Proc.Fcs == 5 or Proc.Fcs == 6 or Proc.Fce == 5 or Proc.Fce == 6) and abs( vtExtr:getX()) > BD.DRILL_VX_MAX then
|
||||
return false, false, false
|
||||
end
|
||||
local bOpen = ( Proc.Fce ~= 0)
|
||||
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and ( Proc.Flg == 2 or Proc.Flg == -2))))
|
||||
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and abs( Proc.Flg) == 2)))
|
||||
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
|
||||
if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
|
||||
if not bOpen then
|
||||
return true, true, false
|
||||
-- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione
|
||||
if BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
return true, false, false
|
||||
else
|
||||
return true, true, false
|
||||
end
|
||||
else
|
||||
return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN)
|
||||
end
|
||||
@@ -236,19 +248,21 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)
|
||||
-- verifico possibilità di foratura da sotto
|
||||
local bDownDrill = ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true))
|
||||
local bDownDrill = ( BD.TURN or ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true)))
|
||||
-- se presente rinvio angolare
|
||||
local bDrillAngTrasm = ( BD.ANG_TRASM and AreOppositeVectorApprox( vtExtr, Z_AX()) and not bOpen)
|
||||
-- verifico che il foro non sia fattibile solo da sotto
|
||||
local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill)
|
||||
local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill) and not bDrillAngTrasm
|
||||
if bToInvert and ( not bOpen or Proc.Flg ~= 1) then
|
||||
local sErr = 'Error : drilling from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- se non già richiesta inversione e invertibile
|
||||
if not bToInvert and Proc.Flg == 1 and ( -vtExtr:getZ() >= BD.DRILL_VZ_MIN or bDownDrill) then
|
||||
-- se il foro è cieco o troppo inclinato all'inizio, lo inverto
|
||||
local _, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
if Proc.Fcs == 0 or ( CosB > BD.DRILL_VX_MAX and bOpen) then
|
||||
if not bToInvert and Proc.Flg == 1 and -vtExtr:getZ() >= BD.DRILL_VZ_MIN then
|
||||
-- se il foro è cieco o dalla faccia sotto o troppo inclinato all'inizio, lo inverto
|
||||
local nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
if Proc.Fcs == 0 or (( nFac == 2 or CosB > BD.DRILL_VX_MAX) and bOpen) then
|
||||
bToInvert = true
|
||||
end
|
||||
end
|
||||
@@ -278,9 +292,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2)
|
||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm)
|
||||
if not sDrilling and dCheckDepth then
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2)
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm)
|
||||
if sDrilling then dCheckDepth = nil end
|
||||
end
|
||||
if not sDrilling then
|
||||
@@ -454,7 +468,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
if bDrillAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
@@ -494,11 +510,14 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= Proc.PrevDouble then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
local bOk = ML.ApplyMachining( true, false)
|
||||
if not bOk and bDownDrill then
|
||||
if not bOk and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessDtMortise.lua by Egaltech s.r.l. 2022/08/18
|
||||
-- ProcessDtMortise.lua by Egaltech s.r.l. 2023/05/11
|
||||
-- Gestione calcolo mortase a coda di rondine per Travi
|
||||
-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa.
|
||||
-- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto.
|
||||
@@ -9,6 +9,9 @@
|
||||
-- 2022/08/18 Migliorato calcolo dello step.
|
||||
-- 2022/09/29 Aggiunto riconoscimento della sola feature laterale.
|
||||
-- 2022/12/28 Aggiunta gestione lavorazione in doppio.
|
||||
-- 2023/03/06 Aggiunta forzatura ingresso fuori dal grezzo con pocket.
|
||||
-- 2023/03/28 Corretto calcolo larghezza mortasa quando più larga che lunga.
|
||||
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDtMortise = {}
|
||||
@@ -176,13 +179,17 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- determino l'altezza della mortasa (0=faccia di fondo)
|
||||
local rfDtMrt, dLenMrt, dWidthMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB)
|
||||
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
|
||||
local dAltMort = b3DtMrt:getDimZ()
|
||||
-- ne determino l'asse (valido se non pocket)
|
||||
-- ne determino l'asse
|
||||
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
|
||||
vtAx:normalize()
|
||||
-- determino l'altezza della mortasa (0=faccia di fondo)
|
||||
local rfDtMrt, dLenMrt, dWidthMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB)
|
||||
if abs( rfDtMrt:getVersY() * vtAx) > abs( rfDtMrt:getVersX() * vtAx) then
|
||||
rfDtMrt:rotate( rfDtMrt:getOrigin(), rfDtMrt:getVersZ(), 90)
|
||||
dLenMrt, dWidthMrt = dWidthMrt, dLenMrt
|
||||
end
|
||||
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
|
||||
local dAltMort = b3DtMrt:getDimZ()
|
||||
-- verifico se di tipo pocket
|
||||
local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1)
|
||||
if bPocket then bMakeAntiSplitPath = false end
|
||||
@@ -283,7 +290,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- se con tasca, la lavoro
|
||||
-- se con tasca, la lavoro (mai in doppio)
|
||||
if bPocket then
|
||||
-- recupero il contorno della tasca (seconda curva ausiliaria)
|
||||
local sVal = EgtGetInfo( Proc.Id, 'AUXID')
|
||||
@@ -344,6 +351,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||
end
|
||||
end
|
||||
-- flag di mirror precedente aggiornabile localmente
|
||||
local nMyPrevDouble = Proc.PrevDouble
|
||||
-- se parametro interno abilitato e il percorso non è chiuso, aggiungo percorso e lavorazione antischeggia
|
||||
if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
@@ -425,6 +434,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= nMyPrevDouble then
|
||||
nMyPrevDouble = Proc.Double
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
@@ -503,9 +516,17 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- dichiaro massima elevazione e assenza sfridi per VMill
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
|
||||
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
|
||||
if bPocket then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
|
||||
end
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= nMyPrevDouble then
|
||||
nMyPrevDouble = Proc.Double
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
|
||||
+45
-57
@@ -1,7 +1,10 @@
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2022/06/07
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2023/03/28
|
||||
-- Gestione calcolo tenone a coda di rondine per Travi
|
||||
-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa.
|
||||
-- 2022/04/14 Aumentati un poco i limiti di orientamento verso il basso per FAST e PF.
|
||||
-- 2023/02/08 Aumentato il range per cui i tenoni vengono lavorati in sottosquadro.
|
||||
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessTenon.
|
||||
-- 2023/03/28 Corretta gestione faccia di base quando divisa in più parti per distanza massima da lavorare.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDtTenon = {}
|
||||
@@ -9,6 +12,7 @@ local ProcessDtTenon = {}
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
local BL = require( 'BeamLib')
|
||||
local Fbp = require( 'FaceByPocket')
|
||||
local Cut = require( 'ProcessCut')
|
||||
|
||||
EgtOutLog( ' ProcessTenon started', 1)
|
||||
@@ -38,14 +42,17 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
|
||||
-- se tenone praticamente in asse, accetto fino a -30 deg
|
||||
if abs( vtN:getY()) < 0.088 then
|
||||
return ( vtN:getZ() >= -0.51)
|
||||
-- se macchina Fast, pezzo stretto e inclinazione laterale non eccessiva, accetto fino a -27deg
|
||||
elseif ( not BD.C_SIMM) and abs( vtN:getY()) < 0.5 and b3Raw:getDimY() < 150.1 then
|
||||
return ( vtN:getZ() >= -0.454)
|
||||
-- altrimenti accetto fino a -21deg
|
||||
else
|
||||
return ( vtN:getZ() >= -0.359)
|
||||
end
|
||||
-- se trave medio-bassa
|
||||
elseif b3Raw:getDimZ() < 281 then
|
||||
-- se tenone praticamente in asse, accetto fino a -25 deg
|
||||
if abs( vtN:getY()) < 0.088 then
|
||||
-- se tenone praticamente in asse oppure pezzo stretto e inclinazione laterale non eccessiva, accetto fino a -25 deg
|
||||
if abs( vtN:getY()) < 0.088 or ( abs( vtN:getY()) < 0.5 and b3Raw:getDimY() < 150.1) then
|
||||
return ( vtN:getZ() >= -0.422)
|
||||
-- altrimenti, accetto fino a -15 deg
|
||||
else
|
||||
@@ -163,6 +170,9 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- ne determino l'asse
|
||||
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
|
||||
vtAx:normalize()
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
|
||||
local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
|
||||
-- se tenone inclinato o non esattamente alle estremità, necessario taglio di lama sulla testa
|
||||
if not AreSameOrOppositeVectorApprox( vtN, X_AX()) or
|
||||
( Proc.Box:getMax():getX() < b3Raw:getMax():getX() - dOvmHead - 100 * GEO.EPS_SMALL and
|
||||
@@ -179,44 +189,17 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if AddId then
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- se pezzo piccolo, in coda e piano inclinato attorno a Z applico svuotatura
|
||||
if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getY()) > 0.173 then
|
||||
local sPocketing = ML.FindPocketing( 'OpenPocket')
|
||||
local dMaxDepth = 100
|
||||
local dStep = 30
|
||||
local nSurfStep
|
||||
-- acquisisco i dati necessari dall'utensile
|
||||
if EgtMdbSetCurrMachining( sPocketing) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
dStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) or dStep
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- acquisisco elevazione
|
||||
local dElev = BL.GetFaceElevation( AddId, 0, nPartId)
|
||||
nSurfStep = ceil( dElev / dMaxDepth)
|
||||
dSurfStep = dElev / nSurfStep
|
||||
local bOk = true
|
||||
local sErr
|
||||
-- copio superfice al passo superfice e ci applico la lavorazione
|
||||
for i = nSurfStep, 2, -1 do
|
||||
local nAddIdTmp = EgtSurfTmPlaneInBBox( nAddGrpId, ptC+((dSurfStep*(i-1))*vtN), vtN, b3Solid, GDB_RT.GLOB)
|
||||
if nAddIdTmp then
|
||||
EgtSetName( nAddIdTmp, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( nAddIdTmp, 'TASKID', Proc.TaskId)
|
||||
-- aggiungo lavorazione
|
||||
bOk, sErr = ApplyPocket( Proc, sPocketing, i, (dSurfStep + 0), nAddIdTmp, vtExtr)
|
||||
if not bOk then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not bOk then
|
||||
-- solo per macchine tipo PF e simili: se pezzo piccolo, in coda, piano inclinato attorno a Z e inclinato verso il basso applico svuotatura
|
||||
if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getY()) > 0.173 and vtExtr:getZ() < -0.1 and BD.C_SIMM then
|
||||
-- recupero la lavorazione
|
||||
local sPocketing = ML.FindPocketing( 'OpenPocket', nil, nil, nil, not bMillDown, bMillDown)
|
||||
if not sPocketing then
|
||||
local sErr = 'Error : pocketing '..sPockType..' not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- faccio ultima superfice
|
||||
bOk, sErr = ApplyPocket( Proc, sPocketing, 1, EgtIf( nSurfStep > 1, ( dSurfStep + 0), 0), AddId, vtExtr)
|
||||
-- eseguo le svuotature necessarie
|
||||
local bOk, sErr = Fbp.Make( Proc, AddId, 0, sPocketing, nPartId, b3Solid)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
end
|
||||
@@ -230,9 +213,6 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
|
||||
local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'DtTenon'
|
||||
local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
@@ -261,22 +241,29 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
return false, sErr
|
||||
end
|
||||
-- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0)
|
||||
local dMaxDist = 0
|
||||
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.Id, 0, EgtGetParent( Proc.Id))
|
||||
if nLoopId then
|
||||
local dUmin, dUmax = EgtCurveDomain( nLoopId)
|
||||
for dU = dUmin, dUmax do
|
||||
local ptP = EgtUP( nLoopId, dU, GDB_ID.ROOT)
|
||||
local ptNear = EgtNP( AuxId, ptP, GDB_ID.ROOT)
|
||||
local dDist = dist( ptP, ptNear)
|
||||
if dDist > dMaxDist then
|
||||
dMaxDist = dDist
|
||||
local dMaxDist
|
||||
for i = 0, Proc.Fct - 1 do
|
||||
local ptFC, vtFN = EgtSurfTmFacetCenter( Proc.Id, i, GDB_ID.ROOT)
|
||||
if not AreSameVectorApprox( vtFN, vtN) or abs( ( ptFC - ptBC) * vtN) > 100 * GEO.EPS_SMALL then
|
||||
break
|
||||
end
|
||||
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.Id, i, EgtGetParent( Proc.Id))
|
||||
if nLoopId then
|
||||
local dUmin, dUmax = EgtCurveDomain( nLoopId)
|
||||
for dU = dUmin, dUmax do
|
||||
local ptP = EgtUP( nLoopId, dU, GDB_ID.ROOT)
|
||||
local ptNear = EgtNP( AuxId, ptP, GDB_ID.ROOT)
|
||||
local dDist = dist( ptP, ptNear)
|
||||
if not dMaxDist or dDist > dMaxDist then
|
||||
dMaxDist = dDist
|
||||
end
|
||||
end
|
||||
for j = 1, nLoopCnt do
|
||||
EgtErase( nLoopId + j - 1)
|
||||
end
|
||||
end
|
||||
for i = 1, nLoopCnt do
|
||||
EgtErase( nLoopId + i - 1)
|
||||
end
|
||||
else
|
||||
end
|
||||
if not dMaxDist then
|
||||
local b3DtAux = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frDtTen)
|
||||
dMaxDist = 2 * ( b3DtTen:getRadius() - b3DtAux:getRadius())
|
||||
end
|
||||
@@ -299,7 +286,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- sistemo i parametri
|
||||
local dOffs = ( i - 1) * dStep
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dDtTenH, 1) .. ';')
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dDtTenH, 1)) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/11/03
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/03/03
|
||||
-- Gestione calcolo profilo libero per Travi
|
||||
-- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10
|
||||
-- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta.
|
||||
@@ -6,7 +6,9 @@
|
||||
-- 2022/11/09 Aggiunta la gestione della chiamata della FreeContour da parte della SimpleScarf.
|
||||
-- 2022/11/24 In MakeByMill aggiunta la lavorazione sopra/sotto nel caso di testa sotto
|
||||
-- In MakeByMill se BeamData forza lettura codolo da Q questo viene sempre fatto indipendentemente dalle dimensioni della feature
|
||||
|
||||
-- 2023/03/03 Corretta MakeByMark ( non definiti b3Raw e b3Aux ).
|
||||
-- 2023/06/21 In CalcSpecialAdd modificato l'angolo minimo da 5 a 15 deg.
|
||||
-- 2023/07/28 In MakeByPocket aggiunta Q06 per specificare un eventuale offset radiale del contorno.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessFreeContour = {}
|
||||
@@ -26,6 +28,7 @@ local Q_DIM_STRIP = 'Q01' -- d
|
||||
local Q_DEPTH_CHAMFER = 'Q02' -- d
|
||||
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
|
||||
local Q_ONLY_CHAMFER = 'Q00' -- i
|
||||
local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
@@ -206,8 +209,8 @@ local function CalcSpecialAdd( nCrv, bStartVsEnd, dToolDiam)
|
||||
-- tangenti prima e dopo il punto interno
|
||||
local vtPrev = EgtUV( nCrv, nIn, -1)
|
||||
local vtNext = EgtUV( nCrv, nIn, 1)
|
||||
-- se c'è perdita di tangenza (delta angolare oltre i 5 gradi)
|
||||
if vtPrev * vtNext < 0.996 then
|
||||
-- se c'è perdita di tangenza (delta angolare oltre i 15 gradi)
|
||||
if vtPrev * vtNext < 0.966 then
|
||||
-- lunghezza del tratto
|
||||
local ptP0 = EgtUP( nCrv, nOut)
|
||||
local ptP1 = EgtUP( nCrv, nIn)
|
||||
@@ -772,6 +775,11 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- imposto elevazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
|
||||
-- imposto eventuale offset radiale, se impostato dall'utente
|
||||
local dRadialOffset = EgtGetInfo( Proc.Id, Q_RADIAL_OFFSET, 'd') or 0
|
||||
if abs( dRadialOffset) > 10 * GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -dRadialOffset)
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -782,7 +790,9 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeByMark( Proc, nRawId, b3Raw, nPartId)
|
||||
local function MakeByMark( Proc, nRawId, nPartId)
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- ingombro del pezzo
|
||||
local Ls = EgtGetFirstNameInGroup( nPartId, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
@@ -802,6 +812,7 @@ local function MakeByMark( Proc, nRawId, b3Raw, nPartId)
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dDepth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
||||
local bToolInv = ( vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
||||
-- verifico che la marcatura non sia orientata verso il basso (-5 deg)
|
||||
if vtExtr:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.TURN then
|
||||
@@ -870,7 +881,7 @@ function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
|
||||
-- se marcatura
|
||||
if nCntType == 10 then
|
||||
return MakeByMark( Proc, nRawId, b3Raw, nPartId)
|
||||
return MakeByMark( Proc, nRawId, nPartId)
|
||||
-- se fresatura
|
||||
else
|
||||
return MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
||||
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
||||
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
||||
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti
|
||||
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo
|
||||
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessHeadCut = {}
|
||||
@@ -119,7 +122,7 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -142,7 +145,7 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true, nil
|
||||
@@ -205,9 +208,9 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
-- se non obbligatorio e coincide con inizio grezzo, non va fatto
|
||||
if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
end
|
||||
-- determino se più tagli con offset
|
||||
local nCuts = max( ceil( dOvmHead / ( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP)), 1)
|
||||
local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1)
|
||||
local dOffsL = dOvmHead / nCuts
|
||||
-- se taglio per sezioni alte e larghe
|
||||
if bBigSectionCut then
|
||||
@@ -262,13 +265,56 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
else
|
||||
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
||||
local dSawRad = dSawDiam / 2
|
||||
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
||||
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
|
||||
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
|
||||
local dKL = dSawRad - dMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
|
||||
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
|
||||
local dMinSawingLength = 5
|
||||
if BD.C_SIMM then
|
||||
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
|
||||
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
|
||||
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
|
||||
end
|
||||
else
|
||||
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
|
||||
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
|
||||
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- per travi alte faccio dei tagli orizzontali aggiuntivi
|
||||
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
local dMinOvmHeadForHorizontalCuts = 10.123
|
||||
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForHorizontalCuts - 10 * GEO.EPS_SMALL)
|
||||
if bAreHorizontalCutsNeeded then
|
||||
local nHorizontalCuts = ceil( dimV / BD.MAX_DIM_DICE) - 1
|
||||
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutXOffset = ( i - 1) * dOffsL
|
||||
-- tagli orizzontali
|
||||
for j = nHorizontalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||
if bDoubleCut then
|
||||
-- gli accorciamenti vanno invertiti per il taglio opposto
|
||||
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- taglio verticale
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, '', b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
-- se necessari tagli in doppio, eseguo gli opposti
|
||||
if bDoubleCut then
|
||||
-- gli accorciamenti vanno invertiti per il taglio opposto
|
||||
|
||||
+268
-192
@@ -1,4 +1,4 @@
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/12/21
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2023/09/26
|
||||
-- Gestione calcolo mezzo-legno per Travi
|
||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
|
||||
@@ -61,6 +61,24 @@
|
||||
-- 2022/12/21 Sistemata gestione SideMillAsSaw.
|
||||
-- 2023/01/19 In MakeMoreFaces -> MakeBySideMill aggiunto controllo che lo step finale non superi lo spessore utensile.
|
||||
-- 2023/01/24 In MakeByPocket gestito caso il caso in cui veniva applicata una fresatura con percorso vuoto. Ora viene rimossa e la tasca viene fatta con lama.
|
||||
-- 2023/02/06 Alla MakeDrillOnCorner aggiunto controllo distanza di sicurezza minima.
|
||||
-- 2023/02/16 Piccola correzione alla scelta utensile di svuotatura.
|
||||
-- 2023/02/21 Piccola correzione alla MakeByPocket.
|
||||
-- 2023/03/31 Correzione al calcolo della distanza di collisione nel caso in cui il gambo sia più piccolo dell'utensile.
|
||||
-- 2023/06/06 Limiti su svuotature tasche a L 4 facce come per L 3 facce. In svuotatura aggiunto recupero UserNotes da libreria per MaxOptSize.
|
||||
-- 2023/16/12 Corretto il recupero dati utensile che, in alcune funzioni, puntava all'utensile errato.
|
||||
-- 2023/06/29 Se forzata lavorazione laterale permetto l'uso del truciolatore solo se non è una tasca chiusa.
|
||||
-- 2023/07/19 Correzioni e modifiche ad antischeggia con lama (#1351).
|
||||
-- 2023/08/01 Aggiunta gestione rinvio angolare solo per tasche 5 lati, da sotto e perfettamente verticali.
|
||||
-- 2023/08/02 Piccola correzione al calcolo della distanza di sicurezza in base al gambo dell'utensile.
|
||||
-- 2023/08/02 Corretto incremento della profondità pari al raggio utensile per tunnel con sega a catena.
|
||||
-- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi (anche per relativi antischeggia con lama).
|
||||
-- 2023/09/12 In MakeByPockets gestito correttamente il ritorno nil di GetUShapeWidth.
|
||||
-- 2023/09/26 In MakeLongMoreFaces migliorata gestione spezzatura di Tunnel.
|
||||
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||
-- 2023/09/27 In MakeMoreFaces e Classify refactoring della gestione scanalatura chiusa.
|
||||
-- 2023/09/27 In MakeLongMoreFaces aggiunto Topology.Classify alla Proc creata.
|
||||
-- 2023/10/03 In MakePocket aggiunto messaggio in caso si rovini il pezzo successivo.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLapJoint = {}
|
||||
@@ -73,6 +91,7 @@ local Cut = require( 'ProcessCut')
|
||||
local DoubleCut = require( 'ProcessDoubleCut')
|
||||
local LongCut = require( 'ProcessLongCut')
|
||||
local Long2Cut = require( 'ProcessLongDoubleCut')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
|
||||
EgtOutLog( ' ProcessLapJoint started', 1)
|
||||
|
||||
@@ -314,16 +333,18 @@ local function VerifyChainSaw( Proc, dMinDim, dMaxDim)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bPocketDown)
|
||||
local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bPocketUp, bPocketDown)
|
||||
-- tipo di svuotatura
|
||||
local sMchFind = EgtIf( sMchFindMaster and #sMchFindMaster > 0, sMchFindMaster, 'Pocket')
|
||||
-- ricerca della svuotatura
|
||||
local sPocketing
|
||||
if dDepth then
|
||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.8 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.6 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.4 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.8 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.7 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.6 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.5 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.4 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen)
|
||||
else
|
||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen)
|
||||
@@ -619,7 +640,8 @@ function ProcessLapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- deve avere la normale principale diretta verso la testa
|
||||
local nFacInd, dElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
Topology.Classify( Proc, b3Raw)
|
||||
local nFacInd, dElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if vtN and vtN:getX() < 0.499 then
|
||||
return false
|
||||
@@ -659,9 +681,9 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
||||
if dEndDist > BD.MAX_DIST_HTFEA then
|
||||
return false
|
||||
end
|
||||
-- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 70% della lunghezza della trave
|
||||
-- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 80% della lunghezza della trave
|
||||
if Proc.Box:getDimX() > b3Solid:getDimX() - 1 or
|
||||
( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.7 * b3Solid:getDimX())) then
|
||||
( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.8 * b3Solid:getDimX())) then
|
||||
return false
|
||||
end
|
||||
-- se una o due facce e interessa veramente la coda, allora di coda
|
||||
@@ -673,7 +695,8 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
||||
end
|
||||
end
|
||||
-- deve avere la normale principale diretta verso la coda (oppure tunnel)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
Topology.Classify( Proc, b3Raw)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if vtN and vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
@@ -722,7 +745,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
||||
local nDeletedFace
|
||||
-- recupero la faccia con il maggior numero di adiacenze e minor elevazione
|
||||
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
if nFacInd == -1 then
|
||||
bClosedOrthoFaces = nFacInd2
|
||||
@@ -730,46 +753,19 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- se è una feature scanalatura (con 5 facce) e non è stata riconosciuta come fessura, eseguo altre verifiche
|
||||
if Proc.Prc == 16 and Proc.Fct == 5 and not bClosedOrthoFaces then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
return false
|
||||
end
|
||||
-- dalla copia della superfice, ciclo eliminando una faccia per volta per verificare se trova fessura
|
||||
for i = 1, Proc.Fct do
|
||||
local nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
-- elimino una faccia
|
||||
nDeletedFace = i - 1
|
||||
if EgtSurfTmRemoveFacet( nNewProc, nDeletedFace) then
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( nNewProc, nPartId)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
if nFacInd == -1 then
|
||||
bClosedOrthoFaces = nFacInd2
|
||||
EgtErase( nNewProc)
|
||||
break
|
||||
else
|
||||
EgtErase( nNewProc)
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- altrimenti esco
|
||||
else
|
||||
EgtErase( nNewProc)
|
||||
break
|
||||
end
|
||||
end
|
||||
-- se riconosciuta fessura ricalcolo l'elevazione dalla faccia di fondo
|
||||
if bClosedOrthoFaces then
|
||||
nFacInd = nDeletedFace
|
||||
-- rendo nulla la faccia opzionale perchè si tratta di una fessura
|
||||
nFacInd2 = nil
|
||||
dElev = BL.GetFaceElevation( Proc.Id, nFacInd)
|
||||
bClosedOrthoFaces = false -- non lo setto come tunnel
|
||||
-- se è presente il rinvio angolare ed è una tasca cieca perfettamente verticale, da sotto, non ruoto
|
||||
if BD.ANG_TRASM and Proc.Fct == 5 then
|
||||
local vtNBottomFace = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if AreOppositeVectorApprox( vtNBottomFace, Z_AX()) then
|
||||
return true, false
|
||||
end
|
||||
end
|
||||
-- se scanalatura chiusa lavoro la faccia di fondo
|
||||
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
|
||||
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, 4)[1]
|
||||
nFacInd2 = nil
|
||||
dElev = Proc.Face[ nFacInd + 1].Elevation
|
||||
end
|
||||
-- se facce formano un tunnel e sono ortogonali
|
||||
if bClosedOrthoFaces then
|
||||
-- ottengo le dimensioni del tunnel
|
||||
@@ -1348,8 +1344,10 @@ local function MakeRoundCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
local dTMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
dTMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTMaxDepth
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
dTMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTMaxDepth
|
||||
end
|
||||
end
|
||||
|
||||
-- se il diametro trovato non è minore dei 3/4 del diametro utilizzato in precedenza, esco
|
||||
@@ -1528,8 +1526,10 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
local dTMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
dTMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTMaxDepth
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
dTMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTMaxDepth
|
||||
end
|
||||
end
|
||||
|
||||
local sMillingDn = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not( bMillDown and bDoubleSide), bMillDown and bDoubleSide)
|
||||
@@ -1543,8 +1543,10 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
local dTMaxDepthDn = 0
|
||||
if EgtMdbSetCurrMachining( sMillingDn) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
dTDiamDn = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiamDn
|
||||
dTMaxDepthDn = EgtTdbGetCurrToolMaxDepth() or dTMaxDepthDn
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dTDiamDn = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiamDn
|
||||
dTMaxDepthDn = EgtTdbGetCurrToolMaxDepth() or dTMaxDepthDn
|
||||
end
|
||||
end
|
||||
|
||||
-- se il diametro trovato non è minore dei 3/4 del diametro utilizzato in precedenza, esco
|
||||
@@ -1647,7 +1649,8 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
-- normale alla faccia aggiunta
|
||||
vtN1 = Vector3d( vtOrtho)
|
||||
-- imposto i lati aperti
|
||||
BL.SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||
BL.SetOpenSide( nFirstId, b3Solid)
|
||||
BL.ChangeOrOpenStart( nFirstId, 2)
|
||||
end
|
||||
|
||||
-- se non trovato il percorso, esco
|
||||
@@ -1896,7 +1899,9 @@ local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacI
|
||||
-- recupero i dati dell'utensile ( temporaneo, per compensare errore nella lavorazione)
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
dMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxDepth
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- l'altezza di taglio del tagliente corrisponde al raggio del raccordo che si riesce a coprire
|
||||
-- quindi confronto l'elevazione con il raggio utensile utilizzato per la svuotatura
|
||||
@@ -2147,6 +2152,11 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- imposto il valore della distanza di sicurezza per l'attacco. Se il valore del db utensili è troppo basso lo alzo a 10.
|
||||
local dToolDbStartPos = EgtGetMachiningParam( MCH_MP.STARTPOS)
|
||||
local dMinStartPos = 10
|
||||
local dStartPos = max( dMinStartPos, dToolDbStartPos)
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, dStartPos)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
-- aggiungo alle note massima elevazione (coincide con affondamento)
|
||||
@@ -2397,11 +2407,6 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
|
||||
-- ottengo le curve di contorno libero
|
||||
local nAuxId1, nAuxId2, nNumIdAux
|
||||
if bIs3Faces then
|
||||
-- nAuxId1, _ = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId)
|
||||
-- EgtModifyCurveExtrusion( nAuxId1, vtOrtho, GDB_RT.GLOB)
|
||||
-- BL.SetOpenSide( nAuxId1, vtOrtho, b3Solid, nAddGrpId, 1)
|
||||
-- nNumIdAux = 2
|
||||
|
||||
-- estraggo i percorsi
|
||||
nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
-- se percorso creato estraggo solo i percorsi delle facce interessate, non di testa
|
||||
@@ -2650,7 +2655,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local bIs3Faces = ( Proc.Fct == 3)
|
||||
if bIs3Faces then
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
local nFacInd1, dFacElev1, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId, bIs3Faces)
|
||||
local nFacInd1, dFacElev1, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc, nPartId, bIs3Faces)
|
||||
if not nFacInd1 or nFacInd1 < 0 then
|
||||
if nFacInd1 == -1 then
|
||||
bOrthoFaces = nFacInd2
|
||||
@@ -3027,12 +3032,14 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
local dSawDiam = 400
|
||||
local dSawThick = 0
|
||||
local dMaxDepth = 0
|
||||
local bSawCCW = false
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
bSawCCW = ( EgtTdbGetCurrToolParam( MCH_TP.SPEED) < 0)
|
||||
end
|
||||
end
|
||||
local dExtraOffs = 0
|
||||
@@ -3057,8 +3064,10 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
end
|
||||
end
|
||||
-- eseguo il taglio
|
||||
local dVzLimDwnUp = EgtIf( BD.TURN, -2, nil)
|
||||
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, dVzLimDwnUp, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local vtNfac = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
|
||||
local dVzLimDwnUp = EgtIf( BD.TURN, -2, BL.GetNzLimDownUp( b3Raw, vtNfac, vtN))
|
||||
local bInvert = ( bSawCCW ~= ( vtNfac:getZ() < dVzLimDwnUp))
|
||||
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, dVzLimDwnUp, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw, bInvert)
|
||||
if bMadeASbyBld then
|
||||
sWarn = nil
|
||||
if not bReduceDepth and abs(dExtraOffs) > 0 then
|
||||
@@ -3069,8 +3078,9 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw)
|
||||
|
||||
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm, nPhase, nRawId)
|
||||
-- distanza dal pezzo successivo
|
||||
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
|
||||
-- calcolo l'elevazione dal punto medio
|
||||
local dElev
|
||||
local dLenIn, dLedOut = BL.GetPointDirDepth( nPartId, ptPs, tvtN[2])
|
||||
@@ -3133,12 +3143,17 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
if bLapJointAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
if AreSameVectorApprox( tvtN[2], Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( tvtN[2]:getX()) < 0.1 then
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
local bNearTail = ( Proc.Box:getMax():getX() < b3Solid:getCenter():getX() + 50 and
|
||||
Proc.Box:getMax():getX() - b3Solid:getMin():getX() < 1000)
|
||||
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif tvtN[2]:getY() > 0.1 then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
@@ -3177,6 +3192,7 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
if bOpenOutRaw then
|
||||
sNotes = sNotes .. 'OpenOutRaw=1;'
|
||||
end
|
||||
sNotes = sNotes .. ( EgtGetMachiningParam( MCH_MP.USERNOTES) or '')
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
@@ -3187,6 +3203,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- se la lavorazione rovina il pezzo successivo emetto warning
|
||||
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and dDistToNextPiece < dDiamTool / 2 then
|
||||
sWarn = 'Warning on pocketing ' .. sName .. ': machining can damage next piece. Minimum distance needed : ' .. ( 1 + dDiamTool / 2) .. ' mm'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
if BD.TURN then
|
||||
-- centro del pezzo
|
||||
local ptCen = ORIG()
|
||||
@@ -3230,7 +3251,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
||||
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
||||
-- applico la svuotatura
|
||||
local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng)
|
||||
local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng, nil, nil, nPhase, nRawId)
|
||||
if not bOk then
|
||||
-- se ho id utensile e diametro è perchè non ha fatto svuotatura perchè la faccia è più stretta del diametro utensile
|
||||
-- e provo ad inserire singola passata di testa
|
||||
@@ -3272,7 +3293,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
else
|
||||
@@ -3439,7 +3460,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
end
|
||||
if bIs3Faces then
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
local nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId, bIs3Faces)
|
||||
local nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc, nPartId, bIs3Faces)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
if nFacInd == -1 then
|
||||
bOrthoFaces = nFacInd2
|
||||
@@ -3462,8 +3483,8 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
dDimMin = 2 * dDimMin
|
||||
-- se tre facce aumento il diametro di quanto possibile
|
||||
elseif Proc.Fct == 3 then
|
||||
local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false)
|
||||
local dWidth = GetUShapeWidth( Proc, nFacInd or -1)
|
||||
local nFacInd = BL.GetFaceWithMostAdj( Proc, nPartId, false)
|
||||
local dWidth = GetUShapeWidth( Proc, nFacInd or -1) or dDimMin
|
||||
if dWidth > dDimMin then
|
||||
dDimMin = min( 2 * dDimMin, dWidth)
|
||||
end
|
||||
@@ -3482,34 +3503,33 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
local bMakePocket, sPocketing, dMaxDepth, dDiamTool = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind)
|
||||
local bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn
|
||||
if bMillDown then
|
||||
bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, true)
|
||||
bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, nil, true)
|
||||
-- se è negativo inverto il versore e la faccia
|
||||
if vtOrtho:getZ() < 0 then
|
||||
vtOrtho = -vtOrtho
|
||||
EgtInvertSurf( nSurfInt)
|
||||
end
|
||||
end
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
local bMakeContour = false
|
||||
local sMilling
|
||||
if dFacElev < dMinFaceElevForPocket and ( bIsU or bIsL) and ( Proc.Fct == 2 or Proc.Fct == 3) and abs( vtN:getZ()) > 0.996 then
|
||||
bMakeContour = true
|
||||
-- recupero la lavorazione di contornatura
|
||||
sMilling = ML.FindMilling( 'Prof', nil, nil, nil, nil, not bMillDown, bMillDown)
|
||||
if not sMilling then
|
||||
local sMyWarn = 'Warning : Prof not found in library'
|
||||
EgtOutLog( sMyWarn)
|
||||
return true, sMyWarn
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
dDiamTool = 50
|
||||
dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
if sMilling and EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dToolMaxDepth
|
||||
bMakeContour = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3521,7 +3541,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB)
|
||||
-- se ho 3 facce oppure se forzato, ciclo sulle entià del percorso per segnare quelle che sono aperte.
|
||||
if bIs3Faces or bSetOpenBorders then
|
||||
BL.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
||||
BL.SetOpenSide( nPathInt, b3Solid)
|
||||
end
|
||||
-- variabili per parametri lavorazione
|
||||
local dMachDepth
|
||||
@@ -3837,7 +3857,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
||||
if not bComplete and bIs3Faces then
|
||||
-- recupero la faccia da lavorare
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local vtN
|
||||
local bPock3rd = false
|
||||
if nFacInd then
|
||||
@@ -3914,7 +3934,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bMillDown, bReduceDepth)
|
||||
local function ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtN, nFacInd, sWarn, bMillDown, bReduceDepth)
|
||||
|
||||
local bMadeASbyBld = false
|
||||
local nNumFac = EgtIf( bIsU, 2, 1)
|
||||
@@ -3948,16 +3968,24 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bM
|
||||
if nIdMach then
|
||||
-- verifico se da invertire
|
||||
local bInvertMach = false
|
||||
local dDepth = 0
|
||||
if bIsU then
|
||||
-- prendo il vettore normale alla faccia
|
||||
local vtNFc = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
|
||||
if abs( vtN:getZ()) > 0.63 or abs( vtN:getY()) > 0.63 then
|
||||
-- se superficie principale parallela al piano XZ
|
||||
if nPrefSide == 0 then
|
||||
-- se facce praticamente verticali || mandrino a destra
|
||||
-- se facce praticamente verticali ||
|
||||
if abs( vtNFc:getZ()) < 0.1 then
|
||||
nPrefSide = 2
|
||||
-- se FAST, mandrino a destra o sinistra come svuotatura
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
local bNearTail = ( Proc.Box:getMax():getX() < b3Solid:getCenter():getX() + 50 and
|
||||
Proc.Box:getMax():getX() - b3Solid:getMin():getX() < 1000)
|
||||
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
|
||||
nPrefSide = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()) or ( bNearTail and not bVeryShortPart), 1, 2)
|
||||
-- altrimenti sempre a destra
|
||||
else
|
||||
nPrefSide = 2
|
||||
end
|
||||
-- se facce inclinate \\ allora mandrino a destra (per essere verso l'alto)
|
||||
elseif vtNFc:getX() * vtNFc:getZ() > 0 then
|
||||
nPrefSide = 2
|
||||
@@ -3983,40 +4011,22 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bM
|
||||
-- eseguo inversione
|
||||
if bInvertMach then
|
||||
local bToolInvert = EgtGetMachiningParam( MCH_MP.TOOLINVERT)
|
||||
local nWS = EgtGetMachiningParam( MCH_MP.WORKSIDE)
|
||||
local nInvWS = EgtIf( nWS == MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)
|
||||
local bInvert = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
local nFaceUse = EgtGetMachiningParam( MCH_MP.FACEUSE)
|
||||
local bOrtUp = ( nFaceUse >= MCH_MILL_FU.ORTUP_DOWN and nFaceUse <= MCH_MILL_FU.ORTUP_RIGHT)
|
||||
if not bOrtUp then
|
||||
-- assegno i parametri invertiti
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, nInvWS)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, not bToolInvert)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvert)
|
||||
-- setto l'offset pari allo spessore lama
|
||||
EgtSetMachiningParam( MCH_MP.OFFSL, -dSawThick)
|
||||
end
|
||||
end
|
||||
-- per diminuire scheggiature su facce davanti
|
||||
if nPrefSide == 2 then
|
||||
local dSpeed = EgtGetMachiningParam( MCH_MP.SPEED)
|
||||
if dSpeed < 0 and vtN:getY() < -0.996 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, vtNFc:getX() > 0)
|
||||
elseif dSpeed > 0 and vtN:getY() > 0.996 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, vtNFc:getX() < 0)
|
||||
elseif dSpeed < 0 and vtN:getZ() > 0.996 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, vtNFc:getX() > 0)
|
||||
elseif dSpeed > 0 and vtN:getZ() > 0.996 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, vtNFc:getX() < 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- posizione del braccio : se primo taglio la recupero, altrimenti la imposto
|
||||
if not nPrevSCC then
|
||||
nPrevSCC = EgtGetMachiningParam( MCH_MP.SCC)
|
||||
else
|
||||
elseif abs( vtN:getZ()) > 0.996 then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nPrevSCC)
|
||||
end
|
||||
-- rieseguo
|
||||
@@ -4340,9 +4350,10 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
end
|
||||
end
|
||||
vtN1 = Vector3d(vtOrtho)
|
||||
local bOkPath = BL.SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||
BL.SetOpenSide( nFirstId, b3Solid)
|
||||
local bOpenPath = BL.ChangeOrOpenStart( nFirstId, 2)
|
||||
-- se non ho un percorso chiuso estraggo i percorsi
|
||||
if bOkPath then
|
||||
if bOpenPath then
|
||||
-- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati
|
||||
pPaths = MakePathsOnExtremPoints( nAddGrpId, nFirstId, pPaths, dTDiam)
|
||||
end
|
||||
@@ -4471,7 +4482,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local nBottomFace
|
||||
local sMchFindBackUp
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
if nFacInd == -1 then
|
||||
bClosedOrthoFaces = nFacInd2
|
||||
@@ -4481,42 +4492,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- se è una feature scanalatura (con 5 facce) e non è stata riconosciuta come fessura, eseguo altre verifiche
|
||||
if Proc.Prc == 16 and Proc.Fct == 5 and not bClosedOrthoFaces then
|
||||
-- dalla copia della superfice, ciclo eliminando una faccia per volta per verificare se trova fessura
|
||||
for i = 1, Proc.Fct do
|
||||
local nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
-- elimino una faccia
|
||||
nBottomFace = i - 1
|
||||
if EgtSurfTmRemoveFacet( nNewProc, nBottomFace) then
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( nNewProc, nPartId)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
if nFacInd == -1 then
|
||||
bClosedOrthoFaces = nFacInd2
|
||||
EgtErase( nNewProc)
|
||||
break
|
||||
else
|
||||
EgtErase( nNewProc)
|
||||
local sErr = 'Error : MakeMoreFaces could not find reference face'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- altrimenti esco
|
||||
else
|
||||
EgtErase( nNewProc)
|
||||
break
|
||||
end
|
||||
end
|
||||
-- se riconosciuta fessura ricalcolo l'elevazione dalla faccia di fondo
|
||||
if bClosedOrthoFaces then
|
||||
nFacInd = nBottomFace
|
||||
-- rendo nulla la faccia opzionale perchè si tratta di una fessura
|
||||
nFacInd2 = nil
|
||||
dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd)
|
||||
bClosedOrthoFaces = false -- non setto come tunnel
|
||||
end
|
||||
-- se scanalatura chiusa lavoro la faccia di fondo
|
||||
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
|
||||
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, 4)[1]
|
||||
nFacInd2 = nil
|
||||
dFacElev = Proc.Face[ nFacInd + 1].Elevation
|
||||
end
|
||||
-- se proviene da divisione in parti lungo X ed è un tunnel non è fattibile
|
||||
if not bSinglePart and bClosedOrthoFaces then
|
||||
@@ -4581,13 +4561,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dDepth = dDepth / 2 + BD.CUT_EXTRA
|
||||
end
|
||||
end
|
||||
local dWorkDepth = dDepth
|
||||
-- cerco di estendere il taglio considerando la parte arrotondata della lama + 1
|
||||
local dWorkDepth = dMaxMat
|
||||
-- cerco di estendere il taglio considerando la parte arrotondata della lama
|
||||
if dMaxMat > dDepth + dSawCornerRad + 1 then
|
||||
dWorkDepth = dDepth + dSawCornerRad + 1
|
||||
-- se massimo affondamento utensile inferiore alla profondità da lavorare, setto la profondità di lavoro e emetto warning
|
||||
elseif dMaxMat < dDepth then
|
||||
dWorkDepth = dMaxMat
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
@@ -4871,8 +4850,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- altrimenti lavorazione di svuotatura o contornatura
|
||||
else
|
||||
local bUseOtherFace
|
||||
local bLapJointAngTrasm = false
|
||||
-- se è presente il rinvio angolare ed è una tasca cieca perfettamente verticale, da sotto
|
||||
if BD.ANG_TRASM and Proc.Fct == 5 and AreOppositeVectorApprox( vtN, Z_AX()) then
|
||||
bLapJointAngTrasm = true
|
||||
-- se orientata verso il basso e non c'è testa da sotto, verifico l'alternativa
|
||||
if vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 then
|
||||
elseif vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 then
|
||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
nFacInd, nFacInd2 = nFacInd2, nFacInd
|
||||
dFacElev, dFacElev2 = dFacElev2, dFacElev
|
||||
@@ -4880,7 +4863,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
-- verifico non sia orientata verso il basso o ci sia una testa dal basso o la lavorazione sia dal lato.
|
||||
local bFaceDown = ( vtN:getZ() < BD.NZ_MINA)
|
||||
if bFaceDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill then
|
||||
if bFaceDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill and not bLapJointAngTrasm then
|
||||
local sErr = 'Error : LapJoint from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
@@ -4929,6 +4912,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342)
|
||||
-- settaggio voluto da Alessandro/Fabio (per fare angoli con fresa piccola)
|
||||
sMchFind = 'Pocket'
|
||||
if bLapJointAngTrasm then sMchFind = 'Pocket_AT' end
|
||||
local dDiam = min( dH, dV)
|
||||
local bTailOnSide = ( Proc.Box:getMin():getX() - b3Solid:getMin():getX() < 0.1 and not Proc.Tail and not bAllWithEndCap)
|
||||
if ( Proc.Fct == 1) or (( Proc.Fct == 2 or Proc.Fct == 3) and bIsL) or ((( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 4 and not bTailOnSide)) and bSinglePart) then
|
||||
@@ -4938,11 +4922,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
elseif Proc.Fct == 4 then
|
||||
-- se non angoli fittizi, per rifinire gli angoli premio utensile diam 25 o da BD
|
||||
if not bAllWithEndCap then
|
||||
dDiam = min( dDiam, BD.MAXDIAM_POCK_CORNER)
|
||||
dDiam = min( EgtIf( bIsL, 2, 1) * dDiam + 10 * GEO.EPS_SMALL, BD.MAXDIAM_POCK_CORNER)
|
||||
end
|
||||
elseif Proc.Fct == 3 and bIsL then
|
||||
-- per rifinire gli angoli premio utensile diam 25 o da BD
|
||||
dDiam = min( ( 2 * dDiam) + 10 * GEO.EPS_SMALL, BD.MAXDIAM_POCK_CORNER)
|
||||
dDiam = min( 2 * dDiam + 10 * GEO.EPS_SMALL, BD.MAXDIAM_POCK_CORNER)
|
||||
else
|
||||
dDiam = 2 * dDiam
|
||||
end
|
||||
@@ -4957,23 +4941,23 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if bNewCheck and Proc.Prc == 20 and nUseRoughTool == 0 then
|
||||
-- verifico se forzato uso truciolatore
|
||||
nUseRT = EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i')
|
||||
if nUseRT and nUseRT ~= 0 then
|
||||
if nUseRT and nUseRT ~= 0 then
|
||||
sMchFind = 'OpenPocket'
|
||||
nUseRoughTool = 1
|
||||
end
|
||||
end
|
||||
-- 03/12/2020 aggiunto controllo su feature 30 senza uso truciolatore
|
||||
if bNewCheck and Proc.Prc == 30 and nUseRoughTool == 0 then
|
||||
-- se è una tasca aperta e forzo lavorazione laterale, cerco il truciolatore (di norma il truciolatore è solo OpenPocket)
|
||||
if bNewCheck and Proc.Prc == 30 and nUseRoughTool == 0 and Proc.Fct < 5 and not bClosedOrthoFaces then
|
||||
-- verifico se forzato uso truciolatore
|
||||
nUseRT = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i')
|
||||
if nUseRT and nUseRT ~= 0 then
|
||||
if nUseRT and nUseRT ~= 0 then
|
||||
sMchFind = 'OpenPocket'
|
||||
nUseRoughTool = 1
|
||||
end
|
||||
end
|
||||
-- se processo 20 e non sto usando il truciolatore
|
||||
if Proc.Prc == 20 and nUseRoughTool == 0 then
|
||||
if nUseRT and nUseRT ~= 0 then
|
||||
if nUseRT and nUseRT ~= 0 then
|
||||
sMchFind = 'OpenPocket'
|
||||
nUseRoughTool = 1
|
||||
end
|
||||
@@ -4985,7 +4969,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
-- ricerca lavorazione
|
||||
local sPocketing
|
||||
local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillDown)
|
||||
local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
|
||||
if not sMyPocketing and bMillUp then
|
||||
_, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind)
|
||||
bMillDown = false
|
||||
@@ -5126,12 +5110,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local bMadeASbyBld = false
|
||||
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
||||
local bOk
|
||||
local bSawDown = ( bMillDown and not bMillUp)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
||||
if not bOk then return false, sWarn end
|
||||
end
|
||||
-- in base al flag interno e al numero di facce e se ha forma ad U
|
||||
@@ -5154,7 +5138,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- 3 facce non a L ma con una faccia favorevole a Y, oppure
|
||||
-- 4 facce
|
||||
-- lancio la MakePocket ( lavorazione solo da un lato, fondo della tasca la faccia più favorevole a Y)
|
||||
if bForceSideMill and (( Proc.Fct == 3 and bIsL) or ( ( Proc.Fct == 3 or Proc.Fct == 2) and abs( vtNFacApproxY:getY()) >= 0.707 ) or Proc.Fct == 4) then
|
||||
if bForceSideMill and (( Proc.Fct == 3 and bIsL) or ( ( Proc.Fct == 3 or Proc.Fct == 2) and abs( vtNFacApproxY:getY()) >= 0.707 ) or ( Proc.Fct == 4 and Proc.Topology == 'Groove')) then
|
||||
nFacInd, vtN, ptC = nFacApproxY, vtNFacApproxY, ptCFacApproxY
|
||||
local tvtNx = {}
|
||||
tvtNx[2] = vtN
|
||||
@@ -5201,7 +5185,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
||||
end
|
||||
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId)
|
||||
if not bOk then return false, sWarn2 end
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
@@ -5264,7 +5248,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
sWarn = sErr
|
||||
-- se ho antischeggia con fresa le inserisco
|
||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
||||
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||
@@ -5365,12 +5349,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local bMadeASbyBld = false
|
||||
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
||||
local bOk
|
||||
local bSawDown = ( bMillDown and not bMillUp)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
||||
if not bOk then return false, sWarn end
|
||||
end
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
@@ -5384,8 +5368,34 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- eseguo la svuotatura della faccia principale, mi restituisce id utensile, il diametro utensile per il foro opzionale
|
||||
local tvtNx = {}
|
||||
tvtNx[2] = vtN
|
||||
-- recupero alcuni parametri dell'utensile per decidere la distanza di sicurezza da utilizzare
|
||||
local dMaxToolCutDepth = 0
|
||||
local dMaxToolMaterial = 0
|
||||
local dToolThLength = 999
|
||||
local dToolTotalLength = 0
|
||||
local dToolThDiameter = 999
|
||||
local dToolDiameter = 0
|
||||
if EgtMdbSetCurrMachining( sPocketing) then
|
||||
local sTuuidPk = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
|
||||
dMaxToolCutDepth = EgtTdbGetCurrToolMaxDepth() or dMaxToolCutDepth
|
||||
dMaxToolMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxToolMaterial
|
||||
dToolDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiameter
|
||||
dToolThLength = EgtTdbGetCurrToolThLength() or dToolThLength
|
||||
dToolThDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dToolThDiameter
|
||||
dToolTotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) or dToolTotalLength
|
||||
end
|
||||
end
|
||||
local dMachiningDepth = 0
|
||||
-- se il gambo è più largo dell'utensile verifico se la lunghezza del gambo è maggiore della distanza di sicurezza calcolata
|
||||
local dShankLength = dToolTotalLength - dToolThLength - dMaxToolCutDepth
|
||||
if ( dMaxToolCutDepth < dMaxToolMaterial - 10 * GEO.EPS_SMALL) and ( dShankLength > dCollSic + 10 * GEO.EPS_SMALL) then
|
||||
dMachiningDepth = dFacElev + BD.COLL_SIC
|
||||
else
|
||||
dMachiningDepth = dFacElev + dCollSic
|
||||
end
|
||||
local bOk, sWarn2
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev + dCollSic, nil, nil, bAllWithEndCap)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId)
|
||||
if not bOk then return false, sWarn2 end
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
@@ -5483,62 +5493,104 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- ottengo la distanza tra la fine del pezzo e il pezzo successivo
|
||||
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
|
||||
-- verifico se applicare gestione speciale delle giunzioni (U diretta come asse X)
|
||||
local bAddEndCap = false
|
||||
local bAddEndCapLeftSide, bAddEndCapRightSide = false, false
|
||||
local dAddLen = 0
|
||||
local bIsOpenU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
|
||||
if bIsOpenU then
|
||||
local ptC0, vtN0 = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
local ptC1, vtN1 = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
||||
local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, 2, GDB_ID.ROOT)
|
||||
if vtN0:getX() < 0.0175 and vtN1:getX() < 0.0175 and vtN2:getX() < 0.0175 then
|
||||
if abs( vtN0:getX()) < 0.0175 and abs( vtN1:getX()) < 0.0175 and abs( vtN2:getX()) < 0.0175 then
|
||||
local dWidth = 0
|
||||
if vtN0 * vtN1 < -0.9998 then
|
||||
bAddEndCap = true
|
||||
bAddEndCapLeftSide = true
|
||||
dWidth = ( ptC1 - ptC0) * vtN0
|
||||
elseif vtN0 * vtN2 < -0.9998 then
|
||||
bAddEndCap = true
|
||||
bAddEndCapLeftSide = true
|
||||
dWidth = ( ptC2 - ptC0) * vtN0
|
||||
elseif vtN1 * vtN2 < -0.9998 then
|
||||
bAddEndCap = true
|
||||
bAddEndCapLeftSide = true
|
||||
dWidth = ( ptC2 - ptC1) * vtN1
|
||||
end
|
||||
dAddLen = min( dWidth, 100) / 2
|
||||
end
|
||||
end
|
||||
-- verifico se applicare gestione speciale per tunnel
|
||||
local nSurfBottomId
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
bAddEndCapLeftSide = true
|
||||
bAddEndCapRightSide = true
|
||||
-- recupero centro e normale delle facce
|
||||
local vtN = {}
|
||||
for i = 1, Proc.Fct do
|
||||
vtN[i] = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||
end
|
||||
-- calcolo l'orientamento del tunnel
|
||||
local vtOrtho
|
||||
local bAdj = EgtSurfTmFacetsContact( Proc.Id, 0, 1)
|
||||
if bAdj then
|
||||
vtOrtho = vtN[1] ^ vtN[2]
|
||||
else
|
||||
if Proc.Fct >= 3 then
|
||||
vtOrtho = vtN[1] ^ vtN[3]
|
||||
else
|
||||
local sErr = 'Error : disconnected tunnel'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
vtOrtho = EgtIf( abs( vtOrtho:getY()) > abs( vtOrtho:getZ()), -Y_AX(), -Z_AX())
|
||||
local ptMaxBox = Proc.Box:getMax()
|
||||
-- per creare le superfici di cap nei tunnel serve aggiungere una faccia di fondo
|
||||
-- recupero il box della trave e lo ingrandisco di poco per essere sicuro di avere intersezione con il piano di fondo
|
||||
local b3SolidExtended = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
b3SolidExtended:expand( 100 * GEO.EPS_SMALL)
|
||||
-- superficie di fondo
|
||||
nSurfBottomId = EgtSurfTmPlaneInBBox( nAddGrpId, ptMaxBox, vtOrtho, b3SolidExtended, GDB_ID.ROOT)
|
||||
-- calcolo di quanto allargare le superfici
|
||||
local dWidth = EgtIf( Proc.AffectedFaces.Front, Proc.Box:getDimZ(), Proc.Box:getDimY())
|
||||
dAddLen = min( dWidth, 100) / 2
|
||||
end
|
||||
-- la divido in parti lungo X
|
||||
local vAddId = {}
|
||||
local bAllWithEndCap = bAddEndCap
|
||||
local bAllWithEndCap = bAddEndCapLeftSide or bAddEndCapRightSide
|
||||
local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_MAXLEN), 2)
|
||||
local dPartLen = Proc.Box:getDimX() / nPart
|
||||
local Xmin = Proc.Box:getMin():getX()
|
||||
-- trimesh per la creazione degli EndCap
|
||||
local AddIdCopy = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
-- aggiunta di eventuale fondo alla trimesh per creare correttamente le superfici EndCap
|
||||
if nSurfBottomId then EgtSurfTmAdd( AddIdCopy, nSurfBottomId) end
|
||||
for i = 1, nPart do
|
||||
local nCapIdLeftSide, nCapIdRightSide
|
||||
-- eseguo divisione
|
||||
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
if i > 1 or bAddEndCap then
|
||||
-- definizione del piano
|
||||
if i > 1 or bAddEndCapLeftSide then
|
||||
-- definizione del piano sinsitro
|
||||
local dAdd = EgtIf( i > 1, dAddLen, 0)
|
||||
local ptOn = Point3d( Xmin - dAdd + ( i - 1) * dPartLen, 0, 0)
|
||||
local vtN = -X_AX()
|
||||
-- se richiesto, creazione tappo
|
||||
local CapId
|
||||
if bAddEndCap then
|
||||
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOn, vtN, AddId, nAddGrpId, GDB_RT.GLOB)
|
||||
-- se richiesto, creazione tappo sinistro
|
||||
if bAddEndCapLeftSide then
|
||||
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOn, vtN, AddIdCopy, nAddGrpId, GDB_RT.GLOB)
|
||||
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
|
||||
EgtCloseCurveCompo( nFirstId)
|
||||
CapId = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
||||
if not CapId then bAllWithEndCap = false end
|
||||
end
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||
EgtErase( nId)
|
||||
end
|
||||
nCapIdLeftSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
||||
if not nCapIdLeftSide then bAllWithEndCap = false end
|
||||
end
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||
EgtErase( nId)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- taglio della superficie
|
||||
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
||||
-- se esiste, aggiunta del tappo
|
||||
if CapId then
|
||||
AddId = EgtSurfTmBySewing( nAddGrpId, { AddId, CapId})
|
||||
if i > 1 then
|
||||
-- taglio della superficie lato sinistro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
||||
end
|
||||
-- se esiste, aggiunta del tappo sinistro
|
||||
if nCapIdLeftSide then
|
||||
AddId = EgtSurfTmBySewing( nAddGrpId, { AddId, nCapIdLeftSide})
|
||||
-- se prima spezzatura, allungamento per non lasciare archi
|
||||
if i == 1 then
|
||||
local b3Box = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
|
||||
@@ -5548,21 +5600,45 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
if i < nPart then
|
||||
local ptOn = Point3d( Xmin + i * dPartLen, 0, 0)
|
||||
-- definizione del piano destro
|
||||
local dAdd = EgtIf( i < nPart, dAddLen, 0)
|
||||
local ptOn = Point3d( Xmin + dAdd + i * dPartLen, 0, 0)
|
||||
local vtN = X_AX()
|
||||
-- taglio della superficie lato destro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
||||
-- se richiesto, creazione tappo destro
|
||||
if bAddEndCapRightSide then
|
||||
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOn, vtN, AddIdCopy, nAddGrpId, GDB_RT.GLOB)
|
||||
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
|
||||
EgtCloseCurveCompo( nFirstId)
|
||||
nCapIdRightSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
||||
if not nCapIdRightSide then bAllWithEndCap = false end
|
||||
end
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||
EgtErase( nId)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se esiste, aggiunta del tappo destro
|
||||
if nCapIdRightSide then
|
||||
AddId = EgtSurfTmBySewing( nAddGrpId, { AddId, nCapIdRightSide})
|
||||
end
|
||||
EgtSetName( AddId, 'AddPart_' .. tostring( Proc.Id) .. '_' .. tostring( i))
|
||||
-- eseguo inserimento in modo da ordinare da X+ a X-
|
||||
table.insert( vAddId, 1, AddId)
|
||||
end
|
||||
EgtErase( AddIdCopy)
|
||||
-- applico le lavorazioni sulle diverse parti
|
||||
local sWarn
|
||||
local bPrevBhSideMill
|
||||
for i = 1, #vAddId do
|
||||
local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD)
|
||||
local nFct = EgtSurfTmFacetCount( vAddId[i])
|
||||
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg}
|
||||
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId}
|
||||
Topology.Classify( AddProc, b3Raw)
|
||||
AddProc.AffectedFaces = BL.GetProcessAffectedFaces( AddProc)
|
||||
-- lasciare il false nel sesto parametro (perchè internamente viene verificato se diverso da nil)
|
||||
local bOk, sMyWarn
|
||||
bOk, sMyWarn, bPrevBhSideMill = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId, dOvmHead, bAllWithEndCap, bPrevBhSideMill, bAllWithEndCap)
|
||||
|
||||
+308
-89
@@ -1,4 +1,4 @@
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2023/01/18
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2023/08/01
|
||||
-- Gestione calcolo taglio longitudinale per Travi
|
||||
-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale.
|
||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||
@@ -13,12 +13,23 @@
|
||||
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
|
||||
-- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali.
|
||||
-- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace.
|
||||
-- 2022/11/28 Correzioni varie per attacco, pulizia spigoli, utilizzo H3
|
||||
-- 2022/11/28 Correzioni varie per attacco, pulizia spigoli, utilizzo H3.
|
||||
-- 2022/11/30 Modifiche su SCC per TURN.
|
||||
-- 2023/01/18 Aggiunta, se richiesta, una lavorazione ulteriore con sega a catena nei casi in cui la doppia lama non sia sufficiente.
|
||||
-- 2023/01/26 Rimossa la pulitura della faccia laterale nel caso in cui la feature abbia almeno una faccia rivolta verso il basso.
|
||||
-- 2023/01/27 In MakeSideFace il prolungamento di uscita è ora fissato a 10 mm.
|
||||
-- 2023/01/27 In caso di lavorazione aggiuntiva con fresa a catena il taglio con lama da sotto viene effettuato a step.
|
||||
-- 2023/02/15 Migliorato verso di avanzamento della lama.
|
||||
-- 2023/02/21 Verso di avanzamento della lama migliorato anche con lama LC.
|
||||
-- 2023/02/22 Nuova gestione del verso di avanzamento ottimale che contempla tutti i casi.
|
||||
-- 2023/03/06 Correzione per i casi con lavorazione limitata.
|
||||
-- 2023/03/15 Modifica alla lavorazione ulteriore con sega a catena per togliere il codolo e lasciare solo dei punti di supporto.
|
||||
-- 2023/03/22 Correzione a SCC lama a seguito di modifiche alle direzioni dei tagli.
|
||||
-- 2023/04/17 Gestione unificata SCC tramite funzione apposita GetSCC
|
||||
-- 2023/05/03 Corretto SCC in caso di asse utensile allineato con Z.
|
||||
-- 2023/05/19 Migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo.
|
||||
-- 2023/08/01 Ammesso uso lama da sotto fino a N +3deg in verticale.
|
||||
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLongCut = {}
|
||||
@@ -56,6 +67,143 @@ function ProcessLongCut.Classify( Proc)
|
||||
return true, false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Estrazione dell'UUID utensile di una lavorazione
|
||||
function GetToolUUID( sMachining)
|
||||
if EgtMdbSetCurrMachining( sMachining) then
|
||||
local sToolUUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
return sToolUUID
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Calcolo dei versori caratteristici della feature
|
||||
function GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert, sMachining)
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
|
||||
local vtOrthO = BL.GetVersRef( nFaceUse)
|
||||
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( Proc.Id, nFacet, vtOrthO, GDB_ID.ROOT)
|
||||
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
|
||||
local dAllStart = 0
|
||||
local dAllEnd = 0
|
||||
-- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo
|
||||
if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then
|
||||
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
|
||||
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
|
||||
local dDist1 = dist( ptP1, ptPm)
|
||||
local dDist2 = dist( ptP2, ptPm)
|
||||
local dCosMax = 0.951 -- cos( 18°)
|
||||
local dLenMin = 30
|
||||
local dToolDiam = 400
|
||||
if EgtMdbSetCurrMachining( sMachining) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
end
|
||||
end
|
||||
local dLenMax = max( 0.5 * dToolDiam * 0.17365 + 1, 2 * dLenMin)
|
||||
--if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then
|
||||
if vtTg1 * vtTg2 < dCosMax then
|
||||
local dOrtho1 = abs( vtTg1 * vtOrthO)
|
||||
local dOrtho2 = abs( vtTg2 * vtOrthO)
|
||||
if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then
|
||||
if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then
|
||||
ptP2 = Point3d( ptPm)
|
||||
dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL
|
||||
end
|
||||
else
|
||||
if dDist2 > dLenMin or dDist2 > 0.5 * dDist1 then
|
||||
ptP1 = Point3d( ptPm)
|
||||
dAllStart = - dDist1 - 10 * GEO.EPS_SMALL
|
||||
end
|
||||
end
|
||||
vtTg = ptP2 - ptP1 ; vtTg:normalize()
|
||||
end
|
||||
end
|
||||
local bWsRight = ( bInvert)
|
||||
-- Versore di riferimento
|
||||
local vtRef = Vector3d( vtTg)
|
||||
vtRef:rotate( vtN, 90)
|
||||
-- Versore esterno
|
||||
local vtOut = vtRef - vtRef * vtTg * vtTg ; vtOut:normalize()
|
||||
-- Versore ausiliario (direzione braccio)
|
||||
local vtAux = Vector3d( vtN:getX(), vtN:getY(), 0) ; vtAux:normalize()
|
||||
vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, -90))
|
||||
if vtAux:isSmall() then
|
||||
vtAux = Vector3d( vtOut:getX(), vtOut:getY(), 0) ; vtAux:normalize()
|
||||
else
|
||||
if abs( vtAux * vtOut) < GEO.EPS_SMALL then
|
||||
if abs( vtTg:getZ()) > 0.5 then
|
||||
if vtAux * vtRef < 0 then
|
||||
vtAux = - vtAux
|
||||
end
|
||||
elseif vtAux * vtTg > 0 then
|
||||
vtAux = - vtAux
|
||||
end
|
||||
elseif vtAux * vtOut < 0 then
|
||||
vtAux = - vtAux
|
||||
end
|
||||
end
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
|
||||
return vtAux, vtRef, vtOut, vtTg
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Calcolo posizione braccio
|
||||
function ProcessLongCut.GetSCC( Proc, nFacet, sMachining, nFaceUse, bInvert, nCuttingStep, nC, bAreCuttingStepsTowardsHead, bIsTopBlade, bCustUseBlade)
|
||||
local nSCC
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
|
||||
local sToolUUID = GetToolUUID( sMachining)
|
||||
local bIsBlade
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sToolUUID) or '') then
|
||||
bIsBlade = ( ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0)
|
||||
end
|
||||
|
||||
-- se Turn posiziono la testa per creare il minor ingombro possibile
|
||||
if BD.TURN then
|
||||
if nFaceUse == MCH_MILL_FU.ORTHO_DOWN or ( ( nFaceUse == MCH_MILL_FU.PARAL_FRONT or nFaceUse == MCH_MILL_FU.PARAL_BACK) and vtN:getZ() > -GEO.EPS_SMALL) then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif nFaceUse == MCH_MILL_FU.ORTHO_TOP or ( nFaceUse == MCH_MILL_FU.PARAL_FRONT or nFaceUse == MCH_MILL_FU.PARAL_BACK) then
|
||||
nSCC = MCH_SCC.ADIR_ZM
|
||||
elseif nFaceUse == MCH_MILL_FU.ORTHO_FRONT or ( ( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP) and vtN:getY() > -GEO.EPS_SMALL) then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
elseif nFaceUse == MCH_MILL_FU.ORTHO_BACK or ( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
-- se Fast e fresa con asse utensile diretto come Z posiziono l'aggregato in Ym per avere il minore ingombro possibile
|
||||
elseif not BD.C_SIMM and not bIsBlade and AreSameVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
-- se Fast ( escluso caso speciale con taglio non passante e inclinato in X e escluso caso con lama esattamente diretta in Z) posiziono l'aggregato in X per ottimizzare il pinzaggio
|
||||
elseif not BD.C_SIMM and ( not ( bCustUseBlade and abs(vtN:getX()) > 0.001) or not bIsBlade) and not ( bIsBlade and AreSameVectorApprox( vtN, Z_AX())) then
|
||||
if bAreCuttingStepsTowardsHead then
|
||||
nSCC = EgtIf( ( not ( nCuttingStep == 1 or nCuttingStep == nC - 1)), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
else
|
||||
nSCC = EgtIf( ( not ( nCuttingStep == 1 or nCuttingStep == nC - 1)), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
end
|
||||
-- per Fast ( caso speciale con taglio non passante e inclinato in X e caso lama diretta esattamente in Z)
|
||||
elseif not BD.C_SIMM then
|
||||
local vtAux = GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert, sMachining)
|
||||
if bCustUseBlade then
|
||||
nSCC = EgtIf( ( nFaceUse == MCH_MILL_FU.ORTHO_TOP or nFaceUse == MCH_MILL_FU.ORTHO_FRONT) and vtN:getY() > -GEO.EPS_SMALL, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
elseif ( abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL) then
|
||||
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
else
|
||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
end
|
||||
-- per PF o simili e lama con aggregato lo posiziono per stare il più lontano possibile dalla trave
|
||||
elseif ( bIsBlade and bIsTopBlade) then
|
||||
if abs( vtN:getX()) > 0.001 then
|
||||
local vtAux = GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert, sMachining)
|
||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
end
|
||||
-- per PF o simili e lama senza aggregato o fresa non do alcuna preferenza
|
||||
else
|
||||
nSCC = MCH_SCC.NONE
|
||||
end
|
||||
|
||||
return nSCC
|
||||
end
|
||||
-----------------------------------------------------------------------------------------------
|
||||
local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam, bForcedLim, dDistToMachine, bUnderDir)
|
||||
if ( not BD.DOWN_HEAD or not BD.TURN) and nSide == -1 then
|
||||
@@ -290,7 +438,7 @@ end
|
||||
-- Applicazione della lavorazione
|
||||
local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
-- cerco la svuotatura opportuna
|
||||
local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX())
|
||||
if not sPocketing then
|
||||
@@ -347,12 +495,13 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- lavorazione faccia laterale con sega a catena
|
||||
local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal)
|
||||
local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShortenStart, bShortenEnd)
|
||||
-- Recupero i dati dell'utensile
|
||||
local sSawing = ML.FindSawing( 'Sawing')
|
||||
local dMaxMat = 0
|
||||
local dSawCornerRad = 0
|
||||
local dSawThick = 0
|
||||
local dSawDiameter = 0
|
||||
-- se non trova una lavorazione di sawing esco
|
||||
if not sSawing then
|
||||
local sErr = 'Error : Sawing not found in library'
|
||||
@@ -365,6 +514,7 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal)
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
||||
dSawCornerRad = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or dSawCornerRad
|
||||
dSawDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiameter
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -388,9 +538,19 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal)
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
|
||||
-- imposto eventuale sovramateriale
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||
-- imposto tratti in cui la sega a catena non lavora per lasciare del materiale di supporto
|
||||
local dSupportingWoodLength = 30
|
||||
-- imposto allungamento percorso iniziale e finale
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
if bShortenStart then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal - dSupportingWoodLength - dSawDiameter)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
end
|
||||
if bShortenEnd then
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal - dSupportingWoodLength - dSawDiameter)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
end
|
||||
-- imposto il lato di lavorazione
|
||||
local nWorkSide = MCH_MILL_WS.RIGHT
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
|
||||
@@ -536,8 +696,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.5 then
|
||||
bCanUseUnderBlade = true
|
||||
end
|
||||
-- se faccia da sotto o di lato ma con versore Z sotto l'orizzontale abilito la lavorazione con lame mixate
|
||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= 0.0175 then
|
||||
-- se faccia da sotto o di lato ma con versore Z sotto l'orizzontale abilito la lavorazione con lame mixate (limite 3 deg verso alto)
|
||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= 0.053 then
|
||||
bCanUseUnderBlade = true
|
||||
end
|
||||
-- se faccia da sopra o di lato ma con versore Z negativo verifico che abbia un angolo compatibile (28deg) per non avere extracorsa
|
||||
@@ -568,11 +728,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
local dToolDiam = 0
|
||||
local dThick = 0
|
||||
local dMaxDepth = 0
|
||||
local dMaxVertDepth = 0
|
||||
local sCuttingDn
|
||||
local dToolDiamDn = 0
|
||||
local dThickDn = 0
|
||||
local dMaxDepthDn = 0
|
||||
-- recupero la lavorazione
|
||||
-- recupero eventuale lavorazione con lama su testa da sotto
|
||||
if bCanUseUnderBlade then
|
||||
sCuttingDn = ML.FindCutting( 'HeadSide_H2', false, true)
|
||||
if not sCuttingDn then
|
||||
@@ -590,6 +751,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
end
|
||||
end
|
||||
-- recupero eventuale lavorazione con lama
|
||||
if bCanUseBlade then
|
||||
local sCutType = EgtIf( BD.USE_LONGCUT, 'LongCut', 'HeadSide')
|
||||
sCutting = ML.FindCutting( sCutType)
|
||||
@@ -605,6 +767,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThick
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -745,7 +908,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
bFinishWithChainSaw = EgtIf ( ( EgtGetInfo( Proc.Id, 'Q05', 'i') or 0) == 1, true, false)
|
||||
end
|
||||
|
||||
local nFaceUse
|
||||
local nFaceUse
|
||||
local nFaceUse2
|
||||
-- se ho solo lama da sotto
|
||||
if bCanUseUnderBlade and not bCanUseBlade then
|
||||
@@ -759,21 +922,23 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
-- si percorrono i lati alto e basso della faccia
|
||||
-- calcolo quanto è l'affondamento del taglio
|
||||
local dOffsetTopBlade = ( dWidth + dDimStrip) / 2
|
||||
local dOffsetDownBlade = ( dWidth + dDimStrip) / 2
|
||||
local dMainMaxDepth = EgtIf( abs( vtN:getY()) < 1e-6, dMaxDepth, dMaxVertDepth)
|
||||
local dOtherMaxDept = EgtIf( bCanUseUnderBlade, dMaxDepthDn, dMainMaxDepth)
|
||||
local dCoeff = min( ( dWidth - dDimStrip) / ( dMainMaxDepth + dOtherMaxDept), 1)
|
||||
local dOffsetTopBlade = dWidth - dCoeff * dMainMaxDepth
|
||||
local dOffsetDownBlade = dWidth - dCoeff * dOtherMaxDept
|
||||
local nStepDownBlade = 1
|
||||
local dStepDownBlade = dWidth - dOffsetDownBlade
|
||||
local dStepDownBlade = dOtherMaxDept
|
||||
-- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama
|
||||
if ( nSide == -1 or abs(nSide) == 2) and bCanUseUnderBlade and (( dWidth - dDimStrip) / 2) > dMaxDepthDn then
|
||||
if ( nSide == -1 or abs(nSide) == 2) and bCanUseUnderBlade and ( dOffsetTopBlade - dDimStrip) > dOtherMaxDept then
|
||||
if bFinishWithChainSaw then
|
||||
dOffsetTopBlade = max( dWidth - dMaxDepth + ( BD.DECR_VERT_CUT or 0), dOffsetTopBlade)
|
||||
dOffsetDownBlade = max( dWidth - dMaxDepthDn, dOffsetDownBlade)
|
||||
local dHCutDownBlade = dWidth - dOffsetDownBlade
|
||||
local dMaxStepDownBlade = 64
|
||||
local dMaxStepDownBlade = 80
|
||||
nStepDownBlade = ceil( dHCutDownBlade / dMaxStepDownBlade)
|
||||
dStepDownBlade = dHCutDownBlade / nStepDownBlade
|
||||
else
|
||||
local sErr = 'Error : side depth is bigger than underneath blade cut depth'
|
||||
local dDelta = dWidth - dDimStrip - ( dMainMaxDepth + dOtherMaxDept)
|
||||
local sErr = 'Error : side depth is bigger than total cut depth (Diff=' .. EgtNumToString( dDelta)..')'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -813,7 +978,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
-- eventuale lavorazione della faccia limitante l'inizio
|
||||
if not bStartFixed then
|
||||
local vtIni = -X_AX()
|
||||
local vtIni = -X_AX()
|
||||
for j = 1, Proc.Fct - 1 do
|
||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
||||
@@ -829,7 +994,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
|
||||
-- eventuale lavorazione della faccia limitante la fine
|
||||
if not bEndFixed then
|
||||
local vtFin = X_AX()
|
||||
local vtFin = X_AX()
|
||||
for j = 1, Proc.Fct - 1 do
|
||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
||||
@@ -846,11 +1011,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
|
||||
-- inserisco tagli di lama
|
||||
for i = 1, nC do
|
||||
-- Posizione braccio portatesta
|
||||
local nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
-- ciclo sulle passate
|
||||
local dLioTang = 0
|
||||
|
||||
for k = 1, 2 do
|
||||
local nStep = 1
|
||||
if k == 2 then nStep = nStepDownBlade end
|
||||
@@ -864,7 +1026,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
bAddOpposite = false
|
||||
end
|
||||
-- faccio in modo di calcolare il valore perpendicolare solo sulla faccia da sotto nel secondo passo o sulla faccia di fianco nel primo passo
|
||||
if nSide == 1 or ( nSide == -1 and k == 1) or ( abs(nSide) == 2 and k == 2) then
|
||||
if nSide == 1 or ( nSide == -1 and k == 1) or ( abs(nSide) == 2 and k == 2) then
|
||||
bAddOpposite = false
|
||||
end
|
||||
if bAddOpposite then
|
||||
@@ -914,36 +1076,87 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
||||
|
||||
-- settaggio di workside, uso faccia e eventuale inversione
|
||||
-- limito opportunamente la lavorazione
|
||||
local dSal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC)
|
||||
local dEal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC)
|
||||
if ( not bFront and k == 1) or ( bFront and k == 2) then
|
||||
local dSalInner, dSalOuter = - dEndAccDist - ( i - 2) * dC, -dEndDist
|
||||
local dEalInner, dEalOuter = - dStartAccDist - ( nC - i - 1) * dC, -dStartDist
|
||||
local dSal = EgtIf( i == 1, dSalOuter, dSalInner)
|
||||
local dEal = EgtIf( i == nC, dEalOuter, dEalInner)
|
||||
if ( bFront and k == 1) or ( not bFront and k == 2) then
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
|
||||
|
||||
-- verifico lama in uso e imposto uso faccia
|
||||
local bIsTopBladeCurrent
|
||||
local nFaceUseCurrent
|
||||
if bCanUseBlade and bCanUseUnderBlade then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
dSal, dEal = dEal, dSal
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse2, nFaceUse))
|
||||
elseif bCanUseBlade and BD.USE_LONGCUT then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
dSal, dEal = dEal, dSal
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse2, nFaceUse))
|
||||
elseif bCanUseUnderBlade then
|
||||
if abs(nSide) ~= 2 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
if k == 1 then
|
||||
bIsTopBladeCurrent = true
|
||||
nFaceUseCurrent = nFaceUse2
|
||||
else
|
||||
bIsTopBladeCurrent = false
|
||||
nFaceUseCurrent = nFaceUse
|
||||
end
|
||||
elseif bCanUseUnderBlade then
|
||||
if k == 1 then
|
||||
bIsTopBladeCurrent = false
|
||||
nFaceUseCurrent = nFaceUse
|
||||
else
|
||||
bIsTopBladeCurrent = false
|
||||
nFaceUseCurrent = nFaceUse2
|
||||
end
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
|
||||
else
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
|
||||
if k == 1 then
|
||||
bIsTopBladeCurrent = true
|
||||
nFaceUseCurrent = nFaceUse
|
||||
else
|
||||
bIsTopBladeCurrent = true
|
||||
nFaceUseCurrent = nFaceUse2
|
||||
end
|
||||
end
|
||||
|
||||
-- recupero alcune informazioni utili dalla lavorazione attuale
|
||||
local bIsCurrentBladeCCW
|
||||
if bIsTopBladeCurrent then
|
||||
EgtMdbSetCurrMachining( sCutting)
|
||||
else
|
||||
EgtMdbSetCurrMachining( sCuttingDn)
|
||||
end
|
||||
bIsCurrentBladeCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
||||
|
||||
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
|
||||
local nWorkSide, bInvert
|
||||
if not bIsTopBladeCurrent and abs( nSide) ~= 2 then
|
||||
if bIsCurrentBladeCCW then
|
||||
nWorkSide = MCH_MILL_WS.LEFT
|
||||
bInvert = true
|
||||
dSal, dEal = dEal, dSal
|
||||
else
|
||||
nWorkSide = MCH_MILL_WS.RIGHT
|
||||
bInvert = false
|
||||
end
|
||||
else
|
||||
if bIsCurrentBladeCCW then
|
||||
nWorkSide = MCH_MILL_WS.LEFT
|
||||
bInvert = false
|
||||
else
|
||||
nWorkSide = MCH_MILL_WS.RIGHT
|
||||
bInvert = true
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
end
|
||||
-- step sempre positivi
|
||||
local bAreCuttingStepsTowardsHead = true
|
||||
-- calcolo SCC
|
||||
local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), nFaceUseCurrent, bInvert, i, nC, bAreCuttingStepsTowardsHead, bIsTopBladeCurrent, bCustUseBlade)
|
||||
|
||||
-- setto la lavorazione con i valori calcolati
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUseCurrent)
|
||||
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
-- imposto offset radiale
|
||||
@@ -954,16 +1167,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
|
||||
-- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut)
|
||||
-- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella
|
||||
if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL then
|
||||
if BD.USE_LONGCUT then
|
||||
nSCC = EgtIf( ( bFront and k == 1) or ( not bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
end
|
||||
end
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
-- imposto posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -978,15 +1182,18 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- se richiesto aggiungo la lavorazione con sega a catena
|
||||
if bFinishWithChainSaw then
|
||||
local dChainSawOverMaterial = 0
|
||||
local dChainSawDepth = dOffsetDownBlade - dDimStrip
|
||||
local dChainSawDepth = dOffsetDownBlade + BD.CUT_EXTRA
|
||||
dEndDist = dEndDistUp
|
||||
dEndAccDist = dEndAccDistUp
|
||||
dStartDist = dStartDistUp
|
||||
dStartAccDist = dStartAccDistUp
|
||||
for i = nC, 1, -1 do
|
||||
local dSal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC)
|
||||
local dEal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC)
|
||||
local bChainSawOk, sErr = MakeSideFaceByChainSaw( Proc.Id, dChainSawDepth, dChainSawOverMaterial, dSal, dEal)
|
||||
local bFirstCut = ( i == nC)
|
||||
local bLastCut = ( i == 1)
|
||||
local dSal = EgtIf( bFirstCut, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC)
|
||||
local dEal = EgtIf( bLastCut, -dStartDist, - dStartAccDist - ( i - 2) * dC)
|
||||
local bShortenStartOrEnd = true
|
||||
local bChainSawOk, sErr = MakeSideFaceByChainSaw( Proc.Id, dChainSawDepth, dChainSawOverMaterial, dSal, dEal, bShortenStartOrEnd, bShortenStartOrEnd)
|
||||
if not bChainSawOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
@@ -998,7 +1205,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- recupero la lavorazione
|
||||
local bDownHead = ( nSide == - 1)
|
||||
sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut')
|
||||
local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1
|
||||
-- rimossa l'esclusione della terza testa a seguito di modifica della testa stessa che la rende utilizzabile in tutti i casi
|
||||
--local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1
|
||||
local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead, nil, bExcludeH3)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling '..sMchType..' not found in library'
|
||||
@@ -1116,17 +1324,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
local nM = 0
|
||||
local nCountMilHead = 0
|
||||
for i = 1, nC do
|
||||
-- Posizione braccio portatesta
|
||||
local nSCC
|
||||
if not BD.TURN then
|
||||
if bFront then
|
||||
nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
else
|
||||
nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
else
|
||||
nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM))
|
||||
end
|
||||
-- ciclo sulle passate
|
||||
local nO = 1
|
||||
local dStep = 0
|
||||
@@ -1152,25 +1349,41 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dWidth + BD.CUT_EXTRA + ( BD.CUT_SIC or 20))
|
||||
end
|
||||
elseif i == nC and not bEndFixed then
|
||||
if nO == 1 or EgtGetMachiningParam( MCH_MP.LOTANG) ~= 0 then
|
||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dWidth + BD.CUT_EXTRA + ( BD.CUT_SIC or 20))
|
||||
end
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
||||
|
||||
-- setto workside e eventuale inversione
|
||||
local bInvert
|
||||
if bInvert then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
end
|
||||
-- limito opportunamente la lavorazione
|
||||
local dSal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
local dEal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC)
|
||||
if bInvert then
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
-- imposto offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep - BD.CUT_EXTRA)
|
||||
-- Posizione braccio portatesta
|
||||
local bAreCuttingStepsTowardsHead = ( nStartSide == 0)
|
||||
local nSCC = ProcessLongCut.GetSCC( Proc, 0, sMilling, nFaceUse, bInvert, i, nC, bAreCuttingStepsTowardsHead, nil, nil)
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto uso della faccia
|
||||
@@ -1181,6 +1394,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
local dDepth = min( 0, dMaxDepth - dElev )
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- eventuale nota utente per disabilitare controllo ingresso e uscita in grezzo
|
||||
if k < nO then
|
||||
local sNotes = 'OutRaw=3;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -1246,8 +1464,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
sMilling = ML.FindMilling( sMchType)
|
||||
sPrefix = 'L2CS_'
|
||||
nExtendMach = nUseMillOnSide
|
||||
if nUseMillOnSide == 2 then
|
||||
bRemoveToolRadius = true
|
||||
if nUseMillOnSide == 2 then
|
||||
bRemoveToolRadius = true
|
||||
end
|
||||
-- se testa da sotto
|
||||
if nSide ~= 1 and BD.DOWN_HEAD then
|
||||
@@ -1532,13 +1750,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
local dSal = EgtIf( nPos == 1, -dEndDist, -dEndAccDist - ( nPos - 2) * dC + dOverLapExtend)
|
||||
local dEal = EgtIf( nPos == nC, -dStartDist, -dStartAccDist - ( nC - nPos - 1) * dC + dOverLapExtend)
|
||||
-- Posizione braccio portatesta
|
||||
local nSCC
|
||||
--local nSCC
|
||||
for k = 1, nPass do
|
||||
if bFront then
|
||||
nSCC = EgtIf( ( BD.C_SIMM or j == 1 or j == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
else
|
||||
nSCC = EgtIf( ( BD.C_SIMM or j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
-- inserisco le parti di lavorazione
|
||||
nM = nM + 1
|
||||
local sNameF = EgtIf( vnHead[k] ~= 2, sPrefix, sPrefixDn) .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
|
||||
@@ -1550,22 +1763,22 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto uso faccia
|
||||
local nUseFace = EgtIf( vnHead[k] ~= 2, MCH_MILL_FU.PARAL_DOWN, MCH_MILL_FU.PARAL_TOP)
|
||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then nUseFace = MCH_MILL_FU.PARAL_BACK end
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nUseFace)
|
||||
local nFaceUse = EgtIf( vnHead[k] ~= 2, MCH_MILL_FU.PARAL_DOWN, MCH_MILL_FU.PARAL_TOP)
|
||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then nFaceUse = MCH_MILL_FU.PARAL_BACK end
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- imposto lato di lavoro e inversione
|
||||
local bInvert
|
||||
if k == 1 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bInvert = true
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
bInvert = false
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
-- limito opportunamente la lavorazione
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
@@ -1574,6 +1787,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- assegno attacco perpendicolare
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp1)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp1)
|
||||
-- step sempre negativi
|
||||
local bAreCuttingStepsTowardsHead = false
|
||||
-- calcolo SCC
|
||||
local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( vnHead[k] ~= 2, sMilling, sMillingDn), nFaceUse, bInvert, j, nC, bAreCuttingStepsTowardsHead, nil, nil)
|
||||
-- imposto posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- se feature orientata su faccia da sotto provo a cambiare l'attacco
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2022/11/30
|
||||
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2023/06/07
|
||||
-- Gestione calcolo doppio taglio longitudinale per Travi
|
||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||
-- 2021/06/29 Corretta gestione caso equivalente a due smussi.
|
||||
@@ -12,6 +12,12 @@
|
||||
-- 2022/11/30 Modifiche su SCC per TURN.
|
||||
-- 2023/01/26 Rimossa la pulitura della faccia laterale nel caso in cui la feature abbia almeno una faccia rivolta verso il basso.
|
||||
-- 2023/01/27 In MakeSideFace il prolungamento di uscita è ora fissato a 10 mm.
|
||||
-- 2023/02/15 Migliorato verso di avanzamento della lama.
|
||||
-- 2023/02/21 Verso di avanzamento della lama migliorato anche con lama LC.
|
||||
-- 2023/02/22 Nuova gestione del verso di avanzamento ottimale che contempla tutti i casi.
|
||||
-- 2023/03/06 Correzione per i casi con lavorazione limitata.
|
||||
-- 2023/03/23 Correzione per caso con doppia lama da sotto.
|
||||
-- 2023/06/07 Sistemazione SCC per macchina TURN
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLong2Cut = {}
|
||||
@@ -120,9 +126,9 @@ function ProcessLong2Cut.GetLongFacesCount( Proc)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam, nL2CSide, bIsAnyFaceUpsideDown)
|
||||
if ( not BD.DOWN_HEAD or not BD.TURN) and bIsAnyFaceUpsideDown then
|
||||
EgtOutLog( 'Long2Cut : side face finishing skipped , down head required')
|
||||
local function MakeSideFace( nId, nFac, nSideLimitingFace, nInd, sMilling, dToolDiam, nL2CSide, bIsAnyFaceUpsideDown)
|
||||
if ( not BD.DOWN_HEAD and not BD.TURN) and bIsAnyFaceUpsideDown then
|
||||
EgtOutLog( 'Long2Cut : side face finishing skipped, down head required')
|
||||
return true
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
@@ -136,8 +142,15 @@ local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam,
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nId, nFac}})
|
||||
-- lato di lavoro e inversione
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
if BD.TURN and
|
||||
( ( nSideLimitingFace == 1 and nInd == EgtIf( nL2CSide ~= -1, 2, 1)) or
|
||||
( nSideLimitingFace == -1 and nInd == EgtIf( nL2CSide ~= -1, 1, 2))) then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
end
|
||||
-- uso della faccia
|
||||
local nFaceUse = EgtIf( nSideLimitingFace == 1, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.ORTHO_LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
@@ -146,8 +159,11 @@ local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam,
|
||||
-- attacco e uscita
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 2)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 5)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 10)
|
||||
if BD.TURN then
|
||||
EgtSetMachiningParam( MCH_MP.LOELEV, 10)
|
||||
end
|
||||
-- se faccia di fianco e testa da sotto, aumento la sicurezza
|
||||
if nL2CSide == 0 and BD.DOWN_HEAD then
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, 80)
|
||||
@@ -527,7 +543,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- Posizione braccio portatesta
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
end
|
||||
local nCountToShift = 0
|
||||
local bChangeBlade
|
||||
@@ -681,46 +697,87 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, vOrd[j]-1}})
|
||||
|
||||
-- settaggio di workside, uso faccia e eventuale inversione
|
||||
-- limito opportunamente la lavorazione
|
||||
local dSal = EgtIf( i == nC, 0, - dEndAccDist - ( nC - i - 1) * dC)
|
||||
local dEal = EgtIf( i == 1, 0, - dStartAccDist - ( i - 2) * dC)
|
||||
if ( not bFront and k == 1) or ( bFront and k == 2) then
|
||||
local dSalInner, dSalOuter = - dEndAccDist - ( i - 2) * dC, 0
|
||||
local dEalInner, dEalOuter = - dStartAccDist - ( nC - i - 1) * dC, 0
|
||||
local dSal = EgtIf( i == 1, dSalOuter, dSalInner)
|
||||
local dEal = EgtIf( i == nC, dEalOuter, dEalInner)
|
||||
if ( bFront and k == 1) or ( not bFront and k == 2) then
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
|
||||
-- verifico lama in uso e imposto uso faccia
|
||||
local bIsTopBladeCurrent = not bMachDown
|
||||
local nFaceUseCurrent
|
||||
if bCanUseBlade and bCanUseUnderBlade then
|
||||
if bCanUseBlade and nSide == -1 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse2, nFaceUse))
|
||||
if nSide == -1 then
|
||||
dSal, dEal = dEal, dSal
|
||||
if k == 1 then
|
||||
nFaceUseCurrent = nFaceUse2
|
||||
else
|
||||
nFaceUseCurrent = nFaceUse
|
||||
end
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
|
||||
if k == 1 then
|
||||
nFaceUseCurrent = nFaceUse
|
||||
else
|
||||
nFaceUseCurrent = nFaceUse2
|
||||
end
|
||||
end
|
||||
elseif bCanUseBlade and BD.USE_LONGCUT then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
dSal, dEal = dEal, dSal
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
|
||||
elseif bCanUseUnderBlade then
|
||||
if nSide ~= 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
if k == 1 then
|
||||
nFaceUseCurrent = nFaceUse
|
||||
else
|
||||
nFaceUseCurrent = nFaceUse2
|
||||
end
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
|
||||
else
|
||||
if bCanUseBlade and nSide == -1 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
if k == 1 then
|
||||
nFaceUseCurrent = nFaceUse
|
||||
else
|
||||
nFaceUseCurrent = nFaceUse2
|
||||
end
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
|
||||
end
|
||||
|
||||
-- recupero alcune informazioni utili dalla lavorazione attuale
|
||||
local bIsCurrentBladeCCW
|
||||
if bIsTopBladeCurrent then
|
||||
EgtMdbSetCurrMachining( sCutting)
|
||||
else
|
||||
EgtMdbSetCurrMachining( sCuttingDn)
|
||||
end
|
||||
bIsCurrentBladeCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
||||
|
||||
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
|
||||
local nWorkSide, bInvert
|
||||
if ( not bIsTopBladeCurrent and abs( nSide) ~= 0) or ( bCanUseBlade and bCanUseUnderBlade and nSide == -1) then
|
||||
if bIsCurrentBladeCCW then
|
||||
nWorkSide = MCH_MILL_WS.LEFT
|
||||
bInvert = true
|
||||
dSal, dEal = dEal, dSal
|
||||
else
|
||||
nWorkSide = MCH_MILL_WS.RIGHT
|
||||
bInvert = false
|
||||
end
|
||||
else
|
||||
if bIsCurrentBladeCCW then
|
||||
nWorkSide = MCH_MILL_WS.LEFT
|
||||
bInvert = false
|
||||
else
|
||||
nWorkSide = MCH_MILL_WS.RIGHT
|
||||
bInvert = true
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
end
|
||||
|
||||
-- setto la lavorazione con i valori calcolati
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUseCurrent)
|
||||
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
|
||||
-- imposto offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, EgtIf( nSide == -1, -dOffset, dOffset))
|
||||
-- imposto attacco/uscita
|
||||
@@ -1049,18 +1106,21 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local nPos = EgtIf( i == 1, j, nC - j + 1)
|
||||
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0))
|
||||
local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC + EgtIf( bSide, dOverLapExtend, 0))
|
||||
if nSide == -1 then
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
-- Posizione braccio portatesta
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if not BD.TURN then
|
||||
nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
else
|
||||
if nSide == 1 then
|
||||
nSCC = EgtIf( vtN[vOrd[i]]:getY() < 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
elseif nSide == -1 then
|
||||
nSCC = EgtIf( vtN[vOrd[i]]:getY() < 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
if nSide == 1 or nSide == -1 then
|
||||
local bFromYM = (( vtN[vOrd[i]]:getY() < 0 and bConvex) or ( vtN[vOrd[i]]:getY() > 0 and not bConvex))
|
||||
nSCC = EgtIf( bFromYM, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
else
|
||||
nSCC = EgtIf( vtN[vOrd[i]]:getZ() < 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
local bFromZM = (( vtN[vOrd[i]]:getZ() < 0 and bConvex) or ( vtN[vOrd[i]]:getZ() > 0 and not bConvex))
|
||||
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1132,11 +1192,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
|
||||
if bConvex and j == 1 and not bStartFixed then
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, i, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
|
||||
end
|
||||
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
|
||||
if bConvex and j == nC and not bEndFixed then
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, i, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1574,11 +1634,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
|
||||
if bConvex and j == 1 and not bStartFixed and bRemoveToolRadius then
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, sMilling, dToolDiam)
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, i, sMilling, dToolDiam)
|
||||
end
|
||||
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
|
||||
if bConvex and j == nC and not bEndFixed and bRemoveToolRadius then
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, sMilling, dToolDiam)
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, i, sMilling, dToolDiam)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+44
-18
@@ -1,4 +1,4 @@
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2022/12/12
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2023/08/10
|
||||
-- Gestione calcolo mortase per Travi
|
||||
-- 2021/07/20 Aggiunta gestione rinvio angolare su FAST.
|
||||
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
|
||||
@@ -9,6 +9,10 @@
|
||||
-- 2022/12/12 Migliorato controllo necessità CleanCorners.
|
||||
-- 2023/01/31 Aggiunta gestione lavorazione in doppio.
|
||||
-- 2023/01/31 Creata la funzione ConvertToClosedCurve (parte della ProcessMortise.Make) e spostata in BeamLib.
|
||||
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
|
||||
-- 2023/06/27 Esclusa la ricerca lati aperti per le mortase passanti, per le quali il contorno finisce sulla faccia e il riconoscimento sbaglia.
|
||||
-- 2023/07/21 Correzioni per mortise passanti con curva Aux che guarda in basso.
|
||||
-- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessMortise = {}
|
||||
@@ -256,7 +260,7 @@ function ProcessMortise.VerifyMortiseOrPocket( Proc, dDiam, dDepth, dMaxTotLen,
|
||||
sPocketing = ML.FindPocketing( sType, dDiam, 0, dMaxTotLen, bExcludeH2)
|
||||
end
|
||||
if not sPocketing then
|
||||
return false
|
||||
return nil
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dMaxDepth = 0
|
||||
@@ -293,10 +297,6 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero versore estrusione della curva supplementare
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_ID.ROOT)
|
||||
-- se curva di contorno aperta la rendo chiusa
|
||||
BL.ConvertToClosedCurve( Proc, AuxId)
|
||||
-- verifico se frontale
|
||||
local bFront = ( Proc.Prc == 51)
|
||||
-- recupero i dati della faccia di fondo
|
||||
@@ -307,8 +307,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
ptC = frMor:getOrigin()
|
||||
vtN = frMor:getVersZ()
|
||||
end
|
||||
-- recupero versore estrusione della curva supplementare
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_ID.ROOT)
|
||||
-- Confronto le direzioni dei 2 versori : se diverse la faccia 0 non è il fondo => mortasa passante
|
||||
local bOpenBtm = not AreSameVectorApprox( vtExtr, vtN)
|
||||
-- se curva di contorno aperta la rendo chiusa
|
||||
local _, bModif = BL.ConvertToClosedCurve( Proc, AuxId)
|
||||
-- se la mortasa passante il contorno è sulla faccia della trave e il riconoscimento lati aperti non è corretto
|
||||
if not bModif and not bOpenBtm then
|
||||
BL.SetOpenSide( AuxId, b3Solid)
|
||||
end
|
||||
if bOpenBtm then
|
||||
-- creo superficie chiusa
|
||||
local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)
|
||||
@@ -450,9 +458,9 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico se invertire versore estrusione geometria
|
||||
-- verifico se invertire direzione utensile
|
||||
if bRevertSide then
|
||||
EgtModifyCurveExtrusion( AuxId, -vtExtr, GDB_ID.ROOT)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
@@ -462,11 +470,14 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if bPockAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif not BD.C_SIMM then
|
||||
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( vtN:getY()) < GEO.EPS_SMALL then
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtN:getX()) < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif abs( vtN:getX()) < 0.1 then
|
||||
local bNearTail = ( Proc.Box:getMax():getX() < b3Solid:getCenter():getX() and
|
||||
Proc.Box:getMax():getX() - b3Solid:getMin():getX() < 1000)
|
||||
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtN:getY() < GEO.EPS_SMALL then
|
||||
nSCC = EgtIf( bRevertSide, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
@@ -493,9 +504,18 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
dMorH = dMaxDepth
|
||||
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
|
||||
else
|
||||
if bOpenBtm and not bForceOneSide then -- se mortasa passante setto metà profondità
|
||||
-- se passante e lavorabile da due lati
|
||||
if bOpenBtm and not bForceOneSide then
|
||||
-- imposto metà profondità
|
||||
nDepthMin = -dMorH
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, nDepthMin)
|
||||
-- se altrimenti passante ma lavorabile solo da un lato
|
||||
elseif bOpenBtm and bForceOneSide then
|
||||
if bRevertSide then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, min( dMorH + BD.CUT_EXTRA, dMaxDepth))
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, min( BD.CUT_EXTRA, dMaxDepth - dMorH))
|
||||
end
|
||||
end
|
||||
end
|
||||
-- imposto elevazione
|
||||
@@ -503,6 +523,9 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= Proc.PrevDouble then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
@@ -523,7 +546,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
-- faccio la copia e la metto nel layer dedicato alle geometrie aggiunte
|
||||
local AuxId_oppo = EgtCopyGlob( AuxId, BL.GetAddGroup(nPartId))
|
||||
local AuxId_oppo = EgtCopyGlob( AuxId, BL.GetAddGroup(nPartId))
|
||||
-- inverto la direzione estrusione di questa
|
||||
EgtModifyCurveExtrusion( AuxId_oppo, - vtExtr, GDB_ID.ROOT)
|
||||
-- aggiungo geometria
|
||||
@@ -532,11 +555,14 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( vtN:getY()) < GEO.EPS_SMALL then
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtN:getX()) < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif abs( vtN:getX()) < 0.1 then
|
||||
local bNearTail = ( Proc.Box:getMax():getX() < b3Solid:getCenter():getX() and
|
||||
Proc.Box:getMax():getX() - b3Solid:getMin():getX() < 1000)
|
||||
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtN:getY() < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
else
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
-- ProcessProfConcave.lua by Egaltech s.r.l. 2022/05/28
|
||||
-- ProcessProfConcave.lua by Egaltech s.r.l. 2023/07/31
|
||||
-- Gestione calcolo profilo concavo per Travi
|
||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
||||
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
|
||||
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2023/05/25 Sistemazione SCC per TURN.
|
||||
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfConcave = {}
|
||||
@@ -88,7 +90,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
bFirstTrim, bLastTrim, dOffsetPar)
|
||||
|
||||
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
||||
@@ -96,6 +98,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
local ptEp = EgtGetMachiningEndPoint()
|
||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||
if nMachMode == 1 and ptSP and ptEp then
|
||||
-- recupero flag inversione direzione di lavorazione
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
-- verifico se da aggiustare
|
||||
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
|
||||
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||
-- ottengo il lato lavoro e lo inverto
|
||||
@@ -103,9 +108,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if nSideWork > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
-- ottengo l'inversione e setto il contrario
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
|
||||
-- imposto il contrario dell'inversione trovata
|
||||
bInvertMode = not bInvertMode
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
|
||||
end
|
||||
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
|
||||
if bInvertMode then
|
||||
dLenIni, dLenLst = dLenLst, dLenIni
|
||||
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
|
||||
end
|
||||
-- modifico attacco e uscita
|
||||
if dLenIni and dLenLst then
|
||||
@@ -119,9 +129,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||
end
|
||||
if bFlagInvert then
|
||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
end
|
||||
@@ -195,6 +202,25 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
||||
return nChamfer, dDepth, sMilling, sMilling2
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetSccForTurn( vtN, sType)
|
||||
local nSCC
|
||||
if abs( vtN:getZ()) > abs( vtN:getY()) then
|
||||
if sType == 'V' then
|
||||
nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_ZM)
|
||||
else
|
||||
nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||
end
|
||||
else
|
||||
if sType == 'V' then
|
||||
nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
else
|
||||
nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
end
|
||||
end
|
||||
return nSCC
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
@@ -227,8 +253,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- acquisisco informazioni sulle facce estreme
|
||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||
-- flag percorso invertito
|
||||
local bFlagInvert = false
|
||||
-- verifico se in testa o coda
|
||||
local bHead = ( vtN:getX() > 0)
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
||||
@@ -324,7 +348,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
@@ -333,14 +356,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -358,7 +379,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -373,8 +394,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -382,7 +401,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -390,7 +408,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -408,7 +425,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -467,14 +484,11 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra e da sotto
|
||||
if ( nSide == 0) then
|
||||
if vtExtr:getZ() > 0.1 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = true
|
||||
end
|
||||
-- altrimenti lavorazione davanti e dietro
|
||||
else
|
||||
@@ -483,14 +497,13 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = true
|
||||
end
|
||||
end
|
||||
-- imposto l'affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
if BD.TURN then nSCC = GetSccForTurn( vtN) end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
@@ -514,7 +527,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -548,8 +561,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
if not bDouble and nSide == -1 then
|
||||
@@ -558,7 +569,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -566,7 +576,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
@@ -575,14 +584,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- se in doppio, imposto l'affondamento
|
||||
@@ -591,7 +598,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
if BD.TURN then nSCC = GetSccForTurn( vtN) end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
@@ -611,7 +618,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -656,14 +663,25 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, 1)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
if BD.TURN then
|
||||
local nSCC = GetSccForTurn( vtN, 'V')
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- modifico attacco e uscita per forzare risalita
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dToolDiam / 2)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 20)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 20)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dToolDiam / 2)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -697,7 +715,10 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
if BD.TURN then
|
||||
local nSCC = GetSccForTurn( vtN)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
-- ProcessProfConvex.lua by Egaltech s.r.l. 2022/05/28
|
||||
-- ProcessProfConvex.lua by Egaltech s.r.l. 2023/07/31
|
||||
-- Gestione calcolo profilo convesso per Travi
|
||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
||||
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
|
||||
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2023/05/25 Sistemazione SCC per TURN.
|
||||
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfConvex = {}
|
||||
@@ -88,7 +90,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
bFirstTrim, bLastTrim, dOffsetPar)
|
||||
|
||||
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
||||
@@ -96,6 +98,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
local ptEp = EgtGetMachiningEndPoint()
|
||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||
if nMachMode == 1 and ptSP and ptEp then
|
||||
-- recupero flag inversione direzione di lavorazione
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
-- verifico se da aggiustare
|
||||
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
|
||||
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||
-- ottengo il lato lavoro e lo inverto
|
||||
@@ -103,9 +108,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if nSideWork > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
-- ottengo l'inversione e setto il contrario
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
|
||||
-- imposto il contrario dell'inversione trovata
|
||||
bInvertMode = not bInvertMode
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
|
||||
end
|
||||
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
|
||||
if bInvertMode then
|
||||
dLenIni, dLenLst = dLenLst, dLenIni
|
||||
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
|
||||
end
|
||||
-- modifico attacco e uscita
|
||||
if dLenIni and dLenLst then
|
||||
@@ -119,9 +129,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||
end
|
||||
if bFlagInvert then
|
||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
end
|
||||
@@ -195,6 +202,25 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
||||
return nChamfer, dDepth, sMilling, sMilling2
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetSccForTurn( vtN, sType)
|
||||
local nSCC
|
||||
if abs( vtN:getZ()) > abs( vtN:getY()) then
|
||||
if sType == 'V' then
|
||||
nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_ZM)
|
||||
else
|
||||
nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||
end
|
||||
else
|
||||
if sType == 'V' then
|
||||
nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
else
|
||||
nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
end
|
||||
end
|
||||
return nSCC
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
@@ -227,8 +253,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- acquisisco informazioni sulle facce estreme
|
||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||
-- flag percorso invertito
|
||||
local bFlagInvert = false
|
||||
-- verifico se in testa o coda
|
||||
local bHead = ( vtN:getX() > 0)
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
||||
@@ -324,7 +348,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
@@ -333,14 +356,12 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -358,7 +379,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -373,8 +394,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -382,7 +401,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -390,7 +408,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -408,7 +425,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -467,14 +484,11 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra e da sotto
|
||||
if ( nSide == 0) then
|
||||
if vtExtr:getZ() > 0.1 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = true
|
||||
end
|
||||
-- altrimenti lavorazione davanti e dietro
|
||||
else
|
||||
@@ -483,14 +497,13 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = true
|
||||
end
|
||||
end
|
||||
-- imposto l'affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
if BD.TURN then nSCC = GetSccForTurn( vtN) end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
@@ -514,7 +527,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -548,8 +561,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
if not bDouble and nSide == -1 then
|
||||
@@ -558,7 +569,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -566,7 +576,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
@@ -575,14 +584,12 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- se in doppio, imposto l'affondamento
|
||||
@@ -591,7 +598,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
if BD.TURN then nSCC = GetSccForTurn( vtN) end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
@@ -611,7 +618,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -656,14 +663,25 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, 1)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
if BD.TURN then
|
||||
local nSCC = GetSccForTurn( vtN, 'V')
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- modifico attacco e uscita per forzare risalita
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dToolDiam / 2)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 20)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 20)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dToolDiam / 2)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -697,7 +715,10 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
if BD.TURN then
|
||||
local nSCC = GetSccForTurn( vtN)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -465,8 +465,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
@@ -554,8 +553,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
|
||||
+18
-29
@@ -1,4 +1,4 @@
|
||||
-- ProcessProfHead.lua by Egaltech s.r.l. 2022/05/28
|
||||
-- ProcessProfHead.lua by Egaltech s.r.l. 2023/07/31
|
||||
-- Gestione calcolo profilo di testa per Travi
|
||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa sotto.
|
||||
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
|
||||
@@ -6,6 +6,7 @@
|
||||
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfHead = {}
|
||||
@@ -81,7 +82,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
bFirstTrim, bLastTrim, dOffsetPar)
|
||||
|
||||
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
||||
@@ -89,6 +90,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
local ptEp = EgtGetMachiningEndPoint()
|
||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||
if nMachMode == 1 and ptSP and ptEp then
|
||||
-- recupero flag inversione direzione di lavorazione
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
-- verifico se da aggiustare
|
||||
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
|
||||
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||
-- ottengo il lato lavoro e lo inverto
|
||||
@@ -96,9 +100,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if nSideWork > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
-- ottengo l'inversione e setto il contrario
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
|
||||
-- imposto il contrario dell'inversione trovata
|
||||
bInvertMode = not bInvertMode
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
|
||||
end
|
||||
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
|
||||
if bInvertMode then
|
||||
dLenIni, dLenLst = dLenLst, dLenIni
|
||||
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
|
||||
end
|
||||
-- modifico attacco e uscita
|
||||
if dLenIni and dLenLst then
|
||||
@@ -112,9 +121,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||
end
|
||||
if bFlagInvert then
|
||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
end
|
||||
@@ -224,8 +230,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- acquisisco informazioni sulle facce estreme
|
||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||
-- flag percorso invertito
|
||||
local bFlagInvert = false
|
||||
-- verifico se in testa o coda
|
||||
local bHead = ( vtN:getX() > 0)
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
||||
@@ -326,7 +330,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
@@ -335,14 +338,12 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -361,7 +362,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dExtra)
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dExtra)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -376,8 +377,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -385,7 +384,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
@@ -394,7 +392,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -413,7 +410,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dExtra)
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dExtra)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -473,8 +470,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra e da sotto
|
||||
if ( nSide == 0) then
|
||||
if vtExtr:getZ() > 0.1 then
|
||||
@@ -517,7 +512,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dOffsetPar)
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -551,8 +546,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
if not bDouble and nSide == -1 then
|
||||
@@ -561,7 +554,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -569,7 +561,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
@@ -578,14 +569,12 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- se in doppio, imposto l'affondamento
|
||||
@@ -613,7 +602,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dOffsetPar)
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessRidgeLap.lua by Egaltech s.r.l. 2021/09/10
|
||||
-- ProcessRidgeLap.lua by Egaltech s.r.l. 2023/08/10
|
||||
-- Gestione calcolo mezzolegno di testa per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -26,8 +26,8 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Classificazione della feature
|
||||
function ProcessRidgeLap.Classify( Proc, b3Raw)
|
||||
-- se PF con testa da sotto, ammessa qualunque orientazione
|
||||
if BD.C_SIMM and BD.DOWN_HEAD then
|
||||
-- se PF con testa da sotto oppure TURN, ammessa qualunque orientazione
|
||||
if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
|
||||
return true, false
|
||||
end
|
||||
-- Se più corta del limite si può fare anche da sotto
|
||||
@@ -195,7 +195,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- aggiornamento ingombro di testa o coda
|
||||
if Proc.Head then
|
||||
local dHCI = 0
|
||||
if abs( vtN[vFaceOrd[3]]:getZ()) > 0.1 then
|
||||
if vtN[vFaceOrd[3]]:getZ() > 0.1 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
||||
else
|
||||
@@ -204,7 +204,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
BL.UpdateHCING( nRawId, dHCI)
|
||||
elseif Proc.Tail then
|
||||
local dTCI = 0
|
||||
if abs( vtN[vFaceOrd[3]]:getZ()) > 0.1 then
|
||||
if vtN[vFaceOrd[3]]:getZ() > 0.1 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessRoundArch.lua by Egaltech s.r.l. 2021/01/29
|
||||
-- ProcessRoundArch.lua by Egaltech s.r.l. 2023/05/18
|
||||
-- Gestione calcolo archi per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -93,6 +93,8 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- normale alla superficie nel mezzo
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, Proc.Fct // 2, GDB_RT.GLOB)
|
||||
-- recupero e verifico l'entità curva
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
if AuxId then AuxId = AuxId + Proc.Id end
|
||||
@@ -222,13 +224,27 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
if Proc.Head then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XP)
|
||||
elseif Proc.Tail then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XM)
|
||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
if Proc.Head then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif Proc.Tail then
|
||||
nSCC = MCH_SCC.ADIR_XM
|
||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
elseif BD.TURN then
|
||||
if vtN:getZ() > 0.707 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif vtN:getZ() < -0.707 then
|
||||
nSCC = MCH_SCC.ADIR_ZM
|
||||
elseif vtN:getY() > 0.707 then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
elseif vtN:getY() < -0.707 then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
-- 2021/06/28 Aggiunto extra-taglio alle lamate orizzontali.
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||
-- 2022/07/12 Aggiunta gestione PF1250 e TURN.
|
||||
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessScarfJoint = {}
|
||||
@@ -100,7 +101,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -123,7 +124,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
@@ -512,7 +513,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
-- aggiornamento ingombro di testa o coda
|
||||
if Proc.Head then
|
||||
local dHCI = 0
|
||||
if abs( vtRef:getZ()) > 0.1 then
|
||||
if abs( vtRef:getZ()) > 0.1 and not BD.ROT90 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
||||
dHCI = 0.75 * dHCI
|
||||
@@ -522,7 +523,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
BL.UpdateHCING( nRawId, dHCI)
|
||||
elseif Proc.Tail then
|
||||
local dTCI = 0
|
||||
if abs( vtRef:getZ()) > 0.1 then
|
||||
if abs( vtRef:getZ()) > 0.1 and not BD.ROT90 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
||||
dTCI = 0.75 * dTCI
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||
-- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut.
|
||||
-- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour.
|
||||
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessSimpleScarf = {}
|
||||
@@ -100,7 +101,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -123,7 +124,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
@@ -317,7 +318,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
|
||||
-- aggiornamento ingombro di testa o coda
|
||||
if Proc.Head then
|
||||
local dHCI = 0
|
||||
if abs( vtRef:getZ()) > 0.1 then
|
||||
if abs( vtRef:getZ()) > 0.1 and not BD.ROT90 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
||||
else
|
||||
@@ -326,7 +327,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
|
||||
BL.UpdateHCING( nRawId, dHCI)
|
||||
elseif Proc.Tail then
|
||||
local dTCI = 0
|
||||
if abs( vtRef:getZ()) > 0.1 then
|
||||
if abs( vtRef:getZ()) > 0.1 and not BD.ROT90 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
||||
else
|
||||
|
||||
+89
-22
@@ -1,4 +1,4 @@
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2022/11/30
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2023/05/09
|
||||
-- Gestione calcolo tagli di separazione per Travi
|
||||
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make.
|
||||
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
||||
@@ -8,6 +8,12 @@
|
||||
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
||||
-- 2022/11/16 Correzioni per travi larghe
|
||||
-- 2022/11/30 Correzione per tagli su grandi sezioni (dopo taglio con sega a catena senza finitura aggiungeva uno split con lama).
|
||||
-- 2023/04/04 Modifiche per travi con sezioni molto grandi e materiale inferiore allo spessore lama.
|
||||
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti.
|
||||
-- 2023/05/09 Aggiunta richiesta risalita preliminare a Zmax per tagli da sopra su macchine PF e ONE.
|
||||
-- 2023/06/13 Corrette note Precut e Cut per tagli aggiuntivi orizzontali.
|
||||
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo.
|
||||
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessSplit = {}
|
||||
@@ -121,7 +127,7 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -144,7 +150,7 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true, nil
|
||||
@@ -298,14 +304,15 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
local nNextRawId = EgtGetNextRawPart( nRawId)
|
||||
local bSplit = ( nNextRawId and ( EgtGetPartInRawPartCount( nNextRawId) > 0 or EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw))
|
||||
-- determino se più tagli con offset
|
||||
local dLenEndRaw = dOvmTail
|
||||
local nCuts = 1
|
||||
local dOffsL = 0
|
||||
if not bSplit then
|
||||
-- cerco grezzo successivo che sia nella fase
|
||||
if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then
|
||||
local b3NextRaw = EgtGetRawPartBBox( nNextRawId)
|
||||
local dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX()
|
||||
nCuts = ceil( dLenEndRaw / BD.MAX_LEN_SCRAP)
|
||||
dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX()
|
||||
nCuts = ceil( dLenEndRaw / ( BD.MAX_LEN_SCRAP + 0.5))
|
||||
dOffsL = dLenEndRaw / nCuts
|
||||
-- aggiorno ingombro del grezzo corrente con quello del successivo
|
||||
b3Raw:Add( b3NextRaw)
|
||||
@@ -396,21 +403,22 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
sNotesFinal = 'Cut;'
|
||||
end
|
||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
||||
-- determinazione materiale da asportare
|
||||
local dSawThickCheck = dSawThick
|
||||
if dSawThick2 > 0 and bDoubleHorizCut then
|
||||
dSawThickCheck = min( dSawThick, dSawThick2)
|
||||
end
|
||||
local dMaxElev = 0
|
||||
if vtN:getX() > 0 then
|
||||
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
|
||||
else
|
||||
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
|
||||
end
|
||||
-- se finitura con lama
|
||||
if nQ05 == 1 or nQ05 == 0 or not bSplit then
|
||||
local dSawThickCheck = dSawThick
|
||||
if dSawThick2 > 0 and bDoubleHorizCut then
|
||||
dSawThickCheck = min( dSawThick, dSawThick2)
|
||||
end
|
||||
local dMaxElev = 0
|
||||
if vtN:getX() > 0 then
|
||||
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
|
||||
else
|
||||
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
|
||||
end
|
||||
if nQ05 == 1 or nQ05 == 0 or ( not bSplit and dMaxElev > dSawThickCheck) then
|
||||
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
|
||||
if bSplit or dMaxElev > dSawThickCheck then
|
||||
local bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dLenEndRaw, nil, false, true, b3Raw, sNotes, dCurrOvmT)
|
||||
local bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT)
|
||||
if sNotesFinal then
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||
end
|
||||
@@ -424,15 +432,20 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local sPocketing = ML.FindPocketing( 'OpenPocket', nil, 0)
|
||||
local sPocketing, dTDiam = ML.FindPocketing( 'OpenPocket', nil, 0)
|
||||
if not sPocketing then
|
||||
local sErr = 'Error : pocketing not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
||||
local dOpenMinSafe
|
||||
if BD.C_SIMM and b3Raw:getDimZ() > 600 then
|
||||
dOpenMinSafe = 230 - dTDiam / 2
|
||||
end
|
||||
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid, dOpenMinSafe)
|
||||
if sNotesFinal then
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) .. sNotesFinal
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
end
|
||||
return bOk, sErr, nNewPhase
|
||||
end
|
||||
@@ -446,18 +459,68 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
local dCutExtra = 0
|
||||
local dAccStart = 0
|
||||
local dAccEnd = 0
|
||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
if bBigSectionCut and BD.C_SIMM then
|
||||
-- qui arrivano sezioni molto grandi su macchine tipo PF con materiale da asportare inferiore allo spessore lama
|
||||
local dSawRad = dSawDiam / 2
|
||||
dCutExtra = - ( b3Raw:getDimY() - dSawRad)
|
||||
dAccEnd = dSawRad
|
||||
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
||||
else
|
||||
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
||||
local dSawRad = dSawDiam / 2
|
||||
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
||||
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
|
||||
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
|
||||
local dKL = dSawRad - dMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
|
||||
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
|
||||
local dMinSawingLength = 5
|
||||
if BD.C_SIMM then
|
||||
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
|
||||
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
|
||||
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
|
||||
end
|
||||
else
|
||||
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
|
||||
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
|
||||
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
|
||||
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
local dMinTailScrapForHorizontalCuts = 10.123
|
||||
local bAreHorizontalCutsNeeded = not bSplit and ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForHorizontalCuts - 10 * GEO.EPS_SMALL)
|
||||
if bAreHorizontalCutsNeeded then
|
||||
local nHorizontalCuts = ceil ( dimV / BD.MAX_DIM_DICE) - 1
|
||||
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutXOffset = ( i - 1) * dOffsL
|
||||
-- tagli orizzontali
|
||||
for j = nHorizontalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||
if bDoubleCut then
|
||||
-- gli accorciamenti vanno invertiti per il taglio opposto
|
||||
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStartDoubleCut, dAccEndDoubleCut, 'Precut;', b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- taglio verticale
|
||||
local sInfo = 'PreCut;'
|
||||
if i == 1 then sInfo = 'Cut;' end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, sInfo, b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
return true, sWarn, nNewPhase
|
||||
end
|
||||
|
||||
-- se necessari tagli in doppio, eseguo gli opposti
|
||||
if bDoubleCut then
|
||||
-- gli accorciamenti vanno invertiti per il taglio opposto
|
||||
@@ -478,6 +541,10 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
else
|
||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||
end
|
||||
-- se primo taglio da sopra e PF o ONE richiedo risalita preliminare a Zmax
|
||||
if i == nCuts and bHorizCut and BD.C_SIMM and not BD.DOWN_HEAD then
|
||||
sNotes = EgtSetValInNotes( sNotes, 'StartZmax', 2)
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- ProcessStepJoint.lua by Egaltech s.r.l. 2022/11/03
|
||||
-- Gestione calcolo giunto a gradino per Travi
|
||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessStepJoint = {}
|
||||
@@ -110,7 +111,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -133,7 +134,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
@@ -433,18 +434,22 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- Eventuale segnalazione ingombro di testa o coda
|
||||
if Proc.Head then
|
||||
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
if vtNm:getZ() > 0.5 then
|
||||
dOffs = 0.5 * dOffs
|
||||
elseif abs( vtNm:getZ()) > 0.35 then
|
||||
dOffs = 0.75 * dOffs
|
||||
if not BD.ROT90 then
|
||||
if vtNm:getZ() > 0.5 then
|
||||
dOffs = 0.5 * dOffs
|
||||
elseif abs( vtNm:getZ()) > 0.35 then
|
||||
dOffs = 0.75 * dOffs
|
||||
end
|
||||
end
|
||||
BL.UpdateHCING( nRawId, dOffs)
|
||||
elseif Proc.Tail then
|
||||
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
if vtNm:getZ() > 0.5 then
|
||||
dOffs = 0.5 * dOffs
|
||||
elseif abs( vtNm:getZ()) > 0.35 then
|
||||
dOffs = 0.75 * dOffs
|
||||
if not BD.ROT90 then
|
||||
if vtNm:getZ() > 0.5 then
|
||||
dOffs = 0.5 * dOffs
|
||||
elseif abs( vtNm:getZ()) > 0.35 then
|
||||
dOffs = 0.75 * dOffs
|
||||
end
|
||||
end
|
||||
BL.UpdateTCING( nRawId, dOffs)
|
||||
end
|
||||
|
||||
@@ -531,7 +531,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
@@ -556,7 +556,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
|
||||
+19
-10
@@ -1,4 +1,4 @@
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2023/01/20
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2023/09/26
|
||||
-- Gestione calcolo tenone per Travi
|
||||
-- 2021/10/04 Corretto calcolo HCING per pezzi piccoli.
|
||||
-- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto.
|
||||
@@ -9,6 +9,8 @@
|
||||
-- 2022/12/12 Su macchine con rulli pressori e pinze separate si riduce di meno l'ingombro con tenoni inclinati.
|
||||
-- 2022/12/20 Aggiunta gestione smusso. Migliorata scelta tra sopra e sotto per il punto di inizio. In VerifyOrientation aggiunta trave medio alta.
|
||||
-- 2023/01/20 Modificata scelta lato di attacco per pezzo piccolo su macchine con pinza speciale (pinza 5).
|
||||
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessDtTenon. Migliorato calcolo altezza tenone.
|
||||
-- 2023/09/26 Per macchina TURN si assegna SCC per privilegiare accesso dal lato corto della trave.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessTenon = {}
|
||||
@@ -128,8 +130,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- determino altezza del tenone
|
||||
local frTen = Frame3d( ptBC, vtExtr)
|
||||
local b3Ten = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frTen)
|
||||
local dTenH = b3Ten:getDimZ()
|
||||
local b3Ten = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frTen)
|
||||
local dTenH = b3Ten:getMax():getZ()
|
||||
-- assegno centro e normale della faccia top
|
||||
local vtN = vtExtr
|
||||
local ptC = ptBC + vtN * dTenH
|
||||
@@ -180,11 +182,10 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if AddId then
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- se pezzo piccolo, in coda, con piano inclinato verso il basso e macchina con testa da sotto applico svuotatura
|
||||
if bShortPart and vtExtr:getX() < 0 and vtExtr:getZ() < -0.09 and BD.DOWN_HEAD then
|
||||
-- solo per macchine tipo PF e simili: se pezzo piccolo, in coda, piano inclinato attorno a Z e inclinato verso il basso applico svuotatura
|
||||
if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getY()) > 0.173 and vtExtr:getZ() < -0.1 and BD.C_SIMM then
|
||||
-- recupero la lavorazione
|
||||
local sPockType = EgtIf( bMillDown, 'OpenPocket_H2', 'OpenPocket')
|
||||
local sPocketing = ML.FindPocketing( sPockType, nil, nil, nil, not bMillDown, bMillDown)
|
||||
local sPocketing = ML.FindPocketing( 'OpenPocket', nil, nil, nil, not bMillDown, bMillDown)
|
||||
if not sPocketing then
|
||||
local sErr = 'Error : pocketing '..sPockType..' not found in library'
|
||||
EgtOutLog( sErr)
|
||||
@@ -240,7 +241,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
@@ -307,7 +308,9 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- sistemo i parametri
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dTenH - 100 * GEO.EPS_SMALL, 1) .. ';')
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dTenH - 100 * GEO.EPS_SMALL, 1)) .. ';'
|
||||
if i < nPass then sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3) end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
local dOffset = ( i - 1) * dStep
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffset)
|
||||
@@ -323,7 +326,13 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
if BD.TURN then
|
||||
if b3Solid:getDimY() >= b3Solid:getDimZ() then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
elseif not BD.C_SIMM then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
if abs( vtExtr:getY()) > 0.088 then
|
||||
nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- ProcessTyroleanDovetail.lua by Egaltech s.r.l. 2022/03/21
|
||||
-- Gestione calcolo giunzione tirolese
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessTyroleanDovetail = {}
|
||||
@@ -510,10 +511,10 @@ local function MakeMachByMill( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b
|
||||
dStepmach = dMaxMat * 0.5
|
||||
end
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, sin(dSideAngle))
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, sin(dSideAngle))
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
-- provo eliminando i sottosquadra
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, -2)
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, -2)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeMachByMill could not find reference face'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+24
-14
@@ -62,7 +62,7 @@ local function MyProcessInputData()
|
||||
end
|
||||
end
|
||||
if not bFound then
|
||||
table.insert( vBeam, { Id = nPartId, Name = ( EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId)))})
|
||||
table.insert( vBeam, { Ind = #vBeam + 1, Id = nPartId, Name = ( EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId)))})
|
||||
end
|
||||
end
|
||||
nId = EgtGetNextSelectedObj()
|
||||
@@ -115,17 +115,6 @@ local function MyProcessInputData()
|
||||
end
|
||||
EgtDeselectAll()
|
||||
|
||||
-- Le ordino in senso di lunghezza crescente
|
||||
table.sort( vBeam, function( B1, B2) return B1.Box:getDimX() < B2.Box:getDimX() end)
|
||||
do
|
||||
local sOut = ''
|
||||
for i = 1, #vBeam do
|
||||
sOut = sOut .. vBeam[i].Name .. ', '
|
||||
end
|
||||
sOut = sOut:sub( 1, -3)
|
||||
EgtOutLog( 'Travi ordinate : ' .. sOut, 1)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -146,12 +135,13 @@ local function MyProcessBeams()
|
||||
local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID
|
||||
EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1)
|
||||
|
||||
-- Richiedo lunghezza del grezzo e sovramateriale di testa
|
||||
-- Richiedo lunghezza del grezzo, sovramateriale di testa, forzatura verticale e ordinamento automatico secondo la lunghezza
|
||||
local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0)..
|
||||
', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')',
|
||||
{'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)},
|
||||
{'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)},
|
||||
{'Forza sezione verticale', ' CB:true,*false'})
|
||||
{'Forza sezione verticale', ' CB:true,*false'},
|
||||
{'Ordina per lunghezza', ' CB:true,*false'})
|
||||
if not vsVal then
|
||||
EgtDraw()
|
||||
return
|
||||
@@ -215,6 +205,26 @@ local function MyProcessBeams()
|
||||
return false
|
||||
end
|
||||
|
||||
-- Se richiesto, ordino le travi in senso di lunghezza crescente
|
||||
local bOrd = ( vsVal[4] == 'true')
|
||||
if bOrd then
|
||||
table.sort( vBeam, function( B1, B2)
|
||||
if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then
|
||||
return B1.Ind < B2.Ind
|
||||
else
|
||||
return B1.Box:getDimX() < B2.Box:getDimX()
|
||||
end
|
||||
end)
|
||||
end
|
||||
do
|
||||
local sOut = ''
|
||||
for i = 1, #vBeam do
|
||||
sOut = sOut .. vBeam[i].Name .. ', '
|
||||
end
|
||||
sOut = sOut:sub( 1, -3)
|
||||
EgtOutLog( 'Travi ordinate : ' .. sOut, 1)
|
||||
end
|
||||
|
||||
-- Sistemo le travi nel grezzo
|
||||
local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
|
||||
if not bOk then
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.5j1 (23/10/2023)
|
||||
- Added : in Process (lancio da EgtCAM5 quindi uso praticamente solo interno) aggiunta possibilità di tenere ordine pezzi in barra come da selezione
|
||||
- Fixed : piccola correzione a Classify di FeatureTopology per casi senza geometria
|
||||
- Fixed : in HeadCut e Split corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
|
||||
- Fixed : in Lapjoint -> MakePocket aggiunto messaggio in caso si rovini il pezzo successivo
|
||||
- Modif : in Topology aggiunti casi al check solo direzione principale
|
||||
- Modif : nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente
|
||||
|
||||
Versione 2.5i2 (27/09/2023)
|
||||
- Added : aggiunto riconoscimento sottosquadro da facce non adiacenti
|
||||
- Fixed : in LapJoint corretto caso tunnel lungo non lavorato correttamente
|
||||
- Fixed : in foratura quando errore in applicazione lavorazione si inverte e riprova solo se singola su foro aperto
|
||||
- Modif : in lavorazione tenoni per Turn si assegna SCC per privilegiare accesso dal lato corto della trave.
|
||||
|
||||
Versione 2.5i1 (12/09/2023)
|
||||
- Fixed : in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth [Ticket #1354]
|
||||
- Modif : in Cut abbassato a 590 mm il limite per convertire in LongCut [Ticket #1448].
|
||||
|
||||
Versione 2.5h2 (11/08/2023)
|
||||
- Fixed : corrette forature con aggregato quando lato aperto
|
||||
- Fixed : in RidgeLap corretto ingombro lavorazione in testa e coda quando rivolta verso il basso
|
||||
- Modif : in LapJoint e Mortise modificata posizione braccio per FAST quando vicino alla coda della trave.
|
||||
|
||||
Versione 2.5h1 (07/08/2023)
|
||||
- Fixed : tagli doppi di lato non effettuati se macchina tipo PF e pezzo alto [Ticket #1400]
|
||||
- Fixed : in split e headcut corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo [Ticket #1227]
|
||||
- Fixed : in lapjoint piccola correzione al calcolo della distanza di sicurezza in base al gambo dell'utensile [Ticket #1227]
|
||||
- Fixed : in Lapjoint corretto incremento della profondità pari al raggio utensile per tunnel con sega a catena [Ticket #1212]
|
||||
|
||||
Versione 2.5g3 (01/08/2023)
|
||||
- Added : aggiunta gestione tasche chiuse ad orientamento verticale con rinvio angolare [Ticket #1333]
|
||||
- Modif : in LongCut ammesso uso lama da sotto fino a Norm +3deg in verticale
|
||||
- Fixed : in Cut correzione calcolo offset per taglio doppio di lato [Ticket #1400].
|
||||
|
||||
Versione 2.5g2 (31/07/2023)
|
||||
- Added : in FreeContour, solo se pocket, aggiunta Q06 per specificare un eventuale offset radiale del contorno [Ticket #1334]
|
||||
- Added : aggiunta gestione forature verticali con rinvio angolare [Ticket #1332]
|
||||
- Fixed : corretta gestione antischeggia con lama su LapJoint [Ticket #1351]
|
||||
- Fixed : in ProfConvex, ProfConcave e ProfHead corretto e semplificato ModifySideInvertLead per invert [Ticket #1330]
|
||||
- Fixed : corretto il funzionamento delle mortase in doppio [Ticket #1404].
|
||||
|
||||
Versione 2.5g1 (05/07/2023)
|
||||
- Modif : in DiceCut modificata scelta tagli ortogonali quando liberi (esteso caso di verticali ammessi)
|
||||
- Modif : in LapJoint estesi casi riconoscimento in coda basato su lunghezza
|
||||
- Fixed : nelle mortase passanti escluso il riconoscimento lati aperti che portava a lavorazioni errate [Ticket #1342]
|
||||
- Fixed : in LapJoint impedito l'uso del truciolatore se la tasca è chiusa [Ticket #1361]
|
||||
- Fixed : migliorato controllo fattibilità taglio di fianco con cubetti.
|
||||
|
||||
Versione 2.5f4 (21/06/2023)
|
||||
- Added : aggiunti tagli speciali per evitare il rischio che il cubetto rimanga appoggiato al motore [Ticket #1004, #1214]
|
||||
- Fixed : corretto attacco speciale in FreeContour [Ticket #1250]
|
||||
|
||||
Versione 2.5f3 (16/06/2023)
|
||||
- Fixed : correzione scelta di approccio lama in casi speciali
|
||||
- Fixed : correzione a tagli aggiuntivi orizzontali negli split.
|
||||
|
||||
Versione 2.5f2 (12/06/2023)
|
||||
- Fixed : in LapJoint corretto il recupero dati utensile che, in alcune funzioni, puntava all'utensile errato
|
||||
- Fixed : In BeamLib -> ChangeOrOpenStart corretta ricerca segmento più lungo.
|
||||
|
||||
Versione 2.5f1 (08/05/2023)
|
||||
- Modif : in Process (esecuzione manuale da Cam5) ordinamento travi di lunghezza praticamente uguale dipende da ordine di selezione
|
||||
- Modif : in LapJoint limiti su svuotature tasche a L 4 facce come per L 3 facce
|
||||
- Modif : in LapJoint su svuotature aggiunto recupero UserNotes da libreria per MaxOptSize.
|
||||
- Fixed : in LongDoubleCut corretta scelta SCC (orientamento braccio testa) per macchine TURN nel caso di concavi
|
||||
|
||||
Versione 2.5e5 (26/05/2023)
|
||||
- Modif : riconoscimento fori da sotto anche dalla faccia di ingresso
|
||||
- Modif : in foratura se TURN aggiunta possibilità di forare da sotto.
|
||||
- Fixed : correzioni a Profili Concavo e Convesso per TURN
|
||||
- Fixed : correzione a foratura per ignorare fori annegati nel pezzo
|
||||
|
||||
Versione 2.5e4 (23/05/2023)
|
||||
- Modif : in LongCut migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo
|
||||
- Fixed : correzione SCC lama per macchina Turn [Ticket #1258]
|
||||
|
||||
Versione 2.5e3 (11/05/2023)
|
||||
- Modif : in taglio di separazione aggiunta richiesta risalita preliminare a Zmax quando da sopra su macchine PF e ONE
|
||||
- Fixed : in lavorazioni in doppio correzione riconoscimento per possibile lavorazione in doppio di tasche che si toccano sul fondo
|
||||
- Fixed : in lavorazioni in doppio con lavorazione precedente differente forzata risalita a Zmax per vitare problemi di riposizionamento [Ticket #1062]
|
||||
|
||||
Versione 2.5e2 (04/05/2023)
|
||||
- Modif : Piccola modifica a SCC per LongCut derivanti da Cut
|
||||
|
||||
Versione 2.5e1 (03/05/2023)
|
||||
- Modif : in TS3v7 tolleranza su quote sezione portata a 0.1 mm
|
||||
- Fixed : Corretto SCC in caso di asse utensile allineato con Z [Ticket #1232]
|
||||
|
||||
Versione 2.5d2 (20/04/2023)
|
||||
- Added : nei tagli di testa e coda, nel caso di travi alte, aggiunti tagli orizzontali per diminuire la dimensione degli sfridi [Ticket #1175, #1185]
|
||||
- Modif : unificata gestione lato testa per tagli longitudinali [Ticket #1167].
|
||||
|
||||
Versione 2.5d1 (06/04/23)
|
||||
- Added : in svuotatura aggiunta possibilità di impostare una distanza di sicurezza minima su attacco da lato aperto
|
||||
- Modif : in split per travi con sezioni molto grandi e materiale inferiore allo spessore lama, miglioramenti volti ad evitare collisioni prevedibili
|
||||
- Modif : in taglio con lama piccola miglioria nella scelta della direzione di approccio per pezzi corti
|
||||
- Fixed : in LapJoint correzione al calcolo della distanza di collisione nel caso in cui il gambo sia più piccolo dell'utensile [Ticket #1150]
|
||||
- Fixed : corretto ordinamento per fori di coda da lasciare in coda
|
||||
- Fixed : correzione per gestire la lama principale sulla testa secondaria quando questa non è una testa da sotto [Ticket #1161]
|
||||
- Fixed : modifiche a Split per travi con sezioni molto grandi e materiale inferiore allo spessore lama.
|
||||
|
||||
Versione 2.5c8 (30/03/23)
|
||||
- Modif : nei tenoni (standard e coda di rondine) migliorate e unificate condizioni scelta pretaglio con lama o fresa [Ticket #1131]
|
||||
- Modif : le mortase a coda di rondine sono ora anticipate a prima dei tagli longitudinali indipendentemente dalla sovrapposizione in Y
|
||||
- Modif : modificato l'ingombro dei tagli inclinati per macchine con trascinatori tipo PF
|
||||
- Fixed : nelle mortase a coda di rondine corretto calcolo larghezza della mortasa per derivare numero e step passate [Ticket #1126, #1143]
|
||||
- Fixed : nei tenoni a coda di rondine corretto calcolo distanza lato da lavorare quando la faccia di base è divisa in più parti.
|
||||
@@ -0,0 +1,6 @@
|
||||
-- Version.lua by Egaltech s.r.l. 2023/10/18
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.5j1'
|
||||
MIN_EXE = '2.5c1'
|
||||
Reference in New Issue
Block a user