diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index dd38882..29307bd 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -1,5 +1,6 @@ --- ProcessDtMortise.lua by Egaltech s.r.l. 2021/01/28 +-- ProcessDtMortise.lua by Egaltech s.r.l. 2021/04/08 -- Gestione calcolo mortase a coda di rondine per Travi +-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. -- Tabella per definizione modulo local ProcessDtMortise = {} @@ -125,9 +126,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtOutLog( sErr) return false, sErr end - -- recupero i dati della curva e del top - local dDepth = abs( EgtCurveThickness( AuxId)) + -- recupero i dati della curva local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) + local ptBC = EgtGP( AuxId, GDB_RT.GLOB) -- verifico che la mortasa non sia orientata verso il basso (-5 deg) o che ci sia una testa da sotto local bFaceDown = ( vtExtr:getZ() < - 0.1) if bFaceDown and not BD.DOWN_HEAD then @@ -135,6 +136,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) EgtOutLog( sErr) return false, sErr end + -- determino l'altezza della mortasa (0=faccia di fondo) + local rfDtMrt = Frame3d( ptBC, vtExtr) + local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt) + local dAltMort = b3DtMrt:getDimZ() -- verifico se di tipo pocket local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1) if bPocket then bMakeAntiSplitPath = false end @@ -201,6 +206,12 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) bCW = ( dSpeed >= 0) end end + -- verifico che la profondità non superi il massimo materiale dell'utensile + if dAltMort > dMaxMat + 10 * GEO.EPS_SMALL then + local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge' + EgtOutLog( sErr) + return false, sErr + end -- se con tasca, la lavoro if bPocket then -- recupero il contorno della tasca (seconda curva ausiliaria) @@ -251,12 +262,6 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- se parametro interno abilitato e il percorso non è chiuso, aggiungo percorso e lavorazione antischeggia if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then - -- recupero il riferimento della faccia di fondo - local rfFac0 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT) - -- ottengo il box con la normale della faccia 0 - local bBoxF0 = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfFac0) - -- recupero l'altezza della mortasa - local dAltMort = bBoxF0:getDimZ() -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) if not nAddGrpId then diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index 6979650..535c9dd 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -1,5 +1,6 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2021/03/01 +-- ProcessTenon.lua by Egaltech s.r.l. 2021/04/08 -- Gestione calcolo tenone a coda di rondine per Travi +-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. -- Tabella per definizione modulo local ProcessDtTenon = {} @@ -131,7 +132,6 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) return false, sErr end -- recupero i dati della curva - local dDepth = abs( EgtCurveThickness( AuxId)) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local ptBC = EgtGP( AuxId, GDB_RT.GLOB) -- verifico che il tenone non sia orientato verso il basso @@ -233,15 +233,23 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- recupero i dati dell'utensile local dTDiam = 50 + local dMaxMat = 30 local bCW = true if EgtMdbSetCurrMachining( sMilling) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam + dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0 bCW = ( dSpeed >= 0) end end + -- verifico che l'altezza non superi il massimo materiale dell'utensile + if dDtTenH > dMaxMat + 10 * GEO.EPS_SMALL then + local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge' + EgtOutLog( sErr) + return false, sErr + end -- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0) local dMaxDist = 0 local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.Id, 0, EgtGetParent( Proc.Id)) diff --git a/LuaLibs/ProcessHeadCut.lua b/LuaLibs/ProcessHeadCut.lua index e99dc48..6f50bf6 100644 --- a/LuaLibs/ProcessHeadCut.lua +++ b/LuaLibs/ProcessHeadCut.lua @@ -1,4 +1,4 @@ --- ProcessSplit.lua by Egaltech s.r.l. 2021/03/25 +-- ProcessSplit.lua by Egaltech s.r.l. 2021/04/08 -- Gestione calcolo tagli di testa per Travi -- Tabella per definizione modulo @@ -171,7 +171,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut -- caratteristiche taglio local bHorizCut = ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA) local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, BD.MAX_DIM_HTCUT_HBEAM) - local bDoubleHorizCut = ( not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) + local bDoubleHorizCut = ( BD.DOWN_HEAD and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) -- dati geometrici del taglio local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index 87d7652..971a29a 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -1,4 +1,4 @@ --- ProcessSplit.lua by Egaltech s.r.l. 2021/03/25 +-- ProcessSplit.lua by Egaltech s.r.l. 2021/04/08 -- Gestione calcolo tagli di separazione per Travi -- Tabella per definizione modulo @@ -171,7 +171,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId) -- caratteristiche taglio local bHorizCut = ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA) local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, BD.MAX_DIM_HTCUT_HBEAM) - local bDoubleHorizCut = ( not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) + local bDoubleHorizCut = ( BD.DOWN_HEAD and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) -- dati geometrici del taglio local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)