DataWall :

- modifiche Filippo per pulitura spigoli.
This commit is contained in:
Dario Sassi
2021-01-19 19:44:36 +00:00
parent 1dbd10d41a
commit 0337d8ae85
3 changed files with 409 additions and 124 deletions
+176 -80
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/12/01
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/01/19
-- Gestione calcolo profilo libero per Pareti
-- Tabella per definizione modulo
@@ -252,9 +252,16 @@ local function GetFacesData( Proc, bOpposite, bCalclForBlade, dToolDiam, dToolMa
-- recupero le dimensioni della faccia
local _, dLen, dWidth = WL.GetFaceHvRefDim( nNewProc, nFac)
-- recupero l'angolo con la faccia precedente
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( nNewProc, nPrecFac, nFac, GDB_ID.ROOT)
local bAdj, ptLocP1, ptLocP2, dAng = EgtSurfTmFacetsContact( nNewProc, nPrecFac, nFac, GDB_ID.ROOT)
-- salvo i dati
vFace[i] = { Fac = nFac, Cen = ptCen, Norm = vtN, Len = dLen, Width = dWidth, AngPrev = EgtIf( bAdj, dAng, 0)}
if bAdj then
if ptLocP1:getZ() < ptLocP2:getZ() then
vFace[i].PPrev = ptLocP1
else
vFace[i].PPrev = ptLocP2
end
end
end
-- analizzo le facce
local dMaxWidth = 0
@@ -524,7 +531,8 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick)
-- aggiungo linea precedente
table.insert( nPath, ( nId1st + i - 1))
-- se non è la linea finale e l'angolo tra le due facce è ammesso
if i < nIdCount and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL) and nPathData[i][2] > -(180-dAngleSmall + 10 * GEO.EPS_SMALL) then
if i < nIdCount and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL) and nPathData[i][2] < 0 and
nPathData[i][2] > -(180-dAngleSmall + 10 * GEO.EPS_SMALL) then
-- aggiungo una retta sulla bisettrice
local _, vtN2 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[i][2], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[i+1][2], GDB_ID.ROOT)
@@ -549,8 +557,8 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick)
for i = 1, nIdCount do
-- aggiungo linea precedente
table.insert( nPath, ( nId1st + i - 1))
-- se non è la linea finale
if i < nIdCount then
-- se non è la linea finale e l'angolo tra le due facce è ammesso
if i < nIdCount and nPathData[i][2] < 0 then
-- aggiungo una retta sulla bisettrice
local _, vtN2 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[i][2], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[i+1][2], GDB_ID.ROOT)
@@ -582,57 +590,105 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick)
end
---------------------------------------------------------------------
local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiamToolMax, nAuxPath,
bMakeExtPath, nAddGrpId, dThSurf, bNegZ, vtNZ)
local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2,
dTall1, dTall2, dDiam3, dTall3)
local nExtPath
if bMakeExtPath then
nExtPath = EgtCopyGlob( nAuxPath, nAddGrpId) or GDB_ID.NULL
else
nExtPath = EgtCopyGlob( nAuxPath, nAddGrpId) or GDB_ID.NULL
local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01)
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
local bColl1 = EgtCDeConeSolid( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB)
if bColl1 then return true end
local ptCentrGrid2 = ptCentr + ( vtExtr * ( dTall1 + 0.01))
frOriTool = Frame3d( ptCentrGrid2, vtExtr)
local bColl2 = EgtCDeCylSolid( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
if bColl2 then return true end
local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01))
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
local bColl3 = EgtCDeCylSolid( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
if bColl3 then return true end
-- restituisco risultato controllo collisioni
return false
end
---------------------------------------------------------------------
local function MakeLocalSurf( ptP1, ptP2, ptP3, nAddGrpId)
if not ptP1 or not ptP2 or not ptP3 then
return nil
end
-- setto a 0 lo spessore
EgtModifyCurveThickness( nExtPath, 0)
-- se versore negativo devo spostare il percorso del suo spessore
if bNegZ then
-- setto griglia normale al percorso
EgtSetGridFrame( Frame3d( ptCentr, vtNZ))
EgtMove( nExtPath, Point3d(0,0,dThSurf) - ORIG(), GDB_RT.GLOB)
EgtSetGridFrame()
local pAuxId = {}
local nAuxId, AuxId
nAuxId = EgtLine( nAddGrpId, ptP1, ptP2, GDB_RT.GLOB)
table.insert( pAuxId, nAuxId)
nAuxId = EgtLine( nAddGrpId, ptP2, ptP3, GDB_RT.GLOB)
table.insert( pAuxId, nAuxId)
nAuxId = EgtLine( nAddGrpId, ptP3, ptP1, GDB_RT.GLOB)
table.insert( pAuxId, nAuxId)
-- trasformo in percorso
if #pAuxId ~= 3 then
return nil
end
-- setto griglia
EgtSetGridFrame( Frame3d( ptCentr, vtExtr))
--creo il cerchio
local nIdCircle = EgtCircle( nAddGrpId, {0,0,0}, dDiamToolMax/2, GDB_RT.GRID)
-- verifico se c'è punto intersezione
local pPint = EgtIP( nIdCircle, nExtPath, {0,0,0}, GDB_RT.GRID)
-- riporto la griglia a globale
EgtSetGridFrame()
-- cancello il cerchio e il contorno
EgtErase( nExtPath)
EgtErase( nIdCircle)
if pPint then
return true
else
return false
AuxId = EgtCurveCompo( nAddGrpId, pAuxId, true)
-- se non c'é il percorso esco
if not AuxId then
return nil
end
-- creo la superfice piana
local nidFace = EgtSurfTmByFlatContour( nAddGrpId, AuxId, 0.01)
if not nidFace then
EgtErase(AuxId)
return nil
end
-- se normale negativa inverto
local _, vtN1 = EgtSurfTmFacetCenter( nidFace, 0, GDB_ID.ROOT)
if vtN1:getZ() < -0.5 then EgtInvertSurf( nidFace) end
EgtErase(AuxId)
return nidFace
end
---------------------------------------------------------------------
local function AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, dOffsAng, dDepthMach,
nCheckPath, dDiamToolMax, bThruThick, dThSurf, bNegZ)
bThruThick, dThSurf, dDiam1, dDiam2, dTall1,
dTall2, dDiam3, dTall3, bMakeLocSurf, vFace)
-- variabili costruzione geometria
local pAuxId = {}
local nAuxId
local ptApPoint
local AuxId
local nNewProcLoc
-- se devo creare superfice locale
if bMakeLocSurf then
-- creo superfice locale o esco
local nSurfToAdd = MakeLocalSurf( tFacAdj[1][7], tFacAdj[1][8], tFacAdj[1][9], nAddGrpId)
if nSurfToAdd then
local nFacCntPre = EgtSurfTmFacetCount( nNewProc)
-- creo copia del percorso principale e gli aggiungo la nuova faccia
nNewProcLoc = EgtCopyGlob( nNewProc, nAddGrpId)
nNewProcLoc = EgtSurfTmBySewing( nAddGrpId, {nNewProcLoc,nSurfToAdd} , true)
-- riordino le facce
nNewProcLoc = ReorderFacesFromTab( nNewProcLoc, vFace)
-- acquisisco il numero della faccia
nFacCnt = EgtSurfTmFacetCount( nNewProcLoc)
nFacInd = nFacCnt - 1
else
return true, ''
end
else
nNewProcLoc = nNewProc
end
-- prendo il primo versore
local _, vtN1 = EgtSurfTmFacetCenter( nNewProc, nFacInd, GDB_ID.ROOT)
local _, vtN2 = EgtSurfTmFacetCenter( nNewProc, tFacAdj[1][1], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( nNewProc, tFacAdj[1][2], GDB_ID.ROOT)
local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT)
local _, vtN2 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[1][1], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[1][2], GDB_ID.ROOT)
-- trovo il punto sulla superfice di riferimento
local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( nNewProc, nFacInd, tFacAdj[1][1], GDB_ID.ROOT)
local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[1][1], GDB_ID.ROOT)
local _, ptLocP3, ptLocP4, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[1][2], GDB_ID.ROOT)
-- se ho creato faccia locale su copia superficie, calcella la copia
if bMakeLocSurf then
EgtErase( nNewProcLoc)
end
local nIdIniPoint
local nIdEndPoint
if ptLocP1 and ptLocP2 then
@@ -668,9 +724,14 @@ local function AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut,
vtExtr = vtExtrExit + Vector3d(0,0,1.539865)
end
vtExtr:normalize()
local vtCheck = Vector3d(vtExtr)
-- se ho un offset angolare ruoto il percorso
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
vtCheck:rotate( Z_AX(), dOffsAng)
end
-- controllo se c'è collisione con le facce della superfice
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtExtr, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiamToolMax, nCheckPath,
false, nAddGrpId, dThSurf, bNegZ, vtN1) then
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
dTall1, dTall2, dDiam3, dTall3) then
return true, ''
end
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdIniPoint], tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
@@ -711,7 +772,7 @@ local function AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut,
end
-- inserisco le ultime tre linee
-- trovo il secondo punto sulla superfice di riferimento
_, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( nNewProc, nFacInd, tFacAdj[1][2], GDB_ID.ROOT)
ptLocP1, ptLocP2 = ptLocP3, ptLocP4
if ptLocP1 and ptLocP2 then
-- se il punto finale corrisponde con il punto utilizzato in precedenza, uso l'altro
if dist( tFacAdj[1][nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
@@ -828,7 +889,7 @@ end
---------------------------------------------------------------------
local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
dToolDiam, nAddGrpId, dThick, nMasterNewProc, dDepthMach,
AuxId, bThruThick, bNegZ)
bThruThick)
local sMilling, dMaxDepth
-- se ripresa angolo con fresa cono 60° con ripresa
@@ -850,13 +911,20 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
end
end
-- recupero i dati dell'utensile
local dMillDiam = 20
local dMillTotDiam = 20
local dMillDiamTh = 20
local dToolLength = 20
local dThickTool = 20
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool
dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- copio la feature nel layer di appoggio
@@ -866,30 +934,28 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
else
nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
end
local nFacInd
-- ottengo le dimensioni apertura, la normale e la faccia inferiore
local dDimMin, dDimMax, dDepth, vtOrtho, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId)
if nSurfInt then
-- uso la dimensione minima anche nel caso che la cava sborda perchè la lavorazione potrebbe collidere con un pezzo limitrofo
local dMinWidth = dDimMin
-- local dMinWidth = EgtIf( dMiddleFacetLength > 0.01, dMiddleFacetLength, dDimMin)
-- controllo le dimensioni della faccia, se dimensione minima al di sotto di un certo valore esco
-- per evitare collisioni
-- if dDepth >= dMinWidth / 2 or dMinWidth < WD.MIN_DIM_ALLOW_CLEAN + 100 * GEO.EPS_SMALL then
-- EgtErase( nNewProc)
-- return true
-- end
local nFacCntPre = EgtSurfTmFacetCount( nNewProc)
nNewProc = EgtSurfTmBySewing( nAddGrpId, {nNewProc,nSurfInt} , true)
-- riordino le facce
nNewProc = ReorderFacesFromTab( nNewProc, vFace)
-- acquisisco il numero della faccia
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
nFacInd = nFacCnt - 1
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
local nFacInd, dDimMin, dDimMax, dDepth, nSurfInt
local bMakeLocSurf
if nFacCnt <= 4 then
-- ottengo le dimensioni apertura, la normale e la faccia inferiore
dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId)
if nSurfInt then
-- uso la dimensione minima anche nel caso che la cava sborda perchè la lavorazione potrebbe collidere con un pezzo limitrofo
local dMinWidth = dDimMin
nNewProc = EgtSurfTmBySewing( nAddGrpId, {nNewProc,nSurfInt} , true)
-- riordino le facce
nNewProc = ReorderFacesFromTab( nNewProc, vFace)
-- acquisisco il numero della faccia
nFacCnt = EgtSurfTmFacetCount( nNewProc)
nFacInd = nFacCnt - 1
else
local sErr = 'Error : cannot create base surface'
EgtOutLog( sErr)
return false, sErr
end
else
local sErr = 'Error : cannot create base surface'
EgtOutLog( sErr)
return false, sErr
bMakeLocSurf = true
end
-- verifico se ciclo chiuso
local bClosed = ( abs( vFace[1].AngPrev) > 0.1)
@@ -911,16 +977,26 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
local tFacAdj = {}
local nFace1 = vFace[i].Fac
local nFace2
-- ricavo i tre punti per eventuale superficie locale
local ptLoc1, ptLoc2, ptLoc3
-- punto precedente (punto precedente della faccia [i])
ptLoc3 = vFace[i].PPrev
-- aggiungo geometria
i = i + 1
local j = EgtIf( i <= #vFace, i, EgtIf( bAllType4, nil, 1))
nFace2 = vFace[j].Fac
-- punto in comune tra le due facce (punto precedente della faccia [j])
ptLoc1 = vFace[j].PPrev
-- punto successivo ( precedente della faccia successiva)
j = j + 1
local k = EgtIf( j <= #vFace, j, EgtIf( bAllType4, nil, 1))
ptLoc2 = vFace[k].PPrev
-- ricavo i punti e l'angolo interno
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT)
-- se punti validi e angolo è interno e >= 90 creo istanza
if ptP1 and ptP2 and dAng < 0 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then
local dLen = dist( ptP1, ptP2)
table.insert( tFacAdj, { nFace1, nFace2, dLen, ptP1, ptP2, dAng})
table.insert( tFacAdj, { nFace1, nFace2, dLen, ptP1, ptP2, dAng, ptLoc1, ptLoc2, ptLoc3})
end
-- se ho un elemento creo percorso o percorsi in base al tipo di cono e all'apertura dall'angolo rispetto ai 90°
-- con una tolleranza di 2 gradi
@@ -930,18 +1006,21 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
-- primo taglio
local bOk, sErr = AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, -dAngOffs, dDepthMach,
AuxId, max( dMillTotDiam, dMillDiamTh), bThruThick, dDepth, bNegZ)
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
-- secondo taglio
bOk, sErr = AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, dAngOffs, dDepthMach,
AuxId, max( dMillTotDiam, dMillDiamTh), bThruThick, dDepth, bNegZ)
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
-- altrimenti ho un solo percorso
else
local bOk, sErr = AddMillCornerMachining( nNewProc, nFacInd, tFacAdj, nTypeConeCut, nAddGrpId,
dToolDiam, dThick, sMilling, 0, dDepthMach,
AuxId, max( dMillTotDiam, dMillDiamTh), bThruThick, dDepth, bNegZ)
bThruThick, dDepth, dMillDiam, dMillTotDiam, abs(dThickTool),
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace)
if not bOk then return bOk, sErr end
end
end
@@ -961,6 +1040,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
-- flag per fresature non passanti
local bNotThrou
local dThick
local dOriDepth
-- recupero i dati dell'utensile
local dMillDiam = 20
local dMaxDepth = 0
@@ -1008,6 +1088,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
end
-- se affondamento superiore ai limiti della fresa
if dDepth > dMaxDepth then
dOriDepth = dDepth
-- lo limito e tolgo eventuali Tabs
dDepth = dMaxDepth
EgtSetMachiningParam( MCH_MP.LEAVETAB, false)
@@ -1059,6 +1140,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
end
-- se affondamento superiore ai limiti della fresa
if dDepth > dMaxDepth then
dOriDepth = dDepth
-- lo limito e tolgo eventuali Tabs
dDepth = dMaxDepth
EgtSetMachiningParam( MCH_MP.LEAVETAB, false)
@@ -1084,6 +1166,8 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
EgtSetMachiningGeometry( vGeom)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- tolgo sempre i Tabs per permettere rimozione sfrido
EgtSetMachiningParam( MCH_MP.LEAVETAB, false)
-- percorso da non invertire
EgtSetMachiningParam( MCH_MP.INVERT, false)
-- assegno utilizzo faccia
@@ -1107,7 +1191,12 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
-- assegno utilizzo faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
-- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
if bNotThrou then
EgtSetMachiningParam( MCH_MP.DEPTH, ( dDepth - dOriDepth))
else
EgtSetMachiningParam( MCH_MP.DEPTH, 0)
end
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
-- posizione braccio porta testa
@@ -1125,7 +1214,12 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
-- assegno utilizzo faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
-- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
if bNotThrou then
EgtSetMachiningParam( MCH_MP.DEPTH, ( dDepth - dOriDepth))
else
EgtSetMachiningParam( MCH_MP.DEPTH, 0)
end
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
-- posizione braccio porta testa
@@ -1383,7 +1477,7 @@ local function MakeByCut( Proc, nRawId, b3Raw, bDeleteBottomFacet)
if ( nConeCut == 1 and nMlOk == 1) or ( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
sMlErr, nAddGrpId, dThick, nNewProc, 0,
AuxId, true, bNegZ)
true)
if not bMcok then return bMcok, sMcErr end
end
-- altrimenti provo con la sega a catena
@@ -1394,7 +1488,7 @@ local function MakeByCut( Proc, nRawId, b3Raw, bDeleteBottomFacet)
if nConeCut == 1 and nCsOk == 1 then
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
sCSErr, nAddGrpId, nil, nNewProc, 0,
AuxId, true, bNegZ)
true)
if not bMcok then return bMcok, sMcErr end
end
end
@@ -1593,6 +1687,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
local sWarn = ''
if bPocketBotface then
local dThElev = dThDiam / 2 * sqrt( vtExtr:getX() * vtExtr:getX() + vtExtr:getY() * vtExtr:getY())
if dElev + dThElev > dMaxDepth + 10 * GEO.EPS_SMALL then
@@ -1604,7 +1699,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
if dDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
dDepth = dMaxDepth
local sWarn = 'Warning : elevation bigger than max tool depth'
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
end
@@ -1625,11 +1720,12 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
-- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante
if nConeCut == 1 then
local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw,
dMillDiam, nAddGrpId, nil, nNewProc, EgtIf( bPocketBotface, dDepth, ( dDepth - dOriDepth)),
AuxId, nil, bNegZ)
dMillDiam, nAddGrpId, nil, nNewProc, EgtIf( bPocketBotface, dDepth, ( dDepth - dOriDepth)))
if not bMcok then return bMcok, sMcErr end
else
EgtErase( nNewProc)
end
return true
return true, sWarn
end
---------------------------------------------------------------------