|
|
|
@@ -2423,7 +2423,8 @@ local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunne
|
|
|
|
|
local bMultipleHeadsAvailble = BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS
|
|
|
|
|
local bMillFromBottom = vtTunnelDirection:getZ() < BD.NZ_MINA
|
|
|
|
|
local bMillFromBottomOpposite = -vtTunnelDirection:getZ() < BD.NZ_MINA
|
|
|
|
|
local sWarn = ''
|
|
|
|
|
local sApplyWarning = ''
|
|
|
|
|
local bIncomplete = false
|
|
|
|
|
|
|
|
|
|
-- ricerca lavorazione lato principale
|
|
|
|
|
local sMilling = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not bMillFromBottom, bMillFromBottom)
|
|
|
|
@@ -2511,7 +2512,7 @@ local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunne
|
|
|
|
|
-- si arriva al massimo raggiungibile
|
|
|
|
|
else
|
|
|
|
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
|
|
|
|
sWarn = 'Warning : incomplete'
|
|
|
|
|
bIncomplete = true
|
|
|
|
|
end
|
|
|
|
|
-- non c'è lavorazione opposta
|
|
|
|
|
else
|
|
|
|
@@ -2521,7 +2522,7 @@ local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunne
|
|
|
|
|
-- si arriva al massimo raggiungibile
|
|
|
|
|
else
|
|
|
|
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
|
|
|
|
sWarn = 'Warning : incomplete'
|
|
|
|
|
bIncomplete = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
|
|
|
@@ -2533,14 +2534,14 @@ local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunne
|
|
|
|
|
-- eseguo
|
|
|
|
|
local bMillingOk
|
|
|
|
|
if ML.ApplyMachining( true, false) then
|
|
|
|
|
_, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
_, sApplyWarning = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( idMachining, false)
|
|
|
|
|
end
|
|
|
|
|
bMillingOk = true
|
|
|
|
|
-- altrimenti lavorazione non applicata
|
|
|
|
|
else
|
|
|
|
|
_, sWarn = EgtGetLastMachMgrError()
|
|
|
|
|
_, sApplyWarning = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( idMachining, false)
|
|
|
|
|
bMillingOk = false
|
|
|
|
|
end
|
|
|
|
@@ -2599,7 +2600,7 @@ local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunne
|
|
|
|
|
-- si arriva al massimo raggiungibile
|
|
|
|
|
else
|
|
|
|
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
|
|
|
|
sWarn = 'Warning : incomplete'
|
|
|
|
|
bIncomplete = true
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
|
|
|
|
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
|
|
|
@@ -2609,21 +2610,28 @@ local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunne
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
|
|
|
|
-- eseguo
|
|
|
|
|
if ML.ApplyMachining( true, false) then
|
|
|
|
|
_, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
_, sApplyWarning = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( idMachining, false)
|
|
|
|
|
end
|
|
|
|
|
bMillingOppositeOk = true
|
|
|
|
|
-- altrimenti lavorazione non applicata
|
|
|
|
|
else
|
|
|
|
|
_, sWarn = EgtGetLastMachMgrError()
|
|
|
|
|
_, sApplyWarning = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( idMachining, false)
|
|
|
|
|
bMillingOppositeOk = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if bMillingOk or ( bOppositeMillingNeeded and bMillingOppositeOk) then
|
|
|
|
|
return true, sWarn
|
|
|
|
|
local sWarning = ''
|
|
|
|
|
if bIncomplete then
|
|
|
|
|
sWarning = 'Warning : machining incomplete'
|
|
|
|
|
end
|
|
|
|
|
if #sApplyWarning > 0 then
|
|
|
|
|
sWarning = sApplyWarning .. '\n' .. sWarning
|
|
|
|
|
end
|
|
|
|
|
return true, sWarning
|
|
|
|
|
else
|
|
|
|
|
local sErr = 'Error : Not applicable'
|
|
|
|
|
return false, sErr
|
|
|
|
@@ -3308,7 +3316,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|
|
|
|
end
|
|
|
|
|
for i = 1, nStep do
|
|
|
|
|
local dOffs = ( i - 1) * dStep
|
|
|
|
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, 0, 0, nil, b3Raw)
|
|
|
|
|
local bForceClimbCut = true
|
|
|
|
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, 0, 0, nil, b3Raw, nil, nil, nil, nil, nil, nil, bForceClimbCut)
|
|
|
|
|
if not bOk then return bOk, sErr end
|
|
|
|
|
end
|
|
|
|
|
-- in base all'elevazione calcolo l'impronta della lama
|
|
|
|
@@ -6889,17 +6898,50 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
if bForceChainsaw then
|
|
|
|
|
-- ottengo le dimensioni del tunnel
|
|
|
|
|
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = BL.GetTunnelDimension( Proc, nPartId)
|
|
|
|
|
-- lavoro fessura con svuotature (singola o doppia contrapposta)
|
|
|
|
|
-- se non richiesto solo contorno, lavoro fessura con svuotature (singola o doppia contrapposta)
|
|
|
|
|
else
|
|
|
|
|
local sMyMchFind = 'Pocket'
|
|
|
|
|
local nOk, sErr
|
|
|
|
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
|
|
|
|
|
nLundIdFace, sErr = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
|
|
|
|
|
if nOk < 0 then
|
|
|
|
|
return false, sErr
|
|
|
|
|
elseif nOk > 0 then
|
|
|
|
|
sWarn = sErr
|
|
|
|
|
bTryWithBlades = false
|
|
|
|
|
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
|
|
|
|
if bOnlyContour then
|
|
|
|
|
if Proc.TopologyLongName == 'Tunnel-Through-RightAngles-Parallel-4' then
|
|
|
|
|
-- direzione e faccia aggiunta del tunnel (la groove-3 passante è uno pseudotunnel)
|
|
|
|
|
local _, _, dTunnelDepth, vtTunnelDirection, _, idAddedTunnelTmFace = BL.GetTunnelDimension( Proc, nPartId)
|
|
|
|
|
-- si tiene il verso del tunnel dal lato Z positiva
|
|
|
|
|
if vtTunnelDirection:getZ() < GEO.EPS_SMALL then
|
|
|
|
|
vtTunnelDirection = -vtTunnelDirection
|
|
|
|
|
EgtInvertSurf( idAddedTunnelTmFace)
|
|
|
|
|
end
|
|
|
|
|
-- estrazione del contorno da lavorare
|
|
|
|
|
local idContourPath = EgtExtractSurfTmLoops( idAddedTunnelTmFace, nAddGrpId)
|
|
|
|
|
EgtModifyCurveExtrusion( idContourPath, vtTunnelDirection, GDB_RT.GLOB)
|
|
|
|
|
-- spessore codolo da lasciare
|
|
|
|
|
local dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0
|
|
|
|
|
-- lavorazione
|
|
|
|
|
local bOkContour, sWarn2 = MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunnelDepth, dDimStrip, nPhase)
|
|
|
|
|
if bOkContour then
|
|
|
|
|
return true, sWarn2
|
|
|
|
|
else
|
|
|
|
|
return false, sWarn2
|
|
|
|
|
end
|
|
|
|
|
if sWarn2 then
|
|
|
|
|
if not sWarn then sWarn = '' end
|
|
|
|
|
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
local sErr2 = 'Error : Cannot use ' .. Q_ONLY_CONTOUR .. ' on this feature'
|
|
|
|
|
return false, sErr2
|
|
|
|
|
end
|
|
|
|
|
-- svuotatura
|
|
|
|
|
else
|
|
|
|
|
local sMyMchFind = 'Pocket'
|
|
|
|
|
local nOk, sErr
|
|
|
|
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
|
|
|
|
|
nLundIdFace, sErr = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
|
|
|
|
|
if nOk < 0 then
|
|
|
|
|
return false, sErr
|
|
|
|
|
elseif nOk > 0 then
|
|
|
|
|
sWarn = sErr
|
|
|
|
|
bTryWithBlades = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- Se la svuotatura precedente non è stata fatta e chamfer non è mutuamente esclusivo provo con la sega-catena
|
|
|
|
@@ -7689,7 +7731,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
|
|
|
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, 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 or BD.TURN) then
|
|
|
|
|
if nChamfer < 2 and ( nQAntisplintResult == 1 or nQAntisplintResult == 3) and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
|
|
|
|
local bOk
|
|
|
|
|
local bSawDown = ( bMillDown and not bMillUp)
|
|
|
|
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
|
|
|
@@ -7774,7 +7816,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
end
|
|
|
|
|
bTryWithBlades = false
|
|
|
|
|
-- se ho antischeggia con fresa le inserisco
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
|
|
|
if nChamfer < 2 and ( nQAntisplintResult == 2 or ( nQAntisplintResult == 3 and not bMadeASbyBld)) then
|
|
|
|
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
|
|
|
|
nil, nil, nil, b3Solid, dDepth,
|
|
|
|
@@ -7798,7 +7840,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- in tutti gli altri casi, a meno che non sia forzata sega a catena, lancio la MakeByPockets
|
|
|
|
|
-- lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo
|
|
|
|
|
-- se non richiesto solo contorno, lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo
|
|
|
|
|
elseif not bForceChainsaw then
|
|
|
|
|
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
|
|
|
|
-- richiesto solo contorno
|
|
|
|
@@ -7811,7 +7853,6 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
vtTunnelDirection = -vtTunnelDirection
|
|
|
|
|
EgtInvertSurf( idAddedTunnelTmFace)
|
|
|
|
|
end
|
|
|
|
|
-- elevazione della faccia aggiunta
|
|
|
|
|
-- estrazione del contorno da lavorare
|
|
|
|
|
local idContourPath = EgtExtractSurfTmLoops( idAddedTunnelTmFace, nAddGrpId)
|
|
|
|
|
EgtModifyCurveExtrusion( idContourPath, vtTunnelDirection, GDB_RT.GLOB)
|
|
|
|
@@ -7819,7 +7860,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
BL.SetOpenSide( idContourPath, b3Solid)
|
|
|
|
|
BL.ChangeOrOpenStart( idContourPath, 2)
|
|
|
|
|
-- spessore codolo da lasciare
|
|
|
|
|
local dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 5
|
|
|
|
|
local dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0
|
|
|
|
|
-- lavorazione
|
|
|
|
|
local bOkContour, sWarn2 = MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunnelDepth, dDimStrip, nPhase)
|
|
|
|
|
if bOkContour then
|
|
|
|
|
return true, sWarn2
|
|
|
|
@@ -7865,7 +7907,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
sWarn = sErr
|
|
|
|
|
-- se ho antischeggia con fresa le inserisco
|
|
|
|
|
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
|
|
|
if nChamfer < 2 and ( nQAntisplintResult == 2 or ( nQAntisplintResult == 3 and not bMadeASbyBld)) then
|
|
|
|
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
|
|
|
|
nil, nil, nil, b3Solid, dFacElevOri,
|
|
|
|
@@ -7970,14 +8012,14 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
|
|
|
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, 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 or BD.TURN) then
|
|
|
|
|
if nChamfer < 2 and ( nQAntisplintResult == 1 or nQAntisplintResult == 3) and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
|
|
|
|
local bOk
|
|
|
|
|
local bSawDown = ( bMillDown and not bMillUp)
|
|
|
|
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
|
|
|
|
if not bOk then return false, sWarn end
|
|
|
|
|
end
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
|
|
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
if nChamfer < 2 and ( nQAntisplintResult == 2 or ( nQAntisplintResult == 3 and not bMadeASbyBld)) then
|
|
|
|
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
|
|
|
|
nil, nil, nil, b3Solid)
|
|
|
|
|
if not bOk then return false, sWarn2 end
|
|
|
|
|