Compare commits
119 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a1ca23acc9 | |||
| 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 | |||
| 5f47ce88da | |||
| 8370ef5b3a | |||
| 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 | |||
| 19edc158c7 | |||
| 041706a04d | |||
| 77cec328a6 | |||
| afef9c54fe | |||
| 83048f2f52 | |||
| 8dce03138e | |||
| ee1c67b006 |
@@ -20,3 +20,4 @@
|
|||||||
/bin/LuaLibs/*.lua
|
/bin/LuaLibs/*.lua
|
||||||
/bin/Images/*.png
|
/bin/Images/*.png
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
|
bin/Images/.placeholder
|
||||||
|
|||||||
+9
-4
@@ -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
|
-- Gestione calcolo batch disposizione e lavorazioni per Travi
|
||||||
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
|
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
|
||||||
-- 2019/07/16 Aggiunta gestione modalità oltre 10 per impostazione macchina e uscita.
|
-- 2019/07/16 Aggiunta gestione modalità oltre 10 per impostazione macchina e uscita.
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
-- 2021/08/04 Direzione vista simulazione da BD.SIMUL_VIEW_DIR se esiste.
|
-- 2021/08/04 Direzione vista simulazione da BD.SIMUL_VIEW_DIR se esiste.
|
||||||
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
|
-- 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).
|
-- 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
|
-- Intestazioni
|
||||||
require( 'EgtBase')
|
require( 'EgtBase')
|
||||||
@@ -267,22 +268,26 @@ if bToProcess then
|
|||||||
vBeam[i].PosX = PosX
|
vBeam[i].PosX = PosX
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Eseguo eventuali rotazioni e inversioni testa-coda
|
-- Se non già eseguite, applico eventuali rotazioni e inversioni testa-coda
|
||||||
for i = 1, #vBeam do
|
for i = 1, #vBeam do
|
||||||
local b3Solid = vBeam[i].Box
|
local b3Solid = vBeam[i].Box
|
||||||
-- rotazione
|
-- rotazione
|
||||||
local dRotAng = EgtGetInfo( vBeam[i].Id, 'ROTATED', 'd')
|
local dRotAng = EgtGetInfo( vBeam[i].Id, 'ROTATED', 'd') or 0
|
||||||
if dRotAng and abs( dRotAng) > GEO.EPS_ANG_SMALL then
|
if abs( dRotAng) > GEO.EPS_ANG_SMALL then
|
||||||
local ptRotCen = b3Solid:getCenter()
|
local ptRotCen = b3Solid:getCenter()
|
||||||
EgtRotate( vBeam[i].Id, ptRotCen, X_AX(), dRotAng, GDB_RT.GLOB)
|
EgtRotate( vBeam[i].Id, ptRotCen, X_AX(), dRotAng, GDB_RT.GLOB)
|
||||||
b3Solid:rotate( ptRotCen, X_AX(), dRotAng)
|
b3Solid:rotate( ptRotCen, X_AX(), dRotAng)
|
||||||
end
|
end
|
||||||
|
EgtRemoveInfo( vBeam[i].Id, 'ROTATED')
|
||||||
|
EgtSetInfo( vBeam[i].Id, 'ROTATED_OK', dRotAng)
|
||||||
-- inversione
|
-- inversione
|
||||||
local dInvAng = 180 - ( EgtGetInfo( vBeam[i].Id, 'INVERTED', 'd') or 0)
|
local dInvAng = 180 - ( EgtGetInfo( vBeam[i].Id, 'INVERTED', 'd') or 0)
|
||||||
if abs( dInvAng) > GEO.EPS_ANG_SMALL then
|
if abs( dInvAng) > GEO.EPS_ANG_SMALL then
|
||||||
local ptInvCen = b3Solid:getCenter()
|
local ptInvCen = b3Solid:getCenter()
|
||||||
EgtRotate( vBeam[i].Id, ptInvCen, Z_AX(), dInvAng, GDB_RT.GLOB)
|
EgtRotate( vBeam[i].Id, ptInvCen, Z_AX(), dInvAng, GDB_RT.GLOB)
|
||||||
end
|
end
|
||||||
|
EgtRemoveInfo( vBeam[i].Id, 'INVERTED')
|
||||||
|
EgtSetInfo( vBeam[i].Id, 'INVERTED_OK', 180 - dInvAng)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Ne verifico le dimensioni
|
-- Ne verifico le dimensioni
|
||||||
|
|||||||
+54
-29
@@ -45,6 +45,7 @@
|
|||||||
-- 2023/02/17 Nelle tasche in doppio, la distanza minima ammessa tra le feature è stata portata a 50.
|
-- 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/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/03/31 Corretto ordinamento per fori di coda da lasciare in coda.
|
||||||
|
-- 2023/07/31 Corretto errore nelle mortase in doppio.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamExec = {}
|
local BeamExec = {}
|
||||||
@@ -973,7 +974,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
|||||||
local bDownSideOnHeadOk = false
|
local bDownSideOnHeadOk = false
|
||||||
|
|
||||||
if Proc.MachineBeforeIntersectingDrillings then
|
if Proc.MachineBeforeIntersectingDrillings then
|
||||||
table.Insert ( vMachineBeforeIntersectingDrillingsId, Proc.Id)
|
table.insert( vMachineBeforeIntersectingDrillingsId, Proc.Id)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se senza geometria (già disabilitato)
|
-- se senza geometria (già disabilitato)
|
||||||
@@ -1395,16 +1396,14 @@ end
|
|||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
-- Controlla se la feature ProcMirror è la specchiata di Proc, per feature di tipo tasca o simile
|
-- Controlla se la feature ProcMirror è la specchiata di Proc, per feature di tipo tasca o simile
|
||||||
local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId)
|
local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId)
|
||||||
|
|
||||||
-- recupero i dati geometrici della curva Proc
|
-- recupero i dati geometrici della curva Proc
|
||||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||||
local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
|
local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
|
||||||
local rfDtMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB)
|
local rfDtMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB)
|
||||||
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
|
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
|
||||||
local b3Proc = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
|
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
|
-- recupero e verifico l'entità curva ProcMirror
|
||||||
local AuxIdMirror = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i')
|
local AuxIdMirror = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i')
|
||||||
if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.Id end
|
if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.Id end
|
||||||
@@ -1420,35 +1419,49 @@ local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId)
|
|||||||
local ptBCMirror = EgtGP( AuxIdMirror, GDB_RT.GLOB)
|
local ptBCMirror = EgtGP( AuxIdMirror, GDB_RT.GLOB)
|
||||||
local b3DtMrtMirror = EgtGetBBoxRef( ProcMirror.Id, GDB_BB.STANDARD, rfDtMrt)
|
local b3DtMrtMirror = EgtGetBBoxRef( ProcMirror.Id, GDB_BB.STANDARD, rfDtMrt)
|
||||||
local b3ProcMirror = EgtGetBBoxGlob( ProcMirror.Id, GDB_BB.STANDARD)
|
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 :
|
||||||
|
-- devono avere estrusioni opposte
|
||||||
-- verifico se le mortase sono specchiate
|
if not AreOppositeVectorApprox( vtExtr, vtExtrMirror) then
|
||||||
local bIsMirror = true
|
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 vtDisplacement = ptBC - ptBCMirror
|
||||||
local ptCenRaw = b3Raw:getCenter()
|
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 = 50
|
local dMinimumDistanceMirroredFeatures = 50
|
||||||
-- controllo che il centro delle due mortase sia allineato, che queste siano equidistanti dalla mezzeria della trave
|
|
||||||
-- e che queste non siano troppo vicine
|
|
||||||
if AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then
|
if AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then
|
||||||
bIsMirror = abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 500 * GEO.EPS_SMALL and
|
local dYMinDistance = max( b3Proc:getMin():getY(), b3ProcMirror:getMin():getY()) - min( b3Proc:getMax():getY(), b3ProcMirror:getMax():getY())
|
||||||
( abs( ptBC:getY() - ptCenRaw:getY()) - abs( ptBCMirror:getY() - ptCenRaw:getY())) < 500 * GEO.EPS_SMALL and
|
if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 500 * GEO.EPS_SMALL and
|
||||||
dYMinDistance - dMinimumDistanceMirroredFeatures > 10 * GEO.EPS_SMALL
|
( 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
|
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||||
bIsMirror = abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 500 * GEO.EPS_SMALL and
|
local dZMinDistance = max( b3Proc:getMin():getZ(), b3ProcMirror:getMin():getZ()) - min( b3Proc:getMax():getZ(), b3ProcMirror:getMax():getZ())
|
||||||
( abs( ptBC:getZ() - ptCenRaw:getZ()) - abs( ptBCMirror:getZ() - ptCenRaw:getZ())) < 500 * GEO.EPS_SMALL and
|
if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 500 * GEO.EPS_SMALL and
|
||||||
dZMinDistance - dMinimumDistanceMirroredFeatures > 10 * GEO.EPS_SMALL
|
( 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
|
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
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
@@ -1493,11 +1506,11 @@ local function VerifyMortiseMirrored( Proc, vProc, b3Raw)
|
|||||||
local sPockType = 'Mortise'
|
local sPockType = 'Mortise'
|
||||||
local sPocketing
|
local sPocketing
|
||||||
if Proc.Prc ~= 53 then
|
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
|
end
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
sPockType = 'Pocket'
|
sPockType = 'Pocket'
|
||||||
sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false)
|
sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false, true)
|
||||||
end
|
end
|
||||||
if not sPocketing or not EgtMdbSetCurrMachining( sPocketing) then
|
if not sPocketing or not EgtMdbSetCurrMachining( sPocketing) then
|
||||||
return
|
return
|
||||||
@@ -1833,11 +1846,15 @@ function BeamExec.ProcessFeatures()
|
|||||||
nRId = EgtGetNextRawPart( nRId)
|
nRId = EgtGetNextRawPart( nRId)
|
||||||
end
|
end
|
||||||
EgtSetInfo( nDispId, 'ROT', -2)
|
EgtSetInfo( nDispId, 'ROT', -2)
|
||||||
|
-- flag feature precedente in doppio
|
||||||
|
local nPrevDouble = 0
|
||||||
-- inserisco le lavorazioni da lavorare ribaltate
|
-- inserisco le lavorazioni da lavorare ribaltate
|
||||||
for i = 1, #vProc do
|
for i = 1, #vProc do
|
||||||
-- creo la lavorazione
|
-- creo la lavorazione
|
||||||
local Proc = vProc[i]
|
local Proc = vProc[i]
|
||||||
if Proc.Flg ~= 0 and Proc.Down then
|
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)
|
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||||
if not bOk then
|
if not bOk then
|
||||||
nTotErr = nTotErr + 1
|
nTotErr = nTotErr + 1
|
||||||
@@ -1905,12 +1922,16 @@ function BeamExec.ProcessFeatures()
|
|||||||
nRId = EgtGetNextRawPart( nRId)
|
nRId = EgtGetNextRawPart( nRId)
|
||||||
end
|
end
|
||||||
EgtSetInfo( nDispId, 'ROT', -1)
|
EgtSetInfo( nDispId, 'ROT', -1)
|
||||||
|
-- flag feature precedente in doppio
|
||||||
|
local nPrevDouble = 0
|
||||||
-- inserisco le lavorazioni da lavorare ruotate
|
-- inserisco le lavorazioni da lavorare ruotate
|
||||||
local nSideMchOk = 0
|
local nSideMchOk = 0
|
||||||
for i = 1, #vProc do
|
for i = 1, #vProc do
|
||||||
-- creo la lavorazione
|
-- creo la lavorazione
|
||||||
local Proc = vProc[i]
|
local Proc = vProc[i]
|
||||||
if Proc.Flg ~= 0 and Proc.Side then
|
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)
|
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
||||||
if not bOk then
|
if not bOk then
|
||||||
nTotErr = nTotErr + 1
|
nTotErr = nTotErr + 1
|
||||||
@@ -1967,11 +1988,15 @@ function BeamExec.ProcessFeatures()
|
|||||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||||
end
|
end
|
||||||
sDownOrSideOrStd = 'STD'
|
sDownOrSideOrStd = 'STD'
|
||||||
|
-- flag feature precedente in doppio
|
||||||
|
local nPrevDouble = 0
|
||||||
-- inserisco le lavorazioni non ribaltate della trave
|
-- inserisco le lavorazioni non ribaltate della trave
|
||||||
for i = 1, #vProc do
|
for i = 1, #vProc do
|
||||||
-- creo la lavorazione
|
-- creo la lavorazione
|
||||||
local Proc = vProc[i]
|
local Proc = vProc[i]
|
||||||
if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then
|
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)
|
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||||
if not bOk then
|
if not bOk then
|
||||||
nTotErr = nTotErr + 1
|
nTotErr = nTotErr + 1
|
||||||
|
|||||||
+3
-2
@@ -21,6 +21,7 @@
|
|||||||
-- 2023/01/20 Modificata PutStartNearestToEdge per gestire lato preferito come Y+, Y-, z*, Z-. Aggiunta funzione GetDistanceToNextPart.
|
-- 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/01/31 Aggiunta funzione ConvertToClosedCurve, precedentemente parte di ProcessMortise.Make
|
||||||
-- 2023/02/22 Modifiche a SetOpenSide, aggiunte ChangeOrOpenStart e CurveWithOnlyStraightLines.
|
-- 2023/02/22 Modifiche a SetOpenSide, aggiunte ChangeOrOpenStart e CurveWithOnlyStraightLines.
|
||||||
|
-- 2023/06/12 In ChangeOrOpenStart corretta ricerca segmento più lungo.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamLib = {}
|
local BeamLib = {}
|
||||||
@@ -966,8 +967,8 @@ function BeamLib.ChangeOrOpenStart( nPathInt, nStartPoint)
|
|||||||
end
|
end
|
||||||
-- recupero l'indice del segmento aperto più lungo
|
-- recupero l'indice del segmento aperto più lungo
|
||||||
local nMaxOpen, dMaxLen
|
local nMaxOpen, dMaxLen
|
||||||
local vOpen = EgtGetInfo( nPathInt or GDB_ID.NULL, 'OPEN')
|
local vOpen = EgtGetInfo( nPathInt or GDB_ID.NULL, 'OPEN', 'vi')
|
||||||
for i = 0, #( vOpen or {}) do
|
for i = 1, #( vOpen or {}) do
|
||||||
-- se primo o più lungo, lo salvo
|
-- se primo o più lungo, lo salvo
|
||||||
local dLen = EgtCurveCompoLength( nPathInt, vOpen[i])
|
local dLen = EgtCurveCompoLength( nPathInt, vOpen[i])
|
||||||
if not dMaxLen or dLen > dMaxLen then
|
if not dMaxLen or dLen > dMaxLen then
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
-- DiceCut.lua by Egaltech s.r.l. 2023/02/05
|
-- DiceCut.lua by Egaltech s.r.l. 2023/06/29
|
||||||
-- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli
|
-- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
@@ -473,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
|
if vtNInner:getZ() > -0.0175 or vtNInner:getZ() < dNzLimDwnUp or abs( vtNInner:getY()) > 0.8 then
|
||||||
vtO:rotate( vtNInner, 90)
|
vtO:rotate( vtNInner, 90)
|
||||||
-- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente
|
-- 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)
|
vtO:rotate( vtNInner, 90)
|
||||||
-- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra
|
-- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra
|
||||||
if vtNInner:getZ() < -0.05 then
|
if vtNInner:getZ() < -0.05 then
|
||||||
|
|||||||
+166
-70
@@ -1,4 +1,4 @@
|
|||||||
-- FacesBySaw.lua by Egaltech s.r.l. 2022/09/24
|
-- FacesBySaw.lua by Egaltech s.r.l. 2023/06/14
|
||||||
-- Gestione taglio con lama di feature con una o due facce
|
-- 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/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.
|
-- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg.
|
||||||
@@ -14,7 +14,9 @@
|
|||||||
-- 2022/06/29 DS In MakeTwo modificato controllo facce dirette verso il basso.
|
-- 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.
|
-- 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/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/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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local FacesBySaw = {}
|
local FacesBySaw = {}
|
||||||
@@ -31,7 +33,124 @@ local BD = require( 'BeamData')
|
|||||||
local ML = require( 'MachiningLib')
|
local ML = require( 'MachiningLib')
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, nForceWorkSide, nForceSCC)
|
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
|
-- dati della faccia
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||||
-- risolvo parametro ambiguo
|
-- risolvo parametro ambiguo
|
||||||
@@ -44,8 +163,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
nOrthoOpposite = Par5
|
nOrthoOpposite = Par5
|
||||||
vtOrthO = BL.GetVersRef( Par5)
|
vtOrthO = BL.GetVersRef( Par5)
|
||||||
end
|
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 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)
|
-- 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)
|
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
|
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
|
||||||
@@ -54,24 +175,24 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
return true, ''
|
return true, ''
|
||||||
end
|
end
|
||||||
vtV1 = - vtV1
|
vtV1 = - vtV1
|
||||||
-- 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)
|
|
||||||
-- verifico se la lama ruota in senso antiorario
|
-- verifico se la lama ruota in senso antiorario
|
||||||
if not EgtMdbSetCurrMachining( sCutting) then
|
if not EgtMdbSetCurrMachining( sCutting) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local bIsSawCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
|
||||||
local bInvert = bForceInvert
|
local bInvert = bForceInvert
|
||||||
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
|
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
|
||||||
if bInvert == nil and bIsSawCCW and not bDownUp then
|
if bInvert == nil then
|
||||||
if ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL) then
|
if not BD.TURN then
|
||||||
bInvert = false
|
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
|
else
|
||||||
bInvert = true
|
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
|
||||||
elseif bInvert == nil then
|
|
||||||
bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
|
||||||
end
|
end
|
||||||
if bInvert then
|
if bInvert then
|
||||||
ptP1, ptP2 = ptP2, ptP1
|
ptP1, ptP2 = ptP2, ptP1
|
||||||
@@ -110,17 +231,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
local nFaceUse = nOrthoOpposite
|
local nFaceUse = nOrthoOpposite
|
||||||
if bDownUp then nFaceUse = BL.GetOrtupOpposite( nOrthoOpposite) end
|
if bDownUp then nFaceUse = BL.GetOrtupOpposite( nOrthoOpposite) end
|
||||||
local bWsRight = ( bInvert ~= bDownUp)
|
local bWsRight = ( bInvert ~= bDownUp)
|
||||||
local nWorkSide = nForceWorkSide
|
local nWorkSide = EgtIf( bWsRight, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||||
if nWorkSide then
|
|
||||||
-- se il workside viene forzato, setto bWsRight di conseguenza
|
|
||||||
if nWorkSide == MCH_MILL_WS.LEFT then
|
|
||||||
bWsRight = false
|
|
||||||
else
|
|
||||||
bWsRight = true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
nWorkSide = EgtIf( bWsRight, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
|
||||||
end
|
|
||||||
-- Versore di riferimento
|
-- Versore di riferimento
|
||||||
local vtRef = Vector3d( vtTg)
|
local vtRef = Vector3d( vtTg)
|
||||||
vtRef:rotate( vtN, EgtIf( bInvert, -90, 90))
|
vtRef:rotate( vtN, EgtIf( bInvert, -90, 90))
|
||||||
@@ -147,30 +258,16 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
-- parametri di attacco/uscita
|
-- parametri di attacco/uscita
|
||||||
local b3Box = BBox3d( b3Raw)
|
local b3Box = BBox3d( b3Raw)
|
||||||
b3Box:expand( dCutSic)
|
b3Box:expand( dCutSic)
|
||||||
local dCutDeltaN, dCutDeltaX = dCutOffset, dCutExtra
|
|
||||||
-- per lavorazioni parallele, nel calcolo dei lead in e out gli offset vanno invertiti
|
|
||||||
if (
|
|
||||||
nFaceUse == MCH_MILL_FU.PARAL_DOWN or
|
|
||||||
nFaceUse == MCH_MILL_FU.PARAL_TOP or
|
|
||||||
nFaceUse == MCH_MILL_FU.PARAL_FRONT or
|
|
||||||
nFaceUse == MCH_MILL_FU.PARAL_BACK or
|
|
||||||
nFaceUse == MCH_MILL_FU.PARAL_LEFT or
|
|
||||||
nFaceUse == MCH_MILL_FU.PARAL_RIGHT
|
|
||||||
) then
|
|
||||||
dCutDeltaN, dCutDeltaX = dCutDeltaX, dCutDeltaN
|
|
||||||
end
|
|
||||||
local ptP1act = ptP1 + vtN * dCutDeltaN
|
|
||||||
local ptP2act = ptP2 + vtN * dCutDeltaN
|
|
||||||
-- attacco perpendicolare
|
-- attacco perpendicolare
|
||||||
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutDeltaX, 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 dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
|
||||||
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
||||||
-- attacco tangente
|
-- attacco tangente
|
||||||
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptP1act, ptP2act, vtN, dSawDiam/2, vtRef, dCutDeltaX, b3Box)
|
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
|
||||||
local dLenLi2 = abs( dLi2Tang)
|
local dLenLi2 = abs( dLi2Tang)
|
||||||
local dLenLo2 = abs( dLo2Tang)
|
local dLenLo2 = abs( dLo2Tang)
|
||||||
-- scelgo l'attacco più conveniente (se non taglio praticamente longitudinale)
|
-- scelgo l'attacco più conveniente (se non taglio praticamente longitudinale)
|
||||||
local bTurnTang
|
local bLioTang
|
||||||
local Ktp = 1.1
|
local Ktp = 1.1
|
||||||
if BD.KIOTP then Ktp = BD.KIOTP end
|
if BD.KIOTP then Ktp = BD.KIOTP end
|
||||||
if ( not bDownUp or abs( vtTg:getY()) > 0.5) and
|
if ( not bDownUp or abs( vtTg:getY()) > 0.5) and
|
||||||
@@ -179,45 +276,44 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5) and not bDownHead) or
|
( ( 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 and b3Box:getDimX() > BD.LEN_SHORT_PART) or
|
( 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
|
( 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
|
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
|
||||||
if BD.TURN then
|
if BD.TURN then
|
||||||
bTurnTang = true
|
local dMove = dist( ptP1, ptP2)
|
||||||
dLoTang = -( dLiTang + dAllStart - dAccStart + dAllEnd - dAccEnd + dLen)
|
dLoTang = -( dLiTang + dAllStart - dAccStart + dAllEnd - dAccEnd + dMove)
|
||||||
dLoPerp = BD.COLL_SIC
|
dLoPerp = BD.COLL_SIC
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- posizione braccio
|
-- posizione braccio
|
||||||
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
|
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
|
||||||
local nSCC = nForceSCC
|
local nSCC = MCH_SCC.NONE
|
||||||
if nSCC == nil then
|
if not BD.TURN then
|
||||||
nSCC = MCH_SCC.NONE
|
if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
||||||
if not BD.TURN then
|
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||||
if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
else
|
||||||
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
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
|
else
|
||||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if bTurnTang then
|
local vtTest = vtOut -- vtLio
|
||||||
local vtTest = EgtIf( bInvert, vtTg, -vtTg)
|
if abs( vtN:getY()) < 0.174 and abs( vtN:getZ()) < 0.174 then
|
||||||
if abs( vtTest:getY()) > abs( vtTest:getZ()) then
|
if abs( vtTest:getY()) > abs( vtTest:getZ()) then
|
||||||
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
else
|
else
|
||||||
nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||||
end
|
end
|
||||||
|
elseif abs( vtN:getZ()) < 0.174 then
|
||||||
|
nSCC = EgtIf( vtTest:getZ() > -0.017, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||||
else
|
else
|
||||||
local vtTest = vtOut -- vtLio
|
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
if abs( vtN:getY()) < 0.174 and abs( vtN:getZ()) < 0.174 then
|
|
||||||
if abs( vtTest:getY()) > abs( vtTest:getZ()) then
|
|
||||||
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
|
||||||
else
|
|
||||||
nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
|
||||||
end
|
|
||||||
elseif abs( vtN:getZ()) < 0.174 then
|
|
||||||
nSCC = EgtIf( vtTest:getZ() > -0.017, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
|
||||||
else
|
|
||||||
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -246,7 +342,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
-- imposto attacco/uscita
|
-- imposto attacco/uscita
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
|
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
|
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.LOTANG, dLoTang)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
||||||
-- imposto allungamenti iniziale e finale
|
-- imposto allungamenti iniziale e finale
|
||||||
@@ -296,7 +392,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local ptM = ( ptT1 + ptT2) / 2
|
local ptM = ( ptT1 + ptT2) / 2
|
||||||
local vtTg = ptT2 - ptT1 ;
|
local vtTg = ptT2 - ptT1 ; vtTg:normalize()
|
||||||
local bConvex = ( dAngT > 0)
|
local bConvex = ( dAngT > 0)
|
||||||
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg)
|
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg)
|
||||||
local bFaceOk = {}
|
local bFaceOk = {}
|
||||||
@@ -312,14 +408,14 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
|||||||
vtRef[1] = vtN[1] ^ vtTg
|
vtRef[1] = vtN[1] ^ vtTg
|
||||||
if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end
|
if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end
|
||||||
vtRef[1]:normalize()
|
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] = ptC[1] - ptM
|
||||||
vtRef[1]:normalize()
|
vtRef[1]:normalize()
|
||||||
end
|
end
|
||||||
vtRef[2] = vtN[2] ^ vtTg
|
vtRef[2] = vtN[2] ^ vtTg
|
||||||
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
|
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
|
||||||
vtRef[2]:normalize()
|
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] = ptC[2] - ptM
|
||||||
vtRef[2]:normalize()
|
vtRef[2]:normalize()
|
||||||
end
|
end
|
||||||
@@ -332,7 +428,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
|||||||
local nOtInd = 3 - nUpInd
|
local nOtInd = 3 - nUpInd
|
||||||
-- metto in relazione la scelta facce con il confronto del versore Z con la scelta in base alla grandezza faccia
|
-- 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
|
-- 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
|
nUpInd = nBigInd
|
||||||
nOtInd = nSmaInd
|
nOtInd = nSmaInd
|
||||||
end
|
end
|
||||||
|
|||||||
+14
-10
@@ -6,6 +6,8 @@
|
|||||||
-- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile.
|
-- 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.
|
-- 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/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile.
|
||||||
|
-- 2023/03/13 Per FindPocketing implementata la scelta lavorazione da UUID dell'utensile.
|
||||||
|
-- 2023/07/28 Aggiunta gestione del tipo di foratura "Drill_AT".
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local MachiningLib = {}
|
local MachiningLib = {}
|
||||||
@@ -162,13 +164,15 @@ function VerifyMill( dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function VerifyPocket( dMaxDiam, dDepth, dMaxTotLen, bH2)
|
function VerifyPocket( dMaxDiam, dDepth, dMaxTotLen, sTuuidMstr, bH2)
|
||||||
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||||
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
|
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
|
||||||
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||||
if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
|
if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
|
||||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
||||||
( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then
|
( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) and
|
||||||
|
( not sTuuidMstr or sTuuidMstr == sTuuid) then
|
||||||
return true, { TDiam = dTDiam, TMaxDepth = dTMaxDepth, H2 = bH2}
|
return true, { TDiam = dTDiam, TMaxDepth = dTMaxDepth, H2 = bH2}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -176,7 +180,7 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function VerifyTool( MachiningType, sType, Params, bH2)
|
function VerifyTool( MachiningType, sType, Params, bH2)
|
||||||
if MachiningType == MCH_MY.DRILLING then
|
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)
|
return VerifyDrill( Params.Diam, Params.Depth, bH2)
|
||||||
elseif EgtStartsWith( sType, 'Pocket') then
|
elseif EgtStartsWith( sType, 'Pocket') then
|
||||||
return VerifyDrillPocket( Params.Diam, Params.Depth, bH2)
|
return VerifyDrillPocket( Params.Diam, Params.Depth, bH2)
|
||||||
@@ -186,7 +190,7 @@ function VerifyTool( MachiningType, sType, Params, bH2)
|
|||||||
elseif MachiningType == MCH_MY.MILLING then
|
elseif MachiningType == MCH_MY.MILLING then
|
||||||
return VerifyMill( Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
|
return VerifyMill( Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
|
||||||
elseif MachiningType == MCH_MY.POCKETING then
|
elseif MachiningType == MCH_MY.POCKETING then
|
||||||
return VerifyPocket( Params.MaxDiam, Params.Depth, Params.MaxTotLen, bH2)
|
return VerifyPocket( Params.MaxDiam, Params.Depth, Params.MaxTotLen, Params.TuuidMstr, bH2)
|
||||||
elseif MachiningType == MCH_MY.MORTISING then
|
elseif MachiningType == MCH_MY.MORTISING then
|
||||||
return true, { H2 = bH2}
|
return true, { H2 = bH2}
|
||||||
else
|
else
|
||||||
@@ -213,7 +217,7 @@ end
|
|||||||
function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
||||||
if MachiningType == MCH_MY.DRILLING then
|
if MachiningType == MCH_MY.DRILLING then
|
||||||
local _, sOrigType = EgtEndsWith( sType, '_H2')
|
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
|
elseif MachiningType == MCH_MY.SAWING then
|
||||||
return MachiningName, ToolParams.H2
|
return MachiningName, ToolParams.H2
|
||||||
elseif MachiningType == MCH_MY.MILLING then
|
elseif MachiningType == MCH_MY.MILLING then
|
||||||
@@ -379,9 +383,9 @@ function MachiningLib.FindCutting( sType, bTopHead, bDownHead)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2)
|
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission)
|
||||||
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Drill', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2)
|
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 == '' then
|
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)
|
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Pocket', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead)
|
||||||
end
|
end
|
||||||
if MachiningName and MachiningName ~= '' then
|
if MachiningName and MachiningName ~= '' then
|
||||||
@@ -403,8 +407,8 @@ function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotL
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sTuuidMstr)
|
||||||
return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen, TuuidMstr = sTuuidMstr}, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|||||||
+91
-40
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessCut.lua by Egaltech s.r.l. 2023/04/05
|
-- ProcessCut.lua by Egaltech s.r.l. 2023/08/01
|
||||||
-- Gestione calcolo singoli tagli di lama per Travi
|
-- 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/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.
|
-- 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/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.
|
-- 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/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
|
-- Tabella per definizione modulo
|
||||||
local ProcessCut = {}
|
local ProcessCut = {}
|
||||||
@@ -172,7 +176,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch1Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- Inserisco la lavorazione del lato opposto
|
-- Inserisco la lavorazione del lato opposto
|
||||||
@@ -195,7 +199,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch2Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
return true, nil
|
return true, nil
|
||||||
@@ -246,14 +250,15 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
if bFromBottom == nil then
|
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)
|
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
|
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)
|
-- 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
|
local bLongCut = ( not bDownCut and vtN:getZ() > 0.865 and
|
||||||
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL 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
|
-- 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
|
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: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
|
-- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10
|
||||||
local bNoDicing = EgtGetInfo( Proc.Id, 'Q04', 'i') == 1
|
local bNoDicing = EgtGetInfo( Proc.Id, 'Q04', 'i') == 1
|
||||||
if bNoDicing then
|
if bNoDicing then
|
||||||
@@ -395,6 +400,19 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
if bCustDiceCut and #vCuts == 0 then
|
if bCustDiceCut and #vCuts == 0 then
|
||||||
return false, -1
|
return false, -1
|
||||||
end
|
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)
|
--DC.PrintOrderCut( vCuts)
|
||||||
if #vCuts > 0 then
|
if #vCuts > 0 then
|
||||||
-- sistemo posizione nel DB e nome
|
-- sistemo posizione nel DB e nome
|
||||||
@@ -453,44 +471,77 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- lavoro la faccia
|
local dDiceFaceMaxH = 0
|
||||||
for j = 1, #vCuts[i] do
|
local dDiceFaceMinH = GEO.INFINITO
|
||||||
-- se taglio dal basso
|
if ( i % 2) == 0 and bDangerousReliefCut then
|
||||||
if bDownCut then
|
for j = 1, #vCuts[i] do
|
||||||
-- se strato pari composto da 1 o 2 elementi
|
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][j], 0)
|
||||||
if ( i % 2) == 0 and #vCuts[i] <= 2 then
|
dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH)
|
||||||
-- il primo elemento prende la direzione prevista, il secondo quella opposta
|
-- calcolo lato orizzontale minore ipotizzando sia un trapezio
|
||||||
local vtNewOrthoO = Vector3d( vtOrthoO)
|
local dDiceFaceH2 = ( 2 * EgtSurfArea( vCuts[i][j]) ) / dDiceFaceV - dDiceFaceH
|
||||||
local dVzLimDwnUp = dNzLimDwnUp
|
dDiceFaceMinH = min( dDiceFaceMinH, dDiceFaceH2)
|
||||||
if j ~= 1 then
|
end
|
||||||
vtNewOrthoO = -vtOrthoO
|
end
|
||||||
if not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.708 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
|
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
|
if not bOk then return bOk, sErr end
|
||||||
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch1Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- Inserisco la lavorazione del lato opposto
|
-- Inserisco la lavorazione del lato opposto
|
||||||
@@ -184,7 +184,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch2Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|||||||
+29
-11
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessDrill.lua by Egaltech s.r.l. 2022/11/30
|
-- ProcessDrill.lua by Egaltech s.r.l. 2023/05/11
|
||||||
-- Gestione calcolo forature per Travi
|
-- Gestione calcolo forature per Travi
|
||||||
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
|
-- 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.
|
-- 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,8 @@
|
|||||||
-- 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/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/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
|
-- 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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDrill = {}
|
local ProcessDrill = {}
|
||||||
@@ -155,6 +157,10 @@ function ProcessDrill.Classify( Proc, b3Raw)
|
|||||||
ptCen = ptCen + vtExtr * dLen
|
ptCen = ptCen + vtExtr * dLen
|
||||||
end
|
end
|
||||||
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
|
-- 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
|
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
|
return false, false, false
|
||||||
@@ -164,7 +170,12 @@ function ProcessDrill.Classify( Proc, b3Raw)
|
|||||||
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
|
-- 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 (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
|
||||||
if not bOpen 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
|
else
|
||||||
return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN)
|
return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN)
|
||||||
end
|
end
|
||||||
@@ -236,19 +247,21 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
end
|
end
|
||||||
local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)
|
local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)
|
||||||
-- verifico possibilità di foratura da sotto
|
-- 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
|
-- 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
|
if bToInvert and ( not bOpen or Proc.Flg ~= 1) then
|
||||||
local sErr = 'Error : drilling from bottom impossible'
|
local sErr = 'Error : drilling from bottom impossible'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- se non già richiesta inversione e invertibile
|
-- se non già richiesta inversione e invertibile
|
||||||
if not bToInvert and Proc.Flg == 1 and ( -vtExtr:getZ() >= BD.DRILL_VZ_MIN or bDownDrill) then
|
if not bToInvert and Proc.Flg == 1 and -vtExtr:getZ() >= BD.DRILL_VZ_MIN then
|
||||||
-- se il foro è cieco o troppo inclinato all'inizio, lo inverto
|
-- se il foro è cieco o dalla faccia sotto o troppo inclinato all'inizio, lo inverto
|
||||||
local _, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
local nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||||
if Proc.Fcs == 0 or ( CosB > BD.DRILL_VX_MAX and bOpen) then
|
if Proc.Fcs == 0 or (( nFac == 2 or CosB > BD.DRILL_VX_MAX) and bOpen) then
|
||||||
bToInvert = true
|
bToInvert = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -278,9 +291,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
end
|
end
|
||||||
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
||||||
-- recupero la lavorazione
|
-- 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
|
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
|
if sDrilling then dCheckDepth = nil end
|
||||||
end
|
end
|
||||||
if not sDrilling then
|
if not sDrilling then
|
||||||
@@ -454,7 +467,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
end
|
end
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
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
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
@@ -494,6 +509,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
-- se lavorazione in doppio
|
-- se lavorazione in doppio
|
||||||
if Proc.Double and Proc.Double > 0 then
|
if Proc.Double and Proc.Double > 0 then
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||||
|
if Proc.Double ~= Proc.PrevDouble then
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessDtMortise.lua by Egaltech s.r.l. 2023/03/28
|
-- ProcessDtMortise.lua by Egaltech s.r.l. 2023/05/11
|
||||||
-- Gestione calcolo mortase a coda di rondine per Travi
|
-- Gestione calcolo mortase a coda di rondine per Travi
|
||||||
-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa.
|
-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa.
|
||||||
-- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto.
|
-- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto.
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
-- 2022/12/28 Aggiunta gestione lavorazione in doppio.
|
-- 2022/12/28 Aggiunta gestione lavorazione in doppio.
|
||||||
-- 2023/03/06 Aggiunta forzatura ingresso fuori dal grezzo con pocket.
|
-- 2023/03/06 Aggiunta forzatura ingresso fuori dal grezzo con pocket.
|
||||||
-- 2023/03/28 Corretto calcolo larghezza mortasa quando più larga che lunga.
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local ProcessDtMortise = {}
|
local ProcessDtMortise = {}
|
||||||
@@ -289,7 +290,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- se con tasca, la lavoro
|
-- se con tasca, la lavoro (mai in doppio)
|
||||||
if bPocket then
|
if bPocket then
|
||||||
-- recupero il contorno della tasca (seconda curva ausiliaria)
|
-- recupero il contorno della tasca (seconda curva ausiliaria)
|
||||||
local sVal = EgtGetInfo( Proc.Id, 'AUXID')
|
local sVal = EgtGetInfo( Proc.Id, 'AUXID')
|
||||||
@@ -350,6 +351,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||||
end
|
end
|
||||||
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
|
-- se parametro interno abilitato e il percorso non è chiuso, aggiungo percorso e lavorazione antischeggia
|
||||||
if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then
|
if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then
|
||||||
-- recupero gruppo per geometria addizionale
|
-- recupero gruppo per geometria addizionale
|
||||||
@@ -431,6 +434,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- se lavorazione in doppio
|
-- se lavorazione in doppio
|
||||||
if Proc.Double and Proc.Double > 0 then
|
if Proc.Double and Proc.Double > 0 then
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||||
|
if Proc.Double ~= nMyPrevDouble then
|
||||||
|
nMyPrevDouble = Proc.Double
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
@@ -516,6 +523,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- se lavorazione in doppio
|
-- se lavorazione in doppio
|
||||||
if Proc.Double and Proc.Double > 0 then
|
if Proc.Double and Proc.Double > 0 then
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||||
|
if Proc.Double ~= nMyPrevDouble then
|
||||||
|
nMyPrevDouble = Proc.Double
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
-- 2022/11/24 In MakeByMill aggiunta la lavorazione sopra/sotto nel caso di testa sotto
|
-- 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
|
-- 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/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
|
-- Tabella per definizione modulo
|
||||||
local ProcessFreeContour = {}
|
local ProcessFreeContour = {}
|
||||||
@@ -26,6 +28,7 @@ local Q_DIM_STRIP = 'Q01' -- d
|
|||||||
local Q_DEPTH_CHAMFER = 'Q02' -- d
|
local Q_DEPTH_CHAMFER = 'Q02' -- d
|
||||||
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
|
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
|
||||||
local Q_ONLY_CHAMFER = 'Q00' -- i
|
local Q_ONLY_CHAMFER = 'Q00' -- i
|
||||||
|
local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Riconoscimento della feature
|
-- Riconoscimento della feature
|
||||||
@@ -206,8 +209,8 @@ local function CalcSpecialAdd( nCrv, bStartVsEnd, dToolDiam)
|
|||||||
-- tangenti prima e dopo il punto interno
|
-- tangenti prima e dopo il punto interno
|
||||||
local vtPrev = EgtUV( nCrv, nIn, -1)
|
local vtPrev = EgtUV( nCrv, nIn, -1)
|
||||||
local vtNext = EgtUV( nCrv, nIn, 1)
|
local vtNext = EgtUV( nCrv, nIn, 1)
|
||||||
-- se c'è perdita di tangenza (delta angolare oltre i 5 gradi)
|
-- se c'è perdita di tangenza (delta angolare oltre i 15 gradi)
|
||||||
if vtPrev * vtNext < 0.996 then
|
if vtPrev * vtNext < 0.966 then
|
||||||
-- lunghezza del tratto
|
-- lunghezza del tratto
|
||||||
local ptP0 = EgtUP( nCrv, nOut)
|
local ptP0 = EgtUP( nCrv, nOut)
|
||||||
local ptP1 = EgtUP( nCrv, nIn)
|
local ptP1 = EgtUP( nCrv, nIn)
|
||||||
@@ -772,6 +775,11 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
-- imposto elevazione
|
-- imposto elevazione
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
|
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
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
||||||
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
-- 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/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
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessHeadCut = {}
|
local ProcessHeadCut = {}
|
||||||
@@ -208,7 +209,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
-- determino se più tagli con offset
|
-- 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
|
local dOffsL = dOvmHead / nCuts
|
||||||
-- se taglio per sezioni alte e larghe
|
-- se taglio per sezioni alte e larghe
|
||||||
if bBigSectionCut then
|
if bBigSectionCut then
|
||||||
@@ -263,7 +264,9 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
else
|
else
|
||||||
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
||||||
local dSawRad = dSawDiam / 2
|
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)
|
||||||
if BD.C_SIMM then
|
if BD.C_SIMM then
|
||||||
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||||
else
|
else
|
||||||
@@ -271,12 +274,12 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
|
-- per travi alte faccio dei tagli orizzontali aggiuntivi
|
||||||
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||||
local dMinOvmHeadForHorizontalCuts = 10.123
|
local dMinOvmHeadForHorizontalCuts = 10.123
|
||||||
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForHorizontalCuts - 10 * GEO.EPS_SMALL)
|
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForHorizontalCuts - 10 * GEO.EPS_SMALL)
|
||||||
if bAreHorizontalCutsNeeded then
|
if bAreHorizontalCutsNeeded then
|
||||||
local nHorizontalCuts = ceil ( dimV / BD.MAX_DIM_DICE) - 1
|
local nHorizontalCuts = ceil( dimV / BD.MAX_DIM_DICE) - 1
|
||||||
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
|
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
|
||||||
for i = nCuts, 1, -1 do
|
for i = nCuts, 1, -1 do
|
||||||
local dCutXOffset = ( i - 1) * dOffsL
|
local dCutXOffset = ( i - 1) * dOffsL
|
||||||
@@ -284,10 +287,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
for j = nHorizontalCuts, 1, -1 do
|
for j = nHorizontalCuts, 1, -1 do
|
||||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||||
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
||||||
local nForceWorkSide = MCH_MILL_WS.LEFT
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw)
|
||||||
local bForceInvert = true
|
|
||||||
local nForceSCC = MCH_SCC.ADIR_XP
|
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, bForceInvert, nForceWorkSide, nForceSCC)
|
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||||
|
|||||||
+153
-86
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/12/22
|
-- ProcessLapJoint.lua by Egaltech s.r.l. 2023/08/10
|
||||||
-- Gestione calcolo mezzo-legno per Travi
|
-- Gestione calcolo mezzo-legno per Travi
|
||||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||||
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
|
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
|
||||||
@@ -64,7 +64,17 @@
|
|||||||
-- 2023/02/06 Alla MakeDrillOnCorner aggiunto controllo distanza di sicurezza minima.
|
-- 2023/02/06 Alla MakeDrillOnCorner aggiunto controllo distanza di sicurezza minima.
|
||||||
-- 2023/02/16 Piccola correzione alla scelta utensile di svuotatura.
|
-- 2023/02/16 Piccola correzione alla scelta utensile di svuotatura.
|
||||||
-- 2023/02/21 Piccola correzione alla MakeByPocket.
|
-- 2023/02/21 Piccola correzione alla MakeByPocket.
|
||||||
|
-- 2023/03/13 In MakeByPocket aggiunto Q11=Tool_ID per forzare la scelta utensile in casi con Q03=2/3.
|
||||||
-- 2023/03/31 Correzione al calcolo della distanza di collisione nel caso in cui il gambo sia più piccolo dell'utensile.
|
-- 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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLapJoint = {}
|
local ProcessLapJoint = {}
|
||||||
@@ -136,6 +146,7 @@ local function AssignQIdent( Proc)
|
|||||||
Q_SIDE_ROUGH_TOOL = ''
|
Q_SIDE_ROUGH_TOOL = ''
|
||||||
Q_ANTISPLINT_TYPE = ''
|
Q_ANTISPLINT_TYPE = ''
|
||||||
Q_MAX_ELEVATION = 'Q10'
|
Q_MAX_ELEVATION = 'Q10'
|
||||||
|
Q_TOOL_ID = ''
|
||||||
|
|
||||||
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
||||||
Q_FORCE_BLADE = 'Q01' -- i
|
Q_FORCE_BLADE = 'Q01' -- i
|
||||||
@@ -159,10 +170,12 @@ local function AssignQIdent( Proc)
|
|||||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||||
Q_DEPTH_CHAMFER = 'Q07' -- d
|
Q_DEPTH_CHAMFER = 'Q07' -- d
|
||||||
|
Q_TOOL_ID = 'Q11' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
||||||
Q_SIDE_ROUGH_TOOL = 'Q01' -- i
|
Q_SIDE_ROUGH_TOOL = 'Q01' -- i
|
||||||
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
|
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
|
||||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||||
|
Q_TOOL_ID = 'Q11' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33 then
|
||||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
|
||||||
@@ -318,12 +331,15 @@ local function VerifyChainSaw( Proc, dMinDim, dMaxDim)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bPocketUp, bPocketDown)
|
local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bPocketUp, bPocketDown, sChosenToolUuid)
|
||||||
-- tipo di svuotatura
|
-- tipo di svuotatura
|
||||||
local sMchFind = EgtIf( sMchFindMaster and #sMchFindMaster > 0, sMchFindMaster, 'Pocket')
|
local sMchFind = EgtIf( sMchFindMaster and #sMchFindMaster > 0, sMchFindMaster, 'Pocket')
|
||||||
-- ricerca della svuotatura
|
-- ricerca della svuotatura
|
||||||
local sPocketing
|
local sPocketing
|
||||||
if dDepth then
|
-- se viene specificato un utensile non guardo altro
|
||||||
|
if sChosenToolUuid then
|
||||||
|
sPocketing = ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen, bPocketUp, bPocketDown, nil, nil, sChosenToolUuid)
|
||||||
|
elseif dDepth then
|
||||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, dDepth, dMaxTotLen, bPocketUp, 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.8 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
||||||
ML.FindPocketing( sMchFind, dDiam, 0.7 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
ML.FindPocketing( sMchFind, dDiam, 0.7 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
||||||
@@ -665,9 +681,9 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
|||||||
if dEndDist > BD.MAX_DIST_HTFEA then
|
if dEndDist > BD.MAX_DIST_HTFEA then
|
||||||
return false
|
return false
|
||||||
end
|
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
|
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
|
return false
|
||||||
end
|
end
|
||||||
-- se una o due facce e interessa veramente la coda, allora di coda
|
-- se una o due facce e interessa veramente la coda, allora di coda
|
||||||
@@ -736,6 +752,13 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- 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 è una feature scanalatura (con 5 facce) e non è stata riconosciuta come fessura, eseguo altre verifiche
|
-- 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
|
if Proc.Prc == 16 and Proc.Fct == 5 and not bClosedOrthoFaces then
|
||||||
-- recupero gruppo per geometria addizionale
|
-- recupero gruppo per geometria addizionale
|
||||||
@@ -1354,8 +1377,10 @@ local function MakeRoundCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
local dTMaxDepth = 0
|
local dTMaxDepth = 0
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dTMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTMaxDepth
|
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||||
|
dTMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTMaxDepth
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se il diametro trovato non è minore dei 3/4 del diametro utilizzato in precedenza, esco
|
-- se il diametro trovato non è minore dei 3/4 del diametro utilizzato in precedenza, esco
|
||||||
@@ -1534,8 +1559,10 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
local dTMaxDepth = 0
|
local dTMaxDepth = 0
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dTMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTMaxDepth
|
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||||
|
dTMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTMaxDepth
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local sMillingDn = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not( bMillDown and bDoubleSide), bMillDown and bDoubleSide)
|
local sMillingDn = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not( bMillDown and bDoubleSide), bMillDown and bDoubleSide)
|
||||||
@@ -1549,8 +1576,10 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
local dTMaxDepthDn = 0
|
local dTMaxDepthDn = 0
|
||||||
if EgtMdbSetCurrMachining( sMillingDn) then
|
if EgtMdbSetCurrMachining( sMillingDn) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
dTDiamDn = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiamDn
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dTMaxDepthDn = EgtTdbGetCurrToolMaxDepth() or dTMaxDepthDn
|
dTDiamDn = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiamDn
|
||||||
|
dTMaxDepthDn = EgtTdbGetCurrToolMaxDepth() or dTMaxDepthDn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se il diametro trovato non è minore dei 3/4 del diametro utilizzato in precedenza, esco
|
-- se il diametro trovato non è minore dei 3/4 del diametro utilizzato in precedenza, esco
|
||||||
@@ -1903,7 +1932,9 @@ local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacI
|
|||||||
-- recupero i dati dell'utensile ( temporaneo, per compensare errore nella lavorazione)
|
-- recupero i dati dell'utensile ( temporaneo, per compensare errore nella lavorazione)
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
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
|
end
|
||||||
-- l'altezza di taglio del tagliente corrisponde al raggio del raccordo che si riesce a coprire
|
-- 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
|
-- quindi confronto l'elevazione con il raggio utensile utilizzato per la svuotatura
|
||||||
@@ -3034,12 +3065,14 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
local dSawThick = 0
|
local dSawThick = 0
|
||||||
local dMaxDepth = 0
|
local dMaxDepth = 0
|
||||||
|
local bSawCCW = false
|
||||||
if EgtMdbSetCurrMachining( sCutting) then
|
if EgtMdbSetCurrMachining( sCutting) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||||
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
|
bSawCCW = ( EgtTdbGetCurrToolParam( MCH_TP.SPEED) < 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local dExtraOffs = 0
|
local dExtraOffs = 0
|
||||||
@@ -3064,8 +3097,10 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- eseguo il taglio
|
-- eseguo il taglio
|
||||||
local dVzLimDwnUp = EgtIf( BD.TURN, -2, nil)
|
local vtNfac = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
|
||||||
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 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
|
if bMadeASbyBld then
|
||||||
sWarn = nil
|
sWarn = nil
|
||||||
if not bReduceDepth and abs(dExtraOffs) > 0 then
|
if not bReduceDepth and abs(dExtraOffs) > 0 then
|
||||||
@@ -3076,7 +3111,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|||||||
end
|
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)
|
||||||
|
|
||||||
-- calcolo l'elevazione dal punto medio
|
-- calcolo l'elevazione dal punto medio
|
||||||
local dElev
|
local dElev
|
||||||
@@ -3140,12 +3175,17 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
|||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
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
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
if AreSameVectorApprox( tvtN[2], Z_AX()) then
|
if AreSameVectorApprox( tvtN[2], Z_AX()) then
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
elseif abs( tvtN[2]:getX()) < 0.1 then
|
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
|
elseif tvtN[2]:getY() > 0.1 then
|
||||||
nSCC = MCH_SCC.ADIR_YP
|
nSCC = MCH_SCC.ADIR_YP
|
||||||
end
|
end
|
||||||
@@ -3184,6 +3224,7 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
|||||||
if bOpenOutRaw then
|
if bOpenOutRaw then
|
||||||
sNotes = sNotes .. 'OpenOutRaw=1;'
|
sNotes = sNotes .. 'OpenOutRaw=1;'
|
||||||
end
|
end
|
||||||
|
sNotes = sNotes .. ( EgtGetMachiningParam( MCH_MP.USERNOTES) or '')
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
-- provo ad allargare leggermente la tasca
|
-- provo ad allargare leggermente la tasca
|
||||||
@@ -3279,7 +3320,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -3431,7 +3472,7 @@ local function GetUShapeWidth( Proc, nFacInd)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL, dOvmHead)
|
||||||
|
|
||||||
local nFirstMachId
|
local nFirstMachId
|
||||||
local bOrthoFaces
|
local bOrthoFaces
|
||||||
@@ -3439,8 +3480,32 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
local sMchFind = 'Pocket'
|
local sMchFind = 'Pocket'
|
||||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
||||||
local bBadMach = false
|
local bBadMach = false
|
||||||
|
dOvmHead = dOvmHead or 10
|
||||||
|
|
||||||
-- minima altezza della tasca sotto alla quale fa una contornatura invece di una svuotatura
|
-- minima altezza della tasca sotto alla quale fa una contornatura invece di una svuotatura
|
||||||
local dMinFaceElevForPocket = 20
|
local dMinFaceElevForPocket = 20
|
||||||
|
|
||||||
|
-- se l'utente forza un utensile e la lavorazione è forzata dal lato modifico la minima altezza della tasca
|
||||||
|
local sChosenToolUuid
|
||||||
|
if ( ( EgtGetInfo( Proc.Id, Q_TOOL_ID, 'i') or 0) > 0 and ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0) > 1) then
|
||||||
|
local nChosenToolUuid = EgtGetInfo( Proc.Id, Q_TOOL_ID, 'i')
|
||||||
|
local sToolName = EgtTdbGetFirstTool( MCH_TF.MILL)
|
||||||
|
while sToolName ~= '' do
|
||||||
|
EgtTdbSetCurrTool( sToolName)
|
||||||
|
local nToolId = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
|
||||||
|
local bIsToolActive = EgtTdbGetCurrToolParam( MCH_TP.ACTIVE)
|
||||||
|
if ( ( nChosenToolUuid == nToolId) and bIsToolActive) then break end
|
||||||
|
sToolName = EgtTdbGetNextTool( MCH_TF.MILL)
|
||||||
|
end
|
||||||
|
if sToolName == '' then
|
||||||
|
sChosenToolUuid = ''
|
||||||
|
else
|
||||||
|
local dChosenToolDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||||
|
dMinFaceElevForPocket = dChosenToolDiameter / 2 + 10 * GEO.EPS_SMALL
|
||||||
|
sChosenToolUuid = EgtTdbGetCurrToolParam( MCH_TP.UUID)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if sMchFindMaster and #sMchFindMaster > 0 then
|
if sMchFindMaster and #sMchFindMaster > 0 then
|
||||||
sMchFind = sMchFindMaster
|
sMchFind = sMchFindMaster
|
||||||
end
|
end
|
||||||
@@ -3459,7 +3524,9 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
else
|
else
|
||||||
bOrthoFaces = bOrthoFacesMaster
|
bOrthoFaces = bOrthoFacesMaster
|
||||||
end
|
end
|
||||||
|
local bMakeContour = false
|
||||||
|
local bMakePocket, sPocketing, dMaxDepth, dDiamTool
|
||||||
|
local sMilling
|
||||||
-- se è un tunnel verifico se è possibile usare la svuotatura
|
-- se è un tunnel verifico se è possibile usare la svuotatura
|
||||||
if bOrthoFaces then
|
if bOrthoFaces then
|
||||||
-- ottengo le dimensioni del tunnel
|
-- ottengo le dimensioni del tunnel
|
||||||
@@ -3470,7 +3537,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
-- se tre facce aumento il diametro di quanto possibile
|
-- se tre facce aumento il diametro di quanto possibile
|
||||||
elseif Proc.Fct == 3 then
|
elseif Proc.Fct == 3 then
|
||||||
local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false)
|
local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false)
|
||||||
local dWidth = GetUShapeWidth( Proc, nFacInd or -1)
|
local dWidth = GetUShapeWidth( Proc, nFacInd or -1) or dDimMin
|
||||||
if dWidth > dDimMin then
|
if dWidth > dDimMin then
|
||||||
dDimMin = min( 2 * dDimMin, dWidth)
|
dDimMin = min( 2 * dDimMin, dWidth)
|
||||||
end
|
end
|
||||||
@@ -3486,10 +3553,10 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
-- ricalcolo se è lavorabile da sotto
|
-- ricalcolo se è lavorabile da sotto
|
||||||
bMillDown = ( BD.DOWN_HEAD == true)
|
bMillDown = ( BD.DOWN_HEAD == true)
|
||||||
-- verifico se può essere fatto con svuotatura
|
-- verifico se può essere fatto con svuotatura
|
||||||
local bMakePocket, sPocketing, dMaxDepth, dDiamTool = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind)
|
bMakePocket, sPocketing, dMaxDepth, dDiamTool = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, nil, nil, sChosenToolUuid)
|
||||||
local bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn
|
local bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn
|
||||||
if bMillDown then
|
if bMillDown then
|
||||||
bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, nil, true)
|
bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, nil, true, sChosenToolUuid)
|
||||||
-- se è negativo inverto il versore e la faccia
|
-- se è negativo inverto il versore e la faccia
|
||||||
if vtOrtho:getZ() < 0 then
|
if vtOrtho:getZ() < 0 then
|
||||||
vtOrtho = -vtOrtho
|
vtOrtho = -vtOrtho
|
||||||
@@ -3498,11 +3565,9 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
end
|
end
|
||||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
local bMakeContour = false
|
-- recupero la lavorazione di contornatura
|
||||||
local sMilling
|
sMilling = ML.FindMilling( 'Prof', nil, sChosenToolUuid)
|
||||||
if dFacElev < dMinFaceElevForPocket and ( bIsU or bIsL) and ( Proc.Fct == 2 or Proc.Fct == 3) and abs( vtN:getZ()) > 0.996 then
|
if dFacElev < dMinFaceElevForPocket and ( bIsU or bIsL) and ( Proc.Fct == 2 or Proc.Fct == 3) and abs( vtN:getZ()) > 0.996 then
|
||||||
-- recupero la lavorazione di contornatura
|
|
||||||
sMilling = ML.FindMilling( 'Prof', nil, nil, nil, nil, not bMillDown, bMillDown)
|
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sMyWarn = 'Warning : Prof not found in library'
|
local sMyWarn = 'Warning : Prof not found in library'
|
||||||
EgtOutLog( sMyWarn)
|
EgtOutLog( sMyWarn)
|
||||||
@@ -3513,8 +3578,8 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
if sMilling and EgtMdbSetCurrMachining( sMilling) then
|
if sMilling and EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dDiamTool
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dToolMaxDepth
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
bMakeContour = true
|
bMakeContour = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -3669,18 +3734,20 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dMinFaceElevForPocket + 10)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
EgtSetMachiningParam( MCH_MP.LOPERP, dMinFaceElevForPocket + 10)
|
||||||
elseif bIsL then
|
elseif bIsL then
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 30)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 30)
|
EgtSetMachiningParam( MCH_MP.LITANG, dOvmHead + ( dDiamTool / 2) + 10)
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
EgtSetMachiningParam( MCH_MP.LOPERP, dMinFaceElevForPocket + 10)
|
||||||
end
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
end
|
end
|
||||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||||
local sNotes = ''
|
local sNotes = ''
|
||||||
@@ -3802,25 +3869,26 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||||
if bIsU then
|
if bIsU then
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dMinFaceElevForPocket + 10)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
EgtSetMachiningParam( MCH_MP.LOPERP, dMinFaceElevForPocket + 10)
|
||||||
elseif bIsL then
|
elseif bIsL then
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 30)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.TANGENT)
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.TANGENT)
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 30)
|
EgtSetMachiningParam( MCH_MP.LOTANG, dOvmHead + ( dDiamTool / 2) + 10)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dMinFaceElevForPocket + 10)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
||||||
end
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
end
|
end
|
||||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||||
sNotes = ''
|
sNotes = ''
|
||||||
@@ -3841,7 +3909,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
||||||
if not bComplete and bIs3Faces then
|
if not bComplete and bIs3Faces and not bMakeContour then
|
||||||
-- recupero la faccia da lavorare
|
-- recupero la faccia da lavorare
|
||||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||||
local vtN
|
local vtN
|
||||||
@@ -3915,12 +3983,17 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if ( sChosenToolUuid == '') or ( sChosenToolUuid and ( ( bMakeContour and not sMilling) or not sPocketing)) then
|
||||||
return 0, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, bOrthoFaces
|
local sErr = 'Error : no machining found with chosen Tool_ID'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return -1, sErr
|
||||||
|
else
|
||||||
|
return 0, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, bOrthoFaces
|
||||||
|
end
|
||||||
end
|
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 bMadeASbyBld = false
|
||||||
local nNumFac = EgtIf( bIsU, 2, 1)
|
local nNumFac = EgtIf( bIsU, 2, 1)
|
||||||
@@ -3954,16 +4027,24 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bM
|
|||||||
if nIdMach then
|
if nIdMach then
|
||||||
-- verifico se da invertire
|
-- verifico se da invertire
|
||||||
local bInvertMach = false
|
local bInvertMach = false
|
||||||
local dDepth = 0
|
|
||||||
if bIsU then
|
if bIsU then
|
||||||
-- prendo il vettore normale alla faccia
|
-- prendo il vettore normale alla faccia
|
||||||
local vtNFc = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
|
local vtNFc = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
|
||||||
if abs( vtN:getZ()) > 0.63 or abs( vtN:getY()) > 0.63 then
|
if abs( vtN:getZ()) > 0.63 or abs( vtN:getY()) > 0.63 then
|
||||||
-- se superficie principale parallela al piano XZ
|
-- se superficie principale parallela al piano XZ
|
||||||
if nPrefSide == 0 then
|
if nPrefSide == 0 then
|
||||||
-- se facce praticamente verticali || mandrino a destra
|
-- se facce praticamente verticali ||
|
||||||
if abs( vtNFc:getZ()) < 0.1 then
|
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)
|
-- se facce inclinate \\ allora mandrino a destra (per essere verso l'alto)
|
||||||
elseif vtNFc:getX() * vtNFc:getZ() > 0 then
|
elseif vtNFc:getX() * vtNFc:getZ() > 0 then
|
||||||
nPrefSide = 2
|
nPrefSide = 2
|
||||||
@@ -3989,40 +4070,22 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bM
|
|||||||
-- eseguo inversione
|
-- eseguo inversione
|
||||||
if bInvertMach then
|
if bInvertMach then
|
||||||
local bToolInvert = EgtGetMachiningParam( MCH_MP.TOOLINVERT)
|
local bToolInvert = EgtGetMachiningParam( MCH_MP.TOOLINVERT)
|
||||||
local nWS = EgtGetMachiningParam( MCH_MP.WORKSIDE)
|
local bInvert = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||||
local nInvWS = EgtIf( nWS == MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)
|
|
||||||
local nFaceUse = EgtGetMachiningParam( MCH_MP.FACEUSE)
|
local nFaceUse = EgtGetMachiningParam( MCH_MP.FACEUSE)
|
||||||
local bOrtUp = ( nFaceUse >= MCH_MILL_FU.ORTUP_DOWN and nFaceUse <= MCH_MILL_FU.ORTUP_RIGHT)
|
local bOrtUp = ( nFaceUse >= MCH_MILL_FU.ORTUP_DOWN and nFaceUse <= MCH_MILL_FU.ORTUP_RIGHT)
|
||||||
if not bOrtUp then
|
if not bOrtUp then
|
||||||
-- assegno i parametri invertiti
|
-- assegno i parametri invertiti
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, nInvWS)
|
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, not bToolInvert)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, not bToolInvert)
|
||||||
|
EgtSetMachiningParam( MCH_MP.INVERT, not bInvert)
|
||||||
-- setto l'offset pari allo spessore lama
|
-- setto l'offset pari allo spessore lama
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSL, -dSawThick)
|
EgtSetMachiningParam( MCH_MP.OFFSL, -dSawThick)
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
-- posizione del braccio : se primo taglio la recupero, altrimenti la imposto
|
-- posizione del braccio : se primo taglio la recupero, altrimenti la imposto
|
||||||
if not nPrevSCC then
|
if not nPrevSCC then
|
||||||
nPrevSCC = EgtGetMachiningParam( MCH_MP.SCC)
|
nPrevSCC = EgtGetMachiningParam( MCH_MP.SCC)
|
||||||
else
|
elseif abs( vtN:getZ()) > 0.996 then
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nPrevSCC)
|
EgtSetMachiningParam( MCH_MP.SCC, nPrevSCC)
|
||||||
end
|
end
|
||||||
-- rieseguo
|
-- rieseguo
|
||||||
@@ -4588,13 +4651,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
dDepth = dDepth / 2 + BD.CUT_EXTRA
|
dDepth = dDepth / 2 + BD.CUT_EXTRA
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local dWorkDepth = dDepth
|
local dWorkDepth = dMaxMat
|
||||||
-- cerco di estendere il taglio considerando la parte arrotondata della lama + 1
|
-- cerco di estendere il taglio considerando la parte arrotondata della lama
|
||||||
if dMaxMat > dDepth + dSawCornerRad + 1 then
|
if dMaxMat > dDepth + dSawCornerRad + 1 then
|
||||||
dWorkDepth = dDepth + dSawCornerRad + 1
|
dWorkDepth = dDepth + dSawCornerRad + 1
|
||||||
-- se massimo affondamento utensile inferiore alla profondità da lavorare, setto la profondità di lavoro e emetto warning
|
-- se massimo affondamento utensile inferiore alla profondità da lavorare, setto la profondità di lavoro e emetto warning
|
||||||
elseif dMaxMat < dDepth then
|
elseif dMaxMat < dDepth then
|
||||||
dWorkDepth = dMaxMat
|
|
||||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||||
EgtOutLog( sWarn)
|
EgtOutLog( sWarn)
|
||||||
end
|
end
|
||||||
@@ -4878,8 +4940,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- altrimenti lavorazione di svuotatura o contornatura
|
-- altrimenti lavorazione di svuotatura o contornatura
|
||||||
else
|
else
|
||||||
local bUseOtherFace
|
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
|
-- 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)
|
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||||
nFacInd, nFacInd2 = nFacInd2, nFacInd
|
nFacInd, nFacInd2 = nFacInd2, nFacInd
|
||||||
dFacElev, dFacElev2 = dFacElev2, dFacElev
|
dFacElev, dFacElev2 = dFacElev2, dFacElev
|
||||||
@@ -4887,7 +4953,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
end
|
end
|
||||||
-- verifico non sia orientata verso il basso o ci sia una testa dal basso o la lavorazione sia dal lato.
|
-- 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)
|
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'
|
local sErr = 'Error : LapJoint from bottom impossible'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
@@ -4936,6 +5002,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342)
|
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342)
|
||||||
-- settaggio voluto da Alessandro/Fabio (per fare angoli con fresa piccola)
|
-- settaggio voluto da Alessandro/Fabio (per fare angoli con fresa piccola)
|
||||||
sMchFind = 'Pocket'
|
sMchFind = 'Pocket'
|
||||||
|
if bLapJointAngTrasm then sMchFind = 'Pocket_AT' end
|
||||||
local dDiam = min( dH, dV)
|
local dDiam = min( dH, dV)
|
||||||
local bTailOnSide = ( Proc.Box:getMin():getX() - b3Solid:getMin():getX() < 0.1 and not Proc.Tail and not bAllWithEndCap)
|
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
|
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
|
||||||
@@ -4945,11 +5012,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
elseif Proc.Fct == 4 then
|
elseif Proc.Fct == 4 then
|
||||||
-- se non angoli fittizi, per rifinire gli angoli premio utensile diam 25 o da BD
|
-- se non angoli fittizi, per rifinire gli angoli premio utensile diam 25 o da BD
|
||||||
if not bAllWithEndCap then
|
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
|
end
|
||||||
elseif Proc.Fct == 3 and bIsL then
|
elseif Proc.Fct == 3 and bIsL then
|
||||||
-- per rifinire gli angoli premio utensile diam 25 o da BD
|
-- 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
|
else
|
||||||
dDiam = 2 * dDiam
|
dDiam = 2 * dDiam
|
||||||
end
|
end
|
||||||
@@ -4964,23 +5031,23 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
if bNewCheck and Proc.Prc == 20 and nUseRoughTool == 0 then
|
if bNewCheck and Proc.Prc == 20 and nUseRoughTool == 0 then
|
||||||
-- verifico se forzato uso truciolatore
|
-- verifico se forzato uso truciolatore
|
||||||
nUseRT = EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i')
|
nUseRT = EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i')
|
||||||
if nUseRT and nUseRT ~= 0 then
|
if nUseRT and nUseRT ~= 0 then
|
||||||
sMchFind = 'OpenPocket'
|
sMchFind = 'OpenPocket'
|
||||||
nUseRoughTool = 1
|
nUseRoughTool = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- 03/12/2020 aggiunto controllo su feature 30 senza uso truciolatore
|
-- 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 then
|
if bNewCheck and Proc.Prc == 30 and nUseRoughTool == 0 and Proc.Fct < 5 and not bClosedOrthoFaces then
|
||||||
-- verifico se forzato uso truciolatore
|
-- verifico se forzato uso truciolatore
|
||||||
nUseRT = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i')
|
nUseRT = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i')
|
||||||
if nUseRT and nUseRT ~= 0 then
|
if nUseRT and nUseRT ~= 0 then
|
||||||
sMchFind = 'OpenPocket'
|
sMchFind = 'OpenPocket'
|
||||||
nUseRoughTool = 1
|
nUseRoughTool = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se processo 20 e non sto usando il truciolatore
|
-- se processo 20 e non sto usando il truciolatore
|
||||||
if Proc.Prc == 20 and nUseRoughTool == 0 then
|
if Proc.Prc == 20 and nUseRoughTool == 0 then
|
||||||
if nUseRT and nUseRT ~= 0 then
|
if nUseRT and nUseRT ~= 0 then
|
||||||
sMchFind = 'OpenPocket'
|
sMchFind = 'OpenPocket'
|
||||||
nUseRoughTool = 1
|
nUseRoughTool = 1
|
||||||
end
|
end
|
||||||
@@ -5071,7 +5138,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- lavoro con svuotature (singola o doppia contrapposta)
|
-- lavoro con svuotature (singola o doppia contrapposta)
|
||||||
local sMyMchFind = 'Pocket'
|
local sMyMchFind = 'Pocket'
|
||||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, _, _, _, _, _, _, _,
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, _, _, _, _, _, _, _,
|
||||||
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, true, b3Solid, nil, bMillDown)
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, true, b3Solid, nil, bMillDown, bSetOpenBorders, bIsU, bIsL, dOvmHead)
|
||||||
-- se lavorazione non idonee ( asse della feature troppo inclinato e impossibile lavorare completamente da due parti)
|
-- se lavorazione non idonee ( asse della feature troppo inclinato e impossibile lavorare completamente da due parti)
|
||||||
if nOk == -2 then
|
if nOk == -2 then
|
||||||
if not sMchFind then
|
if not sMchFind then
|
||||||
@@ -5138,7 +5205,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
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
|
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 bOk
|
||||||
local bSawDown = ( bMillDown and not bMillUp)
|
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
|
if not bOk then return false, sWarn end
|
||||||
end
|
end
|
||||||
-- in base al flag interno e al numero di facce e se ha forma ad U
|
-- in base al flag interno e al numero di facce e se ha forma ad U
|
||||||
@@ -5249,7 +5316,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
bSetOpenBorders = true
|
bSetOpenBorders = true
|
||||||
end
|
end
|
||||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
||||||
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL, dOvmHead)
|
||||||
if nOk == -3 then
|
if nOk == -3 then
|
||||||
bTryWithBlades = true
|
bTryWithBlades = true
|
||||||
elseif nOk == -2 then
|
elseif nOk == -2 then
|
||||||
@@ -5377,7 +5444,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
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
|
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 bOk
|
||||||
local bSawDown = ( bMillDown and not bMillUp)
|
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
|
if not bOk then return false, sWarn end
|
||||||
end
|
end
|
||||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||||
@@ -5412,13 +5479,13 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local dMachiningDepth = 0
|
local dMachiningDepth = 0
|
||||||
-- se il gambo è più largo dell'utensile verifico se la lunghezza del gambo è maggiore della distanza di sicurezza calcolata
|
-- se il gambo è più largo dell'utensile verifico se la lunghezza del gambo è maggiore della distanza di sicurezza calcolata
|
||||||
local dShankLength = dToolTotalLength - dToolThLength - dMaxToolCutDepth
|
local dShankLength = dToolTotalLength - dToolThLength - dMaxToolCutDepth
|
||||||
if ( dMaxToolCutDepth < dMaxToolMaterial + 10 * GEO.EPS_SMALL) and ( dShankLength > dCollSic + 10 * GEO.EPS_SMALL) then
|
if ( dMaxToolCutDepth < dMaxToolMaterial - 10 * GEO.EPS_SMALL) and ( dShankLength > dCollSic + 10 * GEO.EPS_SMALL) then
|
||||||
dMachiningDepth = dFacElev + BD.COLL_SIC
|
dMachiningDepth = dFacElev + BD.COLL_SIC
|
||||||
else
|
else
|
||||||
dMachiningDepth = dFacElev + dCollSic
|
dMachiningDepth = dFacElev + dCollSic
|
||||||
end
|
end
|
||||||
local bOk, sWarn2
|
local bOk, sWarn2
|
||||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap)
|
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm)
|
||||||
if not bOk then return false, sWarn2 end
|
if not bOk then return false, sWarn2 end
|
||||||
if sWarn2 then
|
if sWarn2 then
|
||||||
if not sWarn then sWarn = '' end
|
if not sWarn then sWarn = '' end
|
||||||
|
|||||||
+19
-16
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2023/05/03
|
-- ProcessLongCut.lua by Egaltech s.r.l. 2023/08/01
|
||||||
-- Gestione calcolo taglio longitudinale per Travi
|
-- Gestione calcolo taglio longitudinale per Travi
|
||||||
-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale.
|
-- 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.
|
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||||
@@ -27,6 +27,8 @@
|
|||||||
-- 2023/03/22 Correzione a SCC lama a seguito di modifiche alle direzioni dei tagli.
|
-- 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/04/17 Gestione unificata SCC tramite funzione apposita GetSCC
|
||||||
-- 2023/05/03 Corretto SCC in caso di asse utensile allineato con Z.
|
-- 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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLongCut = {}
|
local ProcessLongCut = {}
|
||||||
@@ -693,8 +695,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.5 then
|
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.5 then
|
||||||
bCanUseUnderBlade = true
|
bCanUseUnderBlade = true
|
||||||
end
|
end
|
||||||
-- se faccia da sotto o di lato ma con versore Z sotto l'orizzontale abilito la lavorazione con lame mixate
|
-- 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.0175 then
|
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= 0.053 then
|
||||||
bCanUseUnderBlade = true
|
bCanUseUnderBlade = true
|
||||||
end
|
end
|
||||||
-- se faccia da sopra o di lato ma con versore Z negativo verifico che abbia un angolo compatibile (28deg) per non avere extracorsa
|
-- se faccia da sopra o di lato ma con versore Z negativo verifico che abbia un angolo compatibile (28deg) per non avere extracorsa
|
||||||
@@ -725,11 +727,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
local dToolDiam = 0
|
local dToolDiam = 0
|
||||||
local dThick = 0
|
local dThick = 0
|
||||||
local dMaxDepth = 0
|
local dMaxDepth = 0
|
||||||
|
local dMaxVertDepth = 0
|
||||||
local sCuttingDn
|
local sCuttingDn
|
||||||
local dToolDiamDn = 0
|
local dToolDiamDn = 0
|
||||||
local dThickDn = 0
|
local dThickDn = 0
|
||||||
local dMaxDepthDn = 0
|
local dMaxDepthDn = 0
|
||||||
-- recupero la lavorazione
|
-- recupero eventuale lavorazione con lama su testa da sotto
|
||||||
if bCanUseUnderBlade then
|
if bCanUseUnderBlade then
|
||||||
sCuttingDn = ML.FindCutting( 'HeadSide_H2', false, true)
|
sCuttingDn = ML.FindCutting( 'HeadSide_H2', false, true)
|
||||||
if not sCuttingDn then
|
if not sCuttingDn then
|
||||||
@@ -747,6 +750,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- recupero eventuale lavorazione con lama
|
||||||
if bCanUseBlade then
|
if bCanUseBlade then
|
||||||
local sCutType = EgtIf( BD.USE_LONGCUT, 'LongCut', 'HeadSide')
|
local sCutType = EgtIf( BD.USE_LONGCUT, 'LongCut', 'HeadSide')
|
||||||
sCutting = ML.FindCutting( sCutType)
|
sCutting = ML.FindCutting( sCutType)
|
||||||
@@ -762,6 +766,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||||
dThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThick
|
dThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThick
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
|
dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -916,25 +921,23 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
end
|
end
|
||||||
-- si percorrono i lati alto e basso della faccia
|
-- si percorrono i lati alto e basso della faccia
|
||||||
-- calcolo quanto è l'affondamento del taglio
|
-- calcolo quanto è l'affondamento del taglio
|
||||||
local dOffsetTopBlade = ( dWidth + dDimStrip) / 2
|
local dMainMaxDepth = EgtIf( abs( vtN:getY()) < 1e-6, dMaxDepth, dMaxVertDepth)
|
||||||
local dOffsetDownBlade = ( dWidth + dDimStrip) / 2
|
local dOtherMaxDept = EgtIf( bCanUseUnderBlade, dMaxDepthDn, dMainMaxDepth)
|
||||||
if bFinishWithChainSaw then
|
local dCoeff = min( ( dWidth - dDimStrip) / ( dMainMaxDepth + dOtherMaxDept), 1)
|
||||||
dOffsetTopBlade = dWidth / 2
|
local dOffsetTopBlade = dWidth - dCoeff * dMainMaxDepth
|
||||||
dOffsetDownBlade = dWidth / 2
|
local dOffsetDownBlade = dWidth - dCoeff * dOtherMaxDept
|
||||||
end
|
|
||||||
local nStepDownBlade = 1
|
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
|
-- 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
|
if bFinishWithChainSaw then
|
||||||
dOffsetTopBlade = max( dWidth - dMaxDepth + ( BD.DECR_VERT_CUT or 0), dOffsetTopBlade)
|
|
||||||
dOffsetDownBlade = max( dWidth - dMaxDepthDn, dOffsetDownBlade)
|
|
||||||
local dHCutDownBlade = dWidth - dOffsetDownBlade
|
local dHCutDownBlade = dWidth - dOffsetDownBlade
|
||||||
local dMaxStepDownBlade = 64
|
local dMaxStepDownBlade = 80
|
||||||
nStepDownBlade = ceil( dHCutDownBlade / dMaxStepDownBlade)
|
nStepDownBlade = ceil( dHCutDownBlade / dMaxStepDownBlade)
|
||||||
dStepDownBlade = dHCutDownBlade / nStepDownBlade
|
dStepDownBlade = dHCutDownBlade / nStepDownBlade
|
||||||
else
|
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)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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
|
-- Gestione calcolo doppio taglio longitudinale per Travi
|
||||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
-- 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.
|
-- 2021/06/29 Corretta gestione caso equivalente a due smussi.
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
-- 2023/02/22 Nuova gestione del verso di avanzamento ottimale che contempla tutti i casi.
|
-- 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/06 Correzione per i casi con lavorazione limitata.
|
||||||
-- 2023/03/23 Correzione per caso con doppia lama da sotto.
|
-- 2023/03/23 Correzione per caso con doppia lama da sotto.
|
||||||
|
-- 2023/06/07 Sistemazione SCC per macchina TURN
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLong2Cut = {}
|
local ProcessLong2Cut = {}
|
||||||
@@ -125,9 +126,9 @@ function ProcessLong2Cut.GetLongFacesCount( Proc)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam, nL2CSide, bIsAnyFaceUpsideDown)
|
local function MakeSideFace( nId, nFac, nSideLimitingFace, nInd, sMilling, dToolDiam, nL2CSide, bIsAnyFaceUpsideDown)
|
||||||
if ( not BD.DOWN_HEAD or not BD.TURN) and bIsAnyFaceUpsideDown then
|
if ( not BD.DOWN_HEAD and not BD.TURN) and bIsAnyFaceUpsideDown then
|
||||||
EgtOutLog( 'Long2Cut : side face finishing skipped , down head required')
|
EgtOutLog( 'Long2Cut : side face finishing skipped, down head required')
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
@@ -141,8 +142,15 @@ local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam,
|
|||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ nId, nFac}})
|
EgtSetMachiningGeometry( {{ nId, nFac}})
|
||||||
-- lato di lavoro e inversione
|
-- lato di lavoro e inversione
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
if BD.TURN and
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
( ( 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
|
-- uso della faccia
|
||||||
local nFaceUse = EgtIf( nSideLimitingFace == 1, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.ORTHO_LEFT)
|
local nFaceUse = EgtIf( nSideLimitingFace == 1, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.ORTHO_LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||||
@@ -151,8 +159,11 @@ local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam,
|
|||||||
-- attacco e uscita
|
-- attacco e uscita
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30)
|
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 2)
|
EgtSetMachiningParam( MCH_MP.LOPERP, 5)
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 10)
|
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
|
-- se faccia di fianco e testa da sotto, aumento la sicurezza
|
||||||
if nL2CSide == 0 and BD.DOWN_HEAD then
|
if nL2CSide == 0 and BD.DOWN_HEAD then
|
||||||
EgtSetMachiningParam( MCH_MP.STARTPOS, 80)
|
EgtSetMachiningParam( MCH_MP.STARTPOS, 80)
|
||||||
@@ -1095,18 +1106,21 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
local nPos = EgtIf( i == 1, j, nC - j + 1)
|
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 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))
|
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
|
-- Posizione braccio portatesta
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if not BD.C_SIMM then
|
if not BD.C_SIMM then
|
||||||
if not BD.TURN then
|
if not BD.TURN then
|
||||||
nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||||
else
|
else
|
||||||
if nSide == 1 then
|
if nSide == 1 or nSide == -1 then
|
||||||
nSCC = EgtIf( vtN[vOrd[i]]:getY() < 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
local bFromYM = (( vtN[vOrd[i]]:getY() < 0 and bConvex) or ( vtN[vOrd[i]]:getY() > 0 and not bConvex))
|
||||||
elseif nSide == -1 then
|
nSCC = EgtIf( bFromYM, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||||
nSCC = EgtIf( vtN[vOrd[i]]:getY() < 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
|
||||||
else
|
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
|
end
|
||||||
end
|
end
|
||||||
@@ -1178,11 +1192,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
end
|
end
|
||||||
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
|
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
|
||||||
if bConvex and j == 1 and not bStartFixed then
|
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
|
end
|
||||||
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
|
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
|
||||||
if bConvex and j == nC and not bEndFixed then
|
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
|
end
|
||||||
end
|
end
|
||||||
@@ -1620,11 +1634,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
end
|
end
|
||||||
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
|
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
|
||||||
if bConvex and j == 1 and not bStartFixed and bRemoveToolRadius then
|
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
|
end
|
||||||
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
|
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
|
||||||
if bConvex and j == nC and not bEndFixed and bRemoveToolRadius then
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+43
-20
@@ -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
|
-- Gestione calcolo mortase per Travi
|
||||||
-- 2021/07/20 Aggiunta gestione rinvio angolare su FAST.
|
-- 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).
|
-- 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.
|
-- 2022/12/12 Migliorato controllo necessità CleanCorners.
|
||||||
-- 2023/01/31 Aggiunta gestione lavorazione in doppio.
|
-- 2023/01/31 Aggiunta gestione lavorazione in doppio.
|
||||||
-- 2023/01/31 Creata la funzione ConvertToClosedCurve (parte della ProcessMortise.Make) e spostata in BeamLib.
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local ProcessMortise = {}
|
local ProcessMortise = {}
|
||||||
@@ -293,13 +297,6 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- recupero versore estrusione della curva supplementare
|
|
||||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_ID.ROOT)
|
|
||||||
-- se curva di contorno aperta la rendo chiusa
|
|
||||||
local _, bModif = BL.ConvertToClosedCurve( Proc, AuxId)
|
|
||||||
if not bModif then
|
|
||||||
BL.SetOpenSide( AuxId, b3Solid)
|
|
||||||
end
|
|
||||||
-- verifico se frontale
|
-- verifico se frontale
|
||||||
local bFront = ( Proc.Prc == 51)
|
local bFront = ( Proc.Prc == 51)
|
||||||
-- recupero i dati della faccia di fondo
|
-- recupero i dati della faccia di fondo
|
||||||
@@ -310,8 +307,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
ptC = frMor:getOrigin()
|
ptC = frMor:getOrigin()
|
||||||
vtN = frMor:getVersZ()
|
vtN = frMor:getVersZ()
|
||||||
end
|
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
|
-- Confronto le direzioni dei 2 versori : se diverse la faccia 0 non è il fondo => mortasa passante
|
||||||
local bOpenBtm = not AreSameVectorApprox( vtExtr, vtN)
|
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
|
if bOpenBtm then
|
||||||
-- creo superficie chiusa
|
-- creo superficie chiusa
|
||||||
local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)
|
local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)
|
||||||
@@ -453,9 +458,9 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- verifico se invertire versore estrusione geometria
|
-- verifico se invertire direzione utensile
|
||||||
if bRevertSide then
|
if bRevertSide then
|
||||||
EgtModifyCurveExtrusion( AuxId, -vtExtr, GDB_ID.ROOT)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
@@ -465,11 +470,14 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if bPockAngTrasm then
|
if bPockAngTrasm then
|
||||||
nSCC = MCH_SCC.ADIR_NEAR
|
nSCC = MCH_SCC.ADIR_NEAR
|
||||||
elseif not BD.C_SIMM then
|
elseif not BD.C_SIMM and not BD.TURN then
|
||||||
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( vtN:getY()) < GEO.EPS_SMALL then
|
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
elseif abs( vtN:getX()) < GEO.EPS_SMALL then
|
elseif abs( vtN:getX()) < 0.1 then
|
||||||
nSCC = MCH_SCC.ADIR_XP
|
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
|
elseif vtN:getY() < GEO.EPS_SMALL then
|
||||||
nSCC = EgtIf( bRevertSide, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
nSCC = EgtIf( bRevertSide, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
else
|
else
|
||||||
@@ -496,9 +504,18 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
dMorH = dMaxDepth
|
dMorH = dMaxDepth
|
||||||
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
|
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
|
||||||
else
|
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
|
nDepthMin = -dMorH
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, nDepthMin)
|
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
|
||||||
end
|
end
|
||||||
-- imposto elevazione
|
-- imposto elevazione
|
||||||
@@ -506,6 +523,9 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- se lavorazione in doppio
|
-- se lavorazione in doppio
|
||||||
if Proc.Double and Proc.Double > 0 then
|
if Proc.Double and Proc.Double > 0 then
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||||
|
if Proc.Double ~= Proc.PrevDouble then
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
@@ -526,7 +546,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- faccio la copia e la metto nel layer dedicato alle geometrie aggiunte
|
-- 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
|
-- inverto la direzione estrusione di questa
|
||||||
EgtModifyCurveExtrusion( AuxId_oppo, - vtExtr, GDB_ID.ROOT)
|
EgtModifyCurveExtrusion( AuxId_oppo, - vtExtr, GDB_ID.ROOT)
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
@@ -535,11 +555,14 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
|
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if not BD.C_SIMM then
|
if not BD.C_SIMM and not BD.TURN then
|
||||||
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( vtN:getY()) < GEO.EPS_SMALL then
|
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
elseif abs( vtN:getX()) < GEO.EPS_SMALL then
|
elseif abs( vtN:getX()) < 0.1 then
|
||||||
nSCC = MCH_SCC.ADIR_XP
|
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
|
elseif vtN:getY() < GEO.EPS_SMALL then
|
||||||
nSCC = MCH_SCC.ADIR_YP
|
nSCC = MCH_SCC.ADIR_YP
|
||||||
else
|
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
|
-- Gestione calcolo profilo concavo per Travi
|
||||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
-- 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.
|
-- 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/02/02 Aggiunta funzione OnlyChamfer.
|
||||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local ProcessProfConcave = {}
|
local ProcessProfConcave = {}
|
||||||
@@ -88,7 +90,7 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
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
|
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
-- 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 ptEp = EgtGetMachiningEndPoint()
|
||||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||||
if nMachMode == 1 and ptSP and ptEp then
|
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()) <
|
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
|
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||||
-- ottengo il lato lavoro e lo inverto
|
-- ottengo il lato lavoro e lo inverto
|
||||||
@@ -103,9 +108,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
|||||||
if nSideWork > 0 then
|
if nSideWork > 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||||
end
|
end
|
||||||
-- ottengo l'inversione e setto il contrario
|
-- imposto il contrario dell'inversione trovata
|
||||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
bInvertMode = not bInvertMode
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, 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
|
end
|
||||||
-- modifico attacco e uscita
|
-- modifico attacco e uscita
|
||||||
if dLenIni and dLenLst then
|
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
|
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||||
end
|
end
|
||||||
if bFlagInvert then
|
|
||||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
|
||||||
end
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||||
end
|
end
|
||||||
@@ -195,6 +202,25 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
|||||||
return nChamfer, dDepth, sMilling, sMilling2
|
return nChamfer, dDepth, sMilling, sMilling2
|
||||||
end
|
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
|
-- Applicazione della lavorazione
|
||||||
function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
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
|
-- acquisisco informazioni sulle facce estreme
|
||||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||||
-- flag percorso invertito
|
|
||||||
local bFlagInvert = false
|
|
||||||
-- verifico se in testa o coda
|
-- verifico se in testa o coda
|
||||||
local bHead = ( vtN:getX() > 0)
|
local bHead = ( vtN:getX() > 0)
|
||||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
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
|
( not bHead and vtExtr:getY() > 0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione dal davanti o dal dietro
|
-- altrimenti lavorazione dal davanti o dal dietro
|
||||||
else
|
else
|
||||||
@@ -333,14 +356,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if vtExtr:getZ() < 0 then
|
if vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||||
if ( bHead and vtN:getY() > 0.1) or
|
if ( bHead and vtN:getY() > 0.1) or
|
||||||
( not bHead and vtN:getY() < -0.1) then
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- assegno affondamento e offset radiale
|
-- assegno affondamento e offset radiale
|
||||||
@@ -358,7 +379,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
else
|
else
|
||||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||||
-- della feature inverto il punto di inizio della lavorazione
|
-- 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
|
||||||
-- se lavorazione da due parti, aggiungo la seconda
|
-- se lavorazione da due parti, aggiungo la seconda
|
||||||
if bDoubleCham then
|
if bDoubleCham then
|
||||||
@@ -373,8 +394,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra o da sotto
|
-- se lavorazione da sopra o da sotto
|
||||||
if nSide ~= 0 then
|
if nSide ~= 0 then
|
||||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
-- 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
|
( not bHead and vtExtr:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
-- 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
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- assegno affondamento e offset radiale
|
-- assegno affondamento e offset radiale
|
||||||
@@ -408,7 +425,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
else
|
else
|
||||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||||
-- della feature inverto il punto di inizio della lavorazione
|
-- 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
|
end
|
||||||
end
|
end
|
||||||
@@ -467,14 +484,11 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra e da sotto
|
-- se lavorazione da sopra e da sotto
|
||||||
if ( nSide == 0) then
|
if ( nSide == 0) then
|
||||||
if vtExtr:getZ() > 0.1 then
|
if vtExtr:getZ() > 0.1 then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = true
|
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione davanti e dietro
|
-- altrimenti lavorazione davanti e dietro
|
||||||
else
|
else
|
||||||
@@ -483,14 +497,13 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
( not bHead and vtExtr:getY() < -0.1) then
|
( not bHead and vtExtr:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- imposto l'affondamento
|
-- imposto l'affondamento
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
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)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||||
local bFinish
|
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
|
-- 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
|
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||||
-- e uscita
|
-- e uscita
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||||
end
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
if bFinish then
|
if bFinish then
|
||||||
@@ -548,8 +561,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra o da sotto
|
-- se lavorazione da sopra o da sotto
|
||||||
if nSide ~= 0 then
|
if nSide ~= 0 then
|
||||||
if not bDouble and nSide == -1 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
|
( not bHead and vtExtr:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
-- 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
|
( not bHead and vtExtr:getY() > 0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione dal davanti o dal dietro
|
-- altrimenti lavorazione dal davanti o dal dietro
|
||||||
@@ -575,14 +584,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if vtExtr:getZ() < 0 then
|
if vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||||
if ( bHead and vtN:getY() > 0.1) or
|
if ( bHead and vtN:getY() > 0.1) or
|
||||||
( not bHead and vtN:getY() < -0.1) then
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se in doppio, imposto l'affondamento
|
-- se in doppio, imposto l'affondamento
|
||||||
@@ -591,7 +598,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
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)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||||
local bFinish
|
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
|
-- 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
|
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||||
-- e uscita
|
-- e uscita
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||||
end
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
if bFinish then
|
if bFinish then
|
||||||
@@ -656,14 +663,25 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
|
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
|
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))
|
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
|
||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, 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
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
@@ -697,7 +715,10 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
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
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
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
|
-- Gestione calcolo profilo convesso per Travi
|
||||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
-- 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.
|
-- 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/02/02 Aggiunta funzione OnlyChamfer.
|
||||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
-- 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
|
-- Tabella per definizione modulo
|
||||||
local ProcessProfConvex = {}
|
local ProcessProfConvex = {}
|
||||||
@@ -88,7 +90,7 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
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
|
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
-- 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 ptEp = EgtGetMachiningEndPoint()
|
||||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||||
if nMachMode == 1 and ptSP and ptEp then
|
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()) <
|
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
|
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||||
-- ottengo il lato lavoro e lo inverto
|
-- ottengo il lato lavoro e lo inverto
|
||||||
@@ -103,9 +108,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
|||||||
if nSideWork > 0 then
|
if nSideWork > 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||||
end
|
end
|
||||||
-- ottengo l'inversione e setto il contrario
|
-- imposto il contrario dell'inversione trovata
|
||||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
bInvertMode = not bInvertMode
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, 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
|
end
|
||||||
-- modifico attacco e uscita
|
-- modifico attacco e uscita
|
||||||
if dLenIni and dLenLst then
|
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
|
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||||
end
|
end
|
||||||
if bFlagInvert then
|
|
||||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
|
||||||
end
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||||
end
|
end
|
||||||
@@ -195,6 +202,25 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
|||||||
return nChamfer, dDepth, sMilling, sMilling2
|
return nChamfer, dDepth, sMilling, sMilling2
|
||||||
end
|
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
|
-- Applicazione della lavorazione
|
||||||
function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
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
|
-- acquisisco informazioni sulle facce estreme
|
||||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||||
-- flag percorso invertito
|
|
||||||
local bFlagInvert = false
|
|
||||||
-- verifico se in testa o coda
|
-- verifico se in testa o coda
|
||||||
local bHead = ( vtN:getX() > 0)
|
local bHead = ( vtN:getX() > 0)
|
||||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
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
|
( not bHead and vtExtr:getY() > 0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione dal davanti o dal dietro
|
-- altrimenti lavorazione dal davanti o dal dietro
|
||||||
else
|
else
|
||||||
@@ -333,14 +356,12 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if vtExtr:getZ() < 0 then
|
if vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||||
if ( bHead and vtN:getY() > 0.1) or
|
if ( bHead and vtN:getY() > 0.1) or
|
||||||
( not bHead and vtN:getY() < -0.1) then
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- assegno affondamento e offset radiale
|
-- assegno affondamento e offset radiale
|
||||||
@@ -358,7 +379,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
else
|
else
|
||||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||||
-- della feature inverto il punto di inizio della lavorazione
|
-- 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
|
||||||
-- se lavorazione da due parti, aggiungo la seconda
|
-- se lavorazione da due parti, aggiungo la seconda
|
||||||
if bDoubleCham then
|
if bDoubleCham then
|
||||||
@@ -373,8 +394,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra o da sotto
|
-- se lavorazione da sopra o da sotto
|
||||||
if nSide ~= 0 then
|
if nSide ~= 0 then
|
||||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
-- 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
|
( not bHead and vtExtr:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
-- 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
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- assegno affondamento e offset radiale
|
-- assegno affondamento e offset radiale
|
||||||
@@ -408,7 +425,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
else
|
else
|
||||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||||
-- della feature inverto il punto di inizio della lavorazione
|
-- 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
|
end
|
||||||
end
|
end
|
||||||
@@ -467,14 +484,11 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra e da sotto
|
-- se lavorazione da sopra e da sotto
|
||||||
if ( nSide == 0) then
|
if ( nSide == 0) then
|
||||||
if vtExtr:getZ() > 0.1 then
|
if vtExtr:getZ() > 0.1 then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = true
|
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione davanti e dietro
|
-- altrimenti lavorazione davanti e dietro
|
||||||
else
|
else
|
||||||
@@ -483,14 +497,13 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
( not bHead and vtExtr:getY() < -0.1) then
|
( not bHead and vtExtr:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- imposto l'affondamento
|
-- imposto l'affondamento
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
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)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||||
local bFinish
|
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
|
-- 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
|
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||||
-- e uscita
|
-- e uscita
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||||
end
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
if bFinish then
|
if bFinish then
|
||||||
@@ -548,8 +561,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra o da sotto
|
-- se lavorazione da sopra o da sotto
|
||||||
if nSide ~= 0 then
|
if nSide ~= 0 then
|
||||||
if not bDouble and nSide == -1 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
|
( not bHead and vtExtr:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
-- 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
|
( not bHead and vtExtr:getY() > 0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione dal davanti o dal dietro
|
-- altrimenti lavorazione dal davanti o dal dietro
|
||||||
@@ -575,14 +584,12 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if vtExtr:getZ() < 0 then
|
if vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||||
if ( bHead and vtN:getY() > 0.1) or
|
if ( bHead and vtN:getY() > 0.1) or
|
||||||
( not bHead and vtN:getY() < -0.1) then
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se in doppio, imposto l'affondamento
|
-- se in doppio, imposto l'affondamento
|
||||||
@@ -591,7 +598,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
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)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||||
local bFinish
|
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
|
-- 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
|
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||||
-- e uscita
|
-- e uscita
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||||
end
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
if bFinish then
|
if bFinish then
|
||||||
@@ -656,14 +663,25 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
|
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
|
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))
|
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
|
||||||
end
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, 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
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
@@ -697,7 +715,10 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
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
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
|||||||
@@ -465,8 +465,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
else
|
else
|
||||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
-- 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
|
-- della feature inverto il punto di inizio della lavorazione
|
||||||
-- e uscita
|
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
||||||
end
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
@@ -554,8 +553,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
else
|
else
|
||||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
-- 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
|
-- della feature inverto il punto di inizio della lavorazione
|
||||||
-- e uscita
|
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
||||||
end
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- 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
|
-- Gestione calcolo profilo di testa per Travi
|
||||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa sotto.
|
-- 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.
|
-- 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/02/02 Aggiunta funzione OnlyChamfer.
|
||||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||||
|
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessProfHead = {}
|
local ProcessProfHead = {}
|
||||||
@@ -81,7 +82,7 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
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
|
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
-- 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 ptEp = EgtGetMachiningEndPoint()
|
||||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||||
if nMachMode == 1 and ptSP and ptEp then
|
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()) <
|
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
|
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||||
-- ottengo il lato lavoro e lo inverto
|
-- ottengo il lato lavoro e lo inverto
|
||||||
@@ -96,9 +100,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
|||||||
if nSideWork > 0 then
|
if nSideWork > 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||||
end
|
end
|
||||||
-- ottengo l'inversione e setto il contrario
|
-- imposto il contrario dell'inversione trovata
|
||||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
bInvertMode = not bInvertMode
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, 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
|
end
|
||||||
-- modifico attacco e uscita
|
-- modifico attacco e uscita
|
||||||
if dLenIni and dLenLst then
|
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
|
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||||
end
|
end
|
||||||
if bFlagInvert then
|
|
||||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
|
||||||
end
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||||
end
|
end
|
||||||
@@ -224,8 +230,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- acquisisco informazioni sulle facce estreme
|
-- acquisisco informazioni sulle facce estreme
|
||||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||||
-- flag percorso invertito
|
|
||||||
local bFlagInvert = false
|
|
||||||
-- verifico se in testa o coda
|
-- verifico se in testa o coda
|
||||||
local bHead = ( vtN:getX() > 0)
|
local bHead = ( vtN:getX() > 0)
|
||||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
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
|
( not bHead and vtExtr:getY() > 0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione dal davanti o dal dietro
|
-- altrimenti lavorazione dal davanti o dal dietro
|
||||||
else
|
else
|
||||||
@@ -335,14 +338,12 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if vtExtr:getZ() < 0 then
|
if vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||||
if ( bHead and vtN:getY() > 0.1) or
|
if ( bHead and vtN:getY() > 0.1) or
|
||||||
( not bHead and vtN:getY() < -0.1) then
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- assegno affondamento e offset radiale
|
-- 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
|
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||||
-- della feature inverto il punto di inizio della lavorazione
|
-- della feature inverto il punto di inizio della lavorazione
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
|
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
|
||||||
-- se lavorazione da due parti, aggiungo la seconda
|
-- se lavorazione da due parti, aggiungo la seconda
|
||||||
if bDoubleCham then
|
if bDoubleCham then
|
||||||
@@ -376,8 +377,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra o da sotto
|
-- se lavorazione da sopra o da sotto
|
||||||
if nSide ~= 0 then
|
if nSide ~= 0 then
|
||||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
-- 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
|
( not bHead and vtExtr:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione dal davanti o dal dietro
|
-- altrimenti lavorazione dal davanti o dal dietro
|
||||||
else
|
else
|
||||||
@@ -394,7 +392,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
( not bHead and vtN:getY() < -0.1) then
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- assegno affondamento e offset radiale
|
-- 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
|
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||||
-- della feature inverto il punto di inizio della lavorazione
|
-- della feature inverto il punto di inizio della lavorazione
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
|
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
|
end
|
||||||
end
|
end
|
||||||
@@ -473,8 +470,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra e da sotto
|
-- se lavorazione da sopra e da sotto
|
||||||
if ( nSide == 0) then
|
if ( nSide == 0) then
|
||||||
if vtExtr:getZ() > 0.1 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
|
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||||
-- e uscita
|
-- e uscita
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
|
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
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
if bFinish then
|
if bFinish then
|
||||||
@@ -551,8 +546,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- resetto il flag inversione percorso
|
|
||||||
bFlagInvert = false
|
|
||||||
-- se lavorazione da sopra o da sotto
|
-- se lavorazione da sopra o da sotto
|
||||||
if nSide ~= 0 then
|
if nSide ~= 0 then
|
||||||
if not bDouble and nSide == -1 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
|
( not bHead and vtExtr:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
-- 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
|
( not bHead and vtExtr:getY() > 0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- altrimenti lavorazione dal davanti o dal dietro
|
-- altrimenti lavorazione dal davanti o dal dietro
|
||||||
@@ -578,14 +569,12 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if vtExtr:getZ() < 0 then
|
if vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||||
if ( bHead and vtN:getY() > 0.1) or
|
if ( bHead and vtN:getY() > 0.1) or
|
||||||
( not bHead and vtN:getY() < -0.1) then
|
( not bHead and vtN:getY() < -0.1) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
bFlagInvert = not bFlagInvert
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se in doppio, imposto l'affondamento
|
-- 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
|
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||||
-- e uscita
|
-- e uscita
|
||||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
|
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
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
if bFinish then
|
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
|
-- Gestione calcolo mezzolegno di testa per Travi
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
@@ -26,8 +26,8 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Classificazione della feature
|
-- Classificazione della feature
|
||||||
function ProcessRidgeLap.Classify( Proc, b3Raw)
|
function ProcessRidgeLap.Classify( Proc, b3Raw)
|
||||||
-- se PF con testa da sotto, ammessa qualunque orientazione
|
-- se PF con testa da sotto oppure TURN, ammessa qualunque orientazione
|
||||||
if BD.C_SIMM and BD.DOWN_HEAD then
|
if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
|
||||||
return true, false
|
return true, false
|
||||||
end
|
end
|
||||||
-- Se più corta del limite si può fare anche da sotto
|
-- 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
|
-- aggiornamento ingombro di testa o coda
|
||||||
if Proc.Head then
|
if Proc.Head then
|
||||||
local dHCI = 0
|
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)
|
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||||
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
||||||
else
|
else
|
||||||
@@ -204,7 +204,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
BL.UpdateHCING( nRawId, dHCI)
|
BL.UpdateHCING( nRawId, dHCI)
|
||||||
elseif Proc.Tail then
|
elseif Proc.Tail then
|
||||||
local dTCI = 0
|
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)
|
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||||
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
||||||
else
|
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
|
-- Gestione calcolo archi per Travi
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
@@ -93,6 +93,8 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
-- normale alla superficie nel mezzo
|
||||||
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, Proc.Fct // 2, GDB_RT.GLOB)
|
||||||
-- recupero e verifico l'entità curva
|
-- recupero e verifico l'entità curva
|
||||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||||
if AuxId then AuxId = AuxId + Proc.Id end
|
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)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
if Proc.Head then
|
local nSCC = MCH_SCC.NONE
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XP)
|
if not BD.C_SIMM and not BD.TURN then
|
||||||
elseif Proc.Tail then
|
if Proc.Head then
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XM)
|
nSCC = MCH_SCC.ADIR_XP
|
||||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
elseif Proc.Tail then
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
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
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch1Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- Inserisco la lavorazione del lato opposto
|
-- Inserisco la lavorazione del lato opposto
|
||||||
@@ -124,7 +124,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch2Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch1Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- Inserisco la lavorazione del lato opposto
|
-- Inserisco la lavorazione del lato opposto
|
||||||
@@ -124,7 +124,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch2Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|||||||
+18
-10
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessSplit.lua by Egaltech s.r.l. 2023/04/04
|
-- ProcessSplit.lua by Egaltech s.r.l. 2023/05/09
|
||||||
-- Gestione calcolo tagli di separazione per Travi
|
-- 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/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.
|
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
||||||
@@ -9,7 +9,10 @@
|
|||||||
-- 2022/11/16 Correzioni per travi larghe
|
-- 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).
|
-- 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/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/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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessSplit = {}
|
local ProcessSplit = {}
|
||||||
@@ -308,7 +311,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then
|
if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then
|
||||||
local b3NextRaw = EgtGetRawPartBBox( nNextRawId)
|
local b3NextRaw = EgtGetRawPartBBox( nNextRawId)
|
||||||
dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX()
|
dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX()
|
||||||
nCuts = ceil( dLenEndRaw / BD.MAX_LEN_SCRAP)
|
nCuts = ceil( dLenEndRaw / ( BD.MAX_LEN_SCRAP + 0.5))
|
||||||
dOffsL = dLenEndRaw / nCuts
|
dOffsL = dLenEndRaw / nCuts
|
||||||
-- aggiorno ingombro del grezzo corrente con quello del successivo
|
-- aggiorno ingombro del grezzo corrente con quello del successivo
|
||||||
b3Raw:Add( b3NextRaw)
|
b3Raw:Add( b3NextRaw)
|
||||||
@@ -465,7 +468,9 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
else
|
else
|
||||||
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
||||||
local dSawRad = dSawDiam / 2
|
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)
|
||||||
if BD.C_SIMM then
|
if BD.C_SIMM then
|
||||||
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||||
else
|
else
|
||||||
@@ -476,7 +481,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
|
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
|
||||||
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||||
local dMinTailScrapForHorizontalCuts = 10.123
|
local dMinTailScrapForHorizontalCuts = 10.123
|
||||||
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForHorizontalCuts - 10 * GEO.EPS_SMALL)
|
local bAreHorizontalCutsNeeded = not bSplit and ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForHorizontalCuts - 10 * GEO.EPS_SMALL)
|
||||||
if bAreHorizontalCutsNeeded then
|
if bAreHorizontalCutsNeeded then
|
||||||
local nHorizontalCuts = ceil ( dimV / BD.MAX_DIM_DICE) - 1
|
local nHorizontalCuts = ceil ( dimV / BD.MAX_DIM_DICE) - 1
|
||||||
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
|
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
|
||||||
@@ -486,10 +491,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
for j = nHorizontalCuts, 1, -1 do
|
for j = nHorizontalCuts, 1, -1 do
|
||||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||||
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
||||||
local nForceWorkSide = MCH_MILL_WS.LEFT
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw)
|
||||||
local bForceInvert = true
|
|
||||||
local nForceSCC = MCH_SCC.ADIR_XM
|
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, bForceInvert, nForceWorkSide, nForceSCC)
|
|
||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||||
@@ -500,7 +502,9 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
-- taglio verticale
|
-- taglio verticale
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, 'Cut;', b3Raw)
|
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
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
return true, sWarn, nNewPhase
|
return true, sWarn, nNewPhase
|
||||||
@@ -526,6 +530,10 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
else
|
else
|
||||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||||
end
|
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)
|
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
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch1Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- Inserisco la lavorazione del lato opposto
|
-- Inserisco la lavorazione del lato opposto
|
||||||
@@ -134,7 +134,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch2Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch1Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -556,7 +556,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch2Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMch1Id, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+8
-2
@@ -62,7 +62,7 @@ local function MyProcessInputData()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not bFound then
|
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
|
||||||
end
|
end
|
||||||
nId = EgtGetNextSelectedObj()
|
nId = EgtGetNextSelectedObj()
|
||||||
@@ -116,7 +116,13 @@ local function MyProcessInputData()
|
|||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
|
|
||||||
-- Le ordino in senso di lunghezza crescente
|
-- Le ordino in senso di lunghezza crescente
|
||||||
table.sort( vBeam, function( B1, B2) return B1.Box:getDimX() < B2.Box:getDimX() end)
|
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)
|
||||||
do
|
do
|
||||||
local sOut = ''
|
local sOut = ''
|
||||||
for i = 1, #vBeam do
|
for i = 1, #vBeam do
|
||||||
|
|||||||
@@ -1,5 +1,66 @@
|
|||||||
==== Beam Update Log ====
|
==== Beam Update Log ====
|
||||||
|
|
||||||
|
Versione 2.5i1 (12/09/2023)
|
||||||
|
- Fixed : in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth [Ticket #1354].
|
||||||
|
|
||||||
|
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)
|
Versione 2.5e2 (04/05/2023)
|
||||||
- Modif : Piccola modifica a SCC per LongCut derivanti da Cut
|
- Modif : Piccola modifica a SCC per LongCut derivanti da Cut
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
-- Version.lua by Egaltech s.r.l. 2023/04/05
|
-- Version.lua by Egaltech s.r.l. 2023/08/10
|
||||||
-- Gestione della versione di Beam
|
-- Gestione della versione di Beam
|
||||||
|
|
||||||
NAME = 'Beam'
|
NAME = 'Beam'
|
||||||
VERSION = '2.5e2'
|
VERSION = '2.5i1'
|
||||||
MIN_EXE = '2.5c1'
|
MIN_EXE = '2.5c1'
|
||||||
|
|||||||
Reference in New Issue
Block a user