diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index df6a386..17a2fd2 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -89,7 +89,7 @@ function WPF.Classify( Proc, b3Raw) elseif nCntType == 10 or nCntType == 20 then return true -- 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 + elseif ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 2) and ( ( not nTool_ID == ( WD.RECESSED_COUNTERBORE_TOOLID or 0)) or ( not EgtCurveIsACircle( AuxId))) then return false -- altrimenti รจ profilo verticale che interessa tutta la sezione o caso speciale con lamatura affondata else @@ -101,8 +101,8 @@ end -- Classificazione del flip della feature per nesting -- return nFlip0, nFlip1 function WPF.FlipClassify( Proc, b3Raw) - local nFlip0 = 0 - local nFlip1 = 0 + local nFlip0 = 0 + local nFlip1 = 0 -- verifico se di tipo pocket local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1) @@ -2187,8 +2187,8 @@ local function MakeByMill( Proc, nRawId, b3Raw) 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 + local bIsRecessedCounterBore = ( Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() + 10 * GEO.EPS_SMALL) and + ( nTool_ID == WD.RECESSED_COUNTERBORE_TOOLID or 0) and ( EgtCurveIsACircle( AuxId)) if bIsRecessedCounterBore then local _, _, _, dContourRadius = EgtCurveIsACircle( AuxId) @@ -2204,6 +2204,16 @@ local function MakeByMill( Proc, nRawId, b3Raw) EgtSetMachiningParam( MCH_MP.LOTANG, 0) EgtSetMachiningParam( MCH_MP.LOPERP, dContourRadius - 0.5 * dMillDiam) EgtSetMachiningParam( MCH_MP.LOELEV, 0) + -- imposto step + local dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0 + local dStep = EgtGetMachiningParam( MCH_MP.STEP) + if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end + local nStep = ceil( ( dDepth - dMaxMat) / dStep) + dStep = max( ( dDepth - dMaxMat) / max( nStep, 1), 0) + local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0) + EgtSetMachiningParam( MCH_MP.STEP, dStep) + -- imposto elevazione + EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';') end -- posizione braccio porta testa local nSCC = MCH_SCC.ADIR_ZP