From 8859059a4b718c6384581befe90a4afcce71ba18 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Sat, 20 Feb 2021 15:17:04 +0000 Subject: [PATCH] =?UTF-8?q?DataWall=20:=20-=20aggiunta=20gestione=20massim?= =?UTF-8?q?a=20profondit=C3=A0=20frese=20da=20massimo=20materiale=20anzich?= =?UTF-8?q?=C3=A9=20da=20lunghezza=20libera=20(da=20flag=20WD.MILL=5FMAX?= =?UTF-8?q?=5FDEPTH=5FAS=5FMAT)-=20-=20minimo=20taglio=20lama=20ridotto=20?= =?UTF-8?q?a=2050mm=20-=20aggiunti=20log=20a=20CleanCorner=20-=20deviazion?= =?UTF-8?q?e=20angolare=20minima=20tra=20entit=C3=A0=20per=20verificare=20?= =?UTF-8?q?se=20pulire=20angolo=20portata=20a=206deg.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/WMachiningLib.lua | 6 ++--- LuaLibs/WProcessDrill.lua | 4 ++-- LuaLibs/WProcessFreeContour.lua | 40 ++++++++++++++++++++++++++------- LuaLibs/WProcessLapJoint.lua | 20 ++++++++++++----- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/LuaLibs/WMachiningLib.lua b/LuaLibs/WMachiningLib.lua index 4cd4a8b..8fb75e5 100644 --- a/LuaLibs/WMachiningLib.lua +++ b/LuaLibs/WMachiningLib.lua @@ -46,7 +46,7 @@ function WMachiningLib.FindMilling( sType, dDepth, sTuuidMstr) local Milling = Millings[i] if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then local sTuuid = EgtGetMachiningParam( MCH_MP.TUUID) - local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() + local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) if ( not sTuuidMstr or sTuuidMstr == sTuuid) and ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then return Milling.Name, dTMaxDepth @@ -61,7 +61,7 @@ function WMachiningLib.FindPocketing( sType, dMaxDiam, dDepth) local Pocketing = Pocketings[i] if Pocketing.On and Pocketing.Type == sType and SetCurrMachiningAndTool( Pocketing.Name) then local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) - local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() + local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then return Pocketing.Name, dTDiam, dTMaxDepth @@ -99,7 +99,7 @@ function WMachiningLib.FindDrilling( dDiam) local Drilling = Drillings[i] if Drilling.On and Drilling.Type == 'Pocket' and SetCurrMachiningAndTool( Drilling.Name) then local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) - local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() + local dTMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) if dTDiam < dDiam - 10 * GEO.EPS_SMALL then return Drilling.Name, Drilling.Type, dTMaxDepth end diff --git a/LuaLibs/WProcessDrill.lua b/LuaLibs/WProcessDrill.lua index 036c4d3..5944089 100644 --- a/LuaLibs/WProcessDrill.lua +++ b/LuaLibs/WProcessDrill.lua @@ -1,4 +1,4 @@ --- WProcessDrill.lua by Egaltech s.r.l. 2020/11/18 +-- WProcessDrill.lua by Egaltech s.r.l. 2021/02/19 -- Gestione calcolo forature per Pareti -- Tabella per definizione modulo @@ -115,7 +115,7 @@ function WPD.Make( Proc, nRawId, b3Raw) if bIsDrilling then dMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxDepth else - dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth end dDiamTh = EgtTdbGetCurrToolThDiam() end diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 0431017..8ca5890 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -15,7 +15,7 @@ local WD = require( 'WallData') local WM = require( 'WMachiningLib') local WHISK_OFFS = 0.1 local WHISK_SAFE = 5 -local MIN_LEN_CUT = 100 +local MIN_LEN_CUT = 50 -- variabili assegnazione parametri Q local sTypeCornerCut = 'Q05' -- i @@ -748,7 +748,7 @@ local function AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, if nIdIniPoint and nIdEndPoint then -- se fresatura da sotto salto la lavorazione if vtExtr:getZ() < WD.DRILL_VZ_MIN then - local sErr = 'Error : clean corner milling from bottom impossible' + local sErr = 'Error : Impossible insert clean corner from bottom' EgtOutLog( sErr) return false, sErr end @@ -771,6 +771,8 @@ local function AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, -- controllo se c'è collisione con le facce della superfice if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2, dTall1, dTall2, dDiam3, dTall3) then + local sErr = 'Collision detect from clean corner tool and surface' + EgtOutLog( sErr) return true, '' end nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdIniPoint], tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB) @@ -965,7 +967,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength - dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth -- calcolo il secondo diametro del cono dMillTotDiam = dMillDiam + ( abs(dThickTool) * tan(dSideAng)) * 2 end @@ -1044,8 +1046,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, end -- ricavo i punti e l'angolo interno local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT) - -- se punti validi e angolo è interno e >= 90 creo istanza - if ptP1 and ptP2 and dAng < 0 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then + -- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza + 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 local dLen = dist( ptP1, ptP2) table.insert( tFacAdj, { nFace1, nFace2, dLen, ptP1, ptP2, dAng, ptLoc1, ptLoc2, ptLoc3}) end @@ -1099,7 +1101,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam - dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth end end -- verifico se ciclo chiuso @@ -1530,6 +1532,16 @@ local function MakeByCut( Proc, nRawId, b3Raw, bDeleteBottomFacet) sMlErr, nAddGrpId, dThick, nNewProc, 0, true) if not bMcok then return bMcok, sMcErr end + else + -- messaggi nel log + if nConeCut == 1 then + local sErr = 'Clean corner 60° not applid because Milling not thru the thickness' + EgtOutLog( sErr) + elseif nConeCut == 2 then + local sErr = 'Clean corner 30° not applid because thickness: ' .. EgtNumToString( dThick, 2) .. + ' is bigger than parameter MAX_CLEAN_CRN30: ' .. EgtNumToString( WD.MAX_CLEAN_CRN30 , 2) + EgtOutLog( sErr) + end end -- altrimenti provo con la sega a catena else @@ -1541,6 +1553,14 @@ local function MakeByCut( Proc, nRawId, b3Raw, bDeleteBottomFacet) sCSErr, nAddGrpId, nil, nNewProc, 0, true) if not bMcok then return bMcok, sMcErr end + else + if nConeCut == 1 then + local sErr = 'Clean corner 60° not applid because Sawing not thru the thickness' + EgtOutLog( sErr) + elseif nConeCut == 2 then + local sErr = 'Not possible apply Clean corner 30° after use sawing' + EgtOutLog( sErr) + end end end return true @@ -1581,7 +1601,7 @@ local function MakeByMill( Proc, nRawId, b3Raw) if EgtMdbSetCurrMachining( sMilling) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then - dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth end end -- eventuale spezzatura sul tratto più lungo se curva chiusa @@ -1714,7 +1734,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam - dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth dThDiam = EgtTdbGetCurrToolThDiam() or dThDiam end end @@ -1773,6 +1793,10 @@ local function MakeByPocket( Proc, nRawId, b3Raw) local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw, dMillDiam, nAddGrpId, nil, nNewProc, EgtIf( bPocketBotface, dDepth, ( dDepth - dOriDepth))) if not bMcok then return bMcok, sMcErr end + elseif nConeCut == 2 then + local sErr = 'Clean corner 30° is not applied on pocketing' + EgtOutLog( sErr) + EgtErase( nNewProc) else EgtErase( nNewProc) end diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index f636074..a18e147 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -1,4 +1,4 @@ --- WProcessLapJoint.lua by Egaltech s.r.l. 2021/02/18 +-- WProcessLapJoint.lua by Egaltech s.r.l. 2021/02/19 -- Gestione calcolo mezzo-legno per Pareti -- Tabella per definizione modulo @@ -600,6 +600,8 @@ local function AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, nFacCnt = EgtSurfTmFacetCount( nNewProcLoc) nFacInd = nFacCnt - 1 else + local sErr = 'Cannot make local bottom surface' + EgtOutLog( sErr) return true, '' end else @@ -636,7 +638,7 @@ local function AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, if nIdIniPoint and nIdEndPoint then -- se fresatura da sotto salto la lavorazione if vtExtr:getZ() < WD.DRILL_VZ_MIN then - local sErr = 'Error : clean corner milling from bottom impossible' + local sErr = 'Error : Impossible insert clean corner from bottom' EgtOutLog( sErr) return false, sErr end @@ -659,6 +661,8 @@ local function AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, -- controllo se c'è collisione con le facce della superfice if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2, dTall1, dTall2, dDiam3, dTall3) then + local sErr = 'Collision detect from clean corner tool and surface' + EgtOutLog( sErr) return true, '' end nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdIniPoint], tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB) @@ -853,7 +857,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength - dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth + dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth -- calcolo il secondo diametro del cono dMillTotDiam = dMillDiam + ( abs(dThickTool) * tan(dSideAng)) * 2 end @@ -932,8 +936,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw, end -- ricavo i punti e l'angolo interno local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT) - -- se punti validi e angolo è interno e >= 90 creo istanza - if ptP1 and ptP2 and dAng < 0 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then + -- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza + 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 local dLen = dist( ptP1, ptP2) table.insert( tFacAdj, { nFace1, nFace2, dLen, ptP1, ptP2, dAng, ptLoc1, ptLoc2, ptLoc3}) end @@ -1317,11 +1321,15 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar) local nConeCut = VerifyCornerType( Proc) -- recupero i dati di tutte le facce local vFace, dMaxWidth = GetFacesData( nNewProc, false, false, dMillDiam, dMaxDepth, (dMillDiam/2), nAddGrpId, Proc.PartId) - -- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante + -- se abilitata la lavorazione corner con stop macchina if nConeCut == 1 then local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw, dMillDiam, nAddGrpId, dMaxWidth, nNewProc, dDepth) if not bMcok then return bMcok, sMcErr end + elseif nConeCut == 2 then + local sErr = 'Clean corner 30° is not applied on pocketing' + EgtOutLog( sErr) + EgtErase( nNewProc) else EgtErase( nNewProc) end