|
|
|
@@ -153,6 +153,7 @@ local Q_CHAINSAW_FROM_SIDE = '' -- i
|
|
|
|
|
local Q_CONVENTIONAL_MILLING = '' -- i
|
|
|
|
|
local Q_CLEAN_CORNER = '' -- 1
|
|
|
|
|
local Q_FLOATING_AGGREGATE = '' -- i
|
|
|
|
|
local Q_DIM_STRIP = '' -- d
|
|
|
|
|
|
|
|
|
|
-- variabile smussi
|
|
|
|
|
local bMadeChamfer
|
|
|
|
@@ -233,6 +234,7 @@ local function AssignQIdent( Proc)
|
|
|
|
|
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
|
|
|
|
Q_CLEAN_CORNER = 'Q15' -- i
|
|
|
|
|
Q_FLOATING_AGGREGATE = 'Q16' -- i
|
|
|
|
|
Q_DIM_STRIP = 'Q17' -- d
|
|
|
|
|
elseif ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 30 then
|
|
|
|
|
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
|
|
|
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
|
|
|
@@ -1064,6 +1066,12 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- eventuale segnalazione ingombro di testa o coda
|
|
|
|
|
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
|
|
|
@@ -1201,6 +1209,12 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -1236,6 +1250,12 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- eventuale segnalazione ingombro di testa o coda
|
|
|
|
|
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
|
|
|
@@ -1405,6 +1425,12 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV
|
|
|
|
|
_, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return true, '', dTDiam
|
|
|
|
|
end
|
|
|
|
@@ -2414,6 +2440,229 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
|
|
|
|
|
return true, sMyWarn
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunnelDepth, dDimStrip, nPhase)
|
|
|
|
|
|
|
|
|
|
local dCollSic = BL.CalcCollisionSafety( vtTunnelDirection)
|
|
|
|
|
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 sApplyWarning = ''
|
|
|
|
|
local bIncomplete = false
|
|
|
|
|
|
|
|
|
|
-- ricerca lavorazione lato principale
|
|
|
|
|
local sMilling = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not bMillFromBottom, bMillFromBottom)
|
|
|
|
|
if not sMilling then
|
|
|
|
|
local sErr = 'Warning : SmallToolContour not found in library'
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
-- dati utensile
|
|
|
|
|
local Tool = BL.GetToolFromMachining( sMilling)
|
|
|
|
|
|
|
|
|
|
-- verifica necessità lavorazione opposta
|
|
|
|
|
local bOppositeMillingNeeded
|
|
|
|
|
local bMainMillingReachesFullDepth = Tool.MaxDepth > dTunnelDepth + dCollSic - dDimStrip
|
|
|
|
|
local bMainMillingReachesHalfDepth = bMainMillingReachesFullDepth or ( Tool.MaxDepth > dTunnelDepth / 2 + dCollSic - dDimStrip / 2)
|
|
|
|
|
if bMainMillingReachesFullDepth and not bMultipleHeadsAvailble then
|
|
|
|
|
bOppositeMillingNeeded = false
|
|
|
|
|
else
|
|
|
|
|
bOppositeMillingNeeded = true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- ricera lavorazione lato opposto
|
|
|
|
|
local sMillingOpposite = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not bMillFromBottomOpposite, bMillFromBottomOpposite)
|
|
|
|
|
if bOppositeMillingNeeded and not sMillingOpposite then
|
|
|
|
|
local sErr = 'Warning : Opposite SmallToolContour not found in library'
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
-- dati utensile
|
|
|
|
|
local ToolOpposite = BL.GetToolFromMachining( sMillingOpposite)
|
|
|
|
|
|
|
|
|
|
local bOppositMillingReachesHalfDepth = ToolOpposite.MaxDepth > dTunnelDepth / 2 + dCollSic - dDimStrip / 2
|
|
|
|
|
|
|
|
|
|
-- eventuale lavorazione opposta
|
|
|
|
|
local bMillingOppositeOk
|
|
|
|
|
if bOppositeMillingNeeded then
|
|
|
|
|
local sName = 'ContourOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
local idMachining = EgtAddMachining( sName, sMillingOpposite)
|
|
|
|
|
if not idMachining then
|
|
|
|
|
local sErr = 'Error : impossible add machining ' .. sName .. '-' .. sMilling
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
-- geometria
|
|
|
|
|
EgtSetMachiningGeometry( {{ idContourPath, -1}})
|
|
|
|
|
-- lato di lavoro sinistro
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
|
|
|
|
-- inversione direzione utensile
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
|
|
|
-- SCC
|
|
|
|
|
local nSCC = MCH_SCC.NONE
|
|
|
|
|
if not BD.C_SIMM then
|
|
|
|
|
if AreSameOrOppositeVectorApprox( vtTunnelDirection, Z_AX()) then
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YM
|
|
|
|
|
elseif abs( vtTunnelDirection:getX()) < 0.1 then
|
|
|
|
|
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
|
|
|
|
elseif vtTunnelDirection:getY() < GEO.EPS_SMALL then
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YM
|
|
|
|
|
else
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YP
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
|
|
|
|
-- gestione attacco e uscita
|
|
|
|
|
if EgtCurveIsClosed( idContourPath) then
|
|
|
|
|
-- attacco e uscita a quarto di cerchio senza allungamenti a inizio e fine
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, 0.5 * Tool.Diameter)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
|
|
|
|
else
|
|
|
|
|
-- nessun attacco e uscita, allungo inizio e fine di raggio utensile + 5mm (per evitare controllo collisioni)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.NONE)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Tool.Diameter / 2 + 5)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Tool.Diameter / 2 + 5)
|
|
|
|
|
end
|
|
|
|
|
-- affondamento - la curva è a metà tasca quindi affondamento 0 significa che la lavorazione arriva a metà tasca
|
|
|
|
|
local dDepth
|
|
|
|
|
-- si arriva a metà tasca
|
|
|
|
|
if bOppositMillingReachesHalfDepth then
|
|
|
|
|
dDepth = -dDimStrip / 2
|
|
|
|
|
-- si arriva al massimo raggiungibile
|
|
|
|
|
else
|
|
|
|
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
|
|
|
|
bIncomplete = true
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
|
|
|
|
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
|
|
|
|
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
|
|
|
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
|
|
|
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTunnelDepth / 2 + dDepth, 1))
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
|
|
|
|
-- eseguo
|
|
|
|
|
if ML.ApplyMachining( true, false) then
|
|
|
|
|
_, sApplyWarning = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( idMachining, false)
|
|
|
|
|
end
|
|
|
|
|
bMillingOppositeOk = true
|
|
|
|
|
-- altrimenti lavorazione non applicata
|
|
|
|
|
else
|
|
|
|
|
_, sApplyWarning = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( idMachining, false)
|
|
|
|
|
bMillingOppositeOk = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- applicazione lavorazione lato principale
|
|
|
|
|
local sName = 'Contour_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
local idMachining = EgtAddMachining( sName, sMilling)
|
|
|
|
|
if not idMachining then
|
|
|
|
|
local sErr = 'Error : impossible add machining ' .. sName .. '-' .. sMilling
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
-- geometria
|
|
|
|
|
EgtSetMachiningGeometry( {{ idContourPath, -1}})
|
|
|
|
|
-- lato di lavoro sinistro
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
|
|
|
|
-- inversione direzione utensile
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
|
|
|
|
|
-- SCC
|
|
|
|
|
local nSCC = MCH_SCC.NONE
|
|
|
|
|
if not BD.C_SIMM then
|
|
|
|
|
if AreSameOrOppositeVectorApprox( vtTunnelDirection, Z_AX()) then
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YM
|
|
|
|
|
elseif abs( vtTunnelDirection:getX()) < 0.1 then
|
|
|
|
|
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
|
|
|
|
elseif vtTunnelDirection:getY() < GEO.EPS_SMALL then
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YM
|
|
|
|
|
else
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YP
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
|
|
|
|
-- gestione attacco e uscita
|
|
|
|
|
if EgtCurveIsClosed( idContourPath) then
|
|
|
|
|
-- attacco e uscita a quarto di cerchio senza allungamenti a inizio e fine
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIPERP, 0.5 * Tool.Diameter)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
|
|
|
|
else
|
|
|
|
|
-- nessun attacco e uscita, allungo inizio e fine di raggio utensile + 5mm (per evitare controllo collisioni)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.NONE)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Tool.Diameter / 2 + 5)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Tool.Diameter / 2 + 5)
|
|
|
|
|
end
|
|
|
|
|
-- affondamento - la curva è a metà tasca quindi affondamento 0 significa che la lavorazione arriva a metà tasca
|
|
|
|
|
local dDepth
|
|
|
|
|
-- c'è la lavorazione opposta
|
|
|
|
|
if bOppositeMillingNeeded then
|
|
|
|
|
-- si arriva a metà tasca
|
|
|
|
|
if bMainMillingReachesHalfDepth then
|
|
|
|
|
dDepth = -dDimStrip / 2
|
|
|
|
|
-- si arriva al massimo raggiungibile
|
|
|
|
|
else
|
|
|
|
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
|
|
|
|
bIncomplete = true
|
|
|
|
|
end
|
|
|
|
|
-- non c'è lavorazione opposta
|
|
|
|
|
else
|
|
|
|
|
-- si arriva fino in fondo
|
|
|
|
|
if bMainMillingReachesFullDepth then
|
|
|
|
|
dDepth = dTunnelDepth / 2 - dDimStrip
|
|
|
|
|
-- si arriva al massimo raggiungibile
|
|
|
|
|
else
|
|
|
|
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
|
|
|
|
bIncomplete = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
|
|
|
|
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
|
|
|
|
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
|
|
|
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
|
|
|
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTunnelDepth / 2 + dDepth, 1))
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
|
|
|
|
-- eseguo
|
|
|
|
|
local bMillingOk
|
|
|
|
|
if ML.ApplyMachining( true, false) then
|
|
|
|
|
_, sApplyWarning = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( idMachining, false)
|
|
|
|
|
end
|
|
|
|
|
bMillingOk = true
|
|
|
|
|
-- altrimenti lavorazione non applicata
|
|
|
|
|
else
|
|
|
|
|
_, sApplyWarning = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( idMachining, false)
|
|
|
|
|
bMillingOk = false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if bMillingOk or ( bOppositeMillingNeeded and bMillingOppositeOk) then
|
|
|
|
|
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
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
local function ExtractExternalPaths( nPathInt, nNumIdAux, vtOrtho, b3Solid, nAddGrpId)
|
|
|
|
|
local nAuxId1, nAuxId2
|
|
|
|
@@ -2752,6 +3001,12 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchId, false)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se non perpendicolare emetto un warning
|
|
|
|
|
-- else
|
|
|
|
@@ -2905,6 +3160,12 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- in base all'elevazione calcolo l'impronta della lama
|
|
|
|
@@ -3091,7 +3352,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
|
|
|
|
@@ -3626,6 +3888,12 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se la lavorazione rovina il pezzo successivo emetto warning
|
|
|
|
|
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and dDistToNextPiece < dDiamTool / 2 then
|
|
|
|
@@ -3743,6 +4011,12 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
return false, sWarn
|
|
|
|
@@ -3870,6 +4144,12 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -4313,6 +4593,12 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
|
|
|
@@ -4384,6 +4670,12 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return -1, sErr
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -4496,6 +4788,12 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtN, nFacInd,
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nIdMach, false)
|
|
|
|
|
return false, false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nIdMach, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -6672,17 +6970,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
|
|
|
|
@@ -6904,6 +7235,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se divisa in due metà
|
|
|
|
|
if bDouble then
|
|
|
|
@@ -6924,6 +7261,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFNId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFNId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -7004,6 +7347,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- CASO SPECIALE 3 FACCE (se rimane esclusa molta sezione trasversale complessiva della feature, solo per feature 20)
|
|
|
|
@@ -7119,6 +7468,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se abilitato dal parametro Q inserisco foro sullo spigolo
|
|
|
|
|
if EgtGetInfo( Proc.Id, Q_BORE_ON_CORNER, 'i') == 1 then
|
|
|
|
@@ -7472,7 +7827,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)
|
|
|
|
@@ -7557,8 +7912,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 and ( bIsU or bIsL) then
|
|
|
|
|
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,
|
|
|
|
@@ -7582,59 +7936,95 @@ 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
|
|
|
|
|
-- se 2 facce setto i parametri corretti per la MakeByPockets
|
|
|
|
|
if bForceSideMill and Proc.Fct == 2 then
|
|
|
|
|
bIs3Faces = false
|
|
|
|
|
bOrthoFacesMaster = true
|
|
|
|
|
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)
|
|
|
|
|
if nOk == -3 then
|
|
|
|
|
bTryWithBlades = true
|
|
|
|
|
elseif nOk == -2 then
|
|
|
|
|
if not sMchFind then
|
|
|
|
|
sMchFind = sMchFindBackUp
|
|
|
|
|
end
|
|
|
|
|
sPocketing = ML.FindPocketing( sMchFind, dDiam, nil, nil, not bMillDown, bMillDown)
|
|
|
|
|
if not sPocketing then
|
|
|
|
|
local sErr2 = 'Error : '..sMchFind..' not found in library'
|
|
|
|
|
EgtOutLog( sErr2)
|
|
|
|
|
return false, sErr2
|
|
|
|
|
end
|
|
|
|
|
bTryWithBlades = false
|
|
|
|
|
sWarn = sErr
|
|
|
|
|
elseif nOk < 0 then
|
|
|
|
|
return false, sErr
|
|
|
|
|
elseif nOk > 0 then
|
|
|
|
|
bTryWithBlades = false
|
|
|
|
|
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, nPartId)
|
|
|
|
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
|
|
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
|
|
|
|
nil, nil, nil, b3Solid, dFacElevOri,
|
|
|
|
|
bOneShot, nFirstMachId)
|
|
|
|
|
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
|
|
|
|
-- richiesto solo contorno
|
|
|
|
|
if bOnlyContour then
|
|
|
|
|
if Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' 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)
|
|
|
|
|
-- si eliminano i lati aperti
|
|
|
|
|
BL.SetOpenSide( idContourPath, b3Solid)
|
|
|
|
|
BL.ChangeOrOpenStart( idContourPath, 2)
|
|
|
|
|
-- 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
|
|
|
|
|
-- se abilitato dal parametro Q inserisco pulitura spigoli o contorno con fresa più piccola
|
|
|
|
|
local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0
|
|
|
|
|
if nContourSmallTool > 0 then
|
|
|
|
|
local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown,
|
|
|
|
|
bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid,
|
|
|
|
|
dDepth, bOneShotm)
|
|
|
|
|
if not bOk then return false, sWarn2 end
|
|
|
|
|
if sWarn2 then
|
|
|
|
|
if not sWarn then sWarn = '' end
|
|
|
|
|
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
|
|
|
|
-- svuotatura
|
|
|
|
|
else
|
|
|
|
|
-- se 2 facce setto i parametri corretti per la MakeByPockets
|
|
|
|
|
if bForceSideMill and Proc.Fct == 2 then
|
|
|
|
|
bIs3Faces = false
|
|
|
|
|
bOrthoFacesMaster = true
|
|
|
|
|
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)
|
|
|
|
|
if nOk == -3 then
|
|
|
|
|
bTryWithBlades = true
|
|
|
|
|
elseif nOk == -2 then
|
|
|
|
|
if not sMchFind then
|
|
|
|
|
sMchFind = sMchFindBackUp
|
|
|
|
|
end
|
|
|
|
|
sPocketing = ML.FindPocketing( sMchFind, dDiam, nil, nil, not bMillDown, bMillDown)
|
|
|
|
|
if not sPocketing then
|
|
|
|
|
local sErr2 = 'Error : '..sMchFind..' not found in library'
|
|
|
|
|
EgtOutLog( sErr2)
|
|
|
|
|
return false, sErr2
|
|
|
|
|
end
|
|
|
|
|
bTryWithBlades = false
|
|
|
|
|
sWarn = sErr
|
|
|
|
|
elseif nOk < 0 then
|
|
|
|
|
return false, sErr
|
|
|
|
|
elseif nOk > 0 then
|
|
|
|
|
bTryWithBlades = false
|
|
|
|
|
sWarn = sErr
|
|
|
|
|
-- se ho antischeggia con fresa le inserisco
|
|
|
|
|
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
|
|
|
|
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,
|
|
|
|
|
bOneShot, nFirstMachId)
|
|
|
|
|
if sWarn2 then
|
|
|
|
|
if not sWarn then sWarn = '' end
|
|
|
|
|
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- se abilitato dal parametro Q inserisco pulitura spigoli o contorno con fresa più piccola
|
|
|
|
|
local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0
|
|
|
|
|
if nContourSmallTool > 0 then
|
|
|
|
|
local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown,
|
|
|
|
|
bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid,
|
|
|
|
|
dDepth, bOneShotm)
|
|
|
|
|
if not bOk then return false, sWarn2 end
|
|
|
|
|
if sWarn2 then
|
|
|
|
|
if not sWarn then sWarn = '' end
|
|
|
|
|
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@@ -7718,14 +8108,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
|
|
|
|
@@ -8265,6 +8655,12 @@ local function MakeStaircaseStep( Proc, nRawId, b3Raw, nPartId)
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
else
|
|
|
|
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
|
|
|
|
if EgtIsMachiningEmpty() then
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sWarn
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
-- eventuale segnalazione ingombro di testa o coda
|
|
|
|
|
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
|
|
|
@@ -8356,6 +8752,11 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
|
|
|
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
|
|
|
|
|
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( Proc.DistanceToNextPart > 1000 or Proc.Box:getDimX() > BD.LONGCUT_ENDLEN)) or
|
|
|
|
|
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
|
|
|
|
|
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
|
|
|
|
if bOnlyContour then
|
|
|
|
|
local sErr2 = 'Error : Cannot use ' .. Q_ONLY_CONTOUR .. ' on long features'
|
|
|
|
|
return false, sErr2
|
|
|
|
|
end
|
|
|
|
|
-- una faccia
|
|
|
|
|
if Proc.Fct == 1 then
|
|
|
|
|
if bUseBlade then
|
|
|
|
|