Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e457a22b0 | |||
| 3c080e2b1a | |||
| 52f347def1 | |||
| 0acd75bece | |||
| db691cefe4 | |||
| d0ecd175c2 | |||
| 7e6d4189ef | |||
| abbc200504 | |||
| 9e4597b739 | |||
| d84d146701 | |||
| 00ff8818da | |||
| d5c582f890 | |||
| bc8b0490b7 | |||
| 5aad9dcbf2 | |||
| 8a582f512f | |||
| 1fde2e5fec | |||
| 7a89501cc9 | |||
| 89acdcc8f8 | |||
| f7c082e5b1 | |||
| 938c46b9d8 | |||
| 917bf5ec4b | |||
| 27d4ab3309 | |||
| 0ece2d91f4 | |||
| e08b53d5cf | |||
| a330b2fd7f | |||
| acdd4e10fb | |||
| ee6afb65c1 | |||
| ea9db1631b | |||
| 6513e75408 | |||
| 0e7d878f10 | |||
| 8bd0e5d145 | |||
| d8ecfc8463 | |||
| e52a9c66b6 | |||
| f3785f8644 | |||
| 350aaabbbe | |||
| 4eb3b38dd4 | |||
| e9534b4eee | |||
| da061a05e5 | |||
| ba432f5029 | |||
| 812397a047 | |||
| cbb42ec088 | |||
| 0c802464e1 | |||
| 498c65b006 | |||
| d81a0e8fbd | |||
| 47fde315a3 | |||
| 3ac61219c9 | |||
| bad0018381 | |||
| 48261c36d8 | |||
| 4f9093b1d2 | |||
| 52830876e9 | |||
| 4513833fb3 | |||
| 26cc812ed1 | |||
| cc3ff75ea2 | |||
| b150c75e96 | |||
| cc3b0da9e5 | |||
| 6c8e3017d0 |
+1
-1
@@ -461,7 +461,7 @@ else
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
|
||||
+1
-1
@@ -562,7 +562,7 @@ else
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
|
||||
+35
-1
@@ -734,7 +734,9 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
if BD.C_SIMM then
|
||||
if BD.GetNzLimDownUp then
|
||||
return BD.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
elseif BD.C_SIMM then
|
||||
return -0.484
|
||||
elseif BD.TURN then
|
||||
return -2
|
||||
@@ -1186,6 +1188,11 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetFacetsInfo( Proc, b3Raw)
|
||||
|
||||
if Proc.Fct > 20 then
|
||||
return nil
|
||||
end
|
||||
|
||||
local Face = {}
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Proc.PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local vAdj
|
||||
@@ -1267,5 +1274,32 @@ function BeamLib.GetMachiningSteps( dMachiningDepth, dStep)
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail)
|
||||
if not dOvmTail then
|
||||
dOvmTail = BD.OVM_MID
|
||||
end
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
|
||||
if Proc.Head then
|
||||
-- se coincide con il taglio di separazione precedente, non va fatto
|
||||
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||
return false
|
||||
end
|
||||
-- altrimenti taglio di coda
|
||||
else
|
||||
-- se coincide con taglio di separazione, non va fatto
|
||||
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- se coincide con un taglio frontale non va fatto
|
||||
if Proc.CutFront then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
+28
-23
@@ -28,6 +28,7 @@
|
||||
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
||||
-- 2024/03/27 In MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST
|
||||
-- 2024/06/18 In MakeOne in caso di inversione del percorso, si scambia anche accorciamento start con end
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FacesBySaw = {}
|
||||
@@ -250,6 +251,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
if bInvert then
|
||||
ptP1, ptP2 = ptP2, ptP1
|
||||
vtV1, vtV2 = vtV2, vtV1
|
||||
dAccStart, dAccEnd = dAccEnd, dAccStart
|
||||
end
|
||||
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
|
||||
local dAllStart = 0
|
||||
@@ -407,7 +409,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.TURN then
|
||||
if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
||||
-- per ora aggregato usato in verticale solo in split e headcut; Fast non influenzata
|
||||
if BD.C_SIMM and bMaximizeVerticalDepth then
|
||||
nSCC = MCH_SCC.ADIR_ZM
|
||||
elseif abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
||||
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
else
|
||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
@@ -511,6 +516,25 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( sCutType, nil, bDownHead)
|
||||
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
|
||||
local dSawThick = 5
|
||||
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
|
||||
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- dati delle facce
|
||||
local ptC = {}
|
||||
local vtN = {}
|
||||
@@ -526,10 +550,10 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
local ptM = ( ptT1 + ptT2) / 2
|
||||
local vtTg = ptT2 - ptT1 ; vtTg:normalize()
|
||||
local bConvex = ( dAngT > 0)
|
||||
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg)
|
||||
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg), oppure in testa o in coda e non troppo distanti dal grezzo esterno
|
||||
local bFaceOk = {}
|
||||
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or abs( vtN[1]:getY()) < 0.174)
|
||||
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or abs( vtN[2]:getY()) < 0.174)
|
||||
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or abs( vtN[1]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[1].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
||||
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or abs( vtN[2]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[2].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
||||
if not bDownHead and ( not bFaceOk[1] or not bFaceOk[2]) then
|
||||
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
@@ -564,25 +588,6 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
nUpInd = nBigInd
|
||||
nOtInd = nSmaInd
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( sCutType, nil, bDownHead)
|
||||
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
|
||||
local dSawThick = 5
|
||||
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
|
||||
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- calcolo extra taglio
|
||||
local dCutExtra = 0
|
||||
if dAngT < -91 and dAngT > -179 then
|
||||
|
||||
+37
-52
@@ -74,40 +74,34 @@ local function SetCurrMachineHeadType()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che conferma e rende attivi testa e utensile ipotizzati
|
||||
-- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa
|
||||
local function ConfirmNextMachining()
|
||||
-- se non definita testa successiva, esco
|
||||
if not nNextMachHead or nNextMachHead < 1 or nNextMachHead > 2 then return end
|
||||
-- altrimenti, la confermo come attiva
|
||||
nActiveHead = nNextMachHead
|
||||
if nNextMachHead == 1 then
|
||||
H1_TOOL = H1_NEXT_TOOL
|
||||
elseif nNextMachHead == 2 then
|
||||
H2_TOOL = H2_NEXT_TOOL
|
||||
-- utensile corrente
|
||||
local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
|
||||
EgtTdbSetCurrTool( sToolName or '')
|
||||
-- testa dell'utensile corrente
|
||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local nHead = tonumber( sHead:sub( 2, #sHead)) + 0
|
||||
|
||||
if ( nHead < 10 and nHead >= 30) or vFixedHeads[nHead] then
|
||||
-- testa che non richiede ottimizzazione
|
||||
return
|
||||
elseif nHead >= 20 then
|
||||
nHead = 2
|
||||
elseif nHead >= 10 then
|
||||
nHead = 1
|
||||
end
|
||||
|
||||
-- se la testa richiede ottimizzazione, confermo testa attiva
|
||||
nActiveHead = nHead
|
||||
if nActiveHead == 1 then
|
||||
H1_TOOL = sToolName
|
||||
elseif nActiveHead == 2 then
|
||||
H2_TOOL = sToolName
|
||||
end
|
||||
-- reset prossima testa
|
||||
nNextMachHead = 0
|
||||
H1_NEXT_TOOL = ''
|
||||
H2_NEXT_TOOL = ''
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che traccia testa e utensile ipotizzati
|
||||
local function SetNextMachining( sToolName, nHead, bFixed)
|
||||
if nHead < 1 or nHead > 2 then return end
|
||||
if bFixed then
|
||||
nNextMachHead = 0
|
||||
H1_NEXT_TOOL = ''
|
||||
H2_NEXT_TOOL = ''
|
||||
end
|
||||
nNextMachHead = nHead
|
||||
if nHead == 1 then
|
||||
H1_NEXT_TOOL = sToolName
|
||||
elseif nHead == 2 then
|
||||
H2_NEXT_TOOL = sToolName
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function SetCurrMachiningAndTool( Machining)
|
||||
EgtMdbSetCurrMachining( Machining.Name)
|
||||
@@ -356,16 +350,16 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
end
|
||||
if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
|
||||
_, sType = EgtEndsWith( sType, '_H2')
|
||||
elseif ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bDownHead then
|
||||
elseif not ( BEAM and BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
|
||||
if not EgtEndsWith( sType, '_H2') then
|
||||
sType = sType .. '_H2'
|
||||
end
|
||||
end
|
||||
local MachineHeadUse = MachineHeadType
|
||||
if not BEAM or not BEAM.BW then
|
||||
if not ( BEAM and BEAM.BW) and MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
MachineHeadUse = ONE_HEAD
|
||||
end
|
||||
if BEAM and BEAM.BW and MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
||||
if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
||||
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
||||
MachineHeadUse = TWO_EQUAL_HEADS
|
||||
end
|
||||
@@ -374,7 +368,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
for i = ForStart, ForEnd, ForStep do
|
||||
local Machining = Machinings[i]
|
||||
local sMachiningType = Machining.Type
|
||||
if BEAM and BEAM.BW then
|
||||
if ( BEAM and BEAM.BW) or MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
||||
end
|
||||
-- recupero dati utensile
|
||||
@@ -383,18 +377,15 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2)
|
||||
if bOk then
|
||||
if MachineHeadUse == ONE_HEAD then
|
||||
SetNextMachining( sToolName, 1, bFixed)
|
||||
return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
elseif MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
-- se nessuna testa attiva, prendo la prima lavorazione disponibile
|
||||
if nActiveHead == 0 then
|
||||
SetNextMachining( sToolName, EgtIf( bH2, 2, 1), bFixed)
|
||||
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
|
||||
-- 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)
|
||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo, a meno che non siano entrambi grandi (truciolatori)
|
||||
if ( not sH1Param or not sH1Param.TDiam or ( sH1Param.TDiam < 75 and ToolParams.TDiam < 75 and sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam)) and ( not sH2Param or not sH2Param.TDiam or ( sH2Param.TDiam < 75 and ToolParams.TDiam < 75 and sH2Param.TDiam < 1.25 * ToolParams.TDiam)) then
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
end
|
||||
end
|
||||
@@ -414,10 +405,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
end
|
||||
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
||||
if bTopHead and not bH2 then
|
||||
SetNextMachining( sToolName, 1, bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
elseif bDownHead and bH2 then
|
||||
SetNextMachining( sToolName, 2, bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
end
|
||||
end
|
||||
@@ -425,34 +414,30 @@ 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
|
||||
-- se entrambi gli utensili sono piccoli (no truciolatori) e uno dei due è 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)
|
||||
if sH1Param.TDiam < 75 or sH2Param.TDiam < 75 then
|
||||
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
||||
if nActiveHead == 1 then
|
||||
if sH2Mach ~= "" then
|
||||
SetNextMachining( sH2Tool, 2, bFixed)
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
||||
elseif sH1Mach ~= "" then
|
||||
SetNextMachining( sH1Tool, 1, bFixed)
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
||||
end
|
||||
elseif nActiveHead == 2 then
|
||||
if sH1Mach ~= "" then
|
||||
SetNextMachining( sH1Tool, 1, bFixed)
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
||||
elseif sH2Mach ~= "" then
|
||||
SetNextMachining( sH2Tool, 2, bFixed)
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
||||
end
|
||||
|
||||
+11
-16
@@ -542,7 +542,11 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if j ~= 1 then
|
||||
vtNewOrthoO = -vtOrthoO
|
||||
if not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.708 end
|
||||
if BD.GetNzLimDownUp then
|
||||
dVzLimDwnUp = BD.GetNzLimDownUp( b3Raw, vtN, V_NULL(), true)
|
||||
elseif not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then
|
||||
dVzLimDwnUp = -0.708
|
||||
end
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
@@ -566,7 +570,11 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
end
|
||||
end
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
|
||||
if BD.GetNzLimDownUp then
|
||||
dVzLimDwnUp = BD.GetNzLimDownUp( b3Raw, vtN, V_NULL(), true)
|
||||
elseif not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then
|
||||
dVzLimDwnUp = -0.708
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -821,20 +829,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
-- se taglio di testa
|
||||
if not bForced then
|
||||
if Proc.Head then
|
||||
-- se coincide con il taglio di separazione precedente, non va fatto
|
||||
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
-- altrimenti taglio di coda
|
||||
else
|
||||
-- se coincide con taglio di separazione, non va fatto
|
||||
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
end
|
||||
-- se coincide con un taglio frontale non va fatto
|
||||
if Proc.CutFront then
|
||||
if not BL.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -216,7 +216,7 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'DtTenon'
|
||||
local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+134
-26
@@ -105,6 +105,9 @@
|
||||
-- 2024/04/15 In SideMillAsSaw gestito anche rabbet
|
||||
-- 2024/04/17 In MakeMoreLongFaces corretto calcolo divisione in parti per evitare problemi di ceil con interi perfetti (ceil(3) = 3 o 4??)
|
||||
-- 2024/04/22 In IsTailFeature se LapJoint a 2 facce che taglia intera sezione, deve essere fatto dopo taglio di coda
|
||||
-- 2024/06/18 In MakeByMillAsSaw si cerca di orientare il motore verso il lato più vicino (rispetto a dove è la feature)
|
||||
-- 2024/06/28 In VerifySideMillAsSaw modificato criterio ricerca utensile in base a normale della faccia
|
||||
-- 2024/07/04 In IsTailFeature controllo per spostare lapjoint dopo taglio di separazione per lavorazioni tipo BH
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLapJoint = {}
|
||||
@@ -203,6 +206,8 @@ local function AssignQIdent( Proc)
|
||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_DEPTH_CHAMFER = 'Q07' -- d
|
||||
elseif ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 30 then
|
||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
||||
Q_SIDE_ROUGH_TOOL = 'Q01' -- i
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
|
||||
@@ -553,7 +558,7 @@ local function VerifySideMillAsSaw( Proc, nAddGrpId, vtN, dDiam, dFacElev)
|
||||
-- cancello la copia del percorso
|
||||
EgtErase( nTestId)
|
||||
-- eseguo test
|
||||
if not bNewIsU and not Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' then
|
||||
if not bNewIsU and not ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2') then
|
||||
return false
|
||||
end
|
||||
-- Verifico sia abbastanza lunga
|
||||
@@ -562,8 +567,19 @@ local function VerifySideMillAsSaw( Proc, nAddGrpId, vtN, dDiam, dFacElev)
|
||||
return false
|
||||
end
|
||||
-- Recupero la lavorazione
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtN:getZ() < BD.NZ_MINA)
|
||||
local sMillingOnSide = ML.FindMilling( 'SideMillAsBlade', nil, nil, nil, nil, not bDownHead, bDownHead)
|
||||
local bDownHead
|
||||
local sMillingOnSide
|
||||
-- se ho testa da sotto e lap-joint diretto verso il basso, cerco prima testa sotto
|
||||
if BD.DOWN_HEAD and vtN:getZ() < BD.NZ_MINA then
|
||||
bDownHead = true
|
||||
sMillingOnSide = ML.FindMilling( 'SideMillAsBlade_H2', nil, nil, nil, nil, not bDownHead, bDownHead)
|
||||
end
|
||||
-- se non ha trovato su testa sotto, cerco su testa sopra
|
||||
if not sMillingOnSide then
|
||||
bDownHead = false
|
||||
sMillingOnSide = ML.FindMilling( 'SideMillAsBlade', nil, nil, nil, nil, not bDownHead, bDownHead)
|
||||
end
|
||||
|
||||
if not sMillingOnSide then
|
||||
return false
|
||||
end
|
||||
@@ -760,7 +776,11 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
||||
-- verifico se è in coda
|
||||
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
|
||||
if dEndDist > BD.MAX_DIST_HTFEA then
|
||||
return false
|
||||
if bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 80% della lunghezza della trave
|
||||
if Proc.Box:getDimX() > b3Solid:getDimX() - 1 or
|
||||
@@ -2664,7 +2684,8 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
if abs( dLen - dMaxLen) < 5 then
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT)
|
||||
if vtN:getY() > 0.5 or vtN:getZ() > 0.5 then
|
||||
local bPositionedToYm = Proc.Box:getMax():getY() < ( b3Raw:getMin():getY() + b3Raw:getMax():getY()) / 2
|
||||
if ( bPositionedToYm and vtN:getY() < 0.5) or ( not bPositionedToYm and vtN:getY() > 0.5) or vtN:getZ() > 0.5 then
|
||||
nFacAdj = vAdj[i]
|
||||
dMaxLen = dLen
|
||||
end
|
||||
@@ -3174,6 +3195,11 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
end
|
||||
-- valuto l'angolo tra le due facce
|
||||
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, nFacInd, nFacet, GDB_ID.ROOT)
|
||||
if not bAdj then
|
||||
local sErr = 'Error : Faces not adjacent'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local ptPm = (ptP1+ptP2)/2
|
||||
-- ottengo il boundingBox e prendo le dimensioni lungo la normale (Z locale) che rappresenta l'elevazione della faccia
|
||||
-- laterale sul punto medio della linea in comune
|
||||
@@ -3295,6 +3321,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
-- se si lavora una faccia orizzontale e la dimensione X della feature è sufficiente, blocco l'asse B per evitare sollecitazioni inutili
|
||||
local b3Face = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
|
||||
if BD.C_SIMM and AreSameOrOppositeVectorApprox( tvtN[2], Z_AX()) and b3Face:getDimX() > BD.LONGCUT_ENDLEN then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
if bLapJointAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
@@ -3339,7 +3370,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
-- eventuale massima elevazione imposta dall'utente
|
||||
local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
|
||||
if dMaxElev and dMaxElev < 1 then dMaxElev = nil end
|
||||
dMaxElev = dMaxElev or dElev
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
if bOpenOutRaw then
|
||||
sNotes = sNotes .. 'OpenOutRaw=1;'
|
||||
@@ -4617,8 +4652,6 @@ end
|
||||
|
||||
-- TODO gestione messaggi in funzione apposita (almeno per append)
|
||||
|
||||
-- TODO gestire topologia tunnel (anche da due lati)
|
||||
|
||||
local SawPlusChain = {}
|
||||
SawPlusChain.Saw = {}
|
||||
SawPlusChain.Chainsaw = {}
|
||||
@@ -4681,6 +4714,7 @@ function SawPlusChain.GetTunnelFaces( Proc)
|
||||
if TunnelAddedFaces.MiddleFaceTm.Height > TunnelAddedFaces.MiddleFaceTm.Width then
|
||||
TunnelAddedFaces.MiddleFaceTm.Height, TunnelAddedFaces.MiddleFaceTm.Width = TunnelAddedFaces.MiddleFaceTm.Width, TunnelAddedFaces.MiddleFaceTm.Height
|
||||
end
|
||||
TunnelAddedFaces.MiddleFaceTm.Type = 'Tunnel'
|
||||
|
||||
return TunnelAddedFaces
|
||||
end
|
||||
@@ -4712,6 +4746,7 @@ function SawPlusChain.GetBottomFace( Proc)
|
||||
end
|
||||
|
||||
BottomFace.Id = nBottomFace
|
||||
BottomFace.Type = 'Bottom'
|
||||
BottomFace.Width = Proc.Face[nBottomFace + 1].Width
|
||||
BottomFace.Height = Proc.Face[nBottomFace + 1].Height
|
||||
BottomFace.Elevation = Proc.Face[nBottomFace + 1].Elevation
|
||||
@@ -4725,6 +4760,7 @@ end
|
||||
|
||||
|
||||
function SawPlusChain.GetLongFace( Proc)
|
||||
local LongFace = {}
|
||||
if not Proc.MainFaces.BottomFace or not Proc.MainFaces.BottomFace.Id then
|
||||
Proc.MainFaces.BottomFace = SawPlusChain.GetBottomFace( Proc)
|
||||
end
|
||||
@@ -4746,10 +4782,10 @@ function SawPlusChain.GetLongFace( Proc)
|
||||
end
|
||||
|
||||
-- si sceglie la più grande (tunnel) o quella adiacente sul lato lungo
|
||||
local LongFace = {}
|
||||
LongFace.Id = FacesToAnalyze[1].Id
|
||||
for i = 1, Proc.Fct do
|
||||
if LongFace.Id == Proc.Face[i].Id then
|
||||
LongFace.Type = 'Long'
|
||||
LongFace.Width = Proc.Face[i].Width
|
||||
LongFace.Height = Proc.Face[i].Height
|
||||
LongFace.Elevation = Proc.Face[i].Elevation
|
||||
@@ -4760,8 +4796,6 @@ function SawPlusChain.GetLongFace( Proc)
|
||||
end
|
||||
end
|
||||
|
||||
LongFace.Edges = SawPlusChain.GetLongFaceEdges( Proc, LongFace)
|
||||
|
||||
return LongFace
|
||||
end
|
||||
|
||||
@@ -4799,6 +4833,7 @@ function SawPlusChain.GetSideFaces( Proc)
|
||||
( bIsLongFaceTheLargest and i > 2) then
|
||||
table.insert( SideFaces, FacesToAnalyze[i])
|
||||
SideFaces[#SideFaces].Id = FacesToAnalyze[i].Id
|
||||
SideFaces[#SideFaces].Type = 'Side'
|
||||
SideFaces[#SideFaces].Width = Proc.Face[FacesToAnalyze[i].Id + 1].Width
|
||||
SideFaces[#SideFaces].Height = Proc.Face[FacesToAnalyze[i].Id + 1].Height
|
||||
SideFaces[#SideFaces].Elevation = Proc.Face[FacesToAnalyze[i].Id + 1].Elevation
|
||||
@@ -4813,6 +4848,51 @@ function SawPlusChain.GetSideFaces( Proc)
|
||||
end
|
||||
|
||||
|
||||
function SawPlusChain.GetBottomFaceEdges( Proc, Face)
|
||||
local Edges = {}
|
||||
Edges.SideEdges = {}
|
||||
Edges.LongEdges = {}
|
||||
|
||||
local nFaceType, vEdges = EgtSurfTmGetFacetOutlineInfo( Proc.Id, Face.Id, GDB_ID.ROOT)
|
||||
if nFaceType < 1 then
|
||||
for j = 1, #vEdges do
|
||||
local nPreviousEdgeIndex = j - 1
|
||||
if j == 1 then
|
||||
nPreviousEdgeIndex = #vEdges
|
||||
end
|
||||
local nNextEdgeIndex = j + 1
|
||||
if j == #vEdges then
|
||||
nNextEdgeIndex = 1
|
||||
end
|
||||
|
||||
local CurrentEdge = {}
|
||||
CurrentEdge.AdjacentFaceId = vEdges[j].Adj
|
||||
CurrentEdge.ToolDirection = Vector3d( vEdges[j].Norm)
|
||||
CurrentEdge.Length = vEdges[j].Len
|
||||
CurrentEdge.Elevation = vEdges[j].Elev
|
||||
CurrentEdge.IsOpen = vEdges[j].Open
|
||||
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
|
||||
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
|
||||
|
||||
if CurrentEdge.AdjacentFaceId == Proc.MainFaces.LongFace.Id then
|
||||
table.insert( Edges.LongEdges, CurrentEdge)
|
||||
Edges.LongEdges[#Edges.LongEdges].Type = 'Long'
|
||||
elseif vEdges[nNextEdgeIndex].Adj == Proc.MainFaces.LongFace.Id or vEdges[nPreviousEdgeIndex].Adj == Proc.MainFaces.LongFace.Id then
|
||||
table.insert( Edges.SideEdges, CurrentEdge)
|
||||
Edges.SideEdges[#Edges.SideEdges].Type = 'Side'
|
||||
else
|
||||
table.insert( Edges.LongEdges, CurrentEdge)
|
||||
Edges.LongEdges[#Edges.LongEdges].Type = 'Long'
|
||||
end
|
||||
end
|
||||
else
|
||||
error( 'Face with closed hole')
|
||||
end
|
||||
|
||||
return Edges
|
||||
end
|
||||
|
||||
|
||||
function SawPlusChain.GetLongFaceEdges( Proc, Face)
|
||||
local Edges = {}
|
||||
Edges.SideEdges = {}
|
||||
@@ -4848,12 +4928,16 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
|
||||
else
|
||||
if CurrentEdge.AdjacentFaceId == Proc.MainFaces.BottomFace.Id then
|
||||
Edges.BottomEdge = CurrentEdge
|
||||
Edges.BottomEdge.Type = 'Bottom'
|
||||
elseif vEdges[nNextEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then
|
||||
Edges.SideEdges.StartEdge = CurrentEdge
|
||||
Edges.SideEdges.StartEdge.Type = 'Side'
|
||||
elseif vEdges[nPreviousEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then
|
||||
Edges.SideEdges.EndEdge = CurrentEdge
|
||||
Edges.SideEdges.EndEdge.Type = 'Side'
|
||||
else
|
||||
table.insert( Edges.OppositeEdges, CurrentEdge)
|
||||
Edges.OppositeEdges[#Edges.OppositeEdges].Type = 'Opposite'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5081,7 +5165,11 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height
|
||||
else
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Height
|
||||
if FaceToMachine.Type == 'Long' then
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Edges.SideEdges[1].Length
|
||||
elseif FaceToMachine.Type == 'Side' then
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Edges.LongEdges[1].Length
|
||||
end
|
||||
end
|
||||
|
||||
-- ricerca lavorazione
|
||||
@@ -5242,32 +5330,43 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.CanApply = true
|
||||
Mortising.Message = ''
|
||||
Mortising.ProcId = Proc.Id
|
||||
local bNeedToMachineOtherSide = false
|
||||
local dTestCornerRadius = 43
|
||||
-- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend
|
||||
local sMortisingType
|
||||
|
||||
local dPocketHeight = 0
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height
|
||||
else
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Height
|
||||
if FaceToMachine.Type == 'Long' then
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Edges.SideEdges[1].Length
|
||||
elseif FaceToMachine.Type == 'Side' then
|
||||
dPocketHeight = Proc.MainFaces.BottomFace.Edges.LongEdges[1].Length
|
||||
end
|
||||
end
|
||||
|
||||
-- ricerca lavorazione
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) + dTestCornerRadius + BD.CUT_EXTRA_MIN)
|
||||
sMortisingType = "OneSideAndExtend"
|
||||
sMortisingType = 'OneSideAndExtend'
|
||||
if not Mortising.Name then
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) / 2 + dTestCornerRadius + BD.CUT_EXTRA_MIN)
|
||||
sMortisingType = "BothSidesAndExtend"
|
||||
sMortisingType = 'BothSidesAndExtend'
|
||||
end
|
||||
elseif EdgeToMachine.Type == 'Side' and #( Proc.MainFaces.SideFaces) == 0 then
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) / 2 + dTestCornerRadius + BD.CUT_EXTRA_MIN)
|
||||
sMortisingType = 'BothSidesAndExtend'
|
||||
else
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation))
|
||||
sMortisingType = "OneSide"
|
||||
sMortisingType = 'OneSide'
|
||||
end
|
||||
if not Mortising.Name then
|
||||
Mortising.Name = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
sMortisingType = "BothSides"
|
||||
if sMortisingType == 'BothSidesAndExtend' then
|
||||
sMortisingType = 'BothSides'
|
||||
elseif sMortisingType == 'OneSideAndExtend' then
|
||||
sMortisingType = 'OneSide'
|
||||
end
|
||||
end
|
||||
if not Mortising.Name then
|
||||
@@ -5311,14 +5410,16 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.ToolInvert = true
|
||||
end
|
||||
-- profondità e offset longitudinale
|
||||
if sMortisingType == "OneSide" then
|
||||
if sMortisingType == 'OneSide' then
|
||||
Mortising.Depth = abs( EdgeToMachine.Elevation)
|
||||
elseif sMortisingType == 'OneSideAndExtend' then
|
||||
Mortising.Depth = abs( EdgeToMachine.Elevation) + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN
|
||||
elseif sMortisingType == 'BothSides' then
|
||||
Mortising.Depth = abs( EdgeToMachine.Elevation) / 2
|
||||
bNeedToMachineOtherSide = true
|
||||
elseif sMortisingType == 'BothSidesAndExtend' then
|
||||
Mortising.Depth = abs( EdgeToMachine.Elevation) / 2 + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN
|
||||
bNeedToMachineOtherSide = true
|
||||
end
|
||||
if Mortising.Tool.MaxMat > Mortising.Depth - 10 * GEO.EPS_SMALL then
|
||||
if EdgeToMachine.Elevation > -10 * GEO.EPS_SMALL then
|
||||
@@ -5357,7 +5458,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.SuggestedAngles = {}
|
||||
Mortising.SuggestedAngles.Index = 1
|
||||
Mortising.SuggestedAngles.VtN = FaceToMachine.VtN
|
||||
Mortising.SuggestedAngles.VtOrthO = EdgeToMachine.ToolDirection
|
||||
Mortising.SuggestedAngles.VtOrtho = EdgeToMachine.ToolDirection
|
||||
-- approccio e retrazione
|
||||
Mortising.LeadIn, Mortising.LeadOut = SawPlusChain.CalculateLeadInOut( Mortising, EdgeToMachine)
|
||||
-- eventuale step verticale
|
||||
@@ -5379,7 +5480,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
EgtOutLog( sDamageNextPieceMessage)
|
||||
end
|
||||
|
||||
return Mortising
|
||||
return Mortising, bNeedToMachineOtherSide
|
||||
end
|
||||
|
||||
|
||||
@@ -5434,7 +5535,10 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
Proc.MainFaces.SideFaces = SawPlusChain.GetSideFaces( Proc)
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
Proc.MainFaces.TunnelAddedFaces = SawPlusChain.GetTunnelFaces( Proc)
|
||||
else
|
||||
Proc.MainFaces.BottomFace.Edges = SawPlusChain.GetBottomFaceEdges( Proc, Proc.MainFaces.BottomFace)
|
||||
end
|
||||
Proc.MainFaces.LongFace.Edges = SawPlusChain.GetLongFaceEdges( Proc, Proc.MainFaces.LongFace)
|
||||
|
||||
-- lama
|
||||
-- lavorazione di lama - fondo della tasca o fino a massimo materiale se tunnel
|
||||
@@ -5452,7 +5556,6 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
end
|
||||
local dBottomDepthToMachine = Cutting.RadialOffset
|
||||
|
||||
-- lato opposto del tunnel
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2])
|
||||
@@ -5501,8 +5604,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
-- sega a catena
|
||||
-- parametri lavorazione con sega a catena - fondo della tasca o tunnel
|
||||
local Mortising = {}
|
||||
local bNeedToMachineOtherSide = false
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[1])
|
||||
Mortising, bNeedToMachineOtherSide = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[1])
|
||||
else
|
||||
Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.BottomEdge)
|
||||
-- si lavora solo quanto non lavorato dalla lama
|
||||
@@ -5512,9 +5616,8 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
if Mortising.CanApply then
|
||||
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
|
||||
end
|
||||
|
||||
-- lato opposto del tunnel
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
if Proc.Topology == 'Tunnel' and bNeedToMachineOtherSide then
|
||||
Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2])
|
||||
bIsMortisingOk = false
|
||||
if Mortising.CanApply then
|
||||
@@ -6853,6 +6956,7 @@ local function MakeStaircaseStep( Proc, nRawId, b3Raw, nPartId)
|
||||
local nFacetRiser, nFacetTread = 0, 1
|
||||
if abs( vtNRiser:getZ()) > abs( vtNTread:getZ()) then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
vtNRiser, vtNTread = vtNTread, vtNRiser
|
||||
end
|
||||
-- riferimenti e dimensioni delle facce
|
||||
@@ -7078,7 +7182,8 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- se lunghezza richiede spezzatura
|
||||
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
|
||||
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) then
|
||||
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) or
|
||||
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > BD.LEN_SHORT_PART or 1000)) then
|
||||
-- una faccia
|
||||
if Proc.Fct == 1 then
|
||||
if bUseBlade then
|
||||
@@ -7117,6 +7222,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
elseif b3Fac1:getDimX() < 1 and abs( vtN2:getX()) < GEO.EPS_SMALL then
|
||||
-- la faccia 0 deve essere quella lunga
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
if bUseBlade then
|
||||
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
|
||||
@@ -7156,10 +7262,12 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if b3Fac1:getDimX() < 1 and b3Fac3:getDimX() < 1 then
|
||||
-- la faccia 0 deve essere quella lunga
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
bApplyBladeOnLongNotContinueFace = true
|
||||
elseif b3Fac1:getDimX() < 1 and b3Fac2:getDimX() < 1 then
|
||||
-- la faccia 0 deve essere quella lunga
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 2)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
bApplyBladeOnLongNotContinueFace = true
|
||||
elseif b3Fac2:getDimX() < 1 and b3Fac3:getDimX() < 1 then
|
||||
bApplyBladeOnLongNotContinueFace = true
|
||||
|
||||
@@ -1070,12 +1070,27 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
local ptP1LineToMachine, _, ptP2LineToMachine = EgtSurfTmFacetOppositeSide( Proc.Id, vOrd[j] - 1, BL.GetVersRef( vFaceUse[vOrd[j]]), GDB_ID.ROOT)
|
||||
local vtTg = ptP2LineToMachine - ptP1LineToMachine ; vtTg:normalize()
|
||||
local bIsMachiningInverted = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
if bIsMachiningInverted then
|
||||
vtTg = -vtTg
|
||||
end
|
||||
if BD.C_SIMM then
|
||||
if abs( vtN[vOrd[j]]:getX()) < GEO.EPS_SMALL then
|
||||
nSCC = EgtIf( ( vtTg:getX() > GEO.EPS_SMALL), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
else
|
||||
nSCC = MCH_SCC.NONE
|
||||
end
|
||||
else
|
||||
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
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 vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( EgtIf( bCanUseUnderBlade, sCuttingDn, sCutting), 'perpendicular', b3Raw, vtN, vtOut))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -10,6 +10,7 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local DC = require( 'DiceCut')
|
||||
local LapJoint = require( 'ProcessLapJoint')
|
||||
|
||||
EgtOutLog( ' ProcessRidgeLap started', 1)
|
||||
|
||||
@@ -48,6 +49,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, 'Q04', 'i') or 0
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- ingombro del pezzo
|
||||
@@ -133,8 +135,15 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
|
||||
if not bOk then return bOk, sErr end
|
||||
if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
|
||||
if not bOk then return bOk, sErr end
|
||||
elseif nForceUseBladeOnNotContinueFace > 0 then
|
||||
EgtSurfTmRemoveFacet( Proc.Id, vFaceOrd[1] - 1)
|
||||
Proc.Fct = Proc.Fct - 1
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- recupero gruppo per geometria addizionale
|
||||
|
||||
@@ -320,10 +320,12 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if bAdj12 then
|
||||
if dAng12 < 0 then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 2)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
end
|
||||
elseif bAdj20 then
|
||||
if dAng20 < 0 then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 1, 2)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
end
|
||||
end
|
||||
-- dati delle facce
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- 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.
|
||||
-- 2024/06/28 In MakeFourFaces aggiunta copia del parametro PartId sulla nuova Proc
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessStepJointNotch = {}
|
||||
@@ -11,6 +12,7 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local DC = require( 'DiceCut')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
|
||||
EgtOutLog( ' ProcessStepJointNotch started', 1)
|
||||
|
||||
@@ -383,7 +385,9 @@ local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidt
|
||||
EgtSurfTmSwapFacets( AddId, 1, 3)
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
-- applico lavorazione
|
||||
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
|
||||
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
Topology.Classify( NewProc, b3Raw)
|
||||
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -478,7 +482,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
-- se diretta verso Z
|
||||
elseif abs( vtExtr:getZ()) > 0.99 then
|
||||
elseif abs( vtExtr:getZ()) > 0.99 and not ( BD.DOWN_HEAD or nTypePos == 0) then
|
||||
-- se diretta verso Z+
|
||||
if vtExtr:getZ() > 0 then
|
||||
-- se sborda verso Z+ abilito solo la lavorazione della parte normale
|
||||
@@ -503,7 +507,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local dExtra = 2
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'Mark'
|
||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||
local bDownHead = BD.DOWN_HEAD and vtExtr:getZ() < GEO.EPS_SMALL
|
||||
local sMilling, bH2
|
||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
if not sMilling then
|
||||
@@ -536,6 +540,14 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
if bExeOpposite then
|
||||
bDownHead = BD.DOWN_HEAD and vtExtr:getZ() > - GEO.EPS_SMALL
|
||||
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 opposto
|
||||
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtAddMachining( sName2, sMilling)
|
||||
|
||||
@@ -1,5 +1,42 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.6g4 (2024/07/19)
|
||||
- Modif : in BatchProcess e BatchProcessNew si forza ricalcolo ogni volta che si è in situazione di CHECK o CHECK + GENERATE
|
||||
|
||||
Versione 2.6g3 (07/07/2024)
|
||||
- Added : aggiunta possibilità di funzione GetNzLimDownUp specifica per ogni macchina
|
||||
- Modif : anche nel taglio a cubetti si chiama GetNzLimDownUp di macchina, se presente, per decidere limite orientamento lama verso il basso
|
||||
- Modif : in BeamExec inserito controllo massimo numero di facce per lanciare GetFacetsInfo
|
||||
- Fixed : in LapJoint corretto typo in nome variabile che provocava mancata impostazione asse bloccato
|
||||
|
||||
Versione 2.6g2 (04/07/2024)
|
||||
- Modif : le lavorazioni BlockHaus, se vicine alla coda, vengono spostate dopo il taglio di separazione
|
||||
|
||||
Versione 2.6g1 (01/07/2024)
|
||||
- Modif : in LongDoubleCut gestita correttamente SCC per lama
|
||||
- Modif : in MachiningLib miglioramenti a scelta testa ottimizzata
|
||||
- Modif : in ProcessDtTenon correzione in scelta testa
|
||||
- Modif : In LapJoint -> VerifySideMillAsSaw modificato criterio ricerca utensile in base a normale della faccia
|
||||
- Fixed : in MakeAntiSplintBySaw se non si trova adiacenza tra le facce si restituisce errore
|
||||
- Fixed : In StepJointNotch, MakeFourFaces corretta copia feature con PartId mancante
|
||||
|
||||
Versione 2.6f2 (17/06/2024)
|
||||
- Modif : correzione a tagli a cubetti (ripristinata versione pre 2.6f1)
|
||||
|
||||
Versione 2.6f1 (06/06/2024)
|
||||
- Added : Q04 (tipo longcut) abilitato anche in RidgeLap (T30), se riconducibile a 2 facce
|
||||
- Modif : migliorie al taglio a cubetti
|
||||
- Modif : in LapJoint -> MakePocket abilitata Q per forzare massima elevazione
|
||||
- Fixed : correzione a SCC per lama da sotto con aggregato
|
||||
- Fixed : correzioni a ottimizzazione teste per macchine con teste sopra/sotto
|
||||
|
||||
Versione 2.6e5 (27/05/2024)
|
||||
- Modif : in LapJoint corretto typo in lavorazione lamello che impediva il funzionamento corretto.
|
||||
|
||||
Versione 2.6e4 (20/05/2024)
|
||||
- Modif : in SawPlusChain le lavorazioni di sega a catena aggiuntive (side) si fermano in mezzeria se tasca passante
|
||||
- Modif : in SawPlusChain il tunnel con sega a catena viene fatto da un solo lato se possibile
|
||||
|
||||
Versione 2.6e3 (14/05/2024)
|
||||
- Modif : in SawPlusChain aggiunta gestione lavorazioni aggiuntive lati aperti e tunnel
|
||||
- Fixed : in Cut -> MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti.
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.6e3'
|
||||
VERSION = '2.6g4'
|
||||
MIN_EXE = '2.6e2'
|
||||
|
||||
Reference in New Issue
Block a user