Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 86c225305f | |||
| af8532970c | |||
| 6fb843e4cf | |||
| c654bbcd19 | |||
| f0ebd5c206 | |||
| 0e3e6b6174 | |||
| 6487fc3836 | |||
| 59b716daa6 | |||
| 98fcfd9bc1 | |||
| 9177fb3c4c | |||
| 7e21b84bb9 | |||
| fb6dbebdd4 | |||
| 111f11cf92 | |||
| 607efa3bef | |||
| b79e180da2 | |||
| 00c0db39d7 | |||
| 8dc1c63b65 | |||
| 3ca4bdde77 | |||
| af643b1ba5 | |||
| a9061ecf51 | |||
| d49cb93e36 | |||
| f620269f31 | |||
| 182639772d | |||
| b2a1fc823d | |||
| ba51a86239 | |||
| 26077bcfdf | |||
| 4dbec60558 | |||
| 3bd16304c5 | |||
| 950f7d1992 | |||
| bc8fffd075 | |||
| 3669787621 | |||
| 0c9945a457 | |||
| 8a693a38cc | |||
| e6c173e5a1 | |||
| bd822e9153 | |||
| cf7322229d | |||
| 9588ee0def | |||
| 4ad4638582 |
+1
-1
@@ -41,4 +41,4 @@ GWD.OVM_MID = BD.OVM_MID
|
|||||||
-- Tutto ok
|
-- Tutto ok
|
||||||
GWD.ERR = 0
|
GWD.ERR = 0
|
||||||
|
|
||||||
EgtOutLog( ' +++ GetWallData completed')
|
EgtOutLog( ' +++ GetBeamData completed')
|
||||||
|
|||||||
+11
-6
@@ -1,4 +1,4 @@
|
|||||||
-- BeamExec.lua by Egaltech s.r.l. 2022/09/24
|
-- BeamExec.lua by Egaltech s.r.l. 2022/09/28
|
||||||
-- Libreria esecuzione lavorazioni per Travi
|
-- Libreria esecuzione 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/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
|
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
-- 2022/08/08 Modifica per macchine senza BD.MAX_WIDTH2 e BD.MAX_HEIGHT2.
|
-- 2022/08/08 Modifica per macchine senza BD.MAX_WIDTH2 e BD.MAX_HEIGHT2.
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||||
-- 2022/09/21 Nella funzione di ordinamento il foro del birdsmouth viene sempre fatto prima della lavorazione stessa
|
-- 2022/09/21 Nella funzione di ordinamento il foro del birdsmouth viene sempre fatto prima della lavorazione stessa
|
||||||
|
-- 2022/09/28 I fori vengono sempre fatti prima delle tacche.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamExec = {}
|
local BeamExec = {}
|
||||||
@@ -321,6 +322,8 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
Proc2.Fce = Proc.Fcs
|
Proc2.Fce = Proc.Fcs
|
||||||
Proc2.CutId = Proc.CutId
|
Proc2.CutId = Proc.CutId
|
||||||
Proc2.TaskId = Proc.TaskId
|
Proc2.TaskId = Proc.TaskId
|
||||||
|
Proc2.AdjId = Proc.AdjId
|
||||||
|
Proc2.MainId = Proc.MainId
|
||||||
table.insert( vProc, Proc2)
|
table.insert( vProc, Proc2)
|
||||||
end
|
end
|
||||||
-- se BlockHaus HalfLap
|
-- se BlockHaus HalfLap
|
||||||
@@ -651,7 +654,7 @@ end
|
|||||||
local function OrderFeatures( vProc, b3Raw)
|
local function OrderFeatures( vProc, b3Raw)
|
||||||
|
|
||||||
local dDrillPenalty = EgtIf( BD.PRESS_ROLLER, 200, 100)
|
local dDrillPenalty = EgtIf( BD.PRESS_ROLLER, 200, 100)
|
||||||
local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, 200, 600)
|
local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, BD.DRILL_RANGE_SP or 200, BD.DRILL_RANGE or 600)
|
||||||
|
|
||||||
-- funzione di confronto
|
-- funzione di confronto
|
||||||
-- secondo centro box in X (taglio di intestazione prima di altri tagli di testa e taglio di separazione però prima di altri tagli di coda)
|
-- secondo centro box in X (taglio di intestazione prima di altri tagli di testa e taglio di separazione però prima di altri tagli di coda)
|
||||||
@@ -680,12 +683,14 @@ local function OrderFeatures( vProc, b3Raw)
|
|||||||
if B1.Head ~= B2.Head then
|
if B1.Head ~= B2.Head then
|
||||||
return B1.Head
|
return B1.Head
|
||||||
end
|
end
|
||||||
-- se primo è foro di un birdsmouth e secondo è il suo birdsmouth, il foro va sempre prima
|
-- se primo è foro e secondo è un ribasso, il foro va sempre prima
|
||||||
if Drill.Identify(B1) and LapJoint.Identify(B2) and B1.MainId == B2.Id then
|
if Drill.Identify(B1) and LapJoint.Identify(B2) and
|
||||||
|
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
-- se primo è birdsmouth e secondo è il suo foro, il birdsmouth va sempre dopo
|
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo
|
||||||
if LapJoint.Identify(B1) and Drill.Identify(B2) and B1.AdjId == B2.Id then
|
if LapJoint.Identify(B1) and Drill.Identify(B2) and
|
||||||
|
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
|
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
|
||||||
|
|||||||
+3
-2
@@ -377,12 +377,13 @@ end
|
|||||||
-- ptCBond*: il punto centrale della superfice limitante (se non esistono altre superfici può essere omesso)
|
-- ptCBond*: il punto centrale della superfice limitante (se non esistono altre superfici può essere omesso)
|
||||||
-- vtNBond*: il versore normale della superfice limitante (se non esistono altre superfici può essere omesso)
|
-- vtNBond*: il versore normale della superfice limitante (se non esistono altre superfici può essere omesso)
|
||||||
-- dOrthoMaxDim : massima profondità taglio se faccia singola perpendicolare facce laterali trave
|
-- dOrthoMaxDim : massima profondità taglio se faccia singola perpendicolare facce laterali trave
|
||||||
-- dCustMaxDimDice: dimensione massima customizzata, sostituisce il parametro BD.MAX_DIM_DICE
|
-- dCustMaxDimDice: dimensione massima customizzata, sostituisce il parametro BD.MAX_DIM_DICE (se negativa qualunque, se positiva deve stare nel MAX)
|
||||||
-- bDownHead : taglio con testa da sotto
|
-- bDownHead : taglio con testa da sotto
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPlanes, ptCBond, vtNBond, dOrthoMaxDim, dCustMaxDimDice, bDownHead)
|
function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPlanes, ptCBond, vtNBond, dOrthoMaxDim, dCustMaxDimDice, bDownHead)
|
||||||
|
|
||||||
local dMaxDimDice = EgtIf( dCustMaxDimDice and dCustMaxDimDice < BD.MAX_DIM_DICE, dCustMaxDimDice, BD.MAX_DIM_DICE)
|
local dMaxDimDice = BD.MAX_DIM_DICE
|
||||||
|
if dCustMaxDimDice and dCustMaxDimDice < BD.MAX_DIM_DICE then dMaxDimDice = abs( dCustMaxDimDice) end
|
||||||
local dTolerance = 0 -- distanza di sicurezza per i tagli ortogonali
|
local dTolerance = 0 -- distanza di sicurezza per i tagli ortogonali
|
||||||
local OffsetP = dMaxDimDice -- distanza tra i piani paralleli
|
local OffsetP = dMaxDimDice -- distanza tra i piani paralleli
|
||||||
local StepP = 100 -- numero massimo di piani paralleli da generare
|
local StepP = 100 -- numero massimo di piani paralleli da generare
|
||||||
|
|||||||
+30
-15
@@ -2,6 +2,7 @@
|
|||||||
-- Libreria ricerca lavorazioni per Travi
|
-- Libreria ricerca lavorazioni per Travi
|
||||||
-- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste.
|
-- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste.
|
||||||
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
||||||
|
-- 2022/11/02 Modificata scelta utensile ottimizzata. Ora se c'è un utensile più grande disponibile si dà preferenza a quello.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local MachiningLib = {}
|
local MachiningLib = {}
|
||||||
@@ -263,6 +264,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
|||||||
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
||||||
MachineHeadUse = TWO_EQUAL_HEADS
|
MachineHeadUse = TWO_EQUAL_HEADS
|
||||||
end
|
end
|
||||||
|
-- variabile che definisce quando un utensile ha un diametro sostanzialmente più grande di un altro
|
||||||
|
local dBiggerToolTolerance = 1.25
|
||||||
for i = ForStart, ForEnd, ForStep do
|
for i = ForStart, ForEnd, ForStep do
|
||||||
local Machining = Machinings[i]
|
local Machining = Machinings[i]
|
||||||
local sMachiningType = Machining.Type
|
local sMachiningType = Machining.Type
|
||||||
@@ -284,22 +287,24 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
|||||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
-- verifico se posso usare lo stesso utensile della testa attiva
|
-- verifico se posso usare lo stesso utensile della testa attiva
|
||||||
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
||||||
SetNextMachining( sToolName, nActiveHead, bFixed)
|
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo
|
||||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then
|
||||||
|
SetNextMachining( sToolName, nActiveHead, bFixed)
|
||||||
|
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- segno le lavorazioni disponibili per entrambe le teste
|
||||||
|
if bH2 then
|
||||||
|
if not sH2Mach or sH2Mach == '' then
|
||||||
|
sH2Mach = Machining.Name
|
||||||
|
sH2Tool = sToolName
|
||||||
|
sH2Param = ToolParams
|
||||||
|
end
|
||||||
else
|
else
|
||||||
-- segno le lavorazioni disponibili per entrambe le teste
|
if not sH1Mach or sH1Mach == '' then
|
||||||
if bH2 then
|
sH1Mach = Machining.Name
|
||||||
if not sH2Mach or sH2Mach == '' then
|
sH1Tool = sToolName
|
||||||
sH2Mach = Machining.Name
|
sH1Param = ToolParams
|
||||||
sH2Tool = sToolName
|
|
||||||
sH2Param = ToolParams
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if not sH1Mach or sH1Mach == '' then
|
|
||||||
sH1Mach = Machining.Name
|
|
||||||
sH1Tool = sToolName
|
|
||||||
sH1Param = ToolParams
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
||||||
@@ -315,6 +320,16 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if MachineHeadUse == TWO_EQUAL_HEADS then
|
if MachineHeadUse == TWO_EQUAL_HEADS then
|
||||||
|
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi
|
||||||
|
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
|
||||||
|
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
||||||
|
SetNextMachining( sH1Tool, 1, bFixed)
|
||||||
|
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||||
|
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
||||||
|
SetNextMachining( sH2Tool, 2, bFixed)
|
||||||
|
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||||
|
end
|
||||||
|
end
|
||||||
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
||||||
if nActiveHead == 1 then
|
if nActiveHead == 1 then
|
||||||
if sH2Mach ~= "" then
|
if sH2Mach ~= "" then
|
||||||
|
|||||||
+31
-3
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessCut.lua by Egaltech s.r.l. 2022/07/28
|
-- ProcessCut.lua by Egaltech s.r.l. 2022/09/30
|
||||||
-- 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.
|
||||||
@@ -353,9 +353,37 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
vtExtra = X_AX()
|
vtExtra = X_AX()
|
||||||
bAutoCalcSurf = false
|
bAutoCalcSurf = false
|
||||||
end
|
end
|
||||||
|
-- verifico elevazione max del materiale tagliato
|
||||||
|
local dMaxElev
|
||||||
|
if vtN:getX() > 0 then
|
||||||
|
if bForced then
|
||||||
|
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
|
||||||
|
else
|
||||||
|
dMaxElev = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if bForced then
|
||||||
|
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
|
||||||
|
else
|
||||||
|
dMaxElev = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- per macchina TURN aggiusto massima dimensione cubetto
|
||||||
|
local dNewDiceDim
|
||||||
|
if BD.TURN then
|
||||||
|
local dDimRef = GEO.INFINITO
|
||||||
|
if abs( vtN:getZ()) < 0.003 then
|
||||||
|
dDimRef = b3Raw:getDimZ()
|
||||||
|
elseif abs( vtN:getY()) < 0.003 then
|
||||||
|
dDimRef = b3Raw:getDimY()
|
||||||
|
end
|
||||||
|
if dDimRef + BD.CUT_EXTRA < dMaxDepth then
|
||||||
|
dNewDiceDim = - ( dMaxDepth - BD.CUT_EXTRA)
|
||||||
|
end
|
||||||
|
end
|
||||||
-- se il taglio è più spesso della lama abilito il dicing, altrimenti no
|
-- se il taglio è più spesso della lama abilito il dicing, altrimenti no
|
||||||
if Proc.Box:getDimX() >= dSawThick then
|
if dMaxElev > dSawThick then
|
||||||
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA)
|
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, dNewDiceDim)
|
||||||
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
|
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
|
||||||
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
|
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
|
||||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
|
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
-- 2022/07/12 Aggiunto un valore minimo (10) per la distanza di sicurezza.
|
-- 2022/07/12 Aggiunto un valore minimo (10) per la distanza di sicurezza.
|
||||||
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto e punta disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto e punta disabilitata.
|
||||||
|
-- 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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDrill = {}
|
local ProcessDrill = {}
|
||||||
@@ -118,7 +119,7 @@ function ProcessDrill.Split( Proc, b3Raw)
|
|||||||
local dDiam = 2 * EgtArcRadius( AuxId)
|
local dDiam = 2 * EgtArcRadius( AuxId)
|
||||||
local dLen = abs( EgtCurveThickness( AuxId))
|
local dLen = abs( EgtCurveThickness( AuxId))
|
||||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||||
local bOpen = ( Proc.Fce ~= 0)
|
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
|
||||||
-- recupero flag abilitazione split (0=auto,1=no)
|
-- recupero flag abilitazione split (0=auto,1=no)
|
||||||
local bTrySplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
|
local bTrySplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
|
||||||
if not bTrySplit then
|
if not bTrySplit then
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/10/07
|
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/11/03
|
||||||
-- Gestione calcolo profilo libero per Travi
|
-- Gestione calcolo profilo libero per Travi
|
||||||
-- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10
|
-- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10
|
||||||
-- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta
|
-- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta.
|
||||||
|
-- 2022/11/03 In MakeByMill migliorata gestione lavorazione con fresa su testa da sotto.
|
||||||
|
-- 2022/11/09 Aggiunta la gestione della chiamata della FreeContour da parte della SimpleScarf.
|
||||||
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
@@ -236,7 +238,6 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local dDepth = abs( EgtCurveThickness( AuxId))
|
local dDepth = abs( EgtCurveThickness( AuxId))
|
||||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||||
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
||||||
local bToolInv = ( vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
|
||||||
local bDown = ( b3Aux:getMin():getZ() < b3Raw:getMin():getZ() + 5)
|
local bDown = ( b3Aux:getMin():getZ() < b3Raw:getMin():getZ() + 5)
|
||||||
-- verifico se in testa o coda
|
-- verifico se in testa o coda
|
||||||
local bHead = Proc.Head
|
local bHead = Proc.Head
|
||||||
@@ -245,12 +246,14 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local bTopHead = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.1)
|
local bTopHead = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.1)
|
||||||
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
||||||
local sMilling = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, bTopHead, bDownHead)
|
local sMilling, _, _, bH2 = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, bTopHead, bDownHead)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : FreeContour not found in library'
|
local sErr = 'Error : FreeContour not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
bDownHead = ( bDownHead and bH2)
|
||||||
|
local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dToolDiam = 10
|
local dToolDiam = 10
|
||||||
local dMaxDepth = 0
|
local dMaxDepth = 0
|
||||||
@@ -306,9 +309,11 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
local bStripOnSide = false
|
local bStripOnSide = false
|
||||||
if bCross then
|
if bCross then
|
||||||
if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then
|
-- se chiamata da SimpleScarf il codolo è sempre attivo
|
||||||
|
if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX()) or Proc.Prc == 70) then
|
||||||
-- devo lasciare un codolo
|
-- devo lasciare un codolo
|
||||||
dDepth = dDepth - dDimStrip
|
local dExtraCham = EgtIf( nChamfer > 0, 2, 0)
|
||||||
|
dDepth = EgtIf( Proc.Prc == 70, dDepth - dDimStrip - dDepthCham - dExtraCham, dDepth - dDimStrip)
|
||||||
bStripOnSide = true
|
bStripOnSide = true
|
||||||
else
|
else
|
||||||
-- devo affondare un poco oltre
|
-- devo affondare un poco oltre
|
||||||
@@ -317,7 +322,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
local bIsDepthReduced = false
|
local bIsDepthReduced = false
|
||||||
-- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga
|
-- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga
|
||||||
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and nStep > 1 and
|
-- se chiamata da SimpleScarf il codolo è sempre attivo
|
||||||
|
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and ( nStep > 1 or Proc.Prc == 70) and
|
||||||
bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then
|
bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then
|
||||||
nDouble = 2
|
nDouble = 2
|
||||||
dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth)
|
dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth)
|
||||||
@@ -352,7 +358,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local dEndAddSpec = 0
|
local dEndAddSpec = 0
|
||||||
if Proc.Grp ~= 0 then dEndAddSpec = CalcSpecialAdd( AuxId, false, dToolDiam) end
|
if Proc.Grp ~= 0 then dEndAddSpec = CalcSpecialAdd( AuxId, false, dToolDiam) end
|
||||||
-- se devo inserire il chamfer
|
-- se devo inserire il chamfer
|
||||||
if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham then
|
if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then
|
||||||
local bDoubleCham = false
|
local bDoubleCham = false
|
||||||
local dExtra = 2
|
local dExtra = 2
|
||||||
-- eseguo
|
-- eseguo
|
||||||
@@ -376,7 +382,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
else
|
else
|
||||||
if vtExtr:getZ() < 0 then
|
if not bDownHead and vtExtr:getZ() < 0 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)
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
@@ -391,7 +397,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
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)
|
||||||
else
|
else
|
||||||
if vtExtr:getZ() < 0 then
|
if not bDownHead and vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
@@ -565,9 +571,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- assegno lato di lavoro
|
-- assegno lato di lavoro
|
||||||
if Proc.Grp == 0 then
|
if Proc.Grp == 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
||||||
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) then
|
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) or ( Proc.Grp == 1 and bToolInv) or ( Proc.Grp == 2 and bToolInv) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then
|
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) or ( Proc.Grp == 1 and not bToolInv) or ( Proc.Grp == 2 and not bToolInv) then
|
||||||
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
|
||||||
@@ -777,6 +783,11 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
|
-- riassegno Q nel caso la funzione sia richiamata da un'altra make
|
||||||
|
if Proc.Prc == 70 then
|
||||||
|
Q_DEPTH_CHAMFER = 'Q01'
|
||||||
|
Q_DIM_STRIP = 'Q02'
|
||||||
|
end
|
||||||
-- recupero la tipologia
|
-- recupero la tipologia
|
||||||
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
|
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
|
||||||
-- se svuotatura
|
-- se svuotatura
|
||||||
|
|||||||
+70
-71
@@ -4,7 +4,7 @@
|
|||||||
-- 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.
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
||||||
-- 2022/09/26 Gestione dei tagli di lama (Horiz, double, etc.) estesa anche a BigSection
|
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessHeadCut = {}
|
local ProcessHeadCut = {}
|
||||||
@@ -192,9 +192,9 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||||
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||||
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
|
local bHorizCut = ( not bBigSectionCut and ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
|
||||||
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bBigSectionCut and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||||
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
local bDoubleCut = ( not bBigSectionCut and not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||||
-- dati geometrici del taglio
|
-- dati geometrici del taglio
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||||
-- se non obbligatorio e coincide con inizio grezzo, non va fatto
|
-- se non obbligatorio e coincide con inizio grezzo, non va fatto
|
||||||
@@ -204,14 +204,14 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
-- 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)), 1)
|
||||||
local dOffsL = dOvmHead / nCuts
|
local dOffsL = dOvmHead / nCuts
|
||||||
local bFinishByBlade = not bBigSectionCut
|
|
||||||
-- se taglio per sezioni alte e larghe
|
-- se taglio per sezioni alte e larghe
|
||||||
if bBigSectionCut then
|
if bBigSectionCut then
|
||||||
if dOvmHead > 0 then
|
if dOvmHead > 0 then
|
||||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
||||||
-- se finitura con lama rimando ai casi standard
|
-- se finitura con lama
|
||||||
if nQ05 == 1 or nQ05 == 0 then
|
if nQ05 == 1 or nQ05 == 0 then
|
||||||
bFinishByBlade = true
|
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
|
||||||
|
if not bOk then return bOk, sErr end
|
||||||
-- se finitura con truciolatore
|
-- se finitura con truciolatore
|
||||||
elseif nQ05 == 2 then
|
elseif nQ05 == 2 then
|
||||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
@@ -230,77 +230,76 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
-- se tagli standard
|
||||||
-- tagli standard con lama
|
elseif not bDoubleHorizCut then
|
||||||
if bFinishByBlade then
|
-- flag di lavorazione faccia
|
||||||
if not bDoubleHorizCut then
|
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
|
||||||
-- flag di lavorazione faccia
|
-- calcolo extra taglio ed accorciamento
|
||||||
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
|
local dCutExtra = 0
|
||||||
-- calcolo extra taglio ed accorciamento
|
local dAccStart = 0
|
||||||
local dCutExtra = 0
|
local dAccEnd = 0
|
||||||
local dAccStart = 0
|
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||||
local dAccEnd = 0
|
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
||||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
|
||||||
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
|
||||||
else
|
|
||||||
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
|
||||||
local dSawRad = dSawDiam / 2
|
|
||||||
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
|
||||||
if BD.C_SIMM then
|
|
||||||
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
|
||||||
else
|
|
||||||
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se necessari tagli in doppio, eseguo gli opposti
|
|
||||||
if bDoubleCut then
|
|
||||||
for i = nCuts, 1, -1 do
|
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw, true)
|
|
||||||
if not bOk then return false, sErr end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- eseguo i tagli necessari
|
|
||||||
for i = nCuts, 1, -1 do
|
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
|
|
||||||
if not bOk then return false, sErr end
|
|
||||||
end
|
|
||||||
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
|
||||||
else
|
else
|
||||||
-- verifico esistenza della lavorazione con lama da sotto
|
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
||||||
if not sCutting2 then
|
local dSawRad = dSawDiam / 2
|
||||||
local sErr = 'Error : cutting H2 not found in library'
|
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
||||||
EgtOutLog( sErr)
|
if BD.C_SIMM then
|
||||||
return false, sErr
|
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||||
|
else
|
||||||
|
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||||
end
|
end
|
||||||
-- verifico che le due lame riescano a lavorare la sezione
|
end
|
||||||
local dDimZ = b3Raw:getDimZ()
|
-- se necessari tagli in doppio, eseguo gli opposti
|
||||||
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
if bDoubleCut then
|
||||||
if dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0 then
|
-- gli accorciamenti vanno invertiti per il taglio opposto
|
||||||
local sErr = 'Error : section too big for head cut'
|
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
|
||||||
EgtOutLog( sErr)
|
|
||||||
return false, sErr
|
|
||||||
end
|
|
||||||
-- calcolo extra taglio ed accorciamento
|
|
||||||
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
|
||||||
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
|
||||||
local dAccStart = 0
|
|
||||||
local dVzLimDwnUp
|
|
||||||
if BD.TURN then dVzLimDwnUp = -2 end
|
|
||||||
-- eseguo i tagli da sotto necessari
|
|
||||||
for i = nCuts, 1, -1 do
|
for i = nCuts, 1, -1 do
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
|
||||||
if not bOk then return false, sErr end
|
|
||||||
end
|
|
||||||
-- eseguo i tagli da sopra necessari
|
|
||||||
for i = nCuts, 1, -1 do
|
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
|
||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- eseguo i tagli necessari
|
||||||
|
for i = nCuts, 1, -1 do
|
||||||
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
|
||||||
|
if not bOk then return false, sErr end
|
||||||
|
end
|
||||||
|
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
||||||
|
else
|
||||||
|
-- verifico esistenza della lavorazione con lama da sotto
|
||||||
|
if not sCutting2 then
|
||||||
|
local sErr = 'Error : cutting H2 not found in library'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- verifico che le due lame riescano a lavorare la sezione
|
||||||
|
local dDimZ = b3Raw:getDimZ()
|
||||||
|
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
||||||
|
if dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0 then
|
||||||
|
local sErr = 'Error : section too big for head cut'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- calcolo extra taglio ed accorciamento
|
||||||
|
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||||
|
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||||
|
local dAccStart = 0
|
||||||
|
local dVzLimDwnUp
|
||||||
|
if BD.TURN then dVzLimDwnUp = -2 end
|
||||||
|
-- eseguo i tagli da sotto necessari
|
||||||
|
for i = nCuts, 1, -1 do
|
||||||
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||||
|
if not bOk then return false, sErr end
|
||||||
|
end
|
||||||
|
-- eseguo i tagli da sopra necessari
|
||||||
|
for i = nCuts, 1, -1 do
|
||||||
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||||
|
if not bOk then return false, sErr end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|||||||
+58
-12
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/07/05
|
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/09/27
|
||||||
-- 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.
|
||||||
@@ -54,6 +54,8 @@
|
|||||||
-- 2022/09/15 Implementata gestione feature Planing L090, gestita come LapJoint
|
-- 2022/09/15 Implementata gestione feature Planing L090, gestita come LapJoint
|
||||||
-- Implementata, in caso di fresatura di lato con altezza tasca molto bassa, la contornatura con unica passata
|
-- Implementata, in caso di fresatura di lato con altezza tasca molto bassa, la contornatura con unica passata
|
||||||
-- Migliorata gestione AntiSplint (Mill e Saw)
|
-- Migliorata gestione AntiSplint (Mill e Saw)
|
||||||
|
-- 2022/09/27 Aggiunta gestione SCC per svuotature con TURN (solo dopo applicazione lavorazione).
|
||||||
|
-- 2022/10/20 In MakeByChainOrSaw modificato check per trovare la faccia adiacente sul lato più lungo.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLapJoint = {}
|
local ProcessLapJoint = {}
|
||||||
@@ -2625,7 +2627,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
for i = 1, #vAdj do
|
for i = 1, #vAdj do
|
||||||
if vAdj[i] >= 0 then
|
if vAdj[i] >= 0 then
|
||||||
local vtAdjN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT)
|
local vtAdjN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT)
|
||||||
if not bIs3Faces or abs( rfFac:getVersZ():getY()) < 0.174 or abs( rfFac:getVersZ():getY()) > 0.984 or vtAdjN:getY() * rfFac:getVersZ():getY() > 0.1 then
|
if not bIs3Faces or abs( rfFac:getVersZ():getY()) < 0.174 or abs( rfFac:getVersZ():getY()) > 0.984 or vtAdjN:getY() * rfFac:getVersZ():getY() > -0.1 then
|
||||||
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacInd, vAdj[i], GDB_ID.ROOT)
|
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacInd, vAdj[i], GDB_ID.ROOT)
|
||||||
local dLen = dist( ptP1, ptP2)
|
local dLen = dist( ptP1, ptP2)
|
||||||
if dLen > dMaxLen then
|
if dLen > dMaxLen then
|
||||||
@@ -2990,7 +2992,8 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- eseguo il taglio
|
-- eseguo il taglio
|
||||||
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
local dVzLimDwnUp = EgtIf( BD.TURN, -2, nil)
|
||||||
|
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, dVzLimDwnUp, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
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
|
||||||
@@ -3001,7 +3004,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakePocket( Proc, nPartId, 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)
|
||||||
|
|
||||||
-- calcolo l'elevazione dal punto medio
|
-- calcolo l'elevazione dal punto medio
|
||||||
local dElev
|
local dElev
|
||||||
@@ -3119,6 +3122,24 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if BD.TURN then
|
||||||
|
-- centro del pezzo
|
||||||
|
local ptCen = ORIG()
|
||||||
|
if b3Solid then ptCen = b3Solid:getCenter() end
|
||||||
|
-- punto inizio lavorazione
|
||||||
|
local ptStart = EgtGetMachiningStartPoint() or ORIG()
|
||||||
|
-- orientamento braccio
|
||||||
|
local nSCC = MCH_SCC.NONE
|
||||||
|
-- se faccia verso alto o basso
|
||||||
|
if abs( tvtN[2]:getZ()) > abs( tvtN[2]:getY()) then
|
||||||
|
nSCC = EgtIf( ptStart:getY() > ptCen:getY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
|
-- altrimenti faccia verso davanti o dietro
|
||||||
|
else
|
||||||
|
nSCC = EgtIf( ptStart:getZ() > ptCen:getZ(), MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
|
ML.ApplyMachining( true, false)
|
||||||
|
end
|
||||||
return true, sWarn, sTuuidPk, dDiamTool, dDepth
|
return true, sWarn, sTuuidPk, dDiamTool, dDepth
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -3144,7 +3165,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|||||||
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
||||||
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
||||||
-- applico la svuotatura
|
-- applico la svuotatura
|
||||||
local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng)
|
local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng)
|
||||||
if not bOk then
|
if not bOk then
|
||||||
-- se ho id utensile e diametro è perchè non ha fatto svuotatura perchè la faccia è più stretta del diametro utensile
|
-- se ho id utensile e diametro è perchè non ha fatto svuotatura perchè la faccia è più stretta del diametro utensile
|
||||||
-- e provo ad inserire singola passata di testa
|
-- e provo ad inserire singola passata di testa
|
||||||
@@ -3271,15 +3292,27 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dTDiam / 2)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dTDiam / 2)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dTDiam / 2)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dTDiam / 2)
|
||||||
|
-- forzo attacco lineare
|
||||||
if dElev > 0 then
|
if dElev > 0 then
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if bOpenEnd then
|
if bOpenEnd then
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dTDiam / 2)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dTDiam / 2)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dTDiam / 2)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dTDiam / 2)
|
||||||
|
-- forzo attacco lineare
|
||||||
if dElev > 0 then
|
if dElev > 0 then
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -4525,7 +4558,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se lavorazione da sotto e lunga, va divisa in due metà
|
-- se lavorazione da sotto e lunga, va divisa in due metà
|
||||||
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200))
|
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200) and not BD.TURN)
|
||||||
-- inserisco la lavorazione di fresatura
|
-- inserisco la lavorazione di fresatura
|
||||||
local sName = 'BHMill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'BHMill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
local nMchFId = EgtAddMachining( sName, sMilling)
|
||||||
@@ -4555,7 +4588,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
sNotes = sNotes .. 'VMRS=0;'
|
sNotes = sNotes .. 'VMRS=0;'
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
-- attacchi e uscite
|
-- attacchi e uscite
|
||||||
if vtN:getZ() > -0.5 then
|
if vtN:getZ() > -0.5 or BD.TURN then
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||||
@@ -4576,7 +4609,20 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local nStepType = MCH_MILL_ST.ONEWAY
|
local nStepType = MCH_MILL_ST.ONEWAY
|
||||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, nStepType)
|
EgtSetMachiningParam( MCH_MP.STEPTYPE, nStepType)
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
local nSCC = EgtIf( ( vtN:getY() > 0.5 or ( bHeadDir and vtN:getZ() > 0.5 ) or ( not bHeadDir and vtN:getZ() < -0.5)), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
local nSCC = MCH_SCC.NONE
|
||||||
|
if not BD.TURN then
|
||||||
|
nSCC = EgtIf( ( vtN:getY() > 0.5 or ( bHeadDir and vtN:getZ() > 0.5 ) or ( not bHeadDir and vtN:getZ() < -0.5)), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
|
else
|
||||||
|
if vtN:getY() > 0.707 then
|
||||||
|
nSCC = MCH_SCC.ADIR_YP
|
||||||
|
elseif vtN:getY() < -0.707 then
|
||||||
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
|
elseif vtN:getZ() > 0.707 then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
elseif vtN:getZ() < -0.707 then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZM
|
||||||
|
end
|
||||||
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
@@ -5072,7 +5118,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD) 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, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
||||||
@@ -5145,7 +5191,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
||||||
end
|
end
|
||||||
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
||||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
||||||
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
|
||||||
@@ -5309,7 +5355,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD) 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, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
||||||
@@ -5327,7 +5373,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local tvtNx = {}
|
local tvtNx = {}
|
||||||
tvtNx[2] = vtN
|
tvtNx[2] = vtN
|
||||||
local bOk, sWarn2
|
local bOk, sWarn2
|
||||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev + dCollSic, nil, nil, bAllWithEndCap)
|
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev + dCollSic, nil, nil, bAllWithEndCap)
|
||||||
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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2022/03/07
|
-- ProcessLongCut.lua by Egaltech s.r.l. 2022/11/04
|
||||||
-- 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.
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
-- 2022/03/07 Razionalizzata gestione casi con fresa di fianco. Aggiunta gestione Long2Cut anche con testa sotto.
|
-- 2022/03/07 Razionalizzata gestione casi con fresa di fianco. Aggiunta gestione Long2Cut anche con testa sotto.
|
||||||
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
|
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
|
||||||
-- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali.
|
-- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali.
|
||||||
|
-- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLongCut = {}
|
local ProcessLongCut = {}
|
||||||
@@ -1025,12 +1026,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
for j = 1, Proc.Fct - 1 do
|
for j = 1, Proc.Fct - 1 do
|
||||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||||
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
||||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam)
|
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, nil, bDownHead)
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if bForcedLim and nCountMilHead < 1 then
|
if bForcedLim and nCountMilHead < 1 then
|
||||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim)
|
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, nil, bDownHead)
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1042,12 +1043,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
for j = 1, Proc.Fct - 1 do
|
for j = 1, Proc.Fct - 1 do
|
||||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||||
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
||||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam)
|
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, nil, bDownHead)
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if bForcedLim and nCountMilHead < 2 then
|
if bForcedLim and nCountMilHead < 2 then
|
||||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim)
|
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, nil, bDownHead)
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
-- 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).
|
||||||
-- 2022/07/26 Aggiunta gestione del parametro P04=1 per la pulizia degli angoli con mortasatrice (sega a catena) specifica
|
-- 2022/07/26 Aggiunta gestione del parametro P04=1 per la pulizia degli angoli con mortasatrice (sega a catena) specifica
|
||||||
-- 2022/07/29 Nella pulitura angoli aggiunto il check dimensioni tasca vs utensile. Corretta direzione utensile per mortasa frontale.
|
-- 2022/07/29 Nella pulitura angoli aggiunto il check dimensioni tasca vs utensile. Corretta direzione utensile per mortasa frontale.
|
||||||
|
-- 2022/09/27 Migliorata la scelta utensile. Se c'è almeno una lavorazione 'mortise' si cerca di usare quelle, riducendo l'elevazione se necessario.
|
||||||
|
-- Se non c'è nemmeno una lavorazione 'mortise' si passa alle pocket.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessMortise = {}
|
local ProcessMortise = {}
|
||||||
@@ -229,6 +231,35 @@ local function CleanCorners( Proc, dMorH, vtN, bDoubleDir, AuxId)
|
|||||||
return true, sWarn
|
return true, sWarn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function VerifyMortiseOrPocket( Proc, dDiam, dDepth, dMaxTotLen, sType, bPocketDown)
|
||||||
|
-- ricerca della svuotatura
|
||||||
|
local sPocketing
|
||||||
|
if dDepth then
|
||||||
|
sPocketing = ML.FindPocketing( sType, dDiam, dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||||
|
ML.FindPocketing( sType, dDiam, 0.8 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||||
|
ML.FindPocketing( sType, dDiam, 0.6 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||||
|
ML.FindPocketing( sType, dDiam, 0.4 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||||
|
ML.FindPocketing( sType, dDiam, 0, dMaxTotLen)
|
||||||
|
else
|
||||||
|
sPocketing = ML.FindPocketing( sType, dDiam, 0, dMaxTotLen)
|
||||||
|
end
|
||||||
|
if not sPocketing then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
-- recupero i dati dell'utensile
|
||||||
|
local dMaxDepth = 0
|
||||||
|
local dToolDiam = 0
|
||||||
|
if EgtMdbSetCurrMachining( sPocketing) then
|
||||||
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
|
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||||
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return sPocketing, dMaxDepth, dToolDiam
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||||
@@ -309,8 +340,10 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- se il percorso ausiliario è esterno al grezzo, lo riavvicino
|
-- se il percorso ausiliario è esterno al grezzo, lo riavvicino
|
||||||
if abs( dMove) > GEO.EPS_SMALL then
|
if abs( dMove) > GEO.EPS_SMALL then
|
||||||
AuxId = EgtCopyGlob( AuxId, BL.GetAddGroup( nPartId))
|
AuxId = EgtCopyGlob( AuxId, BL.GetAddGroup( nPartId))
|
||||||
EgtMove( AuxId, Vector3d(0,0,-dMove))
|
local vtMove = Vector3d(0,0,dMove)
|
||||||
EgtMove( nFlat, Vector3d(0,0,-dMove))
|
vtMove:toGlob(frMor)
|
||||||
|
EgtMove( AuxId, vtMove, GDB_RT.GLOB)
|
||||||
|
EgtMove( nFlat, vtMove, GDB_RT.GLOB)
|
||||||
frMor, dL, dW = EgtSurfTmFacetMinAreaRectangle( nFlat, 0, GDB_ID.ROOT)
|
frMor, dL, dW = EgtSurfTmFacetMinAreaRectangle( nFlat, 0, GDB_ID.ROOT)
|
||||||
ptC = frMor:getOrigin()
|
ptC = frMor:getOrigin()
|
||||||
vtN = frMor:getVersZ()
|
vtN = frMor:getVersZ()
|
||||||
@@ -387,16 +420,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
local sPocketing
|
local sPocketing
|
||||||
if Proc.Prc ~= 53 then
|
if Proc.Prc ~= 53 then
|
||||||
sPocketing = ML.FindPocketing( sPockType..sMchExt, dW, nil, nil, not bPockDown, bPockDown)
|
sPocketing = VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown)
|
||||||
if not sPocketing and bPockUp then
|
if not sPocketing and bPockUp then
|
||||||
sPocketing = ML.FindPocketing( sPockType, dW)
|
sPocketing = VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
sPockType = 'Pocket'
|
sPockType = 'Pocket'
|
||||||
sPocketing = ML.FindPocketing( sPockType..sMchExt, dW, nil, nil, not bPockDown, bPockDown)
|
sPocketing = VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown)
|
||||||
if not sPocketing and bPockUp then
|
if not sPocketing and bPockUp then
|
||||||
sPocketing = ML.FindPocketing( sPockType, dW)
|
sPocketing = VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessProfCamb.lua by Egaltech s.r.l. 2022/05/28
|
-- ProcessProfCamb.lua by Egaltech s.r.l. 2022/11/03
|
||||||
-- Gestione calcolo profilo caudato per Travi
|
-- Gestione calcolo profilo caudato 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.
|
||||||
@@ -8,6 +8,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.
|
||||||
|
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessProfCamb = {}
|
local ProcessProfCamb = {}
|
||||||
@@ -315,12 +316,14 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- leggo anticipatamente i parametri utensile fresa per dare un valore opportuno all'elevazione della lama
|
-- leggo anticipatamente i parametri utensile fresa per dare un valore opportuno all'elevazione della lama
|
||||||
-- recupero la lavorazione di fresatura
|
-- recupero la lavorazione di fresatura
|
||||||
local sMillType = 'Prof'
|
local sMillType = 'Prof'
|
||||||
sMilling, _, _, bMillDown = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bMillDown)
|
local bH2
|
||||||
|
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bMillDown)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
bMillDown = ( bMillDown and bH2)
|
||||||
-- Recupero i dati dell'utensile
|
-- Recupero i dati dell'utensile
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessScarfJoint.lua by Egaltech s.r.l. 2022/07/12
|
-- ProcessScarfJoint.lua by Egaltech s.r.l. 2022/09/30
|
||||||
-- Gestione calcolo giunto Gerber per Travi
|
-- Gestione calcolo giunto Gerber per Travi
|
||||||
-- 2021/06/28 Aggiunto extra-taglio alle lamate orizzontali.
|
-- 2021/06/28 Aggiunto extra-taglio alle lamate orizzontali.
|
||||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||||
@@ -173,7 +173,11 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
|||||||
if vtO then
|
if vtO then
|
||||||
vtOrthoO = Vector3d( vtO)
|
vtOrthoO = Vector3d( vtO)
|
||||||
else
|
else
|
||||||
vtOrthoO = Y_AX()
|
if vtN[vFaceOrd[4]]:getZ() < 0.1 then
|
||||||
|
vtOrthoO = Z_AX()
|
||||||
|
else
|
||||||
|
vtOrthoO = Y_AX()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -310,10 +314,12 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
end
|
end
|
||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
|
local dMaxDepth = 0
|
||||||
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
|
||||||
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -346,7 +352,6 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||||
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
||||||
nGoodFace4 = EgtSurfTmFacetCount( nFace4)
|
nGoodFace4 = EgtSurfTmFacetCount( nFace4)
|
||||||
@@ -356,21 +361,27 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
||||||
end
|
end
|
||||||
|
|
||||||
local bOkd, sErrD, vCuts = ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw)
|
-- per macchina TURN aggiusto massima dimensione cubetto
|
||||||
|
local dNewDiceDim
|
||||||
|
if BD.TURN and nGoodFace4 and nGoodFace4 > 0 then
|
||||||
|
local dDimRef = EgtIf( abs( vtN[vFaceOrd[4]]:getZ()) < 0.1, b3Raw:getDimZ(), b3Raw:getDimY())
|
||||||
|
if dDimRef + BD.CUT_EXTRA < dMaxDepth then
|
||||||
|
dNewDiceDim = - ( dMaxDepth - BD.CUT_EXTRA)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local bOkd, sErrD, vCuts = ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
|
||||||
if not bOkd then return bOkd, sErrD end
|
if not bOkd then return bOkd, sErrD end
|
||||||
|
|
||||||
if #vCuts == 0 then
|
if #vCuts == 0 then
|
||||||
-- se ho la faccia intermedia, per prima cosa verifico se ho intersezione con la faccia tappo
|
-- se ho la faccia intermedia, per prima cosa verifico se ho intersezione con la faccia tappo
|
||||||
if nGoodFace4 ~= 0 then
|
if nGoodFace4 ~= 0 then
|
||||||
-- taglio sulla faccia interna
|
|
||||||
if vFaceOrd[1] ~= 0 then
|
|
||||||
-- inserisco la lavorazione
|
|
||||||
local vtOrthoO = Vector3d( vtRef)
|
|
||||||
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
||||||
if not bOkd then return bOkd, sErrD end
|
|
||||||
end
|
|
||||||
-- se non ho intersezione con la faccia tappo posso fare il taglio sul fianco
|
-- se non ho intersezione con la faccia tappo posso fare il taglio sul fianco
|
||||||
if not nGoodFace1 or nGoodFace1 == 0 then
|
if not nGoodFace1 or nGoodFace1 == 0 then
|
||||||
|
-- inserisco la lavorazione
|
||||||
|
local vtRef2 = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, Z_AX(), EgtIf( bHead, Y_AX(), -Y_AX()))
|
||||||
|
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOkd then return bOkd, sErrD end
|
||||||
-- lavoro la faccia opposta (definita dal parametro P11)
|
-- lavoro la faccia opposta (definita dal parametro P11)
|
||||||
if vFaceOrd[3] ~= 0 then
|
if vFaceOrd[3] ~= 0 then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
@@ -378,16 +389,20 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
if not bOkd then return bOkd, sErrD end
|
if not bOkd then return bOkd, sErrD end
|
||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- altrimenti se ho intersezione forzo il DiceCut ad essere eseguito con distanze più piccole
|
||||||
local vtRef2 = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, Z_AX(), EgtIf( bHead, Y_AX(), -Y_AX()))
|
else
|
||||||
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
||||||
if not bOkd then return bOkd, sErrD end
|
|
||||||
else -- altrimenti se ho intersezione forzo il DiceCut ad essere eseguito con distanze più piccole
|
|
||||||
-- definisco la nuova dimensione massima del dice cut
|
-- definisco la nuova dimensione massima del dice cut
|
||||||
local dNewDiceDim = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, b3Raw:getDimZ(), b3Raw:getDimY())
|
local dNewDiceDim = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, b3Raw:getDimZ(), b3Raw:getDimY())
|
||||||
bOkd, sErrD = ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
|
bOkd, sErrD = ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
|
||||||
if not bOkd then return bOkd, sErrD end
|
if not bOkd then return bOkd, sErrD end
|
||||||
end
|
end
|
||||||
|
-- taglio sulla faccia interna
|
||||||
|
if vFaceOrd[1] ~= 0 then
|
||||||
|
-- inserisco la lavorazione
|
||||||
|
local vtOrthoO = Vector3d( vtRef)
|
||||||
|
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOkd then return bOkd, sErrD end
|
||||||
|
end
|
||||||
else
|
else
|
||||||
-- taglio sulla faccia interna
|
-- taglio sulla faccia interna
|
||||||
if vFaceOrd[1] ~= 0 then
|
if vFaceOrd[1] ~= 0 then
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
-- Gestione calcolo giunto Gerber per Travi
|
-- Gestione calcolo giunto Gerber per Travi
|
||||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||||
-- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut.
|
-- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut.
|
||||||
|
-- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessSimpleScarf = {}
|
local ProcessSimpleScarf = {}
|
||||||
@@ -12,6 +13,7 @@ local BL = require( 'BeamLib')
|
|||||||
local Fbs = require( 'FacesBySaw')
|
local Fbs = require( 'FacesBySaw')
|
||||||
local DC = require( 'DiceCut')
|
local DC = require( 'DiceCut')
|
||||||
local Cut = require( 'ProcessCut')
|
local Cut = require( 'ProcessCut')
|
||||||
|
local FreeContour = require( 'ProcessFreeContour')
|
||||||
|
|
||||||
EgtOutLog( ' ProcessSimpleScarf started', 1)
|
EgtOutLog( ' ProcessSimpleScarf started', 1)
|
||||||
|
|
||||||
@@ -28,11 +30,13 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Classificazione della feature
|
-- Classificazione della feature
|
||||||
function ProcessSimpleScarf.Classify( Proc)
|
function ProcessSimpleScarf.Classify( Proc)
|
||||||
|
-- se forzato utilizzo fresa non ruoto la trave
|
||||||
|
local bForceSideMill = ( EgtGetInfo( Proc.Id, 'Q04', 'd') or 0) > 0
|
||||||
-- verifico le normali delle facce
|
-- verifico le normali delle facce
|
||||||
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
||||||
for i = 1, nFacetCnt do
|
for i = 1, nFacetCnt do
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
|
||||||
if vtN:getZ() < - 0.5 and Proc.Box:getDimX() / abs( vtN:getZ()) > BD.MAX_DIM_DICE then
|
if vtN:getZ() < - 0.5 and Proc.Box:getDimX() / abs( vtN:getZ()) > BD.MAX_DIM_DICE and not bForceSideMill then
|
||||||
return true, true
|
return true, true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -188,6 +192,14 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
|
|||||||
-- inserimento smussi
|
-- inserimento smussi
|
||||||
local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
if not bOkc then return bOkc, sErrC end
|
if not bOkc then return bOkc, sErrC end
|
||||||
|
-- se forzato utilizzo fresa richiamo la freecontour
|
||||||
|
local bForceSideMill = EgtGetInfo( Proc.Id, 'Q04', 'd') == 1 or
|
||||||
|
( EgtGetInfo( Proc.Id, 'Q04', 'd') == 2 and abs( vtN[vFaceOrd[3]]:getY()) < 0.1) or
|
||||||
|
( EgtGetInfo( Proc.Id, 'Q04', 'd') == 3 and abs( vtN[vFaceOrd[3]]:getY()) < 0.1 and vtN[vFaceOrd[3]]:getZ() < 0.1)
|
||||||
|
if bForceSideMill then
|
||||||
|
bOk, sErr = FreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
|
return bOk, sErr
|
||||||
|
end
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sCutting = ML.FindCutting( 'HeadSide')
|
local sCutting = ML.FindCutting( 'HeadSide')
|
||||||
if not sCutting then
|
if not sCutting then
|
||||||
|
|||||||
+103
-82
@@ -4,7 +4,8 @@
|
|||||||
-- 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.
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
||||||
-- 2022/09/26 Gestione dei tagli di lama (Horiz, double, etc.) estesa anche a BigSection
|
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
||||||
|
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessSplit = {}
|
local ProcessSplit = {}
|
||||||
@@ -256,11 +257,13 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
local dMaxDepth = 50
|
local dMaxDepth = 50
|
||||||
|
local dSawThick = 2
|
||||||
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
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
|
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||||
@@ -269,11 +272,13 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- recupero i dati della eventuale seconda lama
|
-- recupero i dati della eventuale seconda lama
|
||||||
local dSawDiam2 = 0
|
local dSawDiam2 = 0
|
||||||
local dMaxDepth2 = 0
|
local dMaxDepth2 = 0
|
||||||
|
local dSawThick2 = 0
|
||||||
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
||||||
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
||||||
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
||||||
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
||||||
|
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- caratteristiche taglio
|
-- caratteristiche taglio
|
||||||
@@ -306,7 +311,6 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
end
|
end
|
||||||
-- se taglio per pezzi alti e larghi
|
-- se taglio per pezzi alti e larghi
|
||||||
local nNewPhase = 0
|
local nNewPhase = 0
|
||||||
local bFinishByBlade = not bBigSectionCut
|
|
||||||
if bBigSectionCut then
|
if bBigSectionCut then
|
||||||
local bFinishingNeeded = false
|
local bFinishingNeeded = false
|
||||||
if bSplit then
|
if bSplit then
|
||||||
@@ -384,9 +388,26 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
sNotesFinal = 'Cut;'
|
sNotesFinal = 'Cut;'
|
||||||
end
|
end
|
||||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
||||||
-- se finitura con lama rimando ai casi standard
|
-- se finitura con lama
|
||||||
if nQ05 == 1 or nQ05 == 0 or not bSplit then
|
if nQ05 == 1 or nQ05 == 0 or not bSplit then
|
||||||
bFinishByBlade = true
|
local dSawThickCheck = dSawThick
|
||||||
|
if dSawThick2 > 0 and bDoubleHorizCut then
|
||||||
|
dSawThickCheck = min( dSawThick, dSawThick2)
|
||||||
|
end
|
||||||
|
local dMaxElev = 0
|
||||||
|
if vtN:getX() > 0 then
|
||||||
|
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
|
||||||
|
else
|
||||||
|
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
|
||||||
|
end
|
||||||
|
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
|
||||||
|
if bSplit or dMaxElev > dSawThickCheck then
|
||||||
|
local bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dLenEndRaw, nil, false, true, b3Raw, sNotes, dCurrOvmT)
|
||||||
|
if sNotesFinal then
|
||||||
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||||
|
end
|
||||||
|
return bOk, sErr, nNewPhase
|
||||||
|
end
|
||||||
-- se finitura con truciolatore
|
-- se finitura con truciolatore
|
||||||
elseif nQ05 == 2 then
|
elseif nQ05 == 2 then
|
||||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
@@ -402,95 +423,95 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
||||||
if not bOk then return bOk, sErr, nNewPhase end
|
if sNotesFinal then
|
||||||
end
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||||
if sNotesFinal then
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
return bOk, sErr, nNewPhase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- tagli standard con lama
|
-- se tagli standard
|
||||||
if bFinishByBlade then
|
if not bDoubleHorizCut then
|
||||||
if not bDoubleHorizCut then
|
-- calcolo extra taglio ed accorciamento
|
||||||
-- calcolo extra taglio ed accorciamento
|
local dCutExtra = 0
|
||||||
local dCutExtra = 0
|
local dAccStart = 0
|
||||||
local dAccStart = 0
|
local dAccEnd = 0
|
||||||
local dAccEnd = 0
|
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
||||||
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
|
||||||
else
|
|
||||||
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
|
||||||
local dSawRad = dSawDiam / 2
|
|
||||||
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
|
||||||
if BD.C_SIMM then
|
|
||||||
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
|
||||||
else
|
|
||||||
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se necessari tagli in doppio, eseguo gli opposti
|
|
||||||
if bDoubleCut then
|
|
||||||
for i = nCuts, 1, -1 do
|
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
|
||||||
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, true)
|
|
||||||
if not bOk then return false, sErr end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- eseguo i tagli necessari
|
|
||||||
for i = nCuts, 1, -1 do
|
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
|
||||||
local sNotes
|
|
||||||
if bSplit then
|
|
||||||
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
|
|
||||||
else
|
|
||||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
|
||||||
end
|
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
|
|
||||||
if not bOk then return false, sErr end
|
|
||||||
end
|
|
||||||
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
|
||||||
else
|
else
|
||||||
-- verifico esistenza della lavorazione con lama da sotto
|
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
|
||||||
if not sCutting2 then
|
local dSawRad = dSawDiam / 2
|
||||||
local sErr = 'Error : cutting H2 not found in library'
|
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
||||||
EgtOutLog( sErr)
|
if BD.C_SIMM then
|
||||||
return false, sErr
|
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||||
|
else
|
||||||
|
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||||
end
|
end
|
||||||
-- verifico che le due lame riescano a lavorare la sezione
|
end
|
||||||
local dDimZ = b3Raw:getDimZ()
|
-- se necessari tagli in doppio, eseguo gli opposti
|
||||||
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
if bDoubleCut then
|
||||||
if dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0 then
|
-- gli accorciamenti vanno invertiti per il taglio opposto
|
||||||
local sErr = 'Error : section too big for tail cut'
|
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
|
||||||
EgtOutLog( sErr)
|
|
||||||
return false, sErr
|
|
||||||
end
|
|
||||||
-- calcolo extra taglio ed accorciamento
|
|
||||||
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
|
||||||
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
|
||||||
local dAccStart = 0
|
|
||||||
-- limiti da sotto
|
|
||||||
local dVzLimDwnUp
|
|
||||||
if BD.TURN then dVzLimDwnUp = -2 end
|
|
||||||
-- eseguo i tagli da sotto necessari
|
|
||||||
for i = nCuts, 1, -1 do
|
for i = nCuts, 1, -1 do
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, sNotes, b3Raw, true)
|
||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
-- eseguo i tagli da sopra necessari
|
end
|
||||||
for i = nCuts, 1, -1 do
|
-- eseguo i tagli necessari
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
for i = nCuts, 1, -1 do
|
||||||
local sNotes
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
if bSplit then
|
local sNotes
|
||||||
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
|
if bSplit then
|
||||||
else
|
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
|
||||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
else
|
||||||
end
|
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
|
||||||
if not bOk then return false, sErr end
|
|
||||||
end
|
end
|
||||||
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
|
||||||
|
if not bOk then return false, sErr end
|
||||||
|
end
|
||||||
|
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
||||||
|
else
|
||||||
|
-- verifico esistenza della lavorazione con lama da sotto
|
||||||
|
if not sCutting2 then
|
||||||
|
local sErr = 'Error : cutting H2 not found in library'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- verifico che le due lame riescano a lavorare la sezione
|
||||||
|
local dDimZ = b3Raw:getDimZ()
|
||||||
|
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
||||||
|
if dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0 then
|
||||||
|
local sErr = 'Error : section too big for tail cut'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- calcolo extra taglio ed accorciamento
|
||||||
|
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||||
|
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||||
|
local dAccStart = 0
|
||||||
|
-- limiti da sotto
|
||||||
|
local dVzLimDwnUp
|
||||||
|
if BD.TURN then dVzLimDwnUp = -2 end
|
||||||
|
-- eseguo i tagli da sotto necessari
|
||||||
|
for i = nCuts, 1, -1 do
|
||||||
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
|
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
||||||
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||||
|
if not bOk then return false, sErr end
|
||||||
|
end
|
||||||
|
-- eseguo i tagli da sopra necessari
|
||||||
|
for i = nCuts, 1, -1 do
|
||||||
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
|
local sNotes
|
||||||
|
if bSplit then
|
||||||
|
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
|
||||||
|
else
|
||||||
|
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||||
|
end
|
||||||
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||||
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true, nil, nNewPhase
|
return true, nil, nNewPhase
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
-- ProcessStepJoint.lua by Egaltech s.r.l. 2022/01/26
|
-- ProcessStepJoint.lua by Egaltech s.r.l. 2022/11/03
|
||||||
-- Gestione calcolo giunto a gradino per Travi
|
-- Gestione calcolo giunto a gradino per Travi
|
||||||
|
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessStepJoint = {}
|
local ProcessStepJoint = {}
|
||||||
@@ -83,13 +84,14 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMillType = 'Mark'
|
local sMillType = 'Mark'
|
||||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||||
local sMilling
|
local sMilling, bH2
|
||||||
sMilling, _, _, bDownHead = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : milling not found in library'
|
local sErr = 'Error : milling not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
bDownHead = ( bDownHead and bH2)
|
||||||
-- Inserisco la lavorazione del lato standard
|
-- Inserisco la lavorazione del lato standard
|
||||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2022/01/25
|
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2022/11/03
|
||||||
-- Gestione calcolo tacca a gradino per Travi
|
-- Gestione calcolo tacca a gradino per Travi
|
||||||
|
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessStepJointNotch = {}
|
local ProcessStepJointNotch = {}
|
||||||
@@ -523,13 +524,14 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMillType = 'Mark'
|
local sMillType = 'Mark'
|
||||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||||
local sMilling
|
local sMilling, bH2
|
||||||
sMilling, _, _, bDownHead = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : milling not found in library'
|
local sErr = 'Error : milling not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
bDownHead = ( bDownHead and bH2)
|
||||||
if bExeNormal then
|
if bExeNormal then
|
||||||
-- Inserisco la lavorazione del lato standard
|
-- Inserisco la lavorazione del lato standard
|
||||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
-- ProcessTenon.lua by Egaltech s.r.l. 2022/05/28
|
-- ProcessTenon.lua by Egaltech s.r.l. 2022/11/03
|
||||||
-- Gestione calcolo tenone per Travi
|
-- Gestione calcolo tenone per Travi
|
||||||
-- 2021/10/04 Corretto calcolo HCING per pezzi piccoli.
|
-- 2021/10/04 Corretto calcolo HCING per pezzi piccoli.
|
||||||
-- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto.
|
-- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto.
|
||||||
-- 2022/05/18 Migliorata gestione attacco.
|
-- 2022/05/18 Migliorata gestione attacco.
|
||||||
-- 2022/05/28 Spostato calcolo svuotatura in modulo di libreria.
|
-- 2022/05/28 Spostato calcolo svuotatura in modulo di libreria.
|
||||||
-- 2022/09/20 Migliorato il calcolo delle passate laterali; ora considera la reale distanza tra contorno del tenone e estremi della faccia
|
-- 2022/09/20 Migliorato il calcolo delle passate laterali; ora considera la reale distanza tra contorno del tenone e estremi della faccia
|
||||||
|
-- 2022/11/03 Corretto uso di bH2 (da sotto solo se anche bMillDown vero).
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessTenon = {}
|
local ProcessTenon = {}
|
||||||
@@ -225,7 +226,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- porto inizio curva il più possibile sul bordo in alto o in basso
|
-- porto inizio curva il più possibile sul bordo in alto o in basso
|
||||||
local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS
|
local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS
|
||||||
local bMyShortPart = ( bShortPart and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
local bMyShortPart = ( bShortPart and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
||||||
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, bH2 ~= bMyShortPart)
|
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, ( bH2 and bMillDown) ~= bMyShortPart)
|
||||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||||
local sWarn
|
local sWarn
|
||||||
local dDepth = 0
|
local dDepth = 0
|
||||||
|
|||||||
+16
-3
@@ -1,5 +1,7 @@
|
|||||||
-- BeamNestProcess.lua by Egaltech s.r.l. 2021/06/14
|
-- BeamNestProcess.lua by Egaltech s.r.l. 2021/06/14
|
||||||
-- Gestione nesting automatico travi
|
-- Gestione nesting automatico travi
|
||||||
|
-- 2022/10/05 Piccole modifiche per far funzionare correttamente i compilati
|
||||||
|
-- 2022/10/06 Corretto bug che moltiplicava i pezzi se erano presenti più grezzi della stessa sezione
|
||||||
|
|
||||||
-- Intestazioni
|
-- Intestazioni
|
||||||
require( 'EgtBase')
|
require( 'EgtBase')
|
||||||
@@ -168,12 +170,20 @@ end
|
|||||||
-- Pezzi
|
-- Pezzi
|
||||||
local Parts = {}
|
local Parts = {}
|
||||||
|
|
||||||
|
-- cerco il grezzo con la lunghezza maggiore, epurata dello start gap
|
||||||
|
local maxRawLenToFillNoStartGap = 0
|
||||||
|
for RawIndex = 1, #Raws do
|
||||||
|
maxRawLenToFillNoStartGap = max( maxRawLenToFillNoStartGap, Raws[RawIndex].LenToFill - Raws[RawIndex].StartGap)
|
||||||
|
end
|
||||||
-- ciclo su pezzi per aggiungerli al nesting
|
-- ciclo su pezzi per aggiungerli al nesting
|
||||||
for nPartId, nCount in pairs( PART) do
|
for nPartId, nCount in pairs( PART) do
|
||||||
-- recupero lunghezza pezzo
|
-- recupero lunghezza pezzo
|
||||||
local Len = EgtGetInfo( nPartId, "L", 'd')
|
local Len = EgtGetInfo( nPartId, "L", 'd')
|
||||||
local DispLen = EgtIf( Len <= 1000, 2000, 0) --EgtIf( Len <= 2000, max( 2000, 6000 - Len), 0)
|
local DispLen = EgtIf( Len <= 1000, 2000, 0) --EgtIf( Len <= 2000, max( 2000, 6000 - Len), 0)
|
||||||
table.insert( Parts, {Id = nPartId, Len = Len, DispLen = DispLen, Cnt = nCount})
|
-- aggiungo il pezzo solo se ci sta nel grezzo più lungo a disposizione
|
||||||
|
if Len < maxRawLenToFillNoStartGap then
|
||||||
|
table.insert( Parts, {Id = nPartId, Len = Len, DispLen = DispLen, Cnt = nCount})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lunghezza totale pezzi
|
-- lunghezza totale pezzi
|
||||||
@@ -207,7 +217,10 @@ for ShortIndex = 1, #ShortList do
|
|||||||
ShortCount = ShortCount + ShortList[ShortIndex].Cnt
|
ShortCount = ShortCount + ShortList[ShortIndex].Cnt
|
||||||
end
|
end
|
||||||
local ShortForRaw = floor( ShortCount / MediumRawQty)
|
local ShortForRaw = floor( ShortCount / MediumRawQty)
|
||||||
local ExtraShortForRaw = fmod( ShortCount, MediumRawQty)
|
local ExtraShortForRaw = 0
|
||||||
|
if MediumRawQty > 0 then
|
||||||
|
ExtraShortForRaw = fmod( ShortCount, MediumRawQty)
|
||||||
|
end
|
||||||
-- creo lista pezzi corti singoli
|
-- creo lista pezzi corti singoli
|
||||||
local SingleShortList = {}
|
local SingleShortList = {}
|
||||||
for ShortIndex = 1, #ShortList do
|
for ShortIndex = 1, #ShortList do
|
||||||
@@ -325,7 +338,7 @@ while nMachGroup do
|
|||||||
if EgtGetInfo( nMachGroup, "AUTONEST",'i') == 1 then
|
if EgtGetInfo( nMachGroup, "AUTONEST",'i') == 1 then
|
||||||
EgtRemoveInfo( nMachGroup, "AUTONEST")
|
EgtRemoveInfo( nMachGroup, "AUTONEST")
|
||||||
EgtSetInfo( nMachGroup, "UPDATEUI", 1)
|
EgtSetInfo( nMachGroup, "UPDATEUI", 1)
|
||||||
local bOk, sErr = pcall( dofile, EgtGetSourceDir() .. "BatchProcessNew.lua")
|
local bOk, sErr = pcall( dofile, BEAM.BASEDIR .. "\\BatchProcessNew.lua")
|
||||||
if not bOk then
|
if not bOk then
|
||||||
EgtOutLog( 'Error in BatchProcessNew.lua call (' .. ( sErr or '') ..')')
|
EgtOutLog( 'Error in BatchProcessNew.lua call (' .. ( sErr or '') ..')')
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user