From eeb34638cf981433e92a4983c6599a35eb534586 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 26 May 2023 18:12:53 +0200 Subject: [PATCH] - da testare funzionamento corretto - da implementare step verticali --- LuaLibs/WProcessFreeContour.lua | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 1c3c0a7..df6a386 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -67,6 +67,7 @@ function WPF.Classify( Proc, b3Raw) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) -- recupero il tipo di lavorazione local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0 + local nTool_ID = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i') or 0 -- se tasca if bPocket then -- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva) @@ -87,10 +88,10 @@ function WPF.Classify( Proc, b3Raw) -- se penna o chiodatura va sempre bene (vengono sempre riportati sopra) elseif nCntType == 10 or nCntType == 20 then return true - -- se altrimenti profilo verticale che non interessa tutta la sezione - elseif Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2 then + -- se altrimenti profilo verticale che non interessa tutta la sezione e non caso speciale con lamatura affondata + elseif ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2) and ( ( not nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID) or ( not EgtCurveIsACircle( AuxId))) then return false - -- altrimenti è profilo verticale che interessa tutta la sezione + -- altrimenti è profilo verticale che interessa tutta la sezione o caso speciale con lamatura affondata else return true end @@ -2185,6 +2186,25 @@ local function MakeByMill( Proc, nRawId, b3Raw) elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) end + -- se lamatura affondata speciale, setto attacco e stacco al centro + local bIsRecessedCounterBore = ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 10 * GEO.EPS_SMALL) and + ( nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID) and + ( EgtCurveIsACircle( AuxId)) + if bIsRecessedCounterBore then + local _, _, _, dContourRadius = EgtCurveIsACircle( AuxId) + -- setto attacco + EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT) + EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0) + EgtSetMachiningParam( MCH_MP.LITANG, 0) + EgtSetMachiningParam( MCH_MP.LIPERP, dContourRadius - 0.5 * dMillDiam) + EgtSetMachiningParam( MCH_MP.LIELEV, 0) + -- setto stacco + EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.LINEAR) + EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) + EgtSetMachiningParam( MCH_MP.LOTANG, 0) + EgtSetMachiningParam( MCH_MP.LOPERP, dContourRadius - 0.5 * dMillDiam) + EgtSetMachiningParam( MCH_MP.LOELEV, 0) + end -- posizione braccio porta testa local nSCC = MCH_SCC.ADIR_ZP if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then