From dcd600af01f0cd7e500e652915d247d38ed0d201 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 29 Nov 2024 17:21:17 +0100 Subject: [PATCH 1/5] - in LapJoint correzioni varie --- LuaLibs/WProcessLapJoint.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index bbe2040..02fba41 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -2015,6 +2015,10 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d local nStep = ceil( ( dThick - dMaxMat) / dStep) dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0) local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0) + -- tasca aperta sopra non necessita di MaxElev + if Proc.Fct == 2 and Proc.AffectedFaces.Top then + dMaxElev = nil + end if nSinglePass and nSinglePass > 0 then dStep = 0 if nSinglePass == 1 then @@ -2028,7 +2032,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d -- leggo eventuali note esistenti della lavorazione local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) -- aggiungo alle note massima elevazione - sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3)) + if dMaxElev then + sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3)) + end -- se lavorazione in doppio aggiungo le rispettive note if Proc.Double and Proc.Double == 2 then sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double) @@ -2880,13 +2886,15 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) -- se ho abilitata lavorazione di fresa di fianco if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 and not bIsSmallSlot then -- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH - local dMaxDepthOnSide = 0 + local dMaxDepthOnSide = 999 local dMillDiam = 0 + local dMillDiamTh = EgtTdbGetCurrToolThDiam() or 60 if EgtMdbSetCurrMachining( sMillOnSide) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam - dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide + dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh + dMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide, 0.5 * ( dMillDiam - dMillDiamTh)) end end local bMakeFirstGroove @@ -2975,7 +2983,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw) else local sErr = 'Side milling not possible' EgtOutLog( sErr) - return true, sErr + return false, sErr end -- fessura verticale elseif Proc.Stype == 3 then From 6a6a194df637ee02e45eedc314092da1b8c197cd Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 29 Nov 2024 17:52:11 +0100 Subject: [PATCH 2/5] - in LapJoint modifica al calcolo feature passante per gorge --- LuaLibs/WProcessLapJoint.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 02fba41..95e736d 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -1691,13 +1691,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d dExtraLongEnd = 0 end -- se ho abilitato la lavorazione di fresatura per garantire passaggio gambo utensile, inserisco la lavorazione - local bThroughRaw = false if bEnablePreMill then - -- verifico se feature e' passante - if ((Proc.Box:getMin():getX() < ( b3Raw:getMin():getX() + 50)) and (Proc.Box:getMax():getX() > ( b3Raw:getMax():getX() - 50))) or - ((Proc.Box:getMin():getY() < ( b3Raw:getMin():getY() + 50)) and (Proc.Box:getMax():getY() > ( b3Raw:getMax():getY() - 50))) then - bThroughRaw = true - end -- recupero la lavorazione di taglio local sCuttingGorge = WM.FindCutting( 'Standard') @@ -1745,7 +1739,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d local bSawInvertSE = false -- se non passante, aggiungo fresatura area della fresa - if not bThroughRaw and nNumStep - 1 > 0 then + if not Proc.IsThrough and nNumStep - 1 > 0 then local SquareId -- Id della composita da fresare local dSawShortening = sqrt( b3Raw:getDimZ() * ( dSawDiam - b3Raw:getDimZ())) -- da calcolare in base a raggio lama e spessore grezzo -- gruppo ausiliario From 6a86f7798e38325a31bbc3de7ef879b8a904c564 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 2 Dec 2024 11:47:48 +0100 Subject: [PATCH 3/5] - in FreeContour eLapJoint ->CleanCorner si scrivono ora TASKID e CUTID per riportare le collisioni sulla feature specifica --- LuaLibs/WProcessFreeContour.lua | 36 +++++++++++++++++---------------- LuaLibs/WProcessLapJoint.lua | 36 +++++++++++++++++---------------- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 482f28e..2e31524 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -777,9 +777,9 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp -- creo superfice locale o esco local nSurfToAdd = MakeLocalSurf( tFacAdj[7], tFacAdj[8], tFacAdj[9], nAddGrpId) if nSurfToAdd then - local nFacCntPre = EgtSurfTmFacetCount( nNewProc) + local nFacCntPre = EgtSurfTmFacetCount( nNewProc.Id) -- creo copia del percorso principale e gli aggiungo la nuova faccia - nNewProcLoc = EgtCopyGlob( nNewProc, nAddGrpId) + nNewProcLoc = EgtCopyGlob( nNewProc.Id, nAddGrpId) nNewProcLoc = EgtSurfTmBySewing( nAddGrpId, {nNewProcLoc,nSurfToAdd} , true) -- riordino le facce ReorderFacesFromTab( nNewProcLoc, vFace) @@ -790,7 +790,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp return true, '' end else - nNewProcLoc = nNewProc + nNewProcLoc = nNewProc.Id end -- prendo il primo versore local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT) @@ -847,7 +847,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp vtCheck:rotate( Z_AX(), dOffsAng) end -- controllo se c'è collisione con le facce della superfice - if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2, + if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2, dTall1, dTall2, dDiam3, dTall3) then local sErr = 'Collision detect from clean corner tool and surface' EgtOutLog( sErr) @@ -944,6 +944,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp -- trasformo in percorso if #pAuxId > 0 then AuxId = EgtCurveCompo( nAddGrpId, pAuxId, true) + EgtSetInfo( AuxId, 'TASKID', nNewProc.TaskId) + EgtSetInfo( AuxId, 'CUTID', nNewProc.CutId) end -- se non c'é il percorso do errore if not AuxId then @@ -958,8 +960,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp EgtRotate( AuxId, tFacAdj[nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB) end -- inserisco la lavorazione - local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) - local nMchId = WM.AddMachining( nNewProc, sName, sMilling) + local sName = 'Clean_' .. ( EgtGetName( nNewProc.Id) or tostring( nNewProc.Id)) + local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1052,26 +1054,26 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, -- verifico se ciclo chiuso local bClosed = ( abs( vFace[1].PrevAng) > 0.1) -- copio la feature nel layer di appoggio - local nNewProc + local nNewProc = { CutId = Proc.CutId, TaskId = Proc.TaskId} if nMasterNewProc then - nNewProc = nMasterNewProc + nNewProc.Id = nMasterNewProc else - nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL + nNewProc.Id = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL end - local nFacCnt = EgtSurfTmFacetCount( nNewProc) + local nFacCnt = EgtSurfTmFacetCount( nNewProc.Id) local nFacInd, dDepth, nSurfInt local bMakeLocSurf -- RIMUOVERE if false and nFacCnt <= 4 then -- recupero profondità e faccia di fondo - _, _, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId, bClosed) + _, _, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc.Id, Proc.PartId, nAddGrpId, bClosed) if nSurfInt then -- aggiungo la faccia di fondo appena calcolata - nNewProc = EgtSurfTmBySewing( nAddGrpId, { nNewProc, nSurfInt}, true) + nNewProc.Id = EgtSurfTmBySewing( nAddGrpId, { nNewProc.Id, nSurfInt}, true) -- riordino le facce - ReorderFacesFromTab( nNewProc, vFace) + ReorderFacesFromTab( nNewProc.Id, vFace) -- aggiorno numero di facce e assegno indice di quella di fondo (sempre ultima) - nFacCnt = EgtSurfTmFacetCount( nNewProc) + nFacCnt = EgtSurfTmFacetCount( nNewProc.Id) nFacInd = nFacCnt - 1 else return true @@ -1119,7 +1121,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, ptLoc2 = vFace[k].PPrev end -- ricavo i punti e l'angolo interno - local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT) + local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc.Id, nFace1, nFace2, GDB_ID.ROOT) -- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza local tFacAdj = {} if ptP1 and ptP2 and dAng < 0 and dAng < -6 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then @@ -1157,8 +1159,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, i = i + 1 end -- cancello la copia della superfice - if nNewProc then - EgtErase( nNewProc) + if nNewProc.Id then + EgtErase( nNewProc.Id) end return true end diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 95e736d..4cb147b 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -760,9 +760,9 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp -- creo superfice locale o esco local nSurfToAdd = MakeLocalSurf( tFacAdj[7], tFacAdj[8], tFacAdj[9], nAddGrpId) if nSurfToAdd then - local nFacCntPre = EgtSurfTmFacetCount( nNewProc) + local nFacCntPre = EgtSurfTmFacetCount( nNewProc.Id) -- creo copia del percorso principale e gli aggiungo la nuova faccia - nNewProcLoc = EgtCopyGlob( nNewProc, nAddGrpId) + nNewProcLoc = EgtCopyGlob( nNewProc.Id, nAddGrpId) nNewProcLoc = EgtSurfTmBySewing( nAddGrpId, {nNewProcLoc,nSurfToAdd} , true) -- riordino le facce nNewProcLoc = ReorderFacesFromTab( nNewProcLoc, vFace) @@ -775,7 +775,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp return true, '' end else - nNewProcLoc = nNewProc + nNewProcLoc = nNewProc.Id end -- prendo il primo versore local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT) @@ -829,7 +829,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp vtCheck:rotate( Z_AX(), dOffsAng) end -- controllo se c'è collisione con le facce della superfice - if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2, + if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2, dTall1, dTall2, dDiam3, dTall3) then local sErr = 'Collision detect from clean corner tool and surface' EgtOutLog( sErr) @@ -926,6 +926,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp -- trasformo in percorso if #pAuxId > 0 then AuxId = EgtCurveCompo( nAddGrpId, pAuxId, true) + EgtSetInfo( AuxId, 'TASKID', nNewProc.TaskId) + EgtSetInfo( AuxId, 'CUTID', nNewProc.CutId) end -- se non c'é il percorso do errore if not AuxId then @@ -940,8 +942,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp EgtRotate( AuxId, tFacAdj[nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB) end -- inserisco la lavorazione - local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc)) - local nMchId = WM.AddMachining( nNewProc, sName, sMilling) + local sName = 'Clean_' .. ( EgtGetName( nNewProc.Id) or tostring( nNewProc.Id)) + local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling) if not nMchId then local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling EgtOutLog( sErr) @@ -1035,27 +1037,27 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, end end -- copio la feature nel layer di appoggio - local nNewProc + local nNewProc = { CutId = Proc.CutId, TaskId = Proc.TaskId} if nMasterNewProc then - nNewProc = nMasterNewProc + nNewProc.Id = nMasterNewProc else - nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL + nNewProc.Id = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL end - local nFacCnt = EgtSurfTmFacetCount( nNewProc) + local nFacCnt = EgtSurfTmFacetCount( nNewProc.Id) local nFacInd, dDimMin, dDimMax, dDepth, nSurfInt local bMakeLocSurf -- RIMUOVERE if false and nFacCnt <= 4 then -- ottengo le dimensioni apertura, la normale e la faccia inferiore - dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId) + dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc.Id, Proc.PartId, nAddGrpId) if nSurfInt then -- uso la dimensione minima anche nel caso che la cava sborda perchè la lavorazione potrebbe collidere con un pezzo limitrofo local dMinWidth = dDimMin - nNewProc = EgtSurfTmBySewing( nAddGrpId, {nNewProc,nSurfInt} , true) + nNewProc.Id = EgtSurfTmBySewing( nAddGrpId, {nNewProc.Id,nSurfInt} , true) -- riordino le facce - nNewProc = ReorderFacesFromTab( nNewProc, vFace) + nNewProc.Id = ReorderFacesFromTab( nNewProc.Id, vFace) -- acquisisco il numero della faccia - nFacCnt = EgtSurfTmFacetCount( nNewProc) + nFacCnt = EgtSurfTmFacetCount( nNewProc.Id) nFacInd = nFacCnt - 1 else local sErr = 'Error : cannot create base surface' @@ -1107,7 +1109,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, ptLoc2 = vFace[k].PPrev end -- ricavo i punti e l'angolo interno - local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT) + local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc.Id, nFace1, nFace2, GDB_ID.ROOT) -- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza local tFacAdj = {} if ptP1 and ptP2 and dAng < 0 and dAng < -6 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then @@ -1145,8 +1147,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, i = i + 1 end -- cancello la copia della superfice - if nNewProc then - EgtErase(nNewProc) + if nNewProc.Id then + EgtErase( nNewProc.Id) end return true end From e844d761f94ae46ac6d338e1b2eca256396aa080 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 2 Dec 2024 18:11:47 +0100 Subject: [PATCH 4/5] - in LapJoint -> CalcInterference ora si usano le stesse funzioni della FreeContour --- LuaLibs/WProcessLapJoint.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 4cb147b..f6e9e49 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -692,15 +692,15 @@ local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2, local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01) local frOriTool = Frame3d( ptCentrGrid1, vtExtr) - local bColl1 = EgtCDeConeSolid( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB) + local bColl1 = EgtTestConeSurface( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB) if bColl1 then return true end local ptCentrGrid2 = ptCentr + ( vtExtr * ( dTall1 + 0.01)) frOriTool = Frame3d( ptCentrGrid2, vtExtr) - local bColl2 = EgtCDeCylSolid( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB) + local bColl2 = EgtTestCylSurface( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB) if bColl2 then return true end local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01)) frOriTool = Frame3d( ptCentrGrid3, vtExtr) - local bColl3 = EgtCDeCylSolid( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB) + local bColl3 = EgtTestCylSurface( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB) if bColl3 then return true end -- restituisco risultato controllo collisioni return false From e3faec9d5d5fcc2e5cb61f603e9302ca7e4d348a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 11 Dec 2024 14:35:12 +0100 Subject: [PATCH 5/5] - update log e version --- UpdateLog.txt | 6 ++++++ Version.lua | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 5f8e5f3..a5f824d 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,11 @@ ==== Wall Update Log ==== +Versione 2.6l1 (11/12/2024) +- Modif : modificato il calcolo feature passante per gorge +- Modif : in pulizia spigoli si riporta correttamente la collisione sulla feature specifica +- Fixed : in pulizia spigoli correzioni varie +- Fixed : in LapJoint correzioni varie + Versione 2.6k3 (27/11/2024) - Modif : migliorato calcolo approccio e retrazione in Sidemill/Sidegroove diff --git a/Version.lua b/Version.lua index 55d4793..ebcaada 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Wall NAME = 'Wall' -VERSION = '2.6k3' +VERSION = '2.6l1' MIN_EXE = '2.6k1'