From 6513e75408bc53f54e0e54ac126228a165ef733a Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 18 Jun 2024 12:09:01 +0200 Subject: [PATCH 1/4] =?UTF-8?q?-=20Corretto=20accorciamento=20start/end=20?= =?UTF-8?q?in=20caso=20di=20inversione=20percorso=20-=20In=20MakeByMillAsS?= =?UTF-8?q?aw=20si=20cerca=20di=20orientare=20il=20motore=20verso=20il=20l?= =?UTF-8?q?ato=20pi=C3=B9=20vicino?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/FacesBySaw.lua | 2 ++ LuaLibs/ProcessLapJoint.lua | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index ebf2f8e..bc0e809 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -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 diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 00cdaf8..fca6f1c 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -105,6 +105,7 @@ -- 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) -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -2666,7 +2667,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 From ea9db1631bdbf1581fce017d582bbdd942e6b443 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 18 Jun 2024 12:47:51 +0200 Subject: [PATCH 2/4] in FacesBySaw -> MakeTwo si accettano facce con qualunque orientazione a patto che siano in testa o in coda e abbastanza piccole --- LuaLibs/FacesBySaw.lua | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index ebf2f8e..d16b546 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -514,6 +514,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 = {} @@ -529,10 +548,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) @@ -567,25 +586,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 From acdd4e10fbc1a0a11b08310f74340f07a935436a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 19 Jun 2024 15:58:31 +0200 Subject: [PATCH 3/4] - 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 --- LuaLibs/ProcessLapJoint.lua | 5 +++++ LuaLibs/ProcessStepJointNotch.lua | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index fca6f1c..87570b6 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -3299,6 +3299,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 diff --git a/LuaLibs/ProcessStepJointNotch.lua b/LuaLibs/ProcessStepJointNotch.lua index 6cc0035..1f206d1 100644 --- a/LuaLibs/ProcessStepJointNotch.lua +++ b/LuaLibs/ProcessStepJointNotch.lua @@ -481,7 +481,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 @@ -506,7 +506,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 @@ -539,6 +539,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) From a330b2fd7fdff418644cd8d8ee51386c70676396 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 19 Jun 2024 16:03:26 +0200 Subject: [PATCH 4/4] update log e versione --- UpdateLog.txt | 7 +++++++ Version.lua | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 92843cb..0bb46ea 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,12 @@ ==== 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) diff --git a/Version.lua b/Version.lua index e12b1c0..93f7b9e 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.6f2' +VERSION = '2.6f3' MIN_EXE = '2.6e2'