Improvement/SideMillGreater90:

- aggiunto ripasso lato inclinato anche per svuotatura
This commit is contained in:
luca.mazzoleni
2022-12-02 15:38:04 +01:00
parent 5023887f2e
commit b2f1645322
2 changed files with 30 additions and 9 deletions
+29 -8
View File
@@ -1945,9 +1945,10 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- imposto modo di lavorare la faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFace2ndFace)
local dMaxElev = dMaxMat
local dStepOtherFace = dStepOri or EgtGetMachiningParam( MCH_MP.STEP)
if dStepOtherFace < GEO.EPS_SMALL then dStepOtherFace = 0.75 * dMaxMat end
local dStepOtherFace = 0
if Proc.Fct == 2 and vtN2:getZ() < -0.99 and vtN2:getZ() > -1.01 then
dStepOtherFace = dStepOri or EgtGetMachiningParam( MCH_MP.STEP)
if dStepOtherFace < GEO.EPS_SMALL then dStepOtherFace = 0.75 * dMaxMat end
local nStepOtherFace = ceil( ( dElevOtherFacet - dMaxMat) / dStepOtherFace)
dStepOtherFace = max( ( dElevOtherFacet - dMaxMat) / max( nStepOtherFace, 1), 0)
dMaxElev = max( ( nStepOtherFace + 1) * dStepOtherFace - GEO.EPS_SMALL, 0)
@@ -2002,7 +2003,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end
end
-- se richiesto, setto la nota per spostare la lavorazione alla fine
if not WD.SIDEMILL_BEFORE then
if bEnablePreMill or bAsEnablePreMill or not WD.SIDEMILL_BEFORE then
EgtSetInfo( nMchFId, 'MOVE_AFTER', 1)
end
else
@@ -2095,8 +2096,9 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
local dMillDiam = 20
local dMaxDepth = 0
local dThDiam = 100
local sTuuid
if EgtMdbSetCurrMachining( sPocketing) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), EgtTdbGetCurrToolMaxDepth()) or dMaxDepth
@@ -2163,7 +2165,7 @@ local function MakeByPocketing( Proc, nFacet, nRawId, b3Raw, bCheckQPar)
else
EgtErase( nNewProc)
end
return true, sWarn
return true, sWarn, sTuuid
end
---------------------------------------------------------------------
@@ -2399,10 +2401,11 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
return MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, EgtIf( bEnableMillOnSide and dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, bLikeAsMakeFirstGroove)
else
local bOk, sErr = MakeByMill( Proc, nFacet, 1 - nFacet, nRawId, b3Raw, dSideDist)
if dAng and dAng > -90 + 10 * GEO.EPS_SMALL then
-- se angolo ottuso riprendo il lato quasi verticale
if bOk and dAng and dAng > -90 + 10 * GEO.EPS_SMALL then
local bOk2, sErr2 = MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, EgtIf( bEnableMillOnSide and dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, false, nil, true)
end
return bOk
return bOk, sErr
end
elseif bEnableMillOnSide and dMaxDepthOnSide > 0 then
bLikeAsMakeFirstGroove = true
@@ -2412,7 +2415,25 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
-- se non inclinate o capacità di taglio non sufficiente o non molto grandi (80mm), provo con contornatura o svuotatura
if vtN:getZ() > 0.866 or vtNV:getZ() > 0.866 or not sCutting or dSawMaxDepth < dDimY[1] + WD.CUT_SIC or dSawMaxDepth < dDimY[2] + WD.CUT_SIC or dDimY[1] < 80 or dDimY[2] < 80 then
-- eseguo la svuotatura
return MakeByPocketing( Proc, nFacet, nRawId, b3Raw)
local bOk, sErr, sTuuid = MakeByPocketing( Proc, nFacet, nRawId, b3Raw)
-- se angolo ottuso riprendo il lato quasi verticale
if bOk and dAng and dAng > -90 + 10 * GEO.EPS_SMALL then
local _, dHVert, dVVert = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacetVert, GDB_ID.ROOT)
local dDepth = min( dHVert, dVVert)
local _, dHHor, dVHor = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacet, GDB_ID.ROOT)
local dDiam = 2 * min( dHHor, dVHor)
local sMillObtuseAngle = WM.FindMilling( 'FreeContour', dDepth, sTuuid, nil, dDiam, nil, nil, nil)
if not sMillObtuseAngle then
sMillObtuseAngle = WM.FindMilling( 'FreeContour', dDepth, nil, nil, dDiam, nil, nil, nil)
end
if not sMillObtuseAngle then
local sErrMillNotFound = 'Error : Processing to finish obtuse angle not found in library'
EgtOutLog( sErrMillNotFound)
return true, sErrMillNotFound
end
local bOk2, sErr2 = MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, sMillObtuseAngle, dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, false, nil, true)
end
return bOk, sErr
end
-- se una delle due facce rivolta verso il basso
elseif vtN[1]:getZ() < -0.001 or vtN[2]:getZ() < -0.001 then