Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b569545b82 | |||
| 02e26c362f | |||
| 63d9d24e30 | |||
| 4789452523 | |||
| 46c5088c28 | |||
| 1b6f8b3be4 | |||
| 857a410416 | |||
| 77c7e42e42 | |||
| f3e04bccb3 | |||
| b3ca865b42 | |||
| c140cd03ec | |||
| cc24b3b3ae | |||
| b614b85652 | |||
| b3cbb4753d | |||
| 9f8e024b35 | |||
| 0ab2e88d77 | |||
| 58e631d899 | |||
| 5ca0809cea | |||
| 58ea436132 | |||
| c8b5f9ca27 | |||
| 33d70bdbf4 | |||
| 6ffb0da24d | |||
| 04abd401f6 | |||
| 5b1fb41c43 | |||
| 8baf4ad2d6 | |||
| 3e27651e4c | |||
| 2c5de2516d | |||
| 07dad8f8c2 | |||
| b48fe0da34 | |||
| 640f77b5f5 | |||
| 14afb25783 | |||
| 5bc4e6f24f | |||
| ea40658bd3 | |||
| ec1a8e711d | |||
| a0b55b8628 | |||
| 24faf57e49 | |||
| 6e0d6c7ea7 | |||
| c3786e0a96 | |||
| 07a66eb132 | |||
| b3fcdcdd6b | |||
| 86c225305f | |||
| 0c5c1dcfe5 | |||
| 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 |
+1
-1
@@ -41,4 +41,4 @@ GWD.OVM_MID = BD.OVM_MID
|
||||
-- Tutto ok
|
||||
GWD.ERR = 0
|
||||
|
||||
EgtOutLog( ' +++ GetWallData completed')
|
||||
EgtOutLog( ' +++ GetBeamData completed')
|
||||
|
||||
+122
-8
@@ -1,4 +1,4 @@
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2022/09/24
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2022/12/23
|
||||
-- Libreria esecuzione lavorazioni per Travi
|
||||
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
|
||||
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
|
||||
@@ -35,7 +35,10 @@
|
||||
-- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
|
||||
-- 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/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.
|
||||
-- 2022/09/29 Aggiunta la ricerca di feature specchiate, al momento solo per DtMortise, con le relative funzioni.
|
||||
-- 2022/12/23 Corrette rotazioni 90 deg per macchine con carico da destra.
|
||||
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamExec = {}
|
||||
@@ -321,6 +324,8 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
Proc2.Fce = Proc.Fcs
|
||||
Proc2.CutId = Proc.CutId
|
||||
Proc2.TaskId = Proc.TaskId
|
||||
Proc2.AdjId = Proc.AdjId
|
||||
Proc2.MainId = Proc.MainId
|
||||
table.insert( vProc, Proc2)
|
||||
end
|
||||
-- se BlockHaus HalfLap
|
||||
@@ -651,7 +656,7 @@ end
|
||||
local function OrderFeatures( vProc, b3Raw)
|
||||
|
||||
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
|
||||
-- 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 +685,14 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if B1.Head ~= B2.Head then
|
||||
return B1.Head
|
||||
end
|
||||
-- se primo è foro di un birdsmouth e secondo è il suo birdsmouth, il foro va sempre prima
|
||||
if Drill.Identify(B1) and LapJoint.Identify(B2) and B1.MainId == B2.Id then
|
||||
-- se primo è foro e secondo è un ribasso, il foro va sempre prima
|
||||
if Drill.Identify(B1) and LapJoint.Identify(B2) and
|
||||
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
||||
return true
|
||||
end
|
||||
-- se primo è birdsmouth e secondo è il suo foro, il birdsmouth va sempre dopo
|
||||
if LapJoint.Identify(B1) and Drill.Identify(B2) and B1.AdjId == B2.Id then
|
||||
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo
|
||||
if LapJoint.Identify(B1) and Drill.Identify(B2) and
|
||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||
return false
|
||||
end
|
||||
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
|
||||
@@ -1363,6 +1370,108 @@ local function MoveDrillsOnTenon( vProc)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Estrazione parametri P da lavorazioni di tipo DtMortise
|
||||
local function GetPParametersDtMortise( Proc)
|
||||
local vPParameters = {
|
||||
{ 'P01', 'd'},
|
||||
{ 'P02', 'd'},
|
||||
{ 'P03', 'd'},
|
||||
{ 'P04', 'i'},
|
||||
{ 'P05', 'i'},
|
||||
{ 'P06', 'd'},
|
||||
{ 'P07', 'd'},
|
||||
{ 'P09', 'd'},
|
||||
{ 'P10', 'd'},
|
||||
{ 'P11', 'd'},
|
||||
{ 'P12', 'd'},
|
||||
{ 'P13', 'd'},
|
||||
{ 'P14', 'd'},
|
||||
{ 'P15', 'd'}
|
||||
}
|
||||
for i = 1, #vPParameters do
|
||||
vPParameter = vPParameters[i]
|
||||
vPParameter[3] = EgtGetInfo( Proc.Id, vPParameter[1], vPParameter[2])
|
||||
end
|
||||
return vPParameters
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Controlla se la feature ProcMirror è la specchiata di Proc, per feature di tipo DtMortise
|
||||
local function CheckMirrorDtMortise( Proc, ProcMirror, dHBeam)
|
||||
local bIsMirror = true
|
||||
local vPParametersProc = GetPParametersDtMortise( Proc)
|
||||
local vPParametersMirror = GetPParametersDtMortise( ProcMirror)
|
||||
local nP02, nP06 = 2, 6
|
||||
-- controllo che i parametri P delle due feature, tranne P02 e P06, siano uguali
|
||||
for i = 1, #vPParametersProc do
|
||||
local vPParameterProc = vPParametersProc[i]
|
||||
local vPParameterMirror = vPParametersMirror[i]
|
||||
if vPParameterProc[1] ~= 'P02' and vPParameterProc[1] ~= 'P06'then
|
||||
bIsMirror = ( abs( vPParameterProc[3] - vPParameterMirror[3]) < 100 * GEO.EPS_SMALL)
|
||||
if bIsMirror == false then break end
|
||||
elseif vPParameterProc[1] == 'P02' then
|
||||
nP02 = i
|
||||
elseif vPParameterProc[1] == 'P06' then
|
||||
nP06 = i
|
||||
end
|
||||
end
|
||||
-- se gli altri parametri P sono uguali, verifico che P02 e P06 siano compatibili con feature specchiate
|
||||
if bIsMirror == true then
|
||||
bIsMirror = ( ( vPParametersProc[nP02][3] == 0 and abs( vPParametersMirror[nP02][3] - dHBeam) < 100 * GEO.EPS_SMALL) and
|
||||
( vPParametersProc[nP06][3] == 90 and vPParametersMirror[nP06][3] == -90)) or
|
||||
( ( vPParametersMirror[nP02][3] == 0 and abs( vPParametersProc[nP02][3] - dHBeam) < 100 * GEO.EPS_SMALL) and
|
||||
( vPParametersMirror[nP06][3] == 90 and vPParametersProc[nP06][3] == -90))
|
||||
end
|
||||
return bIsMirror
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Cerca se esiste una feature specchiata di Proc e nel caso ne restituisce la posizione in vProc
|
||||
local function FindMirrorFeature( vProc, Proc, sFeatureType, dHBeam)
|
||||
local nProcMirror
|
||||
-- se mortasa a coda di rondine
|
||||
if sFeatureType == 'DtMortise' then
|
||||
Proc.Side = EgtGetInfo( Proc.Id, 'SIDE', 'i')
|
||||
for i = 1, #vProc do
|
||||
local ProcMirror = vProc[i]
|
||||
if DtMortise.SideIdentify(ProcMirror) then
|
||||
ProcMirror.Side = EgtGetInfo( ProcMirror.Id, 'SIDE', 'i')
|
||||
if ( Proc.Side == 1 and ProcMirror.Side == 3) or ( Proc.Side == 3 and ProcMirror.Side == 1) or
|
||||
( Proc.Side == 2 and ProcMirror.Side == 4) or ( Proc.Side == 4 and ProcMirror.Side == 2) then
|
||||
local bIsMirror = CheckMirrorDtMortise( Proc, ProcMirror, dHBeam)
|
||||
if bIsMirror then nProcMirror = i end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se foratura (da implementare)
|
||||
return nProcMirror
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- Cerca in vProc la presenza di feature specchiate. Se le trova scrive in Proc e nelle info l'Id della specchiata.
|
||||
local function SetMirroredFeatures( vProc, dHBeam)
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
local sFeatureType
|
||||
if DtMortise.SideIdentify(Proc) then
|
||||
sFeatureType = 'DtMortise'
|
||||
elseif Drill.Identify(Proc) then
|
||||
sFeatureType = 'Drill'
|
||||
end
|
||||
if ( sFeatureType == 'DtMortise' or sFeatureType == 'Drill') and not Proc.MirrorId then
|
||||
local nProcMirror = FindMirrorFeature( vProc, Proc, sFeatureType, dHBeam)
|
||||
if nProcMirror then
|
||||
Proc.MirrorId = vProc[nProcMirror].Id
|
||||
vProc[nProcMirror].MirrorId = Proc.Id
|
||||
EgtSetInfo( Proc.Id, 'MIRRORID', vProc[nProcMirror].Id)
|
||||
EgtSetInfo( vProc[nProcMirror].Id, 'MIRRORID', Proc.Id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- verifica se ci sono forature da lavorare dopo tagli di testa o coda e nel caso le classifica come Head o Tail e gli assegna l'Id della rispettiva feature di taglio
|
||||
local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
|
||||
@@ -1457,6 +1566,11 @@ function BeamExec.ProcessFeatures()
|
||||
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
|
||||
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
|
||||
end
|
||||
-- verifica presenza di feature specchiate per eventuali lavorazioni simultanee
|
||||
local bConcurrentDoubleHead = BD.DOUBLE_HEAD_MIRRORED_FEATURES and ( BD.TWO_EQUAL_HEADS or BD.TWO_UP_DOWN_HEADS)
|
||||
if bConcurrentDoubleHead then
|
||||
SetMirroredFeatures( vProc, EgtGetRawPartBBox( nRawId):getDimZ())
|
||||
end
|
||||
-- le ordino lungo X
|
||||
OrderFeatures( vProc, b3Raw)
|
||||
-- le classifico
|
||||
@@ -1545,7 +1659,7 @@ function BeamExec.ProcessFeatures()
|
||||
sDownOrSideOrStd = 'SIDE'
|
||||
-- vettore movimento grezzi per rotazione di 90deg
|
||||
local dDeltaYZ = EgtGetRawPartBBox( nRawId):getDimY() - EgtGetRawPartBBox( nRawId):getDimZ()
|
||||
local vtMove = Vector3d( 0, dDeltaYZ / 2, dDeltaYZ / 2)
|
||||
local vtMove = Vector3d( 0, dDeltaYZ / 2 * EgtIf( BD.RIGHT_LOAD, -1, 1), dDeltaYZ / 2)
|
||||
local bPreMove = ( dDeltaYZ < 0)
|
||||
-- ruoto le travi della fase corrente
|
||||
local nRId = nRawId
|
||||
|
||||
+3
-2
@@ -377,12 +377,13 @@ end
|
||||
-- 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)
|
||||
-- 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
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
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 OffsetP = dMaxDimDice -- distanza tra i piani paralleli
|
||||
local StepP = 100 -- numero massimo di piani paralleli da generare
|
||||
|
||||
+39
-22
@@ -2,6 +2,8 @@
|
||||
-- Libreria ricerca lavorazioni per Travi
|
||||
-- 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/11/02 Modificata scelta utensile ottimizzata. Ora se c'è un utensile più grande disponibile si dà preferenza a quello.
|
||||
-- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local MachiningLib = {}
|
||||
@@ -107,8 +109,9 @@ local function SetCurrMachiningAndTool( sMachName)
|
||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local nHead = tonumber( sHead:sub( 2, #sHead))
|
||||
local bH2 = ( nHead >= 21 and nHead <= 29)
|
||||
local bH3 = ( nHead >= 31 and nHead <= 39)
|
||||
local bFixed = ( vFixedHeads[nHead])
|
||||
return bActive, sTool, bH2, bFixed
|
||||
return bActive, sTool, bH2, bFixed, bH3
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -144,7 +147,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyMill( dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
|
||||
local sTuuid = EgtGetMachiningParam( MCH_MP.TUUID)
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
@@ -221,7 +224,7 @@ function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
||||
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH3)
|
||||
if bTopHead == nil and bDownHead == nil then
|
||||
bTopHead = true
|
||||
bDownHead = false
|
||||
@@ -263,6 +266,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
|
||||
MachineHeadUse = TWO_EQUAL_HEADS
|
||||
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
|
||||
local Machining = Machinings[i]
|
||||
local sMachiningType = Machining.Type
|
||||
@@ -270,8 +275,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
||||
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
||||
end
|
||||
-- recupero dati utensile
|
||||
local bToolActive, sToolName, bH2, bFixed = SetCurrMachiningAndTool( Machining.Name)
|
||||
if Machining.On and sMachiningType == sType and bToolActive then
|
||||
local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining.Name)
|
||||
if Machining.On and sMachiningType == sType and bToolActive and ( not bH3 or bH3 == not bExcludeH3) then
|
||||
local bOk, ToolParams = VerifyTool( MachiningType, sType, Params, bH2)
|
||||
if bOk then
|
||||
if MachineHeadUse == ONE_HEAD then
|
||||
@@ -284,22 +289,24 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
-- 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
|
||||
SetNextMachining( sToolName, nActiveHead, bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo
|
||||
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
|
||||
-- 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
|
||||
if not sH1Mach or sH1Mach == '' then
|
||||
sH1Mach = Machining.Name
|
||||
sH1Tool = sToolName
|
||||
sH1Param = ToolParams
|
||||
end
|
||||
if not sH1Mach or sH1Mach == '' then
|
||||
sH1Mach = Machining.Name
|
||||
sH1Tool = sToolName
|
||||
sH1Param = ToolParams
|
||||
end
|
||||
end
|
||||
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
||||
@@ -315,6 +322,16 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
||||
end
|
||||
end
|
||||
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
|
||||
if nActiveHead == 1 then
|
||||
if sH2Mach ~= "" then
|
||||
@@ -369,8 +386,8 @@ function MachiningLib.FindAngleDrilling( dDiam, dDepth, bTopHead, bDownHead)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead)
|
||||
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead)
|
||||
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH3)
|
||||
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH3)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
+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
|
||||
-- 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.
|
||||
@@ -353,9 +353,37 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
vtExtra = X_AX()
|
||||
bAutoCalcSurf = false
|
||||
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
|
||||
if Proc.Box:getDimX() >= dSawThick then
|
||||
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA)
|
||||
if dMaxElev > dSawThick then
|
||||
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
|
||||
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())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2022/08/18
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2022/11/30
|
||||
-- Gestione calcolo forature per Travi
|
||||
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
|
||||
-- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto.
|
||||
@@ -13,6 +13,8 @@
|
||||
-- 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/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.
|
||||
-- 2022/11/23 Aggiunta la gestione dei fori con angolo < 30 gradi, per i quali si usa la testa della macchina per accorciare l'utile di lavoro.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDrill = {}
|
||||
@@ -118,7 +120,7 @@ function ProcessDrill.Split( Proc, b3Raw)
|
||||
local dDiam = 2 * EgtArcRadius( AuxId)
|
||||
local dLen = abs( EgtCurveThickness( AuxId))
|
||||
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)
|
||||
local bTrySplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
|
||||
if not bTrySplit then
|
||||
@@ -266,7 +268,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
local nErrorCode = 0
|
||||
-- abilitazione foratura da sotto
|
||||
local bDrillDown = ( bDownDrill and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259))
|
||||
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.5)
|
||||
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.421)
|
||||
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown)
|
||||
@@ -368,11 +370,15 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
-- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 2) * TgA
|
||||
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
|
||||
-- Per fori molto inclinati ( < 30 gradi) si usa la testa della macchina per l'accorciamento. Fast esclusa
|
||||
if BD.C_SIMM and CosB > 0.866 then
|
||||
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
|
||||
end
|
||||
local dMaxDepthOri = dMaxDepth
|
||||
dMaxDepth = min( dMaxDepth, dToolFreeLen - dSubL)
|
||||
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
||||
-- Verifico inclinazione foro nei limiti
|
||||
local bTryDrill = ( CosB < BD.DRILL_VX_MAX)
|
||||
local bTryDrill = EgtIf( dMaxDepth > 0, ( CosB < BD.DRILL_VX_MAX), false)
|
||||
if ( CosB > 0.8 * BD.DRILL_VX_MAX and CosB < BD.DRILL_VX_MAX_ANGLEDRILL) then
|
||||
-- cerco le forature speciali AngleDrill
|
||||
local sDrilling3, sType3, dMaxDepth3 = ML.FindAngleDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
|
||||
-- 2022/06/01 Modifiche per evitare di entrare nel legno con mortase parziali.
|
||||
-- 2022/08/18 Migliorato calcolo dello step.
|
||||
-- 2022/09/29 Aggiunto riconoscimento della sola feature laterale.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDtMortise = {}
|
||||
@@ -39,6 +40,12 @@ function ProcessDtMortise.FrontIdentify( Proc)
|
||||
return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 56)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della sola feature laterale
|
||||
function ProcessDtMortise.SideIdentify( Proc)
|
||||
return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 55)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Verifica se feature di coda
|
||||
function ProcessDtMortise.IsTailFeature( Proc, b3Raw)
|
||||
|
||||
+110
-25
@@ -1,7 +1,11 @@
|
||||
-- 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
|
||||
-- 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.
|
||||
-- 2022/11/24 In MakeByMill aggiunta la lavorazione sopra/sotto nel caso di testa sotto
|
||||
-- In MakeByMill se BeamData forza lettura codolo da Q questo viene sempre fatto indipendentemente dalle dimensioni della feature
|
||||
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -119,7 +123,7 @@ function ProcessFreeContour.Classify( Proc, b3Raw)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham)
|
||||
local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham, bDownHead)
|
||||
local nChamfer = 0
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
@@ -159,7 +163,11 @@ local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham)
|
||||
-- recupero la lavorazione
|
||||
local sMilling
|
||||
if nChamfer > 0 then
|
||||
sMilling = ML.FindMilling( 'Mark')
|
||||
if bDownHead then
|
||||
sMilling = ML.FindMilling( 'Mark_H2', nil, nil, nil, nil, false, true)
|
||||
else
|
||||
sMilling = ML.FindMilling( 'Mark')
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Mark not found in library'
|
||||
EgtOutLog( sErr)
|
||||
@@ -236,7 +244,6 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local dDepth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
||||
local bToolInv = ( vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
||||
local bDown = ( b3Aux:getMin():getZ() < b3Raw:getMin():getZ() + 5)
|
||||
-- verifico se in testa o coda
|
||||
local bHead = Proc.Head
|
||||
@@ -245,12 +252,14 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- recupero la lavorazione
|
||||
local bTopHead = ( 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
|
||||
local sErr = 'Error : FreeContour not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
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
|
||||
local dToolDiam = 10
|
||||
local dMaxDepth = 0
|
||||
@@ -299,16 +308,18 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
local dOriDepth = dDepth
|
||||
local nDouble = 1
|
||||
local bCanDouble = ( abs( vtExtr:getY()) > abs( vtExtr:getZ()) and bCross)
|
||||
local bCanDouble = ( abs( vtExtr:getY()) > abs( vtExtr:getZ()) and bCross) or ( BD.DOWN_HEAD and bCross)
|
||||
local dDimStrip = BD.DIM_STRIP
|
||||
if dDimStrip < 0 then
|
||||
dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0
|
||||
end
|
||||
local bStripOnSide = false
|
||||
if bCross then
|
||||
if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then
|
||||
-- se forzata da parametro Q il codolo è sempre attivo
|
||||
if dDimStrip > 10 * GEO.EPS_SMALL and ( BD.DIM_STRIP < 0 or nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then
|
||||
-- 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
|
||||
else
|
||||
-- devo affondare un poco oltre
|
||||
@@ -317,7 +328,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
local bIsDepthReduced = false
|
||||
-- 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 forzata da parametro Q il codolo è sempre attivo
|
||||
local dDepthWork = dDepth
|
||||
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and ( BD.DIM_STRIP < 0 or nStep > 1) and
|
||||
bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then
|
||||
nDouble = 2
|
||||
dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth)
|
||||
@@ -326,8 +339,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if dDepth > dMaxDepth then
|
||||
if bCanDouble then
|
||||
nDouble = 2
|
||||
dDepth = min( 0.5 * dDepth, dMaxDepth)
|
||||
if dDepth < 0.5 * dDepth - 10 * GEO.EPS_SMALL then
|
||||
dDepthWork = 0.5 * dDepth
|
||||
dDepth = min( dDepthWork, dMaxDepth)
|
||||
if dDepth < dDepthWork - 10 * GEO.EPS_SMALL then
|
||||
bIsDepthReduced = true
|
||||
end
|
||||
else
|
||||
@@ -339,7 +353,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local sWarn = ''
|
||||
-- se ho ridotto l'altezza emetto warning
|
||||
if bIsDepthReduced then
|
||||
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' (Free Contour) : elevation bigger than max tool depth'
|
||||
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' (Free Contour) : depth (' .. EgtNumToString( dDepthWork, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-
|
||||
@@ -352,14 +366,37 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local dEndAddSpec = 0
|
||||
if Proc.Grp ~= 0 then dEndAddSpec = CalcSpecialAdd( AuxId, false, dToolDiam) end
|
||||
-- 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 dExtra = 2
|
||||
local sChamferDown, sChamferUp
|
||||
if nDouble > 1 and bCanDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
local nChamferDown
|
||||
nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true)
|
||||
if nChamferDown < 0 then
|
||||
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||
sChamferDown = nil
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
local nChamferUp
|
||||
nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false)
|
||||
if nChamferUp < 0 then
|
||||
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||
sChamferUp = nil
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eseguo
|
||||
for i = 1, nStep do
|
||||
-- inserisco la lavorazione
|
||||
local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sNameCh, sChamfer)
|
||||
local sChamferSide1 = EgtIf( bDownHead, sChamferDown, sChamfer)
|
||||
local nMchId = EgtAddMachining( sNameCh, sChamferSide1)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer
|
||||
EgtOutLog( sErr)
|
||||
@@ -368,15 +405,12 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
bDoubleCham = true
|
||||
end
|
||||
if Proc.Grp == 3 then
|
||||
if not bToolInv then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
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.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
@@ -391,7 +425,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
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.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
@@ -400,6 +434,11 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
end
|
||||
if nSide == 0 then
|
||||
bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false)
|
||||
else
|
||||
bDoubleCham = true
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
@@ -439,12 +478,19 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'ChamB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sChamfer)
|
||||
local sChamferSide2
|
||||
if EgtEndsWith( sChamferSide1, 'H2') then
|
||||
sChamferSide2 = sChamferUp
|
||||
elseif nSide == 0 then
|
||||
sChamferSide2 = sChamferDown
|
||||
else
|
||||
sChamferSide2 = sChamfer
|
||||
end
|
||||
nMchId = EgtAddMachining( sName, sChamferSide2)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sChamfer
|
||||
EgtOutLog( sErr)
|
||||
@@ -505,6 +551,31 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- verifico se devo fare sgrossatura più finitura
|
||||
local dOffsetPar = EgtGetInfo( Proc.Id, Q_OVERMAT_FOR_FINISH, 'i') or 0
|
||||
-- nel caso di lavorazioni sopra/sotto cerco lavorazioni specifiche
|
||||
local sMillingDown, sMillingUp
|
||||
if nDouble > 1 and bCanDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
sMillingDown = ML.FindMilling( 'FreeContour_H2', nil, nil, nil, nil, false, true)
|
||||
if not sMillingDown then
|
||||
nDouble = 1
|
||||
dDepth = min( dOriDepth, dMaxDepth)
|
||||
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' (Free Contour) : milling from bottom not found in library' .. '\n' ..
|
||||
'; depth (' .. EgtNumToString( dOriDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
EgtOutLog( sWarn)
|
||||
elseif sMillingDown and not bDownHead then
|
||||
bToolInv = true
|
||||
sMilling = sMillingDown
|
||||
end
|
||||
end
|
||||
sMillingUp = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, true, false)
|
||||
if not sMillingUp then
|
||||
sWarn = 'Warning : milling not found in library'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eseguo
|
||||
for i = 1, nStep do
|
||||
for j = 1, nDouble do
|
||||
@@ -529,7 +600,13 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
else
|
||||
-- inserisco la lavorazione
|
||||
sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
nMchId = EgtAddMachining( sName, sMilling)
|
||||
if EgtEndsWith( sMilling, '_H2') then
|
||||
nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingUp, sMilling))
|
||||
elseif sMillingDown then
|
||||
nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingDown, sMilling))
|
||||
else
|
||||
nMchId = EgtAddMachining( sName, sMilling)
|
||||
end
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
@@ -565,9 +642,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- assegno lato di lavoro
|
||||
if Proc.Grp == 0 then
|
||||
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)
|
||||
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)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
@@ -777,6 +854,14 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
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'
|
||||
elseif Proc.Prc == 30 then
|
||||
Q_DEPTH_CHAMFER = 'Q01'
|
||||
Q_DIM_STRIP = 'Q02'
|
||||
end
|
||||
-- recupero la tipologia
|
||||
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
|
||||
-- se svuotatura
|
||||
|
||||
+86
-68
@@ -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/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/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
|
||||
local ProcessHeadCut = {}
|
||||
@@ -168,11 +169,13 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
local dMaxDepth = 50
|
||||
local dSawThick = 2
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
|
||||
end
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
@@ -181,11 +184,13 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
-- recupero i dati della eventuale seconda lama
|
||||
local dSawDiam2 = 0
|
||||
local dMaxDepth2 = 0
|
||||
local dSawThick2 = 0
|
||||
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
||||
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
||||
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
||||
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
||||
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
|
||||
end
|
||||
end
|
||||
-- caratteristiche taglio
|
||||
@@ -204,14 +209,27 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
-- determino se più tagli con offset
|
||||
local nCuts = max( ceil( dOvmHead / ( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP)), 1)
|
||||
local dOffsL = dOvmHead / nCuts
|
||||
local bFinishByBlade = not bBigSectionCut
|
||||
-- se taglio per sezioni alte e larghe
|
||||
if bBigSectionCut then
|
||||
if dOvmHead > 0 then
|
||||
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
|
||||
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 dMaxElev > dSawThickCheck then
|
||||
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
|
||||
return bOk, sErr
|
||||
end
|
||||
-- se finitura con truciolatore
|
||||
elseif nQ05 == 2 then
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
@@ -227,80 +245,80 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
return false, sErr
|
||||
end
|
||||
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
||||
if not bOk then return bOk, sErr end
|
||||
return bOk, sErr
|
||||
end
|
||||
end
|
||||
end
|
||||
-- tagli standard con lama
|
||||
if bFinishByBlade then
|
||||
if not bDoubleHorizCut then
|
||||
-- flag di lavorazione faccia
|
||||
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = 0
|
||||
local dAccStart = 0
|
||||
local dAccEnd = 0
|
||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
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
|
||||
-- se tagli standard
|
||||
if not bDoubleHorizCut then
|
||||
-- flag di lavorazione faccia
|
||||
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = 0
|
||||
local dAccStart = 0
|
||||
local dAccEnd = 0
|
||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
||||
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
|
||||
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
|
||||
-- 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
|
||||
end
|
||||
-- se necessari tagli in doppio, eseguo gli opposti
|
||||
if bDoubleCut then
|
||||
-- gli accorciamenti vanno invertiti per il taglio opposto
|
||||
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
|
||||
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)
|
||||
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
|
||||
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) and not bBigSectionCut 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
|
||||
return true
|
||||
end
|
||||
|
||||
+77
-33
@@ -1,4 +1,4 @@
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/07/05
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/12/12
|
||||
-- Gestione calcolo mezzo-legno per Travi
|
||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
|
||||
@@ -54,6 +54,9 @@
|
||||
-- 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
|
||||
-- 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.
|
||||
-- 2022/12/12 Default 1000 per BD.MIN_LEN_LAMELLO. In MachineByMill migliorata ricerca utensile e gestione inversione in funzione del lato di lavoro.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLapJoint = {}
|
||||
@@ -155,6 +158,7 @@ local function AssignQIdent( Proc)
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
||||
Q_USE_MILL = 'Q02' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
elseif ( Proc.Grp == 4) and Proc.Prc == 37 then
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
@@ -706,16 +710,10 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
||||
else
|
||||
-- dati della faccia
|
||||
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
local nFac2Ind = EgtIf( nFacInd ~= 0, 0, 1)
|
||||
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFac2Ind, GDB_ID.ROOT)
|
||||
if abs( rfFac:getVersY() * vtN2) < 0.5 then
|
||||
dH, dV = dV, dH
|
||||
rfFac:rotate( rfFac:getOrigin(), rfFac:getVersZ(), 90)
|
||||
end
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
-- se può essere fatto con utensile tipo lama
|
||||
local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc)
|
||||
if bUseBHSideMill then
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if vtN:getZ() > -0.5 or b3Raw:getDimZ() - Proc.Box:getDimZ() < ( BD.MAX_DIST_BH_FROM_BOTTOM or 395) - dTDiam / 2 then
|
||||
return true, false
|
||||
else
|
||||
@@ -723,8 +721,6 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
||||
end
|
||||
-- altrimenti controllo se deve essere ruotato con le altre lavorazioni
|
||||
else
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
-- cerco se c'è faccia adiacente sul lato più lungo
|
||||
local nFaceAdj = GetFaceAdj( Proc, nFacInd, dH, dV) or -1
|
||||
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2)
|
||||
@@ -734,23 +730,24 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
||||
if bDown then
|
||||
local bIsU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
|
||||
-- se forzata la lavorazione con fresa di lato da parametro Q03=2/3 non devo ruotare
|
||||
local bForceSideMill = ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') == 2 or EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') == 3) and ( Proc.Fct == 3 or Proc.Fct == 4))
|
||||
local nSideRoughTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd')
|
||||
local bForceSideMill = ( ( nSideRoughTool == 2 or nSideRoughTool == 3) and ( Proc.Fct == 3 or Proc.Fct == 4))
|
||||
if bForceSideMill then
|
||||
bDown = false
|
||||
elseif nFacInd2 and dElev2 < 2 * dElev then
|
||||
local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
elseif nFacInd2 and dElev2 < 160 and dElev2 < 2 * dElev then
|
||||
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
bDown = ( vtN2:getZ() < BD.NZ_MINB)
|
||||
elseif not nFacInd2 and bIsL and nFaceAdj >= 0 then
|
||||
local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, nFaceAdj, GDB_ID.ROOT)
|
||||
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFaceAdj, GDB_ID.ROOT)
|
||||
bDown = ( vtN2:getZ() < BD.NZ_MINB)
|
||||
end
|
||||
-- verifico se la faccia principale è sottosquadra, ha forma L ed esiste la faccia adiacente
|
||||
elseif vtN:getZ() < -0.2589 and bIsL and nFaceAdj >= 0 then
|
||||
-- box del pezzo
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- se il numero di facce > 2 o il box della feature supera una certa distanza dalle teste allora controllo la z della faccia ausiiaria
|
||||
-- se più di 2 facce o il box della feature supera una certa distanza dalle teste allora controllo Nz della faccia ausiiaria
|
||||
if Proc.Fct > 2 or ( Proc.Box:getMax():getX() < b3Solid:getMin():getX() - 150) or ( Proc.Box:getMin():getX() > b3Solid:getMax():getX() + 150) then
|
||||
local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, nFaceAdj, GDB_ID.ROOT)
|
||||
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFaceAdj, GDB_ID.ROOT)
|
||||
bDown = ( vtN2:getZ() < BD.NZ_MINB)
|
||||
end
|
||||
end
|
||||
@@ -2625,7 +2622,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
for i = 1, #vAdj do
|
||||
if vAdj[i] >= 0 then
|
||||
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 dLen = dist( ptP1, ptP2)
|
||||
if dLen > dMaxLen then
|
||||
@@ -2990,7 +2987,8 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
end
|
||||
end
|
||||
-- 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
|
||||
sWarn = nil
|
||||
if not bReduceDepth and abs(dExtraOffs) > 0 then
|
||||
@@ -3001,7 +2999,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
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
|
||||
local dElev
|
||||
@@ -3119,6 +3117,24 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo
|
||||
return false, sErr
|
||||
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
|
||||
end
|
||||
|
||||
@@ -3144,7 +3160,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
||||
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
||||
-- applico la svuotatura
|
||||
local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, 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
|
||||
-- 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
|
||||
@@ -3224,8 +3240,10 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
local sMilling
|
||||
if nUseRoughTool > 0 then
|
||||
sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk)
|
||||
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
|
||||
else
|
||||
sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk)
|
||||
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut') end
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
|
||||
@@ -3254,8 +3272,9 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, (nSideFace)}})
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- setto inversione del percorso
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
-- sistemazione inversione del percorso
|
||||
local nWrkSide = EgtGetMachiningParam( MCH_MP.WORKSIDE)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, ( nWrkSide ~= MCH_MILL_WS.RIGHT))
|
||||
-- setto a 0 eventuali offset
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
-- calcolo elevazione per allungamenti attacchi con fianchi chiusi
|
||||
@@ -3271,15 +3290,27 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dTDiam / 2)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dTDiam / 2)
|
||||
-- forzo attacco lineare
|
||||
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)
|
||||
end
|
||||
end
|
||||
if bOpenEnd then
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dTDiam / 2)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dTDiam / 2)
|
||||
-- forzo attacco lineare
|
||||
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)
|
||||
end
|
||||
end
|
||||
@@ -4525,7 +4556,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
end
|
||||
-- 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
|
||||
local sName = 'BHMill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
||||
@@ -4555,7 +4586,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
-- 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.LIPERP, dFacElev + BD.CUT_SIC)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
@@ -4576,7 +4607,20 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local nStepType = MCH_MILL_ST.ONEWAY
|
||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, nStepType)
|
||||
-- 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)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -4889,7 +4933,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local nFaces = EgtSurfTmFacetCount( nTestId)
|
||||
while not bExit and nFaces >= 3 do
|
||||
local bDeleteFace
|
||||
nInt = 0
|
||||
local nInt = 0
|
||||
while not bDeleteFace and nInt < nFaces do
|
||||
nInt = nInt + 1
|
||||
local b3Facet = EgtSurfTmGetFacetBBoxGlob( nTestId, nInt-1, GDB_BB.STANDARD)
|
||||
@@ -4916,9 +4960,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- cancello la copia del percorso
|
||||
EgtErase( nTestId)
|
||||
|
||||
if bNewIsU and ( not BD.MIN_LEN_LAMELLO or
|
||||
( Proc.TotBox and Proc.TotBox:getDimX() > BD.MIN_LEN_LAMELLO) or
|
||||
( not Proc.TotBox and Proc.Box:getDimX() > BD.MIN_LEN_LAMELLO)) then
|
||||
if bNewIsU and
|
||||
(( Proc.TotBox and Proc.TotBox:getDimX() > ( BD.MIN_LEN_LAMELLO or 1000)) or
|
||||
( not Proc.TotBox and Proc.Box:getDimX() > ( BD.MIN_LEN_LAMELLO or 1000))) then
|
||||
-- recupero la lavorazione
|
||||
local bDownHead = BD.DOWN_HEAD and vtN:getZ() < BD.NZ_MINA
|
||||
sMillingOnSide = ML.FindMilling( 'SideMillAsBlade_H2', nil, nil, nil, nil, not bDownHead, bDownHead)
|
||||
@@ -5072,7 +5116,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 nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD) 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 bSawDown = ( bMillDown and not bMillUp)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
||||
@@ -5145,7 +5189,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
||||
end
|
||||
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, 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 sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
@@ -5309,7 +5353,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 nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD) 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 bSawDown = ( bMillDown and not bMillUp)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
||||
@@ -5327,7 +5371,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local tvtNx = {}
|
||||
tvtNx[2] = vtN
|
||||
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 sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
|
||||
+56
-15
@@ -1,4 +1,4 @@
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2022/03/07
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2022/11/30
|
||||
-- Gestione calcolo taglio longitudinale per Travi
|
||||
-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale.
|
||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||
@@ -12,6 +12,9 @@
|
||||
-- 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/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali.
|
||||
-- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace.
|
||||
-- 2022/11/28 Correzioni varie per attacco, pulizia spigoli, utilizzo H3
|
||||
-- 2022/11/30 Modifiche su SCC per TURN.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLongCut = {}
|
||||
@@ -859,7 +862,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- recupero la lavorazione
|
||||
local bDownHead = ( nSide == - 1)
|
||||
sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut')
|
||||
local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead)
|
||||
local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1
|
||||
local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead, bExcludeH3)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling '..sMchType..' not found in library'
|
||||
EgtOutLog( sErr)
|
||||
@@ -884,11 +888,22 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
if bLimXmin and bLimXmax and Proc.Box:getDimX() < 2 * dToolDiam then
|
||||
return MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- determino l'utilizzo della faccia
|
||||
local nFaceUse = EgtIf( abs( vtN:getY()) > 0.01, MCH_MILL_FU.ORTHO_DOWN, EgtIf( bFront, MCH_MILL_FU.ORTHO_FRONT, MCH_MILL_FU.ORTHO_BACK))
|
||||
-- determino il lato di attacco (0:xMin, 1:xMax)
|
||||
local nStartSide = 0
|
||||
if nFaceUse == MCH_MILL_FU.ORTHO_DOWN and not bFront then
|
||||
nStartSide = 1
|
||||
elseif nFaceUse ~= MCH_MILL_FU.ORTHO_DOWN then
|
||||
if ( bFront and nSide == -1) or ( not bFront and nSide == 1) then
|
||||
nStartSide = 1
|
||||
end
|
||||
end
|
||||
-- determino gli estremi
|
||||
local dStartDist = 0
|
||||
local dStartAccDist = BD.LONGCUT_ENDLEN
|
||||
local bStartFixed = true
|
||||
if ( bLimXmin and bFront) or ( bLimXmax and not bFront) then
|
||||
if ( bLimXmin and nStartSide == 0) or ( bLimXmax and nStartSide == 1) then
|
||||
dStartDist = dToolDiam / 2
|
||||
dStartAccDist = BD.LONGCUT_MAXLEN
|
||||
bStartFixed = false
|
||||
@@ -896,7 +911,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
local dEndDist = 0
|
||||
local dEndAccDist = BD.LONGCUT_ENDLEN
|
||||
local bEndFixed = true
|
||||
if ( bLimXmin and not bFront) or ( bLimXmax and bFront) then
|
||||
if ( bLimXmin and nStartSide == 1) or ( bLimXmax and nStartSide == 0) then
|
||||
dEndDist = dToolDiam / 2
|
||||
dEndAccDist = BD.LONGCUT_MAXLEN
|
||||
bEndFixed = false
|
||||
@@ -961,18 +976,20 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
dEndAccDist = 0
|
||||
end
|
||||
end
|
||||
-- determino l'utilizzo della faccia
|
||||
local nFaceUse = EgtIf( abs( vtN:getY()) > 0.01, MCH_MILL_FU.ORTHO_DOWN, EgtIf( bFront, MCH_MILL_FU.ORTHO_FRONT, MCH_MILL_FU.ORTHO_BACK))
|
||||
-- si percorre il lato basso della faccia
|
||||
local nM = 0
|
||||
local nCountMilHead = 0
|
||||
for i = 1, nC do
|
||||
-- Posizione braccio portatesta
|
||||
local nSCC
|
||||
if bFront then
|
||||
nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
if not BD.TURN then
|
||||
if bFront then
|
||||
nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
else
|
||||
nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
else
|
||||
nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM))
|
||||
end
|
||||
-- ciclo sulle passate
|
||||
local nO = 1
|
||||
@@ -993,6 +1010,22 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- correggo l'attacco se necessario
|
||||
if i == 1 and not bStartFixed then
|
||||
if nO == 1 or EgtGetMachiningParam( MCH_MP.LITANG) ~= 0 then
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20)
|
||||
end
|
||||
elseif i == nC and not bEndFixed then
|
||||
if nO == 1 or EgtGetMachiningParam( MCH_MP.LOTANG) ~= 0 then
|
||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20)
|
||||
end
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
||||
-- limito opportunamente la lavorazione
|
||||
@@ -1021,16 +1054,20 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
-- eventuale lavorazione della faccia limitante l'inizio
|
||||
if i == 1 and not bStartFixed then
|
||||
local vtIni = EgtIf( bFront, X_AX(), -X_AX())
|
||||
-- per il lato sotto il vettore è opposto
|
||||
local vtIni = EgtIf( bFront, X_AX(), -X_AX())
|
||||
if nSide == -1 then
|
||||
vtIni = -1 * vtIni
|
||||
end
|
||||
for j = 1, Proc.Fct - 1 do
|
||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||
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
|
||||
end
|
||||
end
|
||||
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
|
||||
end
|
||||
end
|
||||
@@ -1038,16 +1075,20 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
|
||||
-- eventuale lavorazione della faccia limitante la fine
|
||||
if not bEndFixed then
|
||||
local vtFin = EgtIf( bFront, -X_AX(), X_AX())
|
||||
-- per il lato sotto il vettore è opposto
|
||||
local vtFin = EgtIf( bFront, -X_AX(), X_AX())
|
||||
if nSide == -1 then
|
||||
vtFin = -1 * vtFin
|
||||
end
|
||||
for j = 1, Proc.Fct - 1 do
|
||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||
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
|
||||
end
|
||||
end
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2022/06/29
|
||||
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2022/11/30
|
||||
-- Gestione calcolo doppio taglio longitudinale per Travi
|
||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||
-- 2021/06/29 Corretta gestione caso equivalente a due smussi.
|
||||
@@ -9,6 +9,7 @@
|
||||
-- 2022/03/20 Tolta da scelta milling tipo Long2CutDown controllo max diametro fresa.
|
||||
-- 2022/05/27 Corretto ordine per casi sui lati.
|
||||
-- 2022/06/29 Corretto calcolo lunghezza attacco/uscita perpendicolare per lavorazioni di fianco.
|
||||
-- 2022/11/30 Modifiche su SCC per TURN.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLong2Cut = {}
|
||||
@@ -1048,11 +1049,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
else
|
||||
if nSide == 1 then
|
||||
nSCC = EgtIf( vtN[vOrd[i]]:getY() < -0.5, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
nSCC = EgtIf( vtN[vOrd[i]]:getY() < 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
elseif nSide == -1 then
|
||||
nSCC = EgtIf( vtN[vOrd[i]]:getY() < 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
nSCC = EgtIf( vtN[vOrd[i]]:getZ() < 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+20
-15
@@ -1,7 +1,8 @@
|
||||
-- ProcessMark.lua by Egaltech s.r.l. 2022/06/07
|
||||
-- ProcessMark.lua by Egaltech s.r.l. 2022/12/05
|
||||
-- Gestione calcolo marcatura per Travi
|
||||
-- 2020/05/28 Tipo di lavorazione passato da Mark a Text.
|
||||
-- 2021/05/03 Aggiunta gestione testa da sotto.
|
||||
-- 2022/12/05 Aggiunta gestione tipo di lavorazione Text_AT.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessMark = {}
|
||||
@@ -37,6 +38,12 @@ function ProcessMark.Classify( Proc)
|
||||
end
|
||||
-- verifico se la marcatura è lavorabile solo da sotto
|
||||
local bDown = (( vtN:getZ() < -0.1))
|
||||
-- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione
|
||||
if bDown and BD.ANG_TRASM then
|
||||
if ML.FindMilling( 'Text_AT') then
|
||||
bDown = false
|
||||
end
|
||||
end
|
||||
return true, bDown
|
||||
end
|
||||
|
||||
@@ -55,25 +62,25 @@ function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- verifico sia una curva/testo
|
||||
if not vtExtr then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Mark with geometry type not accepted'
|
||||
local sErr = 'Error : Mark with geometry type not accepted'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico che la marcatura non sia orientata verso il basso (-5 deg)
|
||||
if vtExtr:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.TURN then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Mark from bottom impossible'
|
||||
if vtExtr:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.ANG_TRASM and not BD.TURN then
|
||||
local sErr = 'Error : Mark from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
|
||||
local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
|
||||
local bMillAngTrasm = ( BD.ANG_TRASM and vtExtr:getZ() < -0.1)
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'Text'
|
||||
--local sMchExt = EgtIf( bMillDown, '_H2', '')
|
||||
local sMillType = EgtIf( not bMillAngTrasm, 'Text', 'Text_AT')
|
||||
local sMilling = ML.FindMilling( sMillType, nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
if not sMilling then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -88,11 +95,13 @@ function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, -1}})
|
||||
-- imposto posizione braccio porta testa
|
||||
if vtExtr:getY() <= 0 then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if bMillAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
nSCC = EgtIf( vtExtr:getY() <= 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -112,11 +121,7 @@ function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- imposto posizione braccio porta testa
|
||||
if vtExtr:getY() <= 0 then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
+18
-14
@@ -1,4 +1,4 @@
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2021/12/01
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2022/12/12
|
||||
-- Gestione calcolo mortase per Travi
|
||||
-- 2021/07/20 Aggiunta gestione rinvio angolare su FAST.
|
||||
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
|
||||
@@ -6,6 +6,7 @@
|
||||
-- 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.
|
||||
-- 2022/12/12 Migliorato controllo necessità CleanCorners.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessMortise = {}
|
||||
@@ -141,20 +142,21 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Pulizia angoli nel caso sia settato il parametro P04=1
|
||||
local function CleanCorners( Proc, dMorH, vtN, bDoubleDir, AuxId)
|
||||
-- verifico se è attiva la pulizia e se l'orientamento della feature è adeguato
|
||||
local bCleanCorners = ( EgtGetInfo( Proc.Id, 'P04', 'i') == 1 and
|
||||
( AreSameOrOppositeVectorApprox( vtN, X_AX()) or
|
||||
AreSameOrOppositeVectorApprox( vtN, Y_AX()) or
|
||||
AreSameOrOppositeVectorApprox( vtN, Z_AX())))
|
||||
-- verifico se l'orientamento della feature è adeguato
|
||||
local bCleanCorners = ( AreSameOrOppositeVectorApprox( vtN, X_AX()) or
|
||||
AreSameOrOppositeVectorApprox( vtN, Y_AX()) or
|
||||
AreSameOrOppositeVectorApprox( vtN, Z_AX()))
|
||||
if not bCleanCorners then
|
||||
EgtOutLog( 'Warning: mortising not aligned with XYZ axes, corner cleaning skipped')
|
||||
return
|
||||
local sWarn = 'Warning: mortising not aligned with XYZ axes, corner cleaning skipped'
|
||||
EgtOutLog( sWarn)
|
||||
return true, sWarn
|
||||
end
|
||||
-- cerco la lavorazione adatta
|
||||
local sMortisingCleanCorners = ML.FindSawing( 'Mortising')
|
||||
if not sMortisingCleanCorners then
|
||||
EgtOutLog( 'Warning: mortising tool not found, corner cleaning skipped')
|
||||
return
|
||||
local sWarn = 'Warning: mortising tool not found, corner cleaning skipped'
|
||||
EgtOutLog( sWarn)
|
||||
return true, sWarn
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawWidth = 50
|
||||
@@ -565,10 +567,12 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- verifico se necessaria la pulizia degli angoli ( tenone ad angoli non raggiati) e applico nel caso
|
||||
local _, sWarn2 = CleanCorners( Proc, dMorH, vtN, bOpenBtm and not bForceOneSide, AuxId)
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
if ( EgtGetInfo( Proc.Id, 'P04', 'i') == 1) then
|
||||
local _, sWarn2 = CleanCorners( Proc, dMorH, vtN, bOpenBtm and not bForceOneSide, AuxId)
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
end
|
||||
end
|
||||
|
||||
return true, sWarn
|
||||
|
||||
@@ -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
|
||||
-- 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.
|
||||
@@ -8,6 +8,7 @@
|
||||
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
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
|
||||
-- recupero la lavorazione di fresatura
|
||||
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
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
bMillDown = ( bMillDown and bH2)
|
||||
-- Recupero i dati dell'utensile
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
|
||||
+64
-52
@@ -10,6 +10,7 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local DC = require( 'DiceCut')
|
||||
local FreeContour = require( 'ProcessFreeContour')
|
||||
|
||||
EgtOutLog( ' ProcessRidgeLap started', 1)
|
||||
|
||||
@@ -26,8 +27,10 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Classificazione della feature
|
||||
function ProcessRidgeLap.Classify( Proc, b3Raw)
|
||||
-- se PF con testa da sotto, ammessa qualunque orientazione
|
||||
if BD.C_SIMM and BD.DOWN_HEAD then
|
||||
-- se forzato utilizzo fresa non ruoto la trave
|
||||
local bForceSideMill = ( EgtGetInfo( Proc.Id, 'Q04', 'd') or 0) > 0
|
||||
-- se PF con testa da sotto oppure forzato utilizzo fresa, ammessa qualunque orientazione
|
||||
if ( BD.C_SIMM and BD.DOWN_HEAD) or bForceSideMill then
|
||||
return true, false
|
||||
end
|
||||
-- Se più corta del limite si può fare anche da sotto
|
||||
@@ -137,59 +140,68 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||
local vCuts = {}
|
||||
if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then
|
||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], false, ptC[vFaceOrd[2]], vtN[vFaceOrd[2]])
|
||||
end
|
||||
if #vCuts > 0 then
|
||||
-- sistemo posizione nel DB e nome
|
||||
for i = 1, #vCuts do
|
||||
for j = 1, #vCuts[i] do
|
||||
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
|
||||
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)
|
||||
if not bOk then return bOk, sErr end
|
||||
else
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- calcolo riferimenti per facce inclinate
|
||||
local vtRef = Vector3d( vtN[vFaceOrd[3]])
|
||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||
-- eseguo
|
||||
for i = 1, #vCuts do
|
||||
local nOrthoOpposite
|
||||
if i % 2 == 1 then
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
|
||||
else
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef2)
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||
local vCuts = {}
|
||||
if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then
|
||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], false, ptC[vFaceOrd[2]], vtN[vFaceOrd[2]])
|
||||
end
|
||||
if #vCuts > 0 then
|
||||
-- sistemo posizione nel DB e nome
|
||||
for i = 1, #vCuts do
|
||||
for j = 1, #vCuts[i] do
|
||||
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- taglio sulla faccia interna
|
||||
if vFaceOrd[2] ~= 0 then
|
||||
-- inserisco la lavorazione
|
||||
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtN[vFaceOrd[3]])
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- taglio sulla faccia intermedia
|
||||
if vFaceOrd[3] ~= 0 then
|
||||
-- inserisco la lavorazione
|
||||
local nOrthoOpposite = BL.GetNearestOrthoOpposite( EgtIf( bHead, X_AX(), -X_AX()))
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- calcolo riferimenti per facce inclinate
|
||||
local vtRef = Vector3d( vtN[vFaceOrd[3]])
|
||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||
-- eseguo
|
||||
for i = 1, #vCuts do
|
||||
local nOrthoOpposite
|
||||
if i % 2 == 1 then
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
|
||||
else
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef2)
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- taglio sulla faccia interna
|
||||
if vFaceOrd[2] ~= 0 then
|
||||
-- inserisco la lavorazione
|
||||
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtN[vFaceOrd[3]])
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- taglio sulla faccia intermedia
|
||||
if vFaceOrd[3] ~= 0 then
|
||||
-- inserisco la lavorazione
|
||||
local nOrthoOpposite = BL.GetNearestOrthoOpposite( EgtIf( bHead, X_AX(), -X_AX()))
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- aggiornamento ingombro di testa o coda
|
||||
|
||||
@@ -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
|
||||
-- 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)
|
||||
@@ -173,7 +173,11 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
||||
if vtO then
|
||||
vtOrthoO = Vector3d( vtO)
|
||||
else
|
||||
vtOrthoO = Y_AX()
|
||||
if vtN[vFaceOrd[4]]:getZ() < 0.1 then
|
||||
vtOrthoO = Z_AX()
|
||||
else
|
||||
vtOrthoO = Y_AX()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -310,10 +314,12 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
local dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
|
||||
@@ -346,7 +352,6 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
||||
nGoodFace4 = EgtSurfTmFacetCount( nFace4)
|
||||
@@ -356,21 +361,27 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
||||
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 #vCuts == 0 then
|
||||
-- se ho la faccia intermedia, per prima cosa verifico se ho intersezione con la faccia tappo
|
||||
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
|
||||
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)
|
||||
if vFaceOrd[3] ~= 0 then
|
||||
-- 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)
|
||||
if not bOkd then return bOkd, sErrD end
|
||||
end
|
||||
-- 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
|
||||
else -- altrimenti se ho intersezione forzo il DiceCut ad essere eseguito con distanze più piccole
|
||||
-- altrimenti se ho intersezione forzo il DiceCut ad essere eseguito con distanze più piccole
|
||||
else
|
||||
-- definisco la nuova dimensione massima del dice cut
|
||||
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)
|
||||
if not bOkd then return bOkd, sErrD 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
|
||||
-- taglio sulla faccia interna
|
||||
if vFaceOrd[1] ~= 0 then
|
||||
|
||||
+121
-108
@@ -2,6 +2,7 @@
|
||||
-- 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/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
|
||||
local ProcessSimpleScarf = {}
|
||||
@@ -12,6 +13,7 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local DC = require( 'DiceCut')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local FreeContour = require( 'ProcessFreeContour')
|
||||
|
||||
EgtOutLog( ' ProcessSimpleScarf started', 1)
|
||||
|
||||
@@ -28,11 +30,13 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Classificazione della feature
|
||||
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
|
||||
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
||||
for i = 1, nFacetCnt do
|
||||
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
|
||||
end
|
||||
end
|
||||
@@ -188,117 +192,126 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
|
||||
-- inserimento smussi
|
||||
local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOkc then return bOkc, sErrC end
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( 'HeadSide')
|
||||
if not sCutting then
|
||||
local sErr = 'Error : cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
end
|
||||
end
|
||||
-- taglio sulla faccia esterna
|
||||
if vFaceOrd[1] ~= 0 then
|
||||
-- in generale va fatto
|
||||
local bCut = true
|
||||
-- se di testa e coincide con inizio grezzo, non va fatto
|
||||
if bHead and AreSameVectorApprox( vtN[vFaceOrd[1]], X_AX()) and abs( ptC[vFaceOrd[1]]:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||
bCut = false
|
||||
end
|
||||
-- se di coda e coincide con taglio di separazione, non va fatto
|
||||
if not bHead and AreSameVectorApprox( vtN[vFaceOrd[1]], - X_AX()) and abs( ptC[vFaceOrd[1]]:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||
bCut = false
|
||||
end
|
||||
-- se va fatto, inserisco la lavorazione
|
||||
if bCut then
|
||||
local vtOrthoO = Vector3d( vtRef)
|
||||
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sNameOrErr end
|
||||
end
|
||||
end
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||
local vCuts = {}
|
||||
if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then
|
||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], false, ptC[vFaceOrd[2]], vtN[vFaceOrd[2]])
|
||||
elseif vFaceOrd[3] ~= 0 then
|
||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], true)
|
||||
end
|
||||
if #vCuts > 0 then
|
||||
-- sistemo posizione nel DB e nome
|
||||
for i = 1, #vCuts do
|
||||
for j = 1, #vCuts[i] do
|
||||
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
|
||||
end
|
||||
end
|
||||
-- calcolo secondo riferimento per testa o coda
|
||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||
-- eseguo
|
||||
for i = 1, #vCuts do
|
||||
local vtOrthoO
|
||||
if i % 2 == 1 then
|
||||
vtOrthoO = Vector3d( vtRef)
|
||||
else
|
||||
if #vCuts[i-1] > 0 then
|
||||
vtOrthoO = Vector3d( EgtIf( vtRef2, vtRef2, vtRef))
|
||||
else
|
||||
local vtO
|
||||
for j = 1, #vCuts[i-1] do
|
||||
_, vtO = EgtSurfTmFacetCenter( vCuts[i-1][j], 0, GDB_ID.ROOT)
|
||||
break
|
||||
end
|
||||
if vtO then
|
||||
vtOrthoO = Vector3d( vtO)
|
||||
else
|
||||
vtOrthoO = Y_AX()
|
||||
end
|
||||
end
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
end
|
||||
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)
|
||||
if not bOk then return bOk, sErr end
|
||||
else
|
||||
-- taglio sulla faccia interna
|
||||
local bIntCut = false
|
||||
if vFaceOrd[2] ~= 0 then
|
||||
-- inserisco la lavorazione
|
||||
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
|
||||
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sNameOrErr end
|
||||
if #sNameOrErr > 0 then bIntCut = true end
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( 'HeadSide')
|
||||
if not sCutting then
|
||||
local sErr = 'Error : cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- taglio sulla faccia intermedia
|
||||
if vFaceOrd[3] ~= 0 then
|
||||
-- calcolo secondo testa o coda
|
||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||
-- se non ho il taglio sulla faccia interna
|
||||
if not bIntCut then
|
||||
local frHV, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, vFaceOrd[3] - 1)
|
||||
if DimV > DimH then
|
||||
vtRef2 = Vector3d( frHV:getVersX())
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
end
|
||||
end
|
||||
-- taglio sulla faccia esterna
|
||||
if vFaceOrd[1] ~= 0 then
|
||||
-- in generale va fatto
|
||||
local bCut = true
|
||||
-- se di testa e coincide con inizio grezzo, non va fatto
|
||||
if bHead and AreSameVectorApprox( vtN[vFaceOrd[1]], X_AX()) and abs( ptC[vFaceOrd[1]]:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||
bCut = false
|
||||
end
|
||||
-- se di coda e coincide con taglio di separazione, non va fatto
|
||||
if not bHead and AreSameVectorApprox( vtN[vFaceOrd[1]], - X_AX()) and abs( ptC[vFaceOrd[1]]:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||
bCut = false
|
||||
end
|
||||
-- se va fatto, inserisco la lavorazione
|
||||
if bCut then
|
||||
local vtOrthoO = Vector3d( vtRef)
|
||||
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sNameOrErr end
|
||||
end
|
||||
end
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||
local vCuts = {}
|
||||
if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then
|
||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], false, ptC[vFaceOrd[2]], vtN[vFaceOrd[2]])
|
||||
elseif vFaceOrd[3] ~= 0 then
|
||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], true)
|
||||
end
|
||||
if #vCuts > 0 then
|
||||
-- sistemo posizione nel DB e nome
|
||||
for i = 1, #vCuts do
|
||||
for j = 1, #vCuts[i] do
|
||||
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
|
||||
end
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- calcolo secondo riferimento per testa o coda
|
||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||
-- eseguo
|
||||
for i = 1, #vCuts do
|
||||
local vtOrthoO
|
||||
if i % 2 == 1 then
|
||||
vtOrthoO = Vector3d( vtRef)
|
||||
else
|
||||
if #vCuts[i-1] > 0 then
|
||||
vtOrthoO = Vector3d( EgtIf( vtRef2, vtRef2, vtRef))
|
||||
else
|
||||
local vtO
|
||||
for j = 1, #vCuts[i-1] do
|
||||
_, vtO = EgtSurfTmFacetCenter( vCuts[i-1][j], 0, GDB_ID.ROOT)
|
||||
break
|
||||
end
|
||||
if vtO then
|
||||
vtOrthoO = Vector3d( vtO)
|
||||
else
|
||||
vtOrthoO = Y_AX()
|
||||
end
|
||||
end
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- taglio sulla faccia interna
|
||||
local bIntCut = false
|
||||
if vFaceOrd[2] ~= 0 then
|
||||
-- inserisco la lavorazione
|
||||
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
|
||||
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sNameOrErr end
|
||||
if #sNameOrErr > 0 then bIntCut = true end
|
||||
end
|
||||
-- taglio sulla faccia intermedia
|
||||
if vFaceOrd[3] ~= 0 then
|
||||
-- calcolo secondo testa o coda
|
||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||
-- se non ho il taglio sulla faccia interna
|
||||
if not bIntCut then
|
||||
local frHV, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, vFaceOrd[3] - 1)
|
||||
if DimV > DimH then
|
||||
vtRef2 = Vector3d( frHV:getVersX())
|
||||
end
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- aggiornamento ingombro di testa o coda
|
||||
|
||||
+114
-83
@@ -1,10 +1,13 @@
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2022/08/18
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2022/11/30
|
||||
-- Gestione calcolo tagli di separazione per Travi
|
||||
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make.
|
||||
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
||||
-- 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/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
|
||||
-- 2022/11/16 Correzioni per travi larghe
|
||||
-- 2022/11/30 Correzione per tagli su grandi sezioni (dopo taglio con sega a catena senza finitura aggiungeva uno split con lama).
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessSplit = {}
|
||||
@@ -256,11 +259,13 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
local dMaxDepth = 50
|
||||
local dSawThick = 2
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
|
||||
end
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
@@ -269,11 +274,13 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
-- recupero i dati della eventuale seconda lama
|
||||
local dSawDiam2 = 0
|
||||
local dMaxDepth2 = 0
|
||||
local dSawThick2 = 0
|
||||
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
||||
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
||||
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
||||
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
||||
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
|
||||
end
|
||||
end
|
||||
-- caratteristiche taglio
|
||||
@@ -306,7 +313,6 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
end
|
||||
-- se taglio per pezzi alti e larghi
|
||||
local nNewPhase = 0
|
||||
local bFinishByBlade = not bBigSectionCut
|
||||
if bBigSectionCut then
|
||||
local bFinishingNeeded = false
|
||||
if bSplit then
|
||||
@@ -342,6 +348,12 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
-- altrimenti tagli dai due fianchi (dietro e davanti)
|
||||
else
|
||||
local cutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
|
||||
-- se la sega a catena non può completare lo split esco
|
||||
if cutDepth >= min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
|
||||
sErr = 'Error : section too big for splitting'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr, -1
|
||||
end
|
||||
local sNotesSplit = 'Presplit;'
|
||||
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_BACK, cutDepth, sNotesSplit, dOffs)
|
||||
if not bOk then return bOk, sErr, nNewPhase end
|
||||
@@ -384,9 +396,26 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
sNotesFinal = 'Cut;'
|
||||
end
|
||||
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
|
||||
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
|
||||
elseif nQ05 == 2 then
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
@@ -402,95 +431,97 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
return false, sErr
|
||||
end
|
||||
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
||||
if not bOk then return bOk, sErr, nNewPhase end
|
||||
end
|
||||
if sNotesFinal then
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||
if sNotesFinal then
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||
end
|
||||
return bOk, sErr, nNewPhase
|
||||
end
|
||||
else
|
||||
return true, nil, nNewPhase
|
||||
end
|
||||
end
|
||||
-- tagli standard con lama
|
||||
if bFinishByBlade then
|
||||
if not bDoubleHorizCut then
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = 0
|
||||
local dAccStart = 0
|
||||
local dAccEnd = 0
|
||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
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
|
||||
-- se tagli standard
|
||||
if not bDoubleHorizCut then
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = 0
|
||||
local dAccStart = 0
|
||||
local dAccEnd = 0
|
||||
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
|
||||
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
|
||||
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
|
||||
-- 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
|
||||
end
|
||||
-- se necessari tagli in doppio, eseguo gli opposti
|
||||
if bDoubleCut then
|
||||
-- gli accorciamenti vanno invertiti per il taglio opposto
|
||||
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
|
||||
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)
|
||||
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
|
||||
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
|
||||
-- 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
|
||||
-- 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) and not bBigSectionCut 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
|
||||
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
|
||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessStepJoint = {}
|
||||
@@ -83,13 +84,14 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'Mark'
|
||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||
local sMilling
|
||||
sMilling, _, _, bDownHead = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
local sMilling, bH2
|
||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
bDownHead = ( bDownHead and bH2)
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
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
|
||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessStepJointNotch = {}
|
||||
@@ -523,13 +524,14 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'Mark'
|
||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||
local sMilling
|
||||
sMilling, _, _, bDownHead = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
local sMilling, bH2
|
||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
bDownHead = ( bDownHead and bH2)
|
||||
if bExeNormal then
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2022/05/28
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2022/12/12
|
||||
-- Gestione calcolo tenone per Travi
|
||||
-- 2021/10/04 Corretto calcolo HCING per pezzi piccoli.
|
||||
-- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto.
|
||||
-- 2022/05/18 Migliorata gestione attacco.
|
||||
-- 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/11/03 Corretto uso di bH2 (da sotto solo se anche bMillDown vero).
|
||||
-- 2022/12/12 Su macchine con rulli pressori e pinze separate si riduce di meno l'ingombro con tenoni inclinati.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessTenon = {}
|
||||
@@ -224,8 +226,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local OVERLAP_COEFF = 0.7
|
||||
-- porto inizio curva il più possibile sul bordo in alto o in basso
|
||||
local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS
|
||||
local bMyShortPart = ( bShortPart and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
||||
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, bH2 ~= bMyShortPart)
|
||||
local bMyShortPart = ( bShortPart and vtN:getX() < 0 and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
||||
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, EgtIf( bH2 and bMillDown, not bMyShortPart, bMyShortPart))
|
||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||
local sWarn
|
||||
local dDepth = 0
|
||||
@@ -286,7 +288,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
local dDelta = 0
|
||||
if abs( vtN:getY()) < 0.1 and vtN:getZ() > 0.5 then
|
||||
dDelta = - 0.5 * dOffs
|
||||
dDelta = - EgtIf( BD.PRESS_ROLLER, 0.7, 0.5) * dOffs
|
||||
end
|
||||
if bShortPart and b3Raw:getDimZ() < BD.VICE_MINH and abs( vtN:getZ()) > 0.575 then
|
||||
local b3Base = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 0, GDB_BB.STANDARD)
|
||||
@@ -297,7 +299,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
elseif Proc.Tail then
|
||||
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
if abs( vtN:getY()) < 0.1 and vtN:getZ() > 0.5 then
|
||||
dOffs = 0.5 * dOffs
|
||||
dOffs = EgtIf( BD.PRESS_ROLLER, 0.3, 0.5) * dOffs
|
||||
end
|
||||
BL.UpdateTCING( nRawId, dOffs)
|
||||
end
|
||||
|
||||
+19
-10
@@ -1,6 +1,7 @@
|
||||
-- ProcessText.lua by Egaltech s.r.l. 2021/05/03
|
||||
-- ProcessText.lua by Egaltech s.r.l. 2022/12/05
|
||||
-- Gestione calcolo testi per Travi
|
||||
-- 2021/05/03 Aggiunta gestione testa da sotto.
|
||||
-- 2022/12/05 Aggiunta gestione tipo di lavorazione Text_AT.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessText = {}
|
||||
@@ -31,6 +32,12 @@ function ProcessText.Classify( Proc)
|
||||
end
|
||||
-- verifico se il testo è lavorabile solo da sotto
|
||||
local bDown = (( vtN:getZ() < -0.1))
|
||||
-- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione
|
||||
if bDown and BD.ANG_TRASM then
|
||||
if ML.FindMilling( 'Text_AT') then
|
||||
bDown = false
|
||||
end
|
||||
end
|
||||
return true, bDown
|
||||
end
|
||||
|
||||
@@ -41,25 +48,25 @@ function ProcessText.Make( Proc, nPhase, nRawId, nPartId)
|
||||
local vtN = EgtTextNormVersor( Proc.Id, GDB_ID.ROOT)
|
||||
-- verifico sia un testo
|
||||
if not vtN then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Text with geometry type not accepted'
|
||||
local sErr = 'Error : Text with geometry type not accepted'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico che il testo non sia orientato verso il basso (-5 deg)
|
||||
if vtN:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.TURN then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Text from bottom impossible'
|
||||
if vtN:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.ANG_TRASM and not BD.TURN then
|
||||
local sErr = 'Error : Text from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259)
|
||||
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.174)
|
||||
local bMillAngTrasm = ( BD.ANG_TRASM and vtN:getZ() < -0.1)
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'Text'
|
||||
--local sMchExt = EgtIf( bMillDown, '_H2', '')
|
||||
local sMillType = EgtIf( not bMillAngTrasm, 'Text', 'Text_AT')
|
||||
local sMilling = ML.FindMilling( sMillType, nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
if not sMilling then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -74,11 +81,13 @@ function ProcessText.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, -1}})
|
||||
-- imposto posizione braccio porta testa
|
||||
if vtN:getY() <= 0 then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if bMillAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
nSCC = EgtIf( vtN:getY() <= 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
+16
-3
@@ -1,5 +1,7 @@
|
||||
-- BeamNestProcess.lua by Egaltech s.r.l. 2021/06/14
|
||||
-- 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
|
||||
require( 'EgtBase')
|
||||
@@ -168,12 +170,20 @@ end
|
||||
-- Pezzi
|
||||
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
|
||||
for nPartId, nCount in pairs( PART) do
|
||||
-- recupero lunghezza pezzo
|
||||
local Len = EgtGetInfo( nPartId, "L", 'd')
|
||||
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
|
||||
|
||||
-- lunghezza totale pezzi
|
||||
@@ -207,7 +217,10 @@ for ShortIndex = 1, #ShortList do
|
||||
ShortCount = ShortCount + ShortList[ShortIndex].Cnt
|
||||
end
|
||||
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
|
||||
local SingleShortList = {}
|
||||
for ShortIndex = 1, #ShortList do
|
||||
@@ -325,7 +338,7 @@ while nMachGroup do
|
||||
if EgtGetInfo( nMachGroup, "AUTONEST",'i') == 1 then
|
||||
EgtRemoveInfo( nMachGroup, "AUTONEST")
|
||||
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
|
||||
EgtOutLog( 'Error in BatchProcessNew.lua call (' .. ( sErr or '') ..')')
|
||||
end
|
||||
|
||||
+3
-2
@@ -144,10 +144,11 @@ local function MyProcessBeams()
|
||||
end
|
||||
dTotLen = dTotLen + max( vBeam[#vBeam].Box:getDimX(), BD.MinRaw)
|
||||
local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID
|
||||
EgtOutLog( 'Ltot : ' .. EgtNumToString( dTotLen, 1) .. ' Lagg : '.. EgtNumToString( dAddLen, 1), 1)
|
||||
EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1)
|
||||
|
||||
-- Richiedo lunghezza del grezzo e sovramateriale di testa
|
||||
local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='.. EgtNumToString( dTotLen + dAddLen + 0.5, 0) .. ', Lmax=' .. EgtNumToString( BD.MAX_RAW, 0) .. ')',
|
||||
local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0)..
|
||||
', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')',
|
||||
{'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)},
|
||||
{'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)},
|
||||
{'Forza sezione verticale', ' CB:true,*false'})
|
||||
|
||||
Reference in New Issue
Block a user