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