From 85cf64157b9a5d36d21db602cd3377637e9d35c8 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 26 Aug 2020 14:55:21 +0000 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20LapJoint=20e=20similari?= =?UTF-8?q?=20corretta=20scelta=20svuotatura=20OpenPocket=20se=20a=20U=20o?= =?UTF-8?q?=20a=20L,=20anzich=C3=A8=20solo=20Pocket=20-=20in=20FreeContour?= =?UTF-8?q?=20corretti=20attacchi/uscite=20su=20tratti=20iniziali/finali?= =?UTF-8?q?=20non=20tangenti=20al=20resto=20del=20percorso=20e=20pi=C3=B9?= =?UTF-8?q?=20corti=20del=20raggio=20fresa=20-=20in=20DovetailMortise=20co?= =?UTF-8?q?rretto=20calcolo=20percorso=20antischeggia=20quando=20la=20mort?= =?UTF-8?q?asa=20=C3=A8=20aperta=20anche=20sulla=20punta=20della=20V.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessDtMortise.lua | 8 ++++---- LuaLibs/ProcessFreeContour.lua | 36 +++++++++++++++++++++++++++++++++- LuaLibs/ProcessLapJoint.lua | 4 ++-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 3f4d922..9a28585 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -1,5 +1,5 @@ --- ProcessDtMortise.lua by Egaltech s.r.l. 2020/07/27 --- Gestione calcolo mortase a coda di rondice per Travi +-- ProcessDtMortise.lua by Egaltech s.r.l. 2020/08/26 +-- Gestione calcolo mortase a coda di rondine per Travi -- Tabella per definizione modulo local ProcessDtMortise = {} @@ -81,8 +81,8 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol end for i = 2, nCount do local CrvId = NewAuxId + i - 1 - local ptStart = EgtSP( CrvId, GDB_ID.ROOT) - EgtAddCurveCompoLine( NewAuxId, ptStart, GDB_RT.GLOB) + local ptStart = EgtSP( CrvId) + EgtAddCurveCompoLine( NewAuxId, ptStart) EgtAddCurveCompoCurve( NewAuxId, CrvId) end end diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 43e7d45..6ba97f5 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -1,4 +1,4 @@ --- ProcessFreeContour.lua by Egaltech s.r.l. 2020/05/16 +-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/08/26 -- Gestione calcolo profilo libero per Travi -- Tabella per definizione modulo @@ -109,6 +109,31 @@ function ProcessFreeContour.Classify( Proc, b3Raw) end end +--------------------------------------------------------------------- +local function CalcSpecialAdd( nCrv, bStartVsEnd, dToolDiam) + -- recupero il dominio della curva + local nUi, nUf = EgtCurveDomain( nCrv) + if not nUi then return 0 end + -- indici punti da analizzare + local nOut = EgtIf( bStartVsEnd, nUi, nUf) + local nIn = EgtIf( bStartVsEnd, nUi + 1, nUf - 1) + -- tangenti prima e dopo il punto interno + local vtPrev = EgtUV( nCrv, nIn, -1) + local vtNext = EgtUV( nCrv, nIn, 1) + -- se c'รจ perdita di tangenza (delta angolare oltre i 5 gradi) + if vtPrev * vtNext < 0.996 then + -- lunghezza del tratto + local ptP0 = EgtUP( nCrv, nOut) + local ptP1 = EgtUP( nCrv, nIn) + local dDist = dist( ptP0, ptP1) + -- se corto rispetto al raggio utensile, ritorno allugamento opportuno + if dDist < 0.6 * dToolDiam then + return ( 0.6 * dToolDiam - dDist + 1) + end + end + return 0 +end + --------------------------------------------------------------------- local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero l'ingombro del grezzo di appartenenza @@ -143,10 +168,12 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) return false, sErr end -- recupero i dati dell'utensile + local dToolDiam = 10 local dMaxDepth = 0 if EgtMdbSetCurrMachining( sMilling) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth end end @@ -200,6 +227,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) if vtExtr:getY() > 0.707 and nDouble == 1 and bStripOnSide then bToolInv = true end + -- verifico se primo e ultimo tratti corti e con angolo + local dStartAddSpec = CalcSpecialAdd( AuxId, true, dToolDiam) + local dEndAddSpec = CalcSpecialAdd( AuxId, false, dToolDiam) -- eseguo for i = 1, nStep do for j = 1, nDouble do @@ -217,11 +247,15 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) if ( j == 1 and i > 1) or ( j == 2 and i < nStep) then local dStartAddLen = EgtIf( j == 1, - ( i - 1) * dStep, - ( nStep - i) * dStep) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen) + else + EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( j == 1, dStartAddSpec, dEndAddSpec)) end -- eventuale accorciamento di coda if ( j == 1 and i < nStep) or ( j == 2 and i > 1) then local dEndAddLen = EgtIf( j == 1, - ( nStep - i) * dStep, - ( i - 1) * dStep) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen) + else + EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( j == 1, dEndAddSpec, dStartAddSpec)) end -- se estrusione da sotto, inverto direzione fresa if ( j == 1 and bToolInv) or ( j == 2 and not bToolInv) then diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 5c116ab..2375399 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2020/08/20 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/08/24 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. @@ -3163,7 +3163,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) --ottengo un diametro utensile opportuno dDiam, sMchFind, nUseRoughTool, dDiamMax = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic), nUseRoughTool) if not dDiam and nUseRoughTool == 0 then - sMchFind = 'Pocket' + sMchFind = 'OpenPocket' dDiam = min( dH, dV) end end