Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 624a188481 | |||
| 4e77597b7d | |||
| 058babe605 | |||
| a7676c7331 | |||
| f1abaeaac3 | |||
| 5db6398725 | |||
| a8924f4425 | |||
| e4c5a2e06d | |||
| 29ed56df16 | |||
| 6d64f2232d | |||
| e0abdbbe63 | |||
| 45afa144ad | |||
| dc4a0eda3e | |||
| b0cdb95e48 | |||
| 53e8605297 | |||
| d3c2787f81 | |||
| 41e490dcd2 | |||
| 56f66d66c3 | |||
| 7497b62dee | |||
| e67e397225 | |||
| a972fbd425 | |||
| 93b4adfdec | |||
| d5140acc91 | |||
| 1d672af81e | |||
| b197c96a34 | |||
| f3a72a7683 | |||
| 8a79a7838e | |||
| 172fc5180a | |||
| 6064a19a2c | |||
| 5cc85a8735 | |||
| 7af9a9affb | |||
| e26a42dfd9 |
+14
-2
@@ -1,4 +1,4 @@
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2022/08/08
|
||||
-- BeamExec.lua by Egaltech s.r.l. 2022/08/18
|
||||
-- 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.
|
||||
@@ -34,6 +34,7 @@
|
||||
-- controllata tramite il parametro IMPROVE_HEAD_TAIL_DRILLINGS da BeamData. Attivata di default.
|
||||
-- 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.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamExec = {}
|
||||
@@ -391,6 +392,7 @@ end
|
||||
-- *** Inserimento delle travi nel grezzo ***
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function VerifyBigSectionCut( dRawW, dRawH)
|
||||
-- lama principale
|
||||
local sCutting = ML.FindCutting( 'TailSide')
|
||||
local dMaxDepth = 50
|
||||
if EgtMdbSetCurrMachining( sCutting or '') then
|
||||
@@ -400,9 +402,19 @@ local function VerifyBigSectionCut( dRawW, dRawH)
|
||||
end
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
-- eventuale lama su testa sotto
|
||||
local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true)
|
||||
local dMaxDepth2 = 0
|
||||
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
||||
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
||||
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
||||
end
|
||||
end
|
||||
-- verifiche
|
||||
local dDimYRef = EgtIf( dRawH < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||
local bBigSectionCut = ( dRawW > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||
( dRawH > EgtIf( BD.DOWN_HEAD or BD.TURN, 2, 1) * dMaxVertDepth - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
( dRawH > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
return bBigSectionCut
|
||||
end
|
||||
|
||||
|
||||
+16
-7
@@ -12,6 +12,9 @@
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe).
|
||||
-- 2022/06/28 Modificata determinazione taglio bFromBottom in MakeFromTop.
|
||||
-- 2022/07/18 Se Q04=1, aggiunto LongCut anche dal lato per macchine tipo PF1250.
|
||||
-- 2022/08/12 I tagli di lama inclinati in coda ora partono dal centro e non dall'esterno.
|
||||
-- 2022/08/24 Disabilitato il dicing per i tagli meno spessi della lama.
|
||||
-- 2022/08/25 In caso di AdvTail con taglio lungo Y la profondità di lavorazione è opportunamente diminuita.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessCut = {}
|
||||
@@ -344,10 +347,13 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
vtExtra = X_AX()
|
||||
bAutoCalcSurf = false
|
||||
end
|
||||
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA)
|
||||
-- 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())
|
||||
-- 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)
|
||||
-- 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())
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se il ProcessCut viene lanciato dal ProcessSawCut e non ci sono tagli a cubetti, esco
|
||||
@@ -481,14 +487,17 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
else
|
||||
vtOrthoO = -X_AX()
|
||||
end
|
||||
elseif Proc.Head then
|
||||
vtOrthoO = EgtIf( vtN:getY() > -0.02, -Y_AX(), Y_AX())
|
||||
else
|
||||
if vtN:getZ() < dVzLimDwnUp then
|
||||
if vtN:getZ() < dVzLimDwnUp or Proc.Head or Proc.Tail then
|
||||
vtOrthoO = EgtIf( vtN:getY() > -0.02, -Y_AX(), Y_AX())
|
||||
else
|
||||
vtOrthoO = EgtIf( vtN:getY() > 0.02, Y_AX(), -Y_AX())
|
||||
end
|
||||
-- se è una lavorazione da anticipare diminuisco la profondità del taglio per evitare collisioni con l'albero della lama
|
||||
if Proc.AdvTail then
|
||||
local _, dH = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
dCutExtra = min( -BD.ADVANCE_TAIL_OFFS, -dH + dMaxDepth)
|
||||
end
|
||||
end
|
||||
-- taglio
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2022/04/21
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2022/08/18
|
||||
-- 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.
|
||||
@@ -12,6 +12,7 @@
|
||||
-- 2022/07/07 Aggiunta la gestione delle forature migliorate in presenza di feature testa/coda che tagliano tutta la sezione; gli Id delle feature sono nelle proprietà MachineAfterHeadCutId e MachineAfterTailCutId.
|
||||
-- 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.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDrill = {}
|
||||
@@ -231,15 +232,17 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
vtExtr = - vtExtr
|
||||
end
|
||||
local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)
|
||||
-- verifico possibilità di foratura da sotto
|
||||
local bDownDrill = ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true))
|
||||
-- verifico che il foro non sia fattibile solo da sotto
|
||||
local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not BD.DOWN_HEAD)
|
||||
local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill)
|
||||
if bToInvert and ( not bOpen or Proc.Flg ~= 1) then
|
||||
local sErr = 'Error : drilling from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- se non già richiesta inversione e invertibile
|
||||
if not bToInvert and Proc.Flg == 1 and ( -vtExtr:getZ() >= BD.DRILL_VZ_MIN or BD.DOWN_HEAD) then
|
||||
if not bToInvert and Proc.Flg == 1 and ( -vtExtr:getZ() >= BD.DRILL_VZ_MIN or bDownDrill) then
|
||||
-- se il foro è cieco o troppo inclinato all'inizio, lo inverto
|
||||
local _, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
if Proc.Fcs == 0 or ( CosB > BD.DRILL_VX_MAX and bOpen) then
|
||||
@@ -262,8 +265,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
local dCheckDepth2 = dDepth2
|
||||
local nErrorCode = 0
|
||||
-- abilitazione foratura da sotto
|
||||
local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259))
|
||||
local bDrillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.5)
|
||||
local bDrillDown = ( bDownDrill and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259))
|
||||
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.5)
|
||||
-- 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)
|
||||
@@ -479,7 +482,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
local bOk = ML.ApplyMachining( true, false)
|
||||
if not bOk and BD.DOWN_HEAD then
|
||||
if not bOk and bDownDrill then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessDtMortise.lua by Egaltech s.r.l. 2022/06/07
|
||||
-- ProcessDtMortise.lua by Egaltech s.r.l. 2022/08/18
|
||||
-- Gestione calcolo mortase a coda di rondine per Travi
|
||||
-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa.
|
||||
-- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto.
|
||||
@@ -6,6 +6,7 @@
|
||||
-- 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).
|
||||
-- 2022/06/01 Modifiche per evitare di entrare nel legno con mortase parziali.
|
||||
-- 2022/08/18 Migliorato calcolo dello step.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDtMortise = {}
|
||||
@@ -430,7 +431,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local dDist = min( vtOrtDiff:len(), dWidthMrt)
|
||||
-- calcolo le passate
|
||||
local nPass = ceil( dDist / ( 1.9 * dToolDiam))
|
||||
local dStep = ( dDist - 0.95 * dToolDiam) / ( 2 * nPass)
|
||||
local dStep = 0
|
||||
if nPass > 1 then dStep = max( ( dDist - 2 * dToolDiam) / ( 2 * nPass - 2), 0.25 * dToolDiam) end
|
||||
for i = nPass, 1, -1 do
|
||||
-- inserisco la lavorazione di contornatura
|
||||
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/10/07
|
||||
-- Gestione calcolo profilo libero per Travi
|
||||
-- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessFreeContour = {}
|
||||
@@ -233,14 +234,16 @@ 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)
|
||||
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
|
||||
-- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva
|
||||
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true)
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'FreeContour')
|
||||
-- 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)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : FreeContour not found in library'
|
||||
EgtOutLog( sErr)
|
||||
@@ -688,6 +691,76 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeByMark( Proc, nRawId, b3Raw, nPartId)
|
||||
-- ingombro del pezzo
|
||||
local Ls = EgtGetFirstNameInGroup( nPartId, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
if not b3Solid then
|
||||
local sErr = 'Error : part box not found'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero e verifico l'entità curva
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
|
||||
if AuxId then AuxId = AuxId + Proc.Id end
|
||||
if not AuxId or ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
|
||||
local sErr = 'Error : missing profile geometry'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dDepth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
local bToolInv = ( vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
||||
-- verifico che la marcatura non sia orientata verso il basso (-5 deg)
|
||||
if vtExtr:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.TURN then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' 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)
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'Text'
|
||||
--local sMchExt = EgtIf( bMillDown, '_H2', '')
|
||||
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'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'FreeMark_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
EgtSetInfo( nMchId, 'Part', Proc.PartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- se estrusione da sotto, inverto direzione fresa
|
||||
if bToolInv then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.ADIR_ZP
|
||||
if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
@@ -698,7 +771,15 @@ function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
return MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- altrimenti contornatura
|
||||
else
|
||||
return MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- recupero il tipo di lavorazione
|
||||
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
|
||||
-- se marcatura
|
||||
if nCntType == 10 then
|
||||
return MakeByMark( Proc, nRawId, b3Raw, nPartId)
|
||||
-- se fresatura
|
||||
else
|
||||
return MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+20
-16
@@ -1,7 +1,8 @@
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2022/07/25
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2022/08/18
|
||||
-- Gestione calcolo tagli di testa per Travi
|
||||
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio di tipo diceCut.
|
||||
-- 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.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessHeadCut = {}
|
||||
@@ -173,10 +174,22 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
end
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
-- recupero la eventuale lavorazione con lama da sotto
|
||||
local sCutting2 = ML.FindCutting( 'HeadSide_H2', false, true)
|
||||
-- recupero i dati della eventuale seconda lama
|
||||
local dSawDiam2 = 0
|
||||
local dMaxDepth2 = 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
|
||||
end
|
||||
end
|
||||
-- caratteristiche taglio
|
||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||
( b3Raw:getDimZ() > EgtIf( BD.DOWN_HEAD or BD.TURN, 2, 1) * dMaxVertDepth - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
local bHorizCut = ( not bBigSectionCut and ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
|
||||
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bBigSectionCut and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
local bDoubleCut = ( not bBigSectionCut and not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||
@@ -250,23 +263,12 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
end
|
||||
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
||||
else
|
||||
-- recupero la lavorazione con lama da sotto
|
||||
local sCutting2 = ML.FindCutting( 'HeadSide_H2', false, true)
|
||||
-- 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
|
||||
-- recupero i dati della seconda lama
|
||||
local dSawDiam2 = 400
|
||||
local dMaxDepth2 = 50
|
||||
if 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
|
||||
end
|
||||
end
|
||||
-- verifico che le due lame riescano a lavorare la sezione
|
||||
local dDimZ = b3Raw:getDimZ()
|
||||
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
||||
@@ -279,16 +281,18 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
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, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
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, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
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
|
||||
|
||||
+159
-134
@@ -49,6 +49,7 @@
|
||||
-- 2022/06/29 Migliorate lavorazioni con fresatura di lato per L30 se parametro Q03=2. Ora con 4 facce / 3 facce a L può entrare una fresa grande fino al doppio dell'altezza della tasca / doppio della dimensione minima.
|
||||
-- 2022/07/05 Modifiche per sega a catena di testa e relativa MaxElev.
|
||||
-- 2022/07/12 In MakeByChainOrSaw aggiunto check per feature L20 usata in modo improprio e, nel caso, si passa a una lavorazione tasca.
|
||||
-- 2022/07/19 Profondamente semplificata la funzione SetOpenSide. Modificata la MakeMoreFaces per cercare sempre OpenPocket in determinate condizioni.
|
||||
-- 2022/08/11 Aggiunta lavorazione tunnel splittata con sega a catena per tutte le macchine ad esclusione della Fast.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -1325,142 +1326,157 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint)
|
||||
|
||||
-- fondo tra loro le curve compatibili
|
||||
EgtMergeCurvesInCurveCompo( nPathInt)
|
||||
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
||||
local pLastPIni, pLastPEnd
|
||||
|
||||
-- faccio una copia della curva e la esplodo
|
||||
if nStartIdEnt then
|
||||
-- prendo i punti
|
||||
-- ciclo i lati della curva e controllo per ognuno se giace in uno dei piani limite del pezzo: se sì allora il lato è aperto
|
||||
for i = 1, nNumEnt do
|
||||
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
||||
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
||||
-- Se normale lungo la Z considero il box in X e Y
|
||||
if abs(vtOrtho:getZ()) > 0.999 then
|
||||
-- se corrisponde a X
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Y
|
||||
elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- altrimenti se normale lungo la Y considero il box in X e Z
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then
|
||||
-- se corrisponde a X
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Z
|
||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- caso che non dovrebbe mai capitare ma gestito per completezza
|
||||
-- altrimenti se normale lungo la X considero il box in Y e Z
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then
|
||||
-- se corrisponde a Y
|
||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Z
|
||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- se asse Z orizzontale verifico se si avvicina piú a Y
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 then
|
||||
if abs(vtOrtho:getY()) > 0.75 then
|
||||
-- se corrisponde a Z
|
||||
if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
end
|
||||
-- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+
|
||||
elseif abs(vtOrtho:getY()) < 0.001 then
|
||||
if abs(vtOrtho:getZ()) > 0.75 then
|
||||
-- se corrisponde a Y
|
||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- scrivo nelle proprietà della curva quali sono i lati aperti
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
-- se ci sono già altri lati aperti
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
-- se è l'unico
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- inizio - 20220719 codice vecchio mantenuto per backup
|
||||
-- -- Se normale lungo la Z considero il box in X e Y
|
||||
-- if abs(vtOrtho:getZ()) > 0.999 then
|
||||
-- -- se corrisponde a X
|
||||
-- if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
-- ( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- -- setto l'entità open
|
||||
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
-- if #sActInfo > 0 then
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
-- else
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
-- end
|
||||
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
-- pLastPIni = pPini
|
||||
-- pLastPEnd = pPend
|
||||
-- -- altrimenti se corrisponde a Y
|
||||
-- elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
-- ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- -- setto l'entità open
|
||||
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
-- if #sActInfo > 0 then
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
-- else
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
-- end
|
||||
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
-- pLastPIni = pPini
|
||||
-- pLastPEnd = pPend
|
||||
-- end
|
||||
-- -- altrimenti se normale lungo la Y considero il box in X e Z
|
||||
-- elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then
|
||||
-- -- se corrisponde a X
|
||||
-- if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
-- ( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- -- setto l'entità open
|
||||
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
-- if #sActInfo > 0 then
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
-- else
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
-- end
|
||||
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
-- pLastPIni = pPini
|
||||
-- pLastPEnd = pPend
|
||||
-- -- altrimenti se corrisponde a Z
|
||||
-- elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
-- ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- -- setto l'entità open
|
||||
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
-- if #sActInfo > 0 then
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
-- else
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
-- end
|
||||
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
-- pLastPIni = pPini
|
||||
-- pLastPEnd = pPend
|
||||
-- end
|
||||
-- -- caso che non dovrebbe mai capitare ma gestito per completezza
|
||||
-- -- altrimenti se normale lungo la X considero il box in Y e Z
|
||||
-- elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then
|
||||
-- -- se corrisponde a Y
|
||||
-- if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
-- ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- -- setto l'entità open
|
||||
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
-- if #sActInfo > 0 then
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
-- else
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
-- end
|
||||
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
-- pLastPIni = pPini
|
||||
-- pLastPEnd = pPend
|
||||
-- -- altrimenti se corrisponde a Z
|
||||
-- elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
-- ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- -- setto l'entità open
|
||||
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
-- if #sActInfo > 0 then
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
-- else
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
-- end
|
||||
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
-- pLastPIni = pPini
|
||||
-- pLastPEnd = pPend
|
||||
-- end
|
||||
-- -- se asse Z orizzontale verifico se si avvicina piú a Y
|
||||
-- elseif abs(vtOrtho:getZ()) < 0.001 then
|
||||
-- if abs(vtOrtho:getY()) > 0.75 then
|
||||
-- -- se corrisponde a Z
|
||||
-- if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
-- ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- -- setto l'entità open
|
||||
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
-- if #sActInfo > 0 then
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
-- else
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
-- end
|
||||
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
-- pLastPIni = pPini
|
||||
-- pLastPEnd = pPend
|
||||
-- end
|
||||
-- end
|
||||
-- -- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+
|
||||
-- elseif abs(vtOrtho:getY()) < 0.001 then
|
||||
-- if abs(vtOrtho:getZ()) > 0.75 then
|
||||
-- -- se corrisponde a Y
|
||||
-- if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
-- ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- -- setto l'entità open
|
||||
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
-- if #sActInfo > 0 then
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
-- else
|
||||
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
-- end
|
||||
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
-- pLastPIni = pPini
|
||||
-- pLastPEnd = pPend
|
||||
-- end
|
||||
-- end
|
||||
-- fine - 20220719 codice vecchio mantenuto per backup
|
||||
end
|
||||
end
|
||||
-- se devo cambiare il punto di partenza
|
||||
@@ -1469,7 +1485,7 @@ local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint)
|
||||
-- calcolo il punto medio con gli ultimi punti utilizzati
|
||||
local ptPs = ( pLastPIni + pLastPEnd) / 2
|
||||
EgtChangeClosedCurveStartPoint( nPathInt, ptPs, GDB_RT.GLOB)
|
||||
-- se devo eliminare la parte open
|
||||
-- se devo eliminare la parte open, nei casi in cui la funzione caller non faccia in automatico il check
|
||||
if nStartPoint == 2 then
|
||||
EgtRemoveCurveCompoCurve( nPathInt, true)
|
||||
EgtRemoveCurveCompoCurve( nPathInt, false)
|
||||
@@ -1478,7 +1494,6 @@ local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -1797,7 +1812,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
end
|
||||
-- normale alla faccia aggiunta
|
||||
vtN1 = Vector3d( vtOrtho)
|
||||
-- imposto i lati aperti
|
||||
-- imposto i lati aperti e con il parametro 2 li cancello per evitare di lavorarli
|
||||
SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||
end
|
||||
|
||||
@@ -4299,6 +4314,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
end
|
||||
end
|
||||
vtN1 = Vector3d(vtOrtho)
|
||||
-- imposto i lati aperti e con il parametro 2 li cancello per evitare di lavorarli
|
||||
local bOkPath = SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||
-- se non ho un percorso chiuso estraggo i percorsi
|
||||
if bOkPath then
|
||||
@@ -4351,10 +4367,15 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUse)
|
||||
local function MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUse, bOpposite)
|
||||
for i = 1, nStep do
|
||||
-- inserisco la lavorazione di sawing
|
||||
local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
|
||||
local sName = ''
|
||||
if bOpposite then
|
||||
sName = 'Csaw_Opp_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
|
||||
else
|
||||
sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
|
||||
end
|
||||
local nMchFId = EgtAddMachining( sName, sSawing)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sSawing
|
||||
@@ -4372,6 +4393,7 @@ local function MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkD
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, sFaceUse)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dWorkDepth)
|
||||
-- modifico la distanza di attacco per considerare anche tunnel inclinati
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, 50)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -4535,6 +4557,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
end
|
||||
local dWorkDepth = dDepth
|
||||
-- cerco di estendere il taglio considerando la parte arrotondata della lama + 1
|
||||
if dMaxMat > dDepth + dSawCornerRad + 1 then
|
||||
dWorkDepth = dDepth + dSawCornerRad + 1
|
||||
-- se massimo affondamento utensile inferiore alla profondità da lavorare, setto la profondità di lavoro e emetto warning
|
||||
@@ -4543,11 +4566,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
local bOk, sErr = MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUse)
|
||||
-- lavoro da un lato
|
||||
local bOk, sErr = MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUse, false)
|
||||
if not bOk then return false, sErr end
|
||||
-- se è da lavorare anche dall'altro lato
|
||||
if bSplit then
|
||||
bOk, sErr = MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUseOtherSide)
|
||||
bOk, sErr = MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkDepth, dMaxMat, nStep, dStep, sFaceUseOtherSide, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
@@ -5157,7 +5181,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- o passare subito dalla lavorazione con lama/sega catena
|
||||
if ( bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU) or bForceSideMill then
|
||||
-- lavoro con svuotature (singola o doppia contrapposta)
|
||||
local sMyMchFind = EgtIf( bForceSideMill, 'OpenPocket', 'Pocket')
|
||||
-- 20220719 -> settate tutte come OpenPocket; prima era Pocket
|
||||
local sMyMchFind = 'OpenPocket'
|
||||
local dDiamTool = 100
|
||||
local nPathInt, nSurfInt, bOneShot, nFirstMachId
|
||||
local bIs3Faces = true
|
||||
|
||||
@@ -323,8 +323,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( 'ptC=' .. tostring( ptC) ..' vtN=' .. tostring( vtN), 3)
|
||||
-- Se mortasa chiusa
|
||||
if not bOpenBtm then
|
||||
-- verifico che la mortasa non sia orientata verso il basso (limite -5 deg) o che ci sia una testa da sotto o un rinvio angolare
|
||||
if vtN:getZ() < -0.1 and not BD.DOWN_HEAD and not BD.ANG_TRASM then
|
||||
-- verifico che la mortasa non sia orientata verso il basso (limite -5 deg) o che ci sia una testa da sotto o un rinvio angolare o macchina Turn
|
||||
if vtN:getZ() < -0.1 and not BD.DOWN_HEAD and not BD.ANG_TRASM and not BD.TURN then
|
||||
local sErr = 'Error : Mortise from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
|
||||
@@ -440,7 +440,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local sMillingDown
|
||||
if bDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
sMillingDown = ML.FindMilling( 'Prof_H2', nil, nil, nil, nil, false, true)
|
||||
if not sMillingDown then
|
||||
@@ -448,7 +448,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sWarn)
|
||||
bDouble = false
|
||||
end
|
||||
else
|
||||
elseif not BD.TURN then
|
||||
sWarn = 'Warning in profiling : depth (' .. EgtNumToString( dProfDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dToolMaxDepth, 1) .. ')'
|
||||
EgtOutLog( sWarn)
|
||||
bDouble = false
|
||||
@@ -489,7 +489,9 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- imposto l'affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
local dOriOffset = 0
|
||||
@@ -588,7 +590,9 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
local dOriOffset = 0
|
||||
@@ -633,7 +637,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se parametro Q disabilitato, e consentito anche in alcuni casi lavorarlo con la feature da sotto
|
||||
-- inserisco eventuale finitura faccia finale (ortogonale alla trave o, se da sotto, parallela)
|
||||
if EgtGetInfo( Proc.Id, sEnableExtraMillUpperFace, 'i') ~= 1 and bLastTrim and
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD))) then
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD or BD.TURN))) then
|
||||
sName = 'ProfV_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchVId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchVId then
|
||||
@@ -659,6 +663,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -669,7 +674,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se parametro Q disabilitato, e consentito anche in alcuni casi lavorarlo con la feature da sotto
|
||||
-- inserisco eventuale finitura faccia finale (ortogonale alla trave o, se da sotto, parallela)
|
||||
if EgtGetInfo( Proc.Id, sEnableExtraMillUpperFace, 'i') ~= 1 and bFirstTrim and
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD))) then
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD or BD.TURN))) then
|
||||
sName = 'ProfV2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchV2Id = EgtAddMachining( sName, sMilling)
|
||||
if not nMchV2Id then
|
||||
@@ -692,6 +697,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -440,7 +440,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local sMillingDown
|
||||
if bDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
sMillingDown = ML.FindMilling( 'Prof_H2', nil, nil, nil, nil, false, true)
|
||||
if not sMillingDown then
|
||||
@@ -448,7 +448,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sWarn)
|
||||
bDouble = false
|
||||
end
|
||||
else
|
||||
elseif not BD.TURN then
|
||||
sWarn = 'Warning in profiling : depth (' .. EgtNumToString( dProfDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dToolMaxDepth, 1) .. ')'
|
||||
EgtOutLog( sWarn)
|
||||
bDouble = false
|
||||
@@ -489,7 +489,9 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- imposto l'affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
local dOriOffset = 0
|
||||
@@ -588,7 +590,9 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
local dOriOffset = 0
|
||||
@@ -633,7 +637,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se parametro Q disabilitato, e consentito anche in alcuni casi lavorarlo con la feature da sotto
|
||||
-- inserisco eventuale finitura faccia finale (ortogonale alla trave o, se da sotto, parallela)
|
||||
if EgtGetInfo( Proc.Id, sEnableExtraMillUpperFace, 'i') ~= 1 and bLastTrim and
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD))) then
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD or BD.TURN))) then
|
||||
sName = 'ProfV_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchVId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchVId then
|
||||
@@ -659,6 +663,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -669,7 +674,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se parametro Q disabilitato, e consentito anche in alcuni casi lavorarlo con la feature da sotto
|
||||
-- inserisco eventuale finitura faccia finale (ortogonale alla trave o, se da sotto, parallela)
|
||||
if EgtGetInfo( Proc.Id, sEnableExtraMillUpperFace, 'i') ~= 1 and bFirstTrim and
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD))) then
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD or BD.TURN))) then
|
||||
sName = 'ProfV2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchV2Id = EgtAddMachining( sName, sMilling)
|
||||
if not nMchV2Id then
|
||||
@@ -692,6 +697,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -701,12 +707,13 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- aggiorno ingombro testa o coda per presa
|
||||
if nSide ~= 1 then
|
||||
if nSide ~= 1 then -- se feature di fianco o da sotto
|
||||
if bHead then
|
||||
BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMin():getX())
|
||||
else
|
||||
BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX())
|
||||
end
|
||||
-- altrimenti feature da sopra
|
||||
else
|
||||
if bHead then
|
||||
BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMax():getX())
|
||||
|
||||
@@ -500,20 +500,20 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
if abs( vtRef:getZ()) > 0.1 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
||||
dHCI = 0.75 * dHCI
|
||||
else
|
||||
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
end
|
||||
dHCI = 0.75 * dHCI
|
||||
BL.UpdateHCING( nRawId, dHCI)
|
||||
elseif Proc.Tail then
|
||||
local dTCI = 0
|
||||
if abs( vtRef:getZ()) > 0.1 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
||||
dTCI = 0.75 * dTCI
|
||||
else
|
||||
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
end
|
||||
dTCI = 0.75 * dTCI
|
||||
BL.UpdateTCING( nRawId, dTCI)
|
||||
end
|
||||
|
||||
|
||||
+21
-16
@@ -1,7 +1,8 @@
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2022/07/26
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2022/08/18
|
||||
-- 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.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessSplit = {}
|
||||
@@ -261,10 +262,22 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
end
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
-- recupero la eventuale lavorazione con lama da sotto
|
||||
local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true)
|
||||
-- recupero i dati della eventuale seconda lama
|
||||
local dSawDiam2 = 0
|
||||
local dMaxDepth2 = 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
|
||||
end
|
||||
end
|
||||
-- caratteristiche taglio
|
||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||
( b3Raw:getDimZ() > EgtIf( BD.DOWN_HEAD or BD.TURN, 2, 1) * dMaxVertDepth - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
local bHorizCut = ( not bBigSectionCut and ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
|
||||
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bBigSectionCut and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
local bDoubleCut = ( not bBigSectionCut and not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||
@@ -433,23 +446,12 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
end
|
||||
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
||||
else
|
||||
-- recupero la lavorazione con lama da sotto
|
||||
local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true)
|
||||
-- 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
|
||||
-- recupero i dati della seconda lama
|
||||
local dSawDiam2 = 400
|
||||
local dMaxDepth2 = 50
|
||||
if 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
|
||||
end
|
||||
end
|
||||
-- verifico che le due lame riescano a lavorare la sezione
|
||||
local dDimZ = b3Raw:getDimZ()
|
||||
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
||||
@@ -462,11 +464,14 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
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, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||
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
|
||||
@@ -478,7 +483,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
else
|
||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||
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
|
||||
|
||||
@@ -46,7 +46,7 @@ function ProcessText.Make( Proc, nPhase, nRawId, nPartId)
|
||||
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 then
|
||||
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'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
|
||||
Reference in New Issue
Block a user