Compare commits

...

33 Commits

Author SHA1 Message Date
luca.mazzoleni e08b53d5cf Merge branch 'release/2.6f3' 2024-06-19 16:03:34 +02:00
luca.mazzoleni a330b2fd7f update log e versione 2024-06-19 16:03:26 +02:00
luca.mazzoleni acdd4e10fb - in StepJointNotch abilitati correttamente smussi con testa da sotto
- in Lapjoint lunghe che guardano il top, se sufficientemente lunghe, si blocca l'asse C per non sollecitare inutilmente l'asse B
2024-06-19 15:58:31 +02:00
luca.mazzoleni ee6afb65c1 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2024-06-18 12:47:55 +02:00
luca.mazzoleni ea9db1631b in FacesBySaw -> MakeTwo si accettano facce con qualunque orientazione a patto che siano in testa o in coda e abbastanza piccole 2024-06-18 12:47:51 +02:00
andrea.villa 6513e75408 - Corretto accorciamento start/end in caso di inversione percorso
- In MakeByMillAsSaw si cerca di orientare il motore verso il lato più vicino
2024-06-18 12:09:01 +02:00
luca.mazzoleni 0e7d878f10 Merge tag '2.6f2' into develop
release
2024-06-17 12:06:47 +02:00
luca.mazzoleni 8bd0e5d145 Merge branch 'release/2.6f2' 2024-06-17 12:06:20 +02:00
luca.mazzoleni d8ecfc8463 correzione a tagli a cubetti (ripristinata versione pre 2.6f1) 2024-06-17 12:06:04 +02:00
andrea.villa e52a9c66b6 Ripristinata vecchia gestione tagli a cubetti per Ticket#1723 2024-06-06 16:25:15 +02:00
luca.mazzoleni f3785f8644 Merge tag '2.6f1' into develop
release#
2024-06-06 12:31:35 +02:00
luca.mazzoleni 350aaabbbe Merge branch 'release/2.6f1' 2024-06-06 12:31:24 +02:00
luca.mazzoleni 4eb3b38dd4 update log e version 2024-06-06 12:31:02 +02:00
luca.mazzoleni e9534b4eee correzioni a ottimizzazione teste 2024-06-06 11:31:40 +02:00
luca.mazzoleni da061a05e5 Merge branch 'feature/RidgeLapAndLapJointToLongcutModify' into develop 2024-06-05 16:04:43 +02:00
luca.mazzoleni ba432f5029 - piccola correzione a LapJoint 2024-06-05 11:01:47 +02:00
luca.mazzoleni 812397a047 - In LapJoint -> MakePocket abilitata Q per forzare massima elevazione 2024-06-05 09:33:52 +02:00
luca.mazzoleni cbb42ec088 - in BeamLib funzione IsCutNeeded per capire se il taglio viene sostituito da un headcut o split
- in RidgeLap abilitato Q04 come LapJoint, se riconducibile a 2 facce
- GetFacetsInfo richiamata ogni volta che c'è uno swap di facce
- In LapJoint -> MakePocket abilitata Q per forzare massima elevazione
2024-06-05 09:31:46 +02:00
andrea.villa 0c802464e1 In DiceCut.GetOrtoCutCenter se faccia piccola e lunga, tolto limite Z negativa per calcolare cubetti solo se esiste testa sotto. Altrimenti cubetti per forza. 2024-06-03 15:25:18 +02:00
luca.mazzoleni 498c65b006 in FacesBySaw corretto SCC in caso di asse bloccato parallelo 2024-06-03 12:55:50 +02:00
andrea.villa d81a0e8fbd In DiceCut.GetOrtoCutCenter se faccia piccola e lunga, tolto limite Z negativa per calcolare cubetti. 2024-05-30 15:32:47 +02:00
luca.mazzoleni 47fde315a3 Merge tag '2.6e5' into develop
release
2024-05-27 15:34:51 +02:00
luca.mazzoleni 3ac61219c9 Merge branch 'release/2.6e5' 2024-05-27 15:34:38 +02:00
luca.mazzoleni bad0018381 update log e version 2024-05-27 15:34:05 +02:00
luca.mazzoleni 48261c36d8 - in LapJoint - svuotature massimo diametro riportato a 3 volte la dimensione minima tasca perchè con certe tasche dà problemi di calcolo offset 2024-05-23 17:53:40 +02:00
luca.mazzoleni 4f9093b1d2 - in LapJoint corretto typo parentesi e modificato diametro massimo per svuotature 2024-05-23 15:46:58 +02:00
luca.mazzoleni 52830876e9 Merge tag '2.6e4' into develop
release
2024-05-20 11:01:00 +02:00
luca.mazzoleni 4513833fb3 Merge branch 'release/2.6e4' 2024-05-20 11:00:46 +02:00
luca.mazzoleni 26cc812ed1 - update log e commenti 2024-05-20 11:00:23 +02:00
luca.mazzoleni cc3ff75ea2 - modifica commento 2024-05-20 10:57:21 +02:00
luca.mazzoleni b150c75e96 - in MachiningLib -> FindMachining si considera ottimizzazione teste solo per macchine tipo PF e non più per macchine tipo PF1250
- in SawPlusChain varie migliorie
2024-05-15 17:08:50 +02:00
luca.mazzoleni cc3b0da9e5 - in SawPlusChain le lavorazioni di sega a catena aggiuntive (side) si fermano in mezzeria se tasca passante
- in SawPlusChain il tunnel con sega a catena viene fatto da un solo lato se possibile
2024-05-14 19:00:26 +02:00
luca.mazzoleni 6c8e3017d0 Merge tag '2.6e3' into develop
release
2024-05-14 13:14:45 +02:00
10 changed files with 243 additions and 109 deletions
+27
View File
@@ -1267,5 +1267,32 @@ function BeamLib.GetMachiningSteps( dMachiningDepth, dStep)
return MachiningSteps return MachiningSteps
end 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 return BeamLib
+28 -23
View File
@@ -28,6 +28,7 @@
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile. -- 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/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/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 -- Tabella per definizione modulo
local FacesBySaw = {} local FacesBySaw = {}
@@ -250,6 +251,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
if bInvert then if bInvert then
ptP1, ptP2 = ptP2, ptP1 ptP1, ptP2 = ptP2, ptP1
vtV1, vtV2 = vtV2, vtV1 vtV1, vtV2 = vtV2, vtV1
dAccStart, dAccEnd = dAccEnd, dAccStart
end end
local vtTg = ptP2 - ptP1 ; vtTg:normalize() local vtTg = ptP2 - ptP1 ; vtTg:normalize()
local dAllStart = 0 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) EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if not BD.TURN then 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) nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
else else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) 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) EgtOutLog( sErr)
return false, sErr return false, sErr
end 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 -- dati delle facce
local ptC = {} local ptC = {}
local vtN = {} local vtN = {}
@@ -526,10 +550,10 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
local ptM = ( ptT1 + ptT2) / 2 local ptM = ( ptT1 + ptT2) / 2
local vtTg = ptT2 - ptT1 ; vtTg:normalize() local vtTg = ptT2 - ptT1 ; vtTg:normalize()
local bConvex = ( dAngT > 0) 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 = {} local bFaceOk = {}
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or abs( vtN[1]: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) 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 if not bDownHead and ( not bFaceOk[1] or not bFaceOk[2]) then
local sErr = 'Error : TwoFacesBySaw from bottom impossible' local sErr = 'Error : TwoFacesBySaw from bottom impossible'
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -564,25 +588,6 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
nUpInd = nBigInd nUpInd = nBigInd
nOtInd = nSmaInd nOtInd = nSmaInd
end 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 -- calcolo extra taglio
local dCutExtra = 0 local dCutExtra = 0
if dAngT < -91 and dAngT > -179 then if dAngT < -91 and dAngT > -179 then
+26 -43
View File
@@ -74,37 +74,31 @@ local function SetCurrMachineHeadType()
end 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() local function ConfirmNextMachining()
-- se non definita testa successiva, esco -- utensile corrente
if not nNextMachHead or nNextMachHead < 1 or nNextMachHead > 2 then return end local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
-- altrimenti, la confermo come attiva local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
nActiveHead = nNextMachHead EgtTdbSetCurrTool( sToolName or '')
if nNextMachHead == 1 then -- testa dell'utensile corrente
H1_TOOL = H1_NEXT_TOOL local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
elseif nNextMachHead == 2 then local nHead = tonumber( sHead:sub( 2, #sHead)) + 0
H2_TOOL = H2_NEXT_TOOL
end
-- reset prossima testa
nNextMachHead = 0
H1_NEXT_TOOL = ''
H2_NEXT_TOOL = ''
end
--------------------------------------------------------------------- if ( nHead < 10 and nHead >= 30) or vFixedHeads[nHead] then
-- funzione che traccia testa e utensile ipotizzati -- testa che non richiede ottimizzazione
local function SetNextMachining( sToolName, nHead, bFixed) return
if nHead < 1 or nHead > 2 then return end elseif nHead >= 20 then
if bFixed then nHead = 2
nNextMachHead = 0 elseif nHead >= 10 then
H1_NEXT_TOOL = '' nHead = 1
H2_NEXT_TOOL = ''
end end
nNextMachHead = nHead
if nHead == 1 then -- se la testa richiede ottimizzazione, confermo testa attiva
H1_NEXT_TOOL = sToolName nActiveHead = nHead
elseif nHead == 2 then if nActiveHead == 1 then
H2_NEXT_TOOL = sToolName H1_TOOL = sToolName
elseif nActiveHead == 2 then
H2_TOOL = sToolName
end end
end end
@@ -356,16 +350,16 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
end 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 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') _, 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 if not EgtEndsWith( sType, '_H2') then
sType = sType .. '_H2' sType = sType .. '_H2'
end end
end end
local MachineHeadUse = MachineHeadType 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 MachineHeadUse = ONE_HEAD
end 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 -- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
MachineHeadUse = TWO_EQUAL_HEADS MachineHeadUse = TWO_EQUAL_HEADS
end end
@@ -374,7 +368,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
for i = ForStart, ForEnd, ForStep do for i = ForStart, ForEnd, ForStep do
local Machining = Machinings[i] local Machining = Machinings[i]
local sMachiningType = Machining.Type local sMachiningType = Machining.Type
if BEAM and BEAM.BW then if ( BEAM and BEAM.BW) or MachineHeadUse == TWO_EQUAL_HEADS then
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2') _, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
end end
-- recupero dati utensile -- recupero dati utensile
@@ -383,18 +377,15 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2) local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2)
if bOk then if bOk then
if MachineHeadUse == ONE_HEAD then if MachineHeadUse == ONE_HEAD then
SetNextMachining( sToolName, 1, bFixed)
return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams)
elseif MachineHeadUse == TWO_EQUAL_HEADS then elseif MachineHeadUse == TWO_EQUAL_HEADS then
-- se nessuna testa attiva, prendo la prima lavorazione disponibile -- se nessuna testa attiva, prendo la prima lavorazione disponibile
if nActiveHead == 0 then if nActiveHead == 0 then
SetNextMachining( sToolName, EgtIf( bH2, 2, 1), bFixed)
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
-- verifico se posso usare lo stesso utensile della testa attiva -- verifico se posso usare lo stesso utensile della testa attiva
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo -- 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 if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then
SetNextMachining( sToolName, nActiveHead, bFixed)
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
end end
end end
@@ -414,10 +405,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
end end
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
if bTopHead and not bH2 then if bTopHead and not bH2 then
SetNextMachining( sToolName, 1, bFixed)
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
elseif bDownHead and bH2 then elseif bDownHead and bH2 then
SetNextMachining( sToolName, 2, bFixed)
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
end end
end end
@@ -428,31 +417,25 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi -- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
SetNextMachining( sH1Tool, 1, bFixed)
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
SetNextMachining( sH2Tool, 2, bFixed)
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
end end
end end
-- verifico se cambiare testa o cambiare utensile su quella corrente -- verifico se cambiare testa o cambiare utensile su quella corrente
if nActiveHead == 1 then if nActiveHead == 1 then
if sH2Mach ~= "" then if sH2Mach ~= "" then
SetNextMachining( sH2Tool, 2, bFixed)
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen --return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
elseif sH1Mach ~= "" then elseif sH1Mach ~= "" then
SetNextMachining( sH1Tool, 1, bFixed)
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen --return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
end end
elseif nActiveHead == 2 then elseif nActiveHead == 2 then
if sH1Mach ~= "" then if sH1Mach ~= "" then
SetNextMachining( sH1Tool, 1, bFixed)
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen --return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
elseif sH2Mach ~= "" then elseif sH2Mach ~= "" then
SetNextMachining( sH2Tool, 2, bFixed)
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen --return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
end end
+1 -14
View File
@@ -821,20 +821,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- se taglio di testa -- se taglio di testa
if not bForced then if not bForced then
if Proc.Head then if not BL.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail) 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
return true return true
end end
end end
+108 -22
View File
@@ -105,6 +105,7 @@
-- 2024/04/15 In SideMillAsSaw gestito anche rabbet -- 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/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/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)
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessLapJoint = {} local ProcessLapJoint = {}
@@ -203,6 +204,8 @@ local function AssignQIdent( Proc)
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- i Q_ANTISPLINT_TYPE = 'Q06' -- i
Q_DEPTH_CHAMFER = 'Q07' -- d 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 elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
Q_SIDE_ROUGH_TOOL = 'Q01' -- i Q_SIDE_ROUGH_TOOL = 'Q01' -- i
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
@@ -553,7 +556,7 @@ local function VerifySideMillAsSaw( Proc, nAddGrpId, vtN, dDiam, dFacElev)
-- cancello la copia del percorso -- cancello la copia del percorso
EgtErase( nTestId) EgtErase( nTestId)
-- eseguo test -- 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 return false
end end
-- Verifico sia abbastanza lunga -- Verifico sia abbastanza lunga
@@ -2664,7 +2667,8 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
local dLen = dist( ptP1, ptP2) local dLen = dist( ptP1, ptP2)
if abs( dLen - dMaxLen) < 5 then if abs( dLen - dMaxLen) < 5 then
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT) 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] nFacAdj = vAdj[i]
dMaxLen = dLen dMaxLen = dLen
end end
@@ -3295,6 +3299,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE 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 if bLapJointAngTrasm then
nSCC = MCH_SCC.ADIR_NEAR nSCC = MCH_SCC.ADIR_NEAR
elseif not BD.C_SIMM and not BD.TURN then elseif not BD.C_SIMM and not BD.TURN then
@@ -3339,7 +3348,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
EgtOutLog( sWarn) EgtOutLog( sWarn)
end end
-- imposto elevazione e dichiaro non si generano sfridi per VMill -- 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;' sNotes = sNotes .. 'VMRS=0;'
if bOpenOutRaw then if bOpenOutRaw then
sNotes = sNotes .. 'OpenOutRaw=1;' sNotes = sNotes .. 'OpenOutRaw=1;'
@@ -4617,8 +4630,6 @@ end
-- TODO gestione messaggi in funzione apposita (almeno per append) -- TODO gestione messaggi in funzione apposita (almeno per append)
-- TODO gestire topologia tunnel (anche da due lati)
local SawPlusChain = {} local SawPlusChain = {}
SawPlusChain.Saw = {} SawPlusChain.Saw = {}
SawPlusChain.Chainsaw = {} SawPlusChain.Chainsaw = {}
@@ -4681,6 +4692,7 @@ function SawPlusChain.GetTunnelFaces( Proc)
if TunnelAddedFaces.MiddleFaceTm.Height > TunnelAddedFaces.MiddleFaceTm.Width then if TunnelAddedFaces.MiddleFaceTm.Height > TunnelAddedFaces.MiddleFaceTm.Width then
TunnelAddedFaces.MiddleFaceTm.Height, TunnelAddedFaces.MiddleFaceTm.Width = TunnelAddedFaces.MiddleFaceTm.Width, TunnelAddedFaces.MiddleFaceTm.Height TunnelAddedFaces.MiddleFaceTm.Height, TunnelAddedFaces.MiddleFaceTm.Width = TunnelAddedFaces.MiddleFaceTm.Width, TunnelAddedFaces.MiddleFaceTm.Height
end end
TunnelAddedFaces.MiddleFaceTm.Type = 'Tunnel'
return TunnelAddedFaces return TunnelAddedFaces
end end
@@ -4712,6 +4724,7 @@ function SawPlusChain.GetBottomFace( Proc)
end end
BottomFace.Id = nBottomFace BottomFace.Id = nBottomFace
BottomFace.Type = 'Bottom'
BottomFace.Width = Proc.Face[nBottomFace + 1].Width BottomFace.Width = Proc.Face[nBottomFace + 1].Width
BottomFace.Height = Proc.Face[nBottomFace + 1].Height BottomFace.Height = Proc.Face[nBottomFace + 1].Height
BottomFace.Elevation = Proc.Face[nBottomFace + 1].Elevation BottomFace.Elevation = Proc.Face[nBottomFace + 1].Elevation
@@ -4725,6 +4738,7 @@ end
function SawPlusChain.GetLongFace( Proc) function SawPlusChain.GetLongFace( Proc)
local LongFace = {}
if not Proc.MainFaces.BottomFace or not Proc.MainFaces.BottomFace.Id then if not Proc.MainFaces.BottomFace or not Proc.MainFaces.BottomFace.Id then
Proc.MainFaces.BottomFace = SawPlusChain.GetBottomFace( Proc) Proc.MainFaces.BottomFace = SawPlusChain.GetBottomFace( Proc)
end end
@@ -4746,10 +4760,10 @@ function SawPlusChain.GetLongFace( Proc)
end end
-- si sceglie la più grande (tunnel) o quella adiacente sul lato lungo -- si sceglie la più grande (tunnel) o quella adiacente sul lato lungo
local LongFace = {}
LongFace.Id = FacesToAnalyze[1].Id LongFace.Id = FacesToAnalyze[1].Id
for i = 1, Proc.Fct do for i = 1, Proc.Fct do
if LongFace.Id == Proc.Face[i].Id then if LongFace.Id == Proc.Face[i].Id then
LongFace.Type = 'Long'
LongFace.Width = Proc.Face[i].Width LongFace.Width = Proc.Face[i].Width
LongFace.Height = Proc.Face[i].Height LongFace.Height = Proc.Face[i].Height
LongFace.Elevation = Proc.Face[i].Elevation LongFace.Elevation = Proc.Face[i].Elevation
@@ -4760,8 +4774,6 @@ function SawPlusChain.GetLongFace( Proc)
end end
end end
LongFace.Edges = SawPlusChain.GetLongFaceEdges( Proc, LongFace)
return LongFace return LongFace
end end
@@ -4799,6 +4811,7 @@ function SawPlusChain.GetSideFaces( Proc)
( bIsLongFaceTheLargest and i > 2) then ( bIsLongFaceTheLargest and i > 2) then
table.insert( SideFaces, FacesToAnalyze[i]) table.insert( SideFaces, FacesToAnalyze[i])
SideFaces[#SideFaces].Id = FacesToAnalyze[i].Id SideFaces[#SideFaces].Id = FacesToAnalyze[i].Id
SideFaces[#SideFaces].Type = 'Side'
SideFaces[#SideFaces].Width = Proc.Face[FacesToAnalyze[i].Id + 1].Width SideFaces[#SideFaces].Width = Proc.Face[FacesToAnalyze[i].Id + 1].Width
SideFaces[#SideFaces].Height = Proc.Face[FacesToAnalyze[i].Id + 1].Height SideFaces[#SideFaces].Height = Proc.Face[FacesToAnalyze[i].Id + 1].Height
SideFaces[#SideFaces].Elevation = Proc.Face[FacesToAnalyze[i].Id + 1].Elevation SideFaces[#SideFaces].Elevation = Proc.Face[FacesToAnalyze[i].Id + 1].Elevation
@@ -4813,6 +4826,51 @@ function SawPlusChain.GetSideFaces( Proc)
end 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) function SawPlusChain.GetLongFaceEdges( Proc, Face)
local Edges = {} local Edges = {}
Edges.SideEdges = {} Edges.SideEdges = {}
@@ -4848,12 +4906,16 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
else else
if CurrentEdge.AdjacentFaceId == Proc.MainFaces.BottomFace.Id then if CurrentEdge.AdjacentFaceId == Proc.MainFaces.BottomFace.Id then
Edges.BottomEdge = CurrentEdge Edges.BottomEdge = CurrentEdge
Edges.BottomEdge.Type = 'Bottom'
elseif vEdges[nNextEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then elseif vEdges[nNextEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then
Edges.SideEdges.StartEdge = CurrentEdge Edges.SideEdges.StartEdge = CurrentEdge
Edges.SideEdges.StartEdge.Type = 'Side'
elseif vEdges[nPreviousEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then elseif vEdges[nPreviousEdgeIndex].Adj == Proc.MainFaces.BottomFace.Id then
Edges.SideEdges.EndEdge = CurrentEdge Edges.SideEdges.EndEdge = CurrentEdge
Edges.SideEdges.EndEdge.Type = 'Side'
else else
table.insert( Edges.OppositeEdges, CurrentEdge) table.insert( Edges.OppositeEdges, CurrentEdge)
Edges.OppositeEdges[#Edges.OppositeEdges].Type = 'Opposite'
end end
end end
end end
@@ -5081,7 +5143,11 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
if Proc.Topology == 'Tunnel' then if Proc.Topology == 'Tunnel' then
dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height
else 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 end
-- ricerca lavorazione -- ricerca lavorazione
@@ -5242,32 +5308,43 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
Mortising.CanApply = true Mortising.CanApply = true
Mortising.Message = '' Mortising.Message = ''
Mortising.ProcId = Proc.Id Mortising.ProcId = Proc.Id
local bNeedToMachineOtherSide = false
local dTestCornerRadius = 43 local dTestCornerRadius = 43
-- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend
local sMortisingType local sMortisingType
local dPocketHeight = 0 local dPocketHeight = 0
if Proc.Topology == 'Tunnel' then if Proc.Topology == 'Tunnel' then
dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height dPocketHeight = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Height
else 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 end
-- ricerca lavorazione -- ricerca lavorazione
if Proc.Topology == 'Tunnel' then if Proc.Topology == 'Tunnel' then
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) + dTestCornerRadius + BD.CUT_EXTRA_MIN) Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) + dTestCornerRadius + BD.CUT_EXTRA_MIN)
sMortisingType = "OneSideAndExtend" sMortisingType = 'OneSideAndExtend'
if not Mortising.Name then if not Mortising.Name then
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) / 2 + dTestCornerRadius + BD.CUT_EXTRA_MIN) Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation) / 2 + dTestCornerRadius + BD.CUT_EXTRA_MIN)
sMortisingType = "BothSidesAndExtend" sMortisingType = 'BothSidesAndExtend'
end 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 else
Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation)) Mortising.Name = ML.FindSawing( 'Sawing', abs( EdgeToMachine.Elevation))
sMortisingType = "OneSide" sMortisingType = 'OneSide'
end end
if not Mortising.Name then if not Mortising.Name then
Mortising.Name = ML.FindSawing( 'Sawing', nil, nil, 'Longest') Mortising.Name = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
if Proc.Topology == 'Tunnel' then if sMortisingType == 'BothSidesAndExtend' then
sMortisingType = "BothSides" sMortisingType = 'BothSides'
elseif sMortisingType == 'OneSideAndExtend' then
sMortisingType = 'OneSide'
end end
end end
if not Mortising.Name then if not Mortising.Name then
@@ -5311,14 +5388,16 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
Mortising.ToolInvert = true Mortising.ToolInvert = true
end end
-- profondità e offset longitudinale -- profondità e offset longitudinale
if sMortisingType == "OneSide" then if sMortisingType == 'OneSide' then
Mortising.Depth = abs( EdgeToMachine.Elevation) Mortising.Depth = abs( EdgeToMachine.Elevation)
elseif sMortisingType == 'OneSideAndExtend' then elseif sMortisingType == 'OneSideAndExtend' then
Mortising.Depth = abs( EdgeToMachine.Elevation) + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN Mortising.Depth = abs( EdgeToMachine.Elevation) + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN
elseif sMortisingType == 'BothSides' then elseif sMortisingType == 'BothSides' then
Mortising.Depth = abs( EdgeToMachine.Elevation) / 2 Mortising.Depth = abs( EdgeToMachine.Elevation) / 2
bNeedToMachineOtherSide = true
elseif sMortisingType == 'BothSidesAndExtend' then elseif sMortisingType == 'BothSidesAndExtend' then
Mortising.Depth = abs( EdgeToMachine.Elevation) / 2 + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN Mortising.Depth = abs( EdgeToMachine.Elevation) / 2 + Mortising.Tool.CornerRadius + BD.CUT_EXTRA_MIN
bNeedToMachineOtherSide = true
end end
if Mortising.Tool.MaxMat > Mortising.Depth - 10 * GEO.EPS_SMALL then if Mortising.Tool.MaxMat > Mortising.Depth - 10 * GEO.EPS_SMALL then
if EdgeToMachine.Elevation > -10 * GEO.EPS_SMALL then if EdgeToMachine.Elevation > -10 * GEO.EPS_SMALL then
@@ -5379,7 +5458,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
EgtOutLog( sDamageNextPieceMessage) EgtOutLog( sDamageNextPieceMessage)
end end
return Mortising return Mortising, bNeedToMachineOtherSide
end end
@@ -5434,7 +5513,10 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
Proc.MainFaces.SideFaces = SawPlusChain.GetSideFaces( Proc) Proc.MainFaces.SideFaces = SawPlusChain.GetSideFaces( Proc)
if Proc.Topology == 'Tunnel' then if Proc.Topology == 'Tunnel' then
Proc.MainFaces.TunnelAddedFaces = SawPlusChain.GetTunnelFaces( Proc) Proc.MainFaces.TunnelAddedFaces = SawPlusChain.GetTunnelFaces( Proc)
else
Proc.MainFaces.BottomFace.Edges = SawPlusChain.GetBottomFaceEdges( Proc, Proc.MainFaces.BottomFace)
end end
Proc.MainFaces.LongFace.Edges = SawPlusChain.GetLongFaceEdges( Proc, Proc.MainFaces.LongFace)
-- lama -- lama
-- lavorazione di lama - fondo della tasca o fino a massimo materiale se tunnel -- lavorazione di lama - fondo della tasca o fino a massimo materiale se tunnel
@@ -5452,7 +5534,6 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
return bIsCuttingOk, Cutting.Message return bIsCuttingOk, Cutting.Message
end end
local dBottomDepthToMachine = Cutting.RadialOffset local dBottomDepthToMachine = Cutting.RadialOffset
-- lato opposto del tunnel -- lato opposto del tunnel
if Proc.Topology == 'Tunnel' then if Proc.Topology == 'Tunnel' then
Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2]) Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2])
@@ -5501,8 +5582,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
-- sega a catena -- sega a catena
-- parametri lavorazione con sega a catena - fondo della tasca o tunnel -- parametri lavorazione con sega a catena - fondo della tasca o tunnel
local Mortising = {} local Mortising = {}
local bNeedToMachineOtherSide = false
if Proc.Topology == 'Tunnel' then 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 else
Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.BottomEdge) Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.BottomEdge)
-- si lavora solo quanto non lavorato dalla lama -- si lavora solo quanto non lavorato dalla lama
@@ -5512,9 +5594,8 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
if Mortising.CanApply then if Mortising.CanApply then
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw) bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
end end
-- lato opposto del tunnel -- 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]) Mortising = SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.OppositeEdges[2])
bIsMortisingOk = false bIsMortisingOk = false
if Mortising.CanApply then if Mortising.CanApply then
@@ -6853,6 +6934,7 @@ local function MakeStaircaseStep( Proc, nRawId, b3Raw, nPartId)
local nFacetRiser, nFacetTread = 0, 1 local nFacetRiser, nFacetTread = 0, 1
if abs( vtNRiser:getZ()) > abs( vtNTread:getZ()) then if abs( vtNRiser:getZ()) > abs( vtNTread:getZ()) then
EgtSurfTmSwapFacets( Proc.Id, 0, 1) EgtSurfTmSwapFacets( Proc.Id, 0, 1)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
vtNRiser, vtNTread = vtNTread, vtNRiser vtNRiser, vtNTread = vtNTread, vtNRiser
end end
-- riferimenti e dimensioni delle facce -- riferimenti e dimensioni delle facce
@@ -7078,7 +7160,8 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
-- se lunghezza richiede spezzatura -- se lunghezza richiede spezzatura
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or 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 -- una faccia
if Proc.Fct == 1 then if Proc.Fct == 1 then
if bUseBlade then if bUseBlade then
@@ -7117,6 +7200,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
elseif b3Fac1:getDimX() < 1 and abs( vtN2:getX()) < GEO.EPS_SMALL then elseif b3Fac1:getDimX() < 1 and abs( vtN2:getX()) < GEO.EPS_SMALL then
-- la faccia 0 deve essere quella lunga -- la faccia 0 deve essere quella lunga
EgtSurfTmSwapFacets( Proc.Id, 0, 1) EgtSurfTmSwapFacets( Proc.Id, 0, 1)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
if bUseBlade then if bUseBlade then
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace) return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
@@ -7156,10 +7240,12 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if b3Fac1:getDimX() < 1 and b3Fac3:getDimX() < 1 then if b3Fac1:getDimX() < 1 and b3Fac3:getDimX() < 1 then
-- la faccia 0 deve essere quella lunga -- la faccia 0 deve essere quella lunga
EgtSurfTmSwapFacets( Proc.Id, 0, 1) EgtSurfTmSwapFacets( Proc.Id, 0, 1)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
bApplyBladeOnLongNotContinueFace = true bApplyBladeOnLongNotContinueFace = true
elseif b3Fac1:getDimX() < 1 and b3Fac2:getDimX() < 1 then elseif b3Fac1:getDimX() < 1 and b3Fac2:getDimX() < 1 then
-- la faccia 0 deve essere quella lunga -- la faccia 0 deve essere quella lunga
EgtSurfTmSwapFacets( Proc.Id, 0, 2) EgtSurfTmSwapFacets( Proc.Id, 0, 2)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
bApplyBladeOnLongNotContinueFace = true bApplyBladeOnLongNotContinueFace = true
elseif b3Fac2:getDimX() < 1 and b3Fac3:getDimX() < 1 then elseif b3Fac2:getDimX() < 1 and b3Fac3:getDimX() < 1 then
bApplyBladeOnLongNotContinueFace = true bApplyBladeOnLongNotContinueFace = true
+11 -2
View File
@@ -10,6 +10,7 @@ local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw') local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut') local Cut = require( 'ProcessCut')
local DC = require( 'DiceCut') local DC = require( 'DiceCut')
local LapJoint = require( 'ProcessLapJoint')
EgtOutLog( ' ProcessRidgeLap started', 1) EgtOutLog( ' ProcessRidgeLap started', 1)
@@ -48,6 +49,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, 'Q04', 'i') or 0
-- recupero l'ingombro del grezzo di appartenenza -- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId) local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo -- 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 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, 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} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false) if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then
if not bOk then return bOk, sErr end 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
end end
-- recupero gruppo per geometria addizionale -- recupero gruppo per geometria addizionale
+2
View File
@@ -320,10 +320,12 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
if bAdj12 then if bAdj12 then
if dAng12 < 0 then if dAng12 < 0 then
EgtSurfTmSwapFacets( Proc.Id, 0, 2) EgtSurfTmSwapFacets( Proc.Id, 0, 2)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
end end
elseif bAdj20 then elseif bAdj20 then
if dAng20 < 0 then if dAng20 < 0 then
EgtSurfTmSwapFacets( Proc.Id, 1, 2) EgtSurfTmSwapFacets( Proc.Id, 1, 2)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
end end
end end
-- dati delle facce -- dati delle facce
+13 -2
View File
@@ -11,6 +11,7 @@ local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw') local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut') local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut') local Cut = require( 'ProcessCut')
local Topology = require( 'FeatureTopology')
EgtOutLog( ' ProcessStepJointNotch started', 1) EgtOutLog( ' ProcessStepJointNotch started', 1)
@@ -384,6 +385,8 @@ local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidt
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
-- applico lavorazione -- 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}
local b3Raw = EgtGetRawPartBBox( nRawId)
Topology.Classify( NewProc, b3Raw)
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth) local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
@@ -478,7 +481,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
end end
-- se diretta verso Z -- 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+ -- se diretta verso Z+
if vtExtr:getZ() > 0 then if vtExtr:getZ() > 0 then
-- se sborda verso Z+ abilito solo la lavorazione della parte normale -- se sborda verso Z+ abilito solo la lavorazione della parte normale
@@ -503,7 +506,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
local dExtra = 2 local dExtra = 2
-- recupero la lavorazione -- recupero la lavorazione
local sMillType = 'Mark' local sMillType = 'Mark'
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1) local bDownHead = BD.DOWN_HEAD and vtExtr:getZ() < GEO.EPS_SMALL
local sMilling, bH2 local sMilling, bH2
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead) sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
if not sMilling then if not sMilling then
@@ -536,6 +539,14 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
end end
if bExeOpposite then 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 -- Inserisco la lavorazione del lato opposto
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtAddMachining( sName2, sMilling) local nMch2Id = EgtAddMachining( sName2, sMilling)
+24
View File
@@ -1,5 +1,29 @@
==== Beam Update Log ==== ==== Beam Update Log ====
Versione 2.6f3 (19/06/2024)
- Modif : in LapJoint -> MakeByMillAsSaw si cerca di orientare il motore verso il lato più vicino
- Modif : in FacesBySaw -> MakeTwo si accettano facce con qualunque orientazione a patto che siano in testa o in coda e abbastanza piccole
- Modif : in Lapjoint lunghe che guardano il top, se sufficientemente lunghe, si blocca l'asse C per non sollecitare inutilmente l'asse B
- Fixed : in FacesBySaw -> MakeOne corretto accorciamento start/end in caso di inversione percorso
- Fixed : in StepJointNotch abilitati correttamente smussi con testa da sotto
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) Versione 2.6e3 (14/05/2024)
- Modif : in SawPlusChain aggiunta gestione lavorazioni aggiuntive lati aperti e tunnel - Modif : in SawPlusChain aggiunta gestione lavorazioni aggiuntive lati aperti e tunnel
- Fixed : in Cut -> MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti. - Fixed : in Cut -> MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti.
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam -- Gestione della versione di Beam
NAME = 'Beam' NAME = 'Beam'
VERSION = '2.6e3' VERSION = '2.6f3'
MIN_EXE = '2.6e2' MIN_EXE = '2.6e2'