|
|
|
@@ -51,6 +51,9 @@
|
|
|
|
|
-- 2022/07/12 In MakeByChainOrSaw aggiunto check per feature L20 usata in modo improprio e, nel caso, si passa a una lavorazione tasca.
|
|
|
|
|
-- 2022/08/11 Aggiunta lavorazione tunnel splittata con sega a catena per tutte le macchine ad esclusione della Fast.
|
|
|
|
|
-- 2022/09/01 Spostate le funzioni GetTunnelDimension, CalcCollisionSafety, SetOpenSide in BeamLib.
|
|
|
|
|
-- 2022/09/15 Implementata gestione feature Planing L090, gestita come LapJoint
|
|
|
|
|
-- Implementata, in caso di fresatura di lato con altezza tasca molto bassa, la contornatura con unica passata
|
|
|
|
|
-- Migliorata gestione AntiSplint (Mill e Saw)
|
|
|
|
|
|
|
|
|
|
-- Tabella per definizione modulo
|
|
|
|
|
local ProcessLapJoint = {}
|
|
|
|
@@ -101,6 +104,7 @@ function ProcessLapJoint.Identify( Proc)
|
|
|
|
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or
|
|
|
|
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or
|
|
|
|
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or
|
|
|
|
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or
|
|
|
|
|
( Proc.Grp == 4 and Proc.Prc == 37) or
|
|
|
|
|
( Proc.Grp == 4 and Proc.Prc == 39) or
|
|
|
|
|
( Proc.Grp == 4 and Proc.Prc == 120))
|
|
|
|
@@ -158,6 +162,9 @@ local function AssignQIdent( Proc)
|
|
|
|
|
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
|
|
|
|
Q_USE_MILL = 'Q02' -- i
|
|
|
|
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
|
|
|
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90 then
|
|
|
|
|
Q_ANTISPLINT_TYPE = 'Q03' -- i
|
|
|
|
|
Q_SIDE_ROUGH_TOOL = 'Q04' -- i
|
|
|
|
|
end
|
|
|
|
|
-- le altre features gestite non hanno parametri Q
|
|
|
|
|
end
|
|
|
|
@@ -2986,7 +2993,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|
|
|
|
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
|
|
|
if bMadeASbyBld then
|
|
|
|
|
sWarn = nil
|
|
|
|
|
if abs(dExtraOffs) > 0 then
|
|
|
|
|
if not bReduceDepth and abs(dExtraOffs) > 0 then
|
|
|
|
|
sWarn = 'Warning : antisplint elevation is bigger than max tool depth'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -3088,8 +3095,10 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo
|
|
|
|
|
end
|
|
|
|
|
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
|
|
|
|
local sWarn
|
|
|
|
|
local dDepth = dElev
|
|
|
|
|
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dElev)
|
|
|
|
|
dDepth = dElev
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
|
|
|
|
dElev = dMaxDepth
|
|
|
|
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
|
|
|
|
EgtOutLog( sWarn)
|
|
|
|
@@ -3110,7 +3119,7 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return true, sWarn, sTuuidPk, dDiamTool
|
|
|
|
|
return true, sWarn, sTuuidPk, dDiamTool, dDepth
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@@ -3314,7 +3323,7 @@ local function GetUShapeWidth( Proc, nFacInd)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders)
|
|
|
|
|
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
|
|
|
|
|
|
|
|
|
local nFirstMachId
|
|
|
|
|
local bOrthoFaces
|
|
|
|
@@ -3322,6 +3331,8 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
local sMchFind = 'Pocket'
|
|
|
|
|
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
|
|
|
|
local bBadMach = false
|
|
|
|
|
-- minima altezza della tasca sotto alla quale fa una contornatura invece di una svuotatura
|
|
|
|
|
local dMinFaceElevForPocket = 20
|
|
|
|
|
if sMchFindMaster and #sMchFindMaster > 0 then
|
|
|
|
|
sMchFind = sMchFindMaster
|
|
|
|
|
end
|
|
|
|
@@ -3377,7 +3388,31 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
EgtInvertSurf( nSurfInt)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if bMakePocket then
|
|
|
|
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
|
|
|
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
|
|
|
|
local bMakeContour = false
|
|
|
|
|
local sMilling
|
|
|
|
|
if dFacElev < dMinFaceElevForPocket and ( bIsU or bIsL) and ( Proc.Fct == 2 or Proc.Fct == 3) and abs( vtN:getZ()) > 0.996 then
|
|
|
|
|
bMakeContour = true
|
|
|
|
|
-- recupero la lavorazione di contornatura
|
|
|
|
|
sMilling = ML.FindMilling( 'Prof', nil, nil, nil, nil, not bMillDown, bMillDown)
|
|
|
|
|
if not sMilling then
|
|
|
|
|
local sMyWarn = 'Warning : Prof not found in library'
|
|
|
|
|
EgtOutLog( sMyWarn)
|
|
|
|
|
return true, sMyWarn
|
|
|
|
|
end
|
|
|
|
|
-- recupero i dati dell'utensile
|
|
|
|
|
dDiamTool = 50
|
|
|
|
|
dMaxDepth = 0
|
|
|
|
|
if EgtMdbSetCurrMachining( sMilling) then
|
|
|
|
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
|
|
|
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
|
|
|
|
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
|
|
|
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dToolMaxDepth
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if bMakePocket or bMakeContour then
|
|
|
|
|
-- gestione svuotatura da un solo lato o anche dal lato opposto (se non verticale)
|
|
|
|
|
-- estraggo il contorno dalla superfice per evitare i problemi con la svuotatura
|
|
|
|
|
-- e assegno l'estrusione
|
|
|
|
@@ -3403,7 +3438,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
else
|
|
|
|
|
-- se direzione verso la verticale setto max affondamento possibile ed
|
|
|
|
|
-- emetto messaggio di warning perché non lavorabile interamente
|
|
|
|
|
if abs( vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
|
|
|
|
if abs( vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD and not bMakeContour then
|
|
|
|
|
dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
|
|
|
|
|
dElev = dMaxDepth
|
|
|
|
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
|
|
|
@@ -3438,29 +3473,49 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
local sErr = 'Impossible apply perpendicular pocketing: ' .. sPocketing
|
|
|
|
|
return -2, sErr
|
|
|
|
|
end
|
|
|
|
|
-- inserisco la lavorazione di svuotatura
|
|
|
|
|
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
local nMchFId = EgtAddMachining( sName, sPocketing)
|
|
|
|
|
if not nMchFId then
|
|
|
|
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
local sName
|
|
|
|
|
local nMchFId
|
|
|
|
|
if bMakeContour then
|
|
|
|
|
-- inserisco la lavorazione di contornatura
|
|
|
|
|
sName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
nMchFId = EgtAddMachining( sName, sMilling)
|
|
|
|
|
if not nMchFId then
|
|
|
|
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
-- altrimenti inserisco la lavorazione di svuotatura
|
|
|
|
|
sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
nMchFId = EgtAddMachining( sName, sPocketing)
|
|
|
|
|
if not nMchFId then
|
|
|
|
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- prendo l'id della prima lavorazione inserita
|
|
|
|
|
if not nFirstMachId then
|
|
|
|
|
nFirstMachId = nMchFId
|
|
|
|
|
end
|
|
|
|
|
-- aggiungo geometria
|
|
|
|
|
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
|
|
|
|
if bMakeContour then
|
|
|
|
|
-- aggiungo geometria per contornatura
|
|
|
|
|
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
|
|
|
|
|
else
|
|
|
|
|
-- altrimenti aggiungo geometria per svuotatura
|
|
|
|
|
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
|
|
|
|
end
|
|
|
|
|
-- verifico se devo invertire direzione utensile (in caso di direzione verso la verticale)
|
|
|
|
|
local bInvertMach
|
|
|
|
|
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
|
|
|
bInvertMach = true
|
|
|
|
|
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
|
|
|
|
|
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
|
|
|
bInvertMach = true
|
|
|
|
|
if not bMakeContour then
|
|
|
|
|
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
|
|
|
bInvertMach = true
|
|
|
|
|
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
|
|
|
|
|
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
|
|
|
bInvertMach = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- imposto posizione braccio porta testa
|
|
|
|
|
local nSCC = MCH_SCC.NONE
|
|
|
|
@@ -3481,11 +3536,50 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
|
|
|
|
end
|
|
|
|
|
-- inverto il percorso di lavorazione per lavorare sinistro
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
|
|
|
|
if not bMakeContour then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
|
|
|
|
end
|
|
|
|
|
-- imposto affondamento
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
|
|
|
|
if not bMakeContour then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
|
|
|
|
end
|
|
|
|
|
-- se contornatura doppia anticipo la fine della lavorazione a metà trave
|
|
|
|
|
if bMakeContour and bDoubleSide then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.OFFSL, dDepth / 2)
|
|
|
|
|
end
|
|
|
|
|
-- se contornatura cerco la direzione di lavoro migliore e setto attacco e allungamenti
|
|
|
|
|
if bMakeContour then
|
|
|
|
|
local nFaceUse = BL.GetNearestParalOpposite( vtOrtho)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
|
|
|
|
-- quantità di cui allargare la contornatura per andare in tangenza con lo spigolo, nel caso di altezza tasca minore di D/2 fresa
|
|
|
|
|
local dAddWorkWidth = EgtIf( dFacElev < dDiamTool / 2, -sqrt( dFacElev * dDiamTool - dFacElev * dFacElev), -dDiamTool / 2)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
|
|
|
|
if bIsU then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
|
|
|
|
elseif bIsL then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LITANG, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
|
|
|
|
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
|
|
|
|
local sNotes = ''
|
|
|
|
|
if not bMakeContour then
|
|
|
|
|
sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
|
|
|
|
end
|
|
|
|
|
sNotes = sNotes .. 'VMRS=0;'
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
|
|
|
|
-- eseguo
|
|
|
|
@@ -3528,20 +3622,36 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
EgtOutLog( sWarn)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- inserisco la lavorazione di svuotatura
|
|
|
|
|
local sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
local nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing))
|
|
|
|
|
if not nMchFId then
|
|
|
|
|
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing)
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
if bMakeContour then
|
|
|
|
|
-- inserisco la lavorazione di contornatura
|
|
|
|
|
sName = 'ProfOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
nMchFId = EgtAddMachining( sName, sMilling)
|
|
|
|
|
if not nMchFId then
|
|
|
|
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
-- inserisco la lavorazione di svuotatura
|
|
|
|
|
sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing))
|
|
|
|
|
if not nMchFId then
|
|
|
|
|
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing)
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- prendo l'id della prima lavorazione inserita
|
|
|
|
|
if not nFirstMachId then
|
|
|
|
|
nFirstMachId = nMchFId
|
|
|
|
|
end
|
|
|
|
|
-- aggiungo geometria
|
|
|
|
|
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
|
|
|
|
if bMakeContour then
|
|
|
|
|
-- aggiungo geometria per contornatura
|
|
|
|
|
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
|
|
|
|
|
else
|
|
|
|
|
-- altrimenti aggiungo geometria per svuotatura
|
|
|
|
|
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
|
|
|
|
end
|
|
|
|
|
-- imposto direzione utensile opposta
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
|
|
|
-- imposto posizione braccio porta testa
|
|
|
|
@@ -3563,11 +3673,49 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
|
|
|
|
end
|
|
|
|
|
-- inverto il percorso di lavorazione per lavorare sinistro
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
|
|
|
|
-- imposo affondamento
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
|
|
|
|
-- imposto affondamento
|
|
|
|
|
if not bMakeContour then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
|
|
|
|
end
|
|
|
|
|
-- se contornatura doppia anticipo la fine della lavorazione a metà trave
|
|
|
|
|
if bMakeContour and bDoubleSide then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.OFFSL, dDepth / 2)
|
|
|
|
|
end
|
|
|
|
|
-- se contornatura cerco la direzione di lavoro migliore
|
|
|
|
|
if bMakeContour then
|
|
|
|
|
local nFaceUse = BL.GetNearestParalOpposite( vtOrtho)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
|
|
|
|
-- quantità di cui allargare la contornatura per andare in tangenza con lo spigolo, nel caso di altezza tasca minore di D/2 fresa
|
|
|
|
|
local dAddWorkWidth = EgtIf( dFacElev < dDiamTool / 2, -sqrt( dFacElev * dDiamTool - dFacElev * dFacElev), -dDiamTool / 2)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
|
|
|
|
if bIsU then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
|
|
|
|
elseif bIsL then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.TANGENT)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOTANG, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
|
|
|
|
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
|
|
|
|
sNotes = ''
|
|
|
|
|
if not bMakeContour then
|
|
|
|
|
sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
|
|
|
|
end
|
|
|
|
|
sNotes = sNotes .. 'VMRS=0;'
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
|
|
|
|
-- eseguo
|
|
|
|
@@ -4918,13 +5066,16 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
-- 2021.07.16 Per poter eseguire antischeggia di lama su feature che non sono passanti da faccia a faccia
|
|
|
|
|
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
|
|
|
|
|
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
|
|
|
|
|
-- non fa mai antischeggia di lama se la faccia è rivolta verso il basso, a meno che ci sia una testa sotto
|
|
|
|
|
local bMadeASbyBld = false
|
|
|
|
|
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
|
|
|
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
|
|
|
|
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
|
|
|
|
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD) then
|
|
|
|
|
local bOk
|
|
|
|
|
local bSawDown = ( bMillDown and not bMillUp)
|
|
|
|
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bSawDown, true)
|
|
|
|
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
|
|
|
|
if not bOk then return false, sWarn end
|
|
|
|
|
end
|
|
|
|
|
-- in base al flag interno e al numero di facce e se ha forma ad U
|
|
|
|
@@ -4994,7 +5145,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
|
|
|
|
end
|
|
|
|
|
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
|
|
|
|
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
|
|
|
|
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
|
|
|
|
if not bOk then return false, sWarn2 end
|
|
|
|
|
if sWarn2 then
|
|
|
|
|
if not sWarn then sWarn = '' end
|
|
|
|
@@ -5005,8 +5156,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
|
|
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide,
|
|
|
|
|
vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth,
|
|
|
|
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
|
|
|
|
nil, nil, nil, b3Solid, dDepth,
|
|
|
|
|
bOneShot, nFirstMachId)
|
|
|
|
|
if sWarn2 then
|
|
|
|
|
if not sWarn then sWarn = '' end
|
|
|
|
@@ -5035,7 +5186,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
bSetOpenBorders = true
|
|
|
|
|
end
|
|
|
|
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
|
|
|
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders)
|
|
|
|
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
|
|
|
|
if nOk == -2 then
|
|
|
|
|
if not sMchFind then
|
|
|
|
|
sMchFind = sMchFindBackUp
|
|
|
|
@@ -5055,10 +5206,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
sWarn = sErr
|
|
|
|
|
-- se ho antischeggia con fresa le inserisco
|
|
|
|
|
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
|
|
|
|
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
|
|
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide,
|
|
|
|
|
vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth,
|
|
|
|
|
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
|
|
|
|
nil, nil, nil, b3Solid, dFacElevOri,
|
|
|
|
|
bOneShot, nFirstMachId)
|
|
|
|
|
if sWarn2 then
|
|
|
|
|
if not sWarn then sWarn = '' end
|
|
|
|
@@ -5151,13 +5303,16 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
-- 2021.07.16 Per poter eseguire antischeggia di lama su feature che non sono passanti da faccia a faccia
|
|
|
|
|
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
|
|
|
|
|
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
|
|
|
|
|
-- non fa mai antischeggia di lama se la faccia è rivolta verso il basso, a meno che ci sia una testa sotto
|
|
|
|
|
local bMadeASbyBld = false
|
|
|
|
|
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
|
|
|
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
|
|
|
|
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
|
|
|
|
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD) then
|
|
|
|
|
local bOk
|
|
|
|
|
local bSawDown = ( bMillDown and not bMillUp)
|
|
|
|
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bSawDown)
|
|
|
|
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
|
|
|
|
if not bOk then return false, sWarn end
|
|
|
|
|
end
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
|
|
@@ -5396,7 +5551,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
|
|
|
-- in base al tipo di feature attribuisco il significato dei parametri Q
|
|
|
|
|
AssignQIdent( Proc)
|
|
|
|
|
-- se non forzate frese, uso la lama
|
|
|
|
|
local bUseBlade = EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1
|
|
|
|
|
local bUseBlade = EgtIf( Proc.Prc == 90, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1)
|
|
|
|
|
local nForceUseBladeOnNotContinueFace
|
|
|
|
|
-- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature
|
|
|
|
|
if bUseBlade then
|
|
|
|
@@ -5523,6 +5678,9 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
|
|
|
-- se piccola, con fresa
|
|
|
|
|
if not bUseBlade and ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then
|
|
|
|
|
return MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
|
|
|
|
-- se è una spianatura a una faccia richiamo la LongCut
|
|
|
|
|
elseif Proc.Prc == 90 then
|
|
|
|
|
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
|
|
|
|
|
-- altrimenti, con lama
|
|
|
|
|
else
|
|
|
|
|
return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
|
|
|