|
|
|
@@ -64,6 +64,7 @@
|
|
|
|
|
-- 2023/02/06 Alla MakeDrillOnCorner aggiunto controllo distanza di sicurezza minima.
|
|
|
|
|
-- 2023/02/16 Piccola correzione alla scelta utensile di svuotatura.
|
|
|
|
|
-- 2023/02/21 Piccola correzione alla MakeByPocket.
|
|
|
|
|
-- 2023/03/13 In MakeByPocket aggiunto Q11=Tool_ID per forzare la scelta utensile in casi con Q03=2/3.
|
|
|
|
|
-- 2023/03/31 Correzione al calcolo della distanza di collisione nel caso in cui il gambo sia più piccolo dell'utensile.
|
|
|
|
|
-- 2023/06/06 Limiti su svuotature tasche a L 4 facce come per L 3 facce. In svuotatura aggiunto recupero UserNotes da libreria per MaxOptSize.
|
|
|
|
|
-- 2023/16/12 Corretto il recupero dati utensile che, in alcune funzioni, puntava all'utensile errato.
|
|
|
|
@@ -73,6 +74,7 @@
|
|
|
|
|
-- 2023/08/02 Piccola correzione al calcolo della distanza di sicurezza in base al gambo dell'utensile.
|
|
|
|
|
-- 2023/08/02 Corretto incremento della profondità pari al raggio utensile per tunnel con sega a catena.
|
|
|
|
|
-- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi (anche per relativi antischeggia con lama).
|
|
|
|
|
-- 2023/09/12 In MakeByPockets gestito correttamente il ritorno nil di GetUShapeWidth.
|
|
|
|
|
|
|
|
|
|
-- Tabella per definizione modulo
|
|
|
|
|
local ProcessLapJoint = {}
|
|
|
|
@@ -144,6 +146,7 @@ local function AssignQIdent( Proc)
|
|
|
|
|
Q_SIDE_ROUGH_TOOL = ''
|
|
|
|
|
Q_ANTISPLINT_TYPE = ''
|
|
|
|
|
Q_MAX_ELEVATION = 'Q10'
|
|
|
|
|
Q_TOOL_ID = ''
|
|
|
|
|
|
|
|
|
|
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
|
|
|
|
Q_FORCE_BLADE = 'Q01' -- i
|
|
|
|
@@ -167,10 +170,12 @@ local function AssignQIdent( Proc)
|
|
|
|
|
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
|
|
|
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
|
|
|
|
Q_DEPTH_CHAMFER = 'Q07' -- d
|
|
|
|
|
Q_TOOL_ID = 'Q11' -- i
|
|
|
|
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
|
|
|
|
Q_SIDE_ROUGH_TOOL = 'Q01' -- i
|
|
|
|
|
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
|
|
|
|
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
|
|
|
|
Q_TOOL_ID = 'Q11' -- i
|
|
|
|
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33 then
|
|
|
|
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
|
|
|
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
|
|
|
|
@@ -326,12 +331,15 @@ local function VerifyChainSaw( Proc, dMinDim, dMaxDim)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bPocketUp, bPocketDown)
|
|
|
|
|
local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bPocketUp, bPocketDown, sChosenToolUuid)
|
|
|
|
|
-- tipo di svuotatura
|
|
|
|
|
local sMchFind = EgtIf( sMchFindMaster and #sMchFindMaster > 0, sMchFindMaster, 'Pocket')
|
|
|
|
|
-- ricerca della svuotatura
|
|
|
|
|
local sPocketing
|
|
|
|
|
if dDepth then
|
|
|
|
|
-- se viene specificato un utensile non guardo altro
|
|
|
|
|
if sChosenToolUuid then
|
|
|
|
|
sPocketing = ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen, bPocketUp, bPocketDown, nil, nil, sChosenToolUuid)
|
|
|
|
|
elseif dDepth then
|
|
|
|
|
sPocketing = ML.FindPocketing( sMchFind, dDiam, dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
|
|
|
|
ML.FindPocketing( sMchFind, dDiam, 0.8 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
|
|
|
|
ML.FindPocketing( sMchFind, dDiam, 0.7 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or
|
|
|
|
@@ -3464,7 +3472,7 @@ local function GetUShapeWidth( Proc, nFacInd)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
|
|
|
|
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL, dOvmHead)
|
|
|
|
|
|
|
|
|
|
local nFirstMachId
|
|
|
|
|
local bOrthoFaces
|
|
|
|
@@ -3472,8 +3480,32 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
local sMchFind = 'Pocket'
|
|
|
|
|
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
|
|
|
|
local bBadMach = false
|
|
|
|
|
dOvmHead = dOvmHead or 10
|
|
|
|
|
|
|
|
|
|
-- minima altezza della tasca sotto alla quale fa una contornatura invece di una svuotatura
|
|
|
|
|
local dMinFaceElevForPocket = 20
|
|
|
|
|
|
|
|
|
|
-- se l'utente forza un utensile e la lavorazione è forzata dal lato modifico la minima altezza della tasca
|
|
|
|
|
local sChosenToolUuid
|
|
|
|
|
if ( ( EgtGetInfo( Proc.Id, Q_TOOL_ID, 'i') or 0) > 0 and ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0) > 1) then
|
|
|
|
|
local nChosenToolUuid = EgtGetInfo( Proc.Id, Q_TOOL_ID, 'i')
|
|
|
|
|
local sToolName = EgtTdbGetFirstTool( MCH_TF.MILL)
|
|
|
|
|
while sToolName ~= '' do
|
|
|
|
|
EgtTdbSetCurrTool( sToolName)
|
|
|
|
|
local nToolId = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'Tool_ID', 'i')
|
|
|
|
|
local bIsToolActive = EgtTdbGetCurrToolParam( MCH_TP.ACTIVE)
|
|
|
|
|
if ( ( nChosenToolUuid == nToolId) and bIsToolActive) then break end
|
|
|
|
|
sToolName = EgtTdbGetNextTool( MCH_TF.MILL)
|
|
|
|
|
end
|
|
|
|
|
if sToolName == '' then
|
|
|
|
|
sChosenToolUuid = ''
|
|
|
|
|
else
|
|
|
|
|
local dChosenToolDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
|
|
|
|
dMinFaceElevForPocket = dChosenToolDiameter / 2 + 10 * GEO.EPS_SMALL
|
|
|
|
|
sChosenToolUuid = EgtTdbGetCurrToolParam( MCH_TP.UUID)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if sMchFindMaster and #sMchFindMaster > 0 then
|
|
|
|
|
sMchFind = sMchFindMaster
|
|
|
|
|
end
|
|
|
|
@@ -3492,7 +3524,9 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
else
|
|
|
|
|
bOrthoFaces = bOrthoFacesMaster
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local bMakeContour = false
|
|
|
|
|
local bMakePocket, sPocketing, dMaxDepth, dDiamTool
|
|
|
|
|
local sMilling
|
|
|
|
|
-- se è un tunnel verifico se è possibile usare la svuotatura
|
|
|
|
|
if bOrthoFaces then
|
|
|
|
|
-- ottengo le dimensioni del tunnel
|
|
|
|
@@ -3519,10 +3553,10 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
-- ricalcolo se è lavorabile da sotto
|
|
|
|
|
bMillDown = ( BD.DOWN_HEAD == true)
|
|
|
|
|
-- verifico se può essere fatto con svuotatura
|
|
|
|
|
local bMakePocket, sPocketing, dMaxDepth, dDiamTool = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind)
|
|
|
|
|
bMakePocket, sPocketing, dMaxDepth, dDiamTool = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, nil, nil, sChosenToolUuid)
|
|
|
|
|
local bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn
|
|
|
|
|
if bMillDown then
|
|
|
|
|
bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, nil, true)
|
|
|
|
|
bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, nil, true, sChosenToolUuid)
|
|
|
|
|
-- se è negativo inverto il versore e la faccia
|
|
|
|
|
if vtOrtho:getZ() < 0 then
|
|
|
|
|
vtOrtho = -vtOrtho
|
|
|
|
@@ -3531,11 +3565,9 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
end
|
|
|
|
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
|
|
|
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
|
|
|
|
local bMakeContour = false
|
|
|
|
|
local sMilling
|
|
|
|
|
-- recupero la lavorazione di contornatura
|
|
|
|
|
sMilling = ML.FindMilling( 'Prof', nil, sChosenToolUuid)
|
|
|
|
|
if dFacElev < dMinFaceElevForPocket and ( bIsU or bIsL) and ( Proc.Fct == 2 or Proc.Fct == 3) and abs( vtN:getZ()) > 0.996 then
|
|
|
|
|
-- 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)
|
|
|
|
@@ -3546,8 +3578,8 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
if sMilling and 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
|
|
|
|
|
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dDiamTool
|
|
|
|
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
|
|
|
|
bMakeContour = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -3702,18 +3734,20 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
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)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, dMinFaceElevForPocket + 10)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, dMinFaceElevForPocket + 10)
|
|
|
|
|
elseif bIsL then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
|
|
|
|
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.LITANG, dOvmHead + ( dDiamTool / 2) + 10)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, dMinFaceElevForPocket + 10)
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
|
|
|
|
end
|
|
|
|
|
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
|
|
|
|
local sNotes = ''
|
|
|
|
@@ -3835,25 +3869,26 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
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)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, dMinFaceElevForPocket + 10)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, dMinFaceElevForPocket + 10)
|
|
|
|
|
elseif bIsL then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 30)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
|
|
|
|
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.LOTANG, dOvmHead + ( dDiamTool / 2) + 10)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, dMinFaceElevForPocket + 10)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
|
|
|
|
end
|
|
|
|
|
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
|
|
|
|
sNotes = ''
|
|
|
|
@@ -3874,7 +3909,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
|
|
|
|
if not bComplete and bIs3Faces then
|
|
|
|
|
if not bComplete and bIs3Faces and not bMakeContour then
|
|
|
|
|
-- recupero la faccia da lavorare
|
|
|
|
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
|
|
|
|
local vtN
|
|
|
|
@@ -3948,8 +3983,13 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return 0, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, bOrthoFaces
|
|
|
|
|
if ( sChosenToolUuid == '') or ( sChosenToolUuid and ( ( bMakeContour and not sMilling) or not sPocketing)) then
|
|
|
|
|
local sErr = 'Error : no machining found with chosen Tool_ID'
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
else
|
|
|
|
|
return 0, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, bOrthoFaces
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@@ -5098,7 +5138,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
-- lavoro con svuotature (singola o doppia contrapposta)
|
|
|
|
|
local sMyMchFind = 'Pocket'
|
|
|
|
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, _, _, _, _, _, _, _,
|
|
|
|
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, true, b3Solid, nil, bMillDown)
|
|
|
|
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, true, b3Solid, nil, bMillDown, bSetOpenBorders, bIsU, bIsL, dOvmHead)
|
|
|
|
|
-- se lavorazione non idonee ( asse della feature troppo inclinato e impossibile lavorare completamente da due parti)
|
|
|
|
|
if nOk == -2 then
|
|
|
|
|
if not sMchFind then
|
|
|
|
@@ -5276,7 +5316,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, bIsU, bIsL)
|
|
|
|
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL, dOvmHead)
|
|
|
|
|
if nOk == -3 then
|
|
|
|
|
bTryWithBlades = true
|
|
|
|
|
elseif nOk == -2 then
|
|
|
|
|