DataWall :

- modifiche per cliente belga.
This commit is contained in:
DarioS
2021-12-07 13:27:29 +01:00
parent 943ccea2a8
commit 0f25503bde
2 changed files with 351 additions and 32 deletions
+26 -32
View File
@@ -1423,7 +1423,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local bInvertMach
local nModifyLeadInOut = 0
local nFace2ndFace
local dMaxDistToOut = 1800 -- dMillDiamTh/2
local dMaxDistToOut = EgtIf( bMachFromDn, 1800, 300)
-- se orientato lungo la Y
if abs( vtN:getX()) > 0.9 then
dExtraLongExtPlus = abs( Proc.Box:getMax():getY() - b3Raw:getMax():getY())
@@ -1537,9 +1537,8 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end
end
end
local nNumStep = 0
-- se ho abilitato la lavorazione di fresatura per garantire passaggio gambo utensile inserisco la lavorazione
if bEnablePreMill or bAsEnablePreMill then
if bEnablePreMill then
-- calcolo di quanto deve essere largo e lungo il canale di fresatura
local dDimGorge = ( 0.5 * ( dMillDiam + dMillDiamTh)) - dElevToPiece + 2
-- se il materiale extra è inferiore della gola completa, ricalcolo la dimensione della gola
@@ -1567,7 +1566,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end
end
-- calcolo quanti passi devo fare in larghezza per scaricare l'area di impegno utensile
nNumStep = ceil( ( dDimGorge - dMillDiamFirst) / ( dMillDiamFirst * 0.8)) + 1
local nNumStep = ceil( ( dDimGorge - dMillDiamFirst) / ( dMillDiamFirst * 0.8)) + 1
local dC = 0
if ( nNumStep - 1) > 0 then
dC = ( dDimGorge - dMillDiamFirst) / ( nNumStep - 1)
@@ -1648,7 +1647,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
if dStep < GEO.EPS_SMALL then dStep = 0.75 * dMaxMat end
local nStep = ceil( ( dThick - dMaxMat) / dStep)
dStep = ( dThick - dMaxMat) / max( nStep, 1)
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
if nSinglePass and nSinglePass > 0 then
dStep = 0
@@ -1665,18 +1664,21 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- se ho inserito il pretaglio modifico
if bEnablePreMill or bAsEnablePreMill then
if nModifyLeadInOut > 0 then
-- Invece del numero di passi in sgrossatura confronto il raggio fresa con l'elevazione dalla normale
-- per vedere se devo modificare l'uscita
-- if nNumStep > 1 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
-- modifico il tipo di uscita
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, 5)
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
-- modifico dati supplementari uscita
EgtSetMachiningParam( MCH_MP.LOPERP, 0.5)
EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd))
if nModifyLeadInOut == 1 then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, MCH_MILL_ST.ONEWAY)
-- modifico il tipo di uscita
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG)
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
-- modifico dati supplementari uscita
EgtSetMachiningParam( MCH_MP.LOPERP, 0.5)
EgtSetMachiningParam( MCH_MP.LOTANG, -( dLongGorge + dExtraLongIni + dExtraLongEnd))
else
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
end
end
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
@@ -1690,9 +1692,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- setto allungamenti iniziali e finali
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dExtraLongIni)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dExtraLongEnd)
-- Invece del numero di passi in sgrossatura confronto il raggio fresa con l'elevazione dalla normale
-- per vedere se devo modificare l'uscita
-- if nNumStep > 1 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto allungamenti perpendicolari
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
@@ -1705,9 +1705,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end
else
if nModifyLeadInOut > 0 then
-- Invece del numero di passi in sgrossatura confronto il raggio fresa con l'elevazione dalla normale
-- per vedere se devo modificare l'uscita
-- if nNumStep > 1 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
@@ -1735,7 +1733,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- verifico se devo lavorare anche la seconda faccia basandomi sul valore dell'angolo interno
if dAng and dAng > -90 + 10 * GEO.EPS_SMALL then
local nOtherFacet = abs(nFacet - 1)
-- inserisco la lavorazione di contornatura
-- inserisco la lavorazione di contornatura
local sName = 'Mill_Oth_Fac_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling)
if not nMchFId then
@@ -1768,9 +1766,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- se ho inserito il pretaglio modifico
if bEnablePreMill or bAsEnablePreMill then
if nModifyLeadInOut > 0 then
-- Invece del numero di passi in sgrossatura confronto il raggio fresa con l'elevazione dalla normale
-- per vedere se devo modificare l'uscita
-- if nNumStep > 1 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
@@ -1812,9 +1808,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
end
else
if nModifyLeadInOut > 0 then
-- Invece del numero di passi in sgrossatura confronto il raggio fresa con l'elevazione dalla normale
-- per vedere se devo modificare l'uscita
-- if nNumStep > 1 then
-- Confronto il raggio fresa con l'elevazione dalla normale per vedere se devo modificare l'uscita
if dElev > ( 0.5 * dMillDiam) then
-- setto il tipo di passo a una via
EgtSetMachiningParam( MCH_MP.STEPTYPE, 1)
@@ -2073,7 +2067,6 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
if bEnableMillOnSide and dMaxDepthOnSide > 0 then
dMaxDist = dMaxDepthOnSide
end
dMaxDist = 1000
-- se vicino al bordo del grezzo e non troppo larga, provo con fresatura di fianco
local ptMid = ( ptP1 + ptP2) / 2
local bMakeFirstGroove
@@ -2158,7 +2151,7 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
bEnableMillOnSide = false
end
-- per il fianco in alto non ci sono problemi di inserimento massimo laterale, setto la variabile pari al raggio utensile - 1mm
dMaxDepthOnSide = (0.5 * dMillDiam) - 1
dMaxDepthOnSide = ( 0.5 * dMillDiam) - 1
local dMaxDist = 300
if bEnableMillOnSide and dMaxDepthOnSide > 0 then
dMaxDist = dMaxDepthOnSide
@@ -2178,7 +2171,8 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
end
elseif bEnableMillOnSide and dMaxDepthOnSide > 0 then
bLikeAsMakeFirstGroove = true
return MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, EgtIf( bEnableMillOnSide and dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, bLikeAsMakeFirstGroove)
local bOk, sErr = MakeSideGrooveByMill( Proc, nFacetVert, nRawId, b3Raw, EgtIf( bEnableMillOnSide and dMaxDepthOnSide, sMillOnSide, nil), dMaxDepthOnSide, bMakeFirstGroove, bMachFromDn, dAng, bLikeAsMakeFirstGroove)
if bOk then return true end
end
-- se non inclinate o capacità di taglio non sufficiente o non molto grandi (80mm), provo con contornatura o svuotatura
if 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