- aggiunta GetSawBlockedAxis per scegliere asse bloccato aggregato lama

This commit is contained in:
luca.mazzoleni
2024-01-04 17:29:42 +01:00
parent 6e8cd5f3bb
commit bc04b680d4
6 changed files with 41 additions and 10 deletions
+9
View File
@@ -844,6 +844,15 @@ function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd)
end
end
---------------------------------------------------------------------
function BeamLib.GetSawBlockedAxis( nInd, bDownHead)
if BD.GetSawBlockedAxis then
return BD.GetSawBlockedAxis( nInd, bDownHead)
else
return ''
end
end
---------------------------------------------------------------------
-- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca.
function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
+8 -1
View File
@@ -135,6 +135,9 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dAccEnd)
-- imposto angolo 3° asse rot
local bIsDownHead = EgtEndsWith( sCutting, '_H2')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetSawBlockedAxis( 1, bIsDownHead))
-- eventuali note
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
@@ -172,7 +175,7 @@ local function GetNameSolidFaceIncludingLine( b3Solid, ptP1Comp, ptP2Comp)
end
---------------------------------------------------------------------
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth)
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
Par5 == MCH_MILL_FU.PARAL_TOP or
@@ -432,6 +435,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
-- imposto angolo 3° asse rot
bMaximizeVerticalDepth = bMaximizeVerticalDepth or false
local bIsDownHead = EgtEndsWith( sCutting, '_H2')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetSawBlockedAxis( EgtIf( bMaximizeVerticalDepth, 0, 1), bIsDownHead))
-- eventuali note
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
+3
View File
@@ -1178,6 +1178,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto angolo 3° asse rot
local bIsDownHead = EgtEndsWith( sCutting, '_H2')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetSawBlockedAxis( 1, bIsDownHead))
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
+6
View File
@@ -877,6 +877,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto angolo 3° asse rot
local bIsDownHead = EgtEndsWith( sCutting, '_H2')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetSawBlockedAxis( 1, bIsDownHead))
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -1066,6 +1069,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- determino e imposto l'utilizzo della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[j]])
-- imposto angolo 3° asse rot
local bIsDownHead = EgtEndsWith( sCutting, '_H2')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetSawBlockedAxis( 1, bIsDownHead))
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
+3
View File
@@ -229,6 +229,9 @@ function ProcessSawCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTail)
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto angolo 3° asse rot
local bIsDownHead = EgtEndsWith( sCutting, '_H2')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetSawBlockedAxis( 1, bIsDownHead))
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
+12 -9
View File
@@ -357,13 +357,17 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
---@type ( SplitType)
local bigSectionSplitType
-- se pezzo non troppo alto, taglio singolo da sopra
if b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < dChainSawMaxMat + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single horizontal"
-- se pezzo non troppo largo, taglio singolo da davanti
elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dChainSawMaxMat, dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single vertical"
-- se pezzo non troppo largo, tagli dai due fianchi (dietro e davanti)
elseif 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dChainSawMaxMat, dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "double vertical"
elseif BD.DOWN_HEAD and ( b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < dSawMaxDepth2 + dChainSawMaxMat + 10 * GEO.EPS_SMALL) then
-- altrimenti taglio con sega a catena da sopra e con lama da sotto
elseif BD.DOWN_HEAD and ( b3Raw:getDimZ() + 2 * BD.CUT_EXTRA_MIN < dSawMaxDepth2 + dChainSawMaxMat + 10 * GEO.EPS_SMALL) then
bigSectionSplitType = "double horizontal"
end
@@ -373,19 +377,18 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
dOffs = dOvmTail - BD.OVM_CHAIN_HBEAM
bFinishingNeeded = true
end
-- se pezzo non troppo alto, taglio singolo da sopra
-- in base alle scelte precedenti, applico le lavorazioni
if bigSectionSplitType == "single horizontal" then
local dCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Split;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_TOP, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- se pezzo non troppo largo, taglio singolo da davanti
elseif bigSectionSplitType == "single vertical" then
local dCutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Split;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- se pezzo non troppo largo, tagli dai due fianchi (dietro e davanti)
elseif bigSectionSplitType == "double vertical" then
local dCutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Presplit;'
@@ -394,21 +397,21 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
sNotesSplit = 'Split;'
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- altrimenti taglio con sega a catena da sopra e con lama da sotto
elseif bigSectionSplitType == "double horizontal" then
-- sega a catena da sopra
local dChainSawCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN - dSawMaxDepth2
local dChainSawCutDepth = b3Raw:getDimZ() + 2 * BD.CUT_EXTRA_MIN - dSawMaxDepth2
local sNotesSplit = 'Presplit;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_TOP, dChainSawCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- lama da sotto
local dCutExtra = dSawMaxDepth2 - b3Raw:getDimZ()
local dCutExtra = -dChainSawCutDepth + 2 * BD.CUT_EXTRA_MIN
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
local sNotes = 'Split;'
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
local bMaximizeVerticalDepth = true
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dOffs, 0, 0, sNotes, b3Raw, nil, bMaximizeVerticalDepth)
if not bOk then return false, sErr end
-- se la sega a catena non può completare lo split esco
-- se è comunque troppo grande per essere separato, esco
else
local sErr = 'Error : section too big for splitting'
EgtOutLog( sErr)