Compare commits
29 Commits
3.1b1
...
Ticket#2897
| Author | SHA1 | Date | |
|---|---|---|---|
| 1af37a5589 | |||
| 7c9b20ae2e | |||
| 5dd839dace | |||
| 6ae1e94cd5 | |||
| bbffd69e1e | |||
| 30028fecf0 | |||
| cf96d7bc90 | |||
| 89fefbcbad | |||
| 6892759956 | |||
| 78a3e907ce | |||
| 63133c8813 | |||
| 58e32bdfd0 | |||
| 6528e6e77c | |||
| 48f1ac5e4d | |||
| fbca8d3abd | |||
| 6c61edc338 | |||
| 6643673196 | |||
| 7d33ea6799 | |||
| 7dd0c14f5f | |||
| 232adff332 | |||
| d55caac3c9 | |||
| 3edc65b785 | |||
| eb4f709db3 | |||
| f6316cc75a | |||
| bd8a551005 | |||
| 1729e57dbf | |||
| 261ce7992d | |||
| 48a1139eea | |||
| 70b2002a24 |
+6
-13
@@ -304,7 +304,7 @@ local function NeedTopologyFeature( Proc)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT, bCreatePreDrill)
|
||||
local dRawW = b3Raw:getDimY()
|
||||
local dRawH = b3Raw:getDimZ()
|
||||
-- recupero le feature
|
||||
@@ -365,7 +365,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
-- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento)
|
||||
Proc.Diam, Proc.Len, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw)
|
||||
-- verifico se devo inserire i prefori
|
||||
if Drill.IsPredrillNeeded( Proc) then
|
||||
if Drill.IsPredrillNeeded( Proc) and bCreatePreDrill then
|
||||
local bAddProc, PredrillProc= Drill.AddPredrillFromDrillProc( Proc)
|
||||
if bAddProc then
|
||||
table.insert( vProc, PredrillProc)
|
||||
@@ -443,7 +443,7 @@ local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
|
||||
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 350 then
|
||||
if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
|
||||
dHeadX = Proc.Box:getCenter():getX()
|
||||
nHeadId = Proc.Id
|
||||
@@ -949,13 +949,6 @@ local function OrderFeatures( vProc, b3Raw, nPartId)
|
||||
if Hcut.Identify( B2) then
|
||||
return false
|
||||
end
|
||||
-- se uno dipende dall'altro
|
||||
if B1.Dependency and B1.Dependency.ExecBefore and B1.Dependency.ExecBefore.Id == B2.Id then
|
||||
return true
|
||||
end
|
||||
if B2.Dependency and B2.Dependency.ExecBefore and B2.Dependency.ExecBefore.Id == B1.Id then
|
||||
return false
|
||||
end
|
||||
-- se uno di testa e non l'altro, privilegio quello di testa (a meno che non siano dei fori)
|
||||
if B1.Head ~= B2.Head and not Drill.Identify(B1) and not Drill.Identify(B2) then
|
||||
return B1.Head
|
||||
@@ -2218,14 +2211,14 @@ function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
|
||||
Proc.PassedByHole = true
|
||||
end
|
||||
-- se taglio attraversato da foro, si definisce precedenza in base ad angolo
|
||||
if Drill.Identify( Proc) and Cut.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
if Drill.Identify( Proc) and ( Cut.Identify( ProcB) or ProcB.Prc == 340 or ProcB.Proc == 350) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
-- recupero e verifico l'entità foro
|
||||
local DrillAuxId = ( EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0) + Proc.Id
|
||||
local vtDrillExtr = EgtCurveExtrusion( DrillAuxId, GDB_RT.GLOB)
|
||||
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
|
||||
local ptCut, vtCutN = EgtSurfTmFacetCenter( ProcB.Id, 0, GDB_ID.ROOT)
|
||||
local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10
|
||||
if GetAngle( vtDrillExtr, vtCutN) > dMaxAngleDrillOnCut then
|
||||
if ( GetAngle( vtDrillExtr, vtCutN) > dMaxAngleDrillOnCut) and not ( ProcB.Prc == 340 or ProcB.Proc == 350) then
|
||||
if bOpen and GetAngle( -vtDrillExtr, vtCutN) < dMaxAngleDrillOnCut then
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
@@ -2315,7 +2308,7 @@ function BeamExec.ProcessFeatures()
|
||||
local dCurrOvmH = EgtGetInfo( nRawId, 'HOVM', 'd') or 0
|
||||
local dCurrOvmT = EgtGetInfo( nRawId, 'TOVM', 'd') or 0
|
||||
-- recupero le feature di lavorazione della trave
|
||||
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT, true)
|
||||
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
|
||||
GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
|
||||
|
||||
|
||||
@@ -1393,6 +1393,11 @@ function BeamLib.GetToolFromMachining( sMachiningName)
|
||||
else
|
||||
Tool.IsOnAggregate = false
|
||||
end
|
||||
Tool.StemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or 0
|
||||
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
|
||||
if Tool.StemDiameter > Tool.Diameter + GEO.EPS_SMALL then
|
||||
Tool.MaxDepth = Tool.MaxDepth - BD.COLL_SIC
|
||||
end
|
||||
-- altri utensili al momento non previsti
|
||||
else
|
||||
error( 'Wrong tool type')
|
||||
|
||||
@@ -231,7 +231,7 @@ local function GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation)
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation, bForceClimbCut)
|
||||
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
|
||||
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
|
||||
Par5 == MCH_MILL_FU.PARAL_TOP or
|
||||
@@ -298,7 +298,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
|
||||
local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||
local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL)
|
||||
if ( bIsSawCCW ~= bDownUp) and ( bIsMachiningDownwards or not ( bIsMachiningDownwards or bIsMachiningUpwards)) then
|
||||
if ( bIsSawCCW ~= bDownUp) and ( bIsMachiningDownwards or not ( bIsMachiningDownwards or bIsMachiningUpwards) or bForceClimbCut) then
|
||||
bInvert = true
|
||||
elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then
|
||||
if Par5Alternative then
|
||||
|
||||
+48
-27
@@ -37,6 +37,7 @@ EgtOutLog( ' ProcessDrill started', 1)
|
||||
-- Dati
|
||||
local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
local FreeContour = require( 'ProcessFreeContour')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
@@ -345,8 +346,6 @@ end
|
||||
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- Se forzato contorno foro forzo richiamo a FreeContour e uscita dalla funzione
|
||||
if EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then
|
||||
_G.package.loaded.ProcessFreeContour = nil
|
||||
local FreeContour = require( 'ProcessFreeContour')
|
||||
return FreeContour.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- default per costanti
|
||||
@@ -387,10 +386,11 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local nFac, CosB
|
||||
-- se non già richiesta inversione e invertibile
|
||||
if not bToInvert and Proc.Flg == 1 and -vtExtr:getZ() >= BD.DRILL_VZ_MIN then
|
||||
-- se il foro è cieco o dalla faccia sotto o troppo inclinato all'inizio, lo inverto
|
||||
local nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
if Proc.Fcs == 0 or (( nFac == 2 or CosB > BD.DRILL_VX_MAX) and bOpen) then
|
||||
bToInvert = true
|
||||
end
|
||||
@@ -422,10 +422,11 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
||||
|
||||
local dMaxDepthOri
|
||||
local vFaces
|
||||
if sDrilling then
|
||||
-- Determino la faccia di inizio del foro e dati correlati
|
||||
local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
-- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
|
||||
@@ -433,7 +434,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if BD.C_SIMM and CosB > 0.866 then
|
||||
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
|
||||
end
|
||||
local dMaxDepthOri = dMaxDepth
|
||||
dMaxDepthOri = dMaxDepth
|
||||
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
||||
-- se utensile scelto non arriva in fondo, cerco il più lungo
|
||||
if dMaxDepth < GEO.EPS_SMALL * 10 then
|
||||
@@ -540,11 +541,13 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then
|
||||
local Tool = BL.GetToolFromMachining( sDrilling)
|
||||
-- lato testa e lato di lavoro devono corrispondere
|
||||
if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
|
||||
or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
|
||||
ptCen = ptCen - vtExtr * dLen
|
||||
vtExtr = - vtExtr
|
||||
bToInvert = true
|
||||
if Tool.PreferredSide then
|
||||
if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
|
||||
or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
|
||||
ptCen = ptCen - vtExtr * dLen
|
||||
vtExtr = - vtExtr
|
||||
bToInvert = true
|
||||
end
|
||||
end
|
||||
end
|
||||
-- Determino la faccia di inizio del foro e dati correlati
|
||||
@@ -715,23 +718,41 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- se DrillPocket passante in doppio si fa lavorazione aggiuntiva dell'ultimo step
|
||||
if Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then
|
||||
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
|
||||
local idProcLastStep = EgtCopyGlob( Proc.Id, nAddGrpId)
|
||||
local idAuxIdLastStep = EgtCopyGlob( AuxId, nAddGrpId)
|
||||
EgtModifyCurveThickness( idAuxIdLastStep, -dLastStepDepth)
|
||||
local ProcLastStep = BL.TableCopyDeep( Proc)
|
||||
ProcLastStep.Id = idProcLastStep
|
||||
ProcLastStep.Flg = 1
|
||||
ProcLastStep.Double = 0
|
||||
ProcLastStep.dCustomMaxElev = dLastStepDepth - dDepth
|
||||
local bOkLastStep, sWarnLastStep = ProcessDrill.Make( ProcLastStep, nPhase, nRawId, nPartId)
|
||||
if not bOkLastStep then
|
||||
sWarnLastStep = 'Drillpocket double : incomplete, last step missing'
|
||||
local idMachiningLastStep = EgtCopyMachining( EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)), sName)
|
||||
EgtSetCurrMachining( idMachiningLastStep)
|
||||
if dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
sMyWarn = 'Warning in drill pocket last step: depth (' .. EgtNumToString( dLastStepDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
dLastStepDepth = dMaxDepth
|
||||
end
|
||||
local sPreviousWarn = sMyWarn or sWarn
|
||||
if sWarnLastStep then
|
||||
if not sPreviousWarn then sPreviousWarn = '' end
|
||||
sMyWarn = EgtIf( #sPreviousWarn > 0, sPreviousWarn .. '\n' .. sWarnLastStep, sWarnLastStep)
|
||||
local dMaxElevLastStep = dLastStepDepth - dDepth
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElevLastStep, 1))
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dLastStepDepth)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', '')
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', '')
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
local bOkLastStep = ML.ApplyMachining( true, false)
|
||||
if not bOkLastStep and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
end
|
||||
bOkLastStep = ML.ApplyMachining( true, false)
|
||||
end
|
||||
if not bOkLastStep then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
else
|
||||
local _, sWarnLastStep = EgtGetMachMgrWarning( 0)
|
||||
if not bOkLastStep then
|
||||
sWarnLastStep = 'Drillpocket double : incomplete, last step missing'
|
||||
end
|
||||
local sPreviousWarn = sMyWarn or sWarn
|
||||
if sWarnLastStep then
|
||||
if not sPreviousWarn then sPreviousWarn = '' end
|
||||
sMyWarn = EgtIf( #sPreviousWarn > 0, sPreviousWarn .. '\n' .. sWarnLastStep, sWarnLastStep)
|
||||
end
|
||||
end
|
||||
end
|
||||
return true, ( sMyWarn or sWarn)
|
||||
|
||||
+367
-64
@@ -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
|
||||
@@ -2414,6 +2416,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
|
||||
@@ -3091,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
|
||||
@@ -6672,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
|
||||
@@ -7472,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)
|
||||
@@ -7486,6 +7745,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if ( bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU) or bForceSideMill then
|
||||
-- lavoro con svuotature (singola o doppia contrapposta)
|
||||
local sMyMchFind = EgtIf( bForceSideMill, 'OpenPocket', 'Pocket')
|
||||
if Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3'
|
||||
or Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' then
|
||||
sMyMchFind = 'OpenPocket'
|
||||
end
|
||||
local dDiamTool = 100
|
||||
local nPathInt, nSurfInt, bOneShot, nFirstMachId
|
||||
local bIs3Faces = true
|
||||
@@ -7553,8 +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 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,
|
||||
@@ -7578,59 +7840,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
|
||||
@@ -7714,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
|
||||
@@ -8352,6 +8650,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
|
||||
|
||||
@@ -1151,7 +1151,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMilling
|
||||
local bDownHead = ( nSide == -1 and BD.DOWN_HEAD)
|
||||
local bDownHead = ( BD.DOWN_HEAD and ( nSide == -1 or AreSameVectorApprox( vtN[vOrd[1]], -Z_AX())))
|
||||
sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead)
|
||||
|
||||
if not sMilling then
|
||||
@@ -1277,31 +1277,35 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local dLimitAngle = -0.5 - 20 * GEO.EPS_SMALL
|
||||
-- se facce ortogonali (concave), mantengo la lavorazione di testa sulla faccia più grande purchè non superi di 30 gradi il sottosquadra
|
||||
if bOrtho then
|
||||
local vtN1 = vtN[vOrd[1]]
|
||||
local vtN2 = vtN[vOrd[2]]
|
||||
if vtN1:getZ() > 0.001 and vtN2:getZ() > 0.001 then
|
||||
if vtN1:getZ() >= vtN2:getZ() then
|
||||
nFin = 1
|
||||
else
|
||||
nIni = 2
|
||||
end
|
||||
if bDownHead and AreSameVectorApprox( vtN[vOrd[1]], -Z_AX()) then
|
||||
nFin = 1
|
||||
else
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
elseif vtN2:getZ() < dLimitAngle then
|
||||
nFin = 1
|
||||
else
|
||||
local vtN1 = vtN[vOrd[1]]
|
||||
local vtN2 = vtN[vOrd[2]]
|
||||
if vtN1:getZ() > 0.001 and vtN2:getZ() > 0.001 then
|
||||
if vtN1:getZ() >= vtN2:getZ() then
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
else
|
||||
nFin = 1
|
||||
end
|
||||
nFin = 1
|
||||
else
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
nIni = 2
|
||||
end
|
||||
else
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
elseif vtN2:getZ() < dLimitAngle then
|
||||
nFin = 1
|
||||
else
|
||||
if vtN1:getZ() >= vtN2:getZ() then
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
else
|
||||
nFin = 1
|
||||
end
|
||||
else
|
||||
nFin = 1
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
else
|
||||
nFin = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1325,7 +1329,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- valore sovrapposizione tra passate con fresa di fianco
|
||||
local dOverLapExtend = 2
|
||||
-- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg)
|
||||
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN)))
|
||||
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( bDownHead or ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN))))
|
||||
-- Limitazioni della lavorazione
|
||||
local nPos = EgtIf( i == 1, j, nC - j + 1)
|
||||
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0))
|
||||
@@ -1470,7 +1474,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left then
|
||||
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left and Proc.DistanceToNextPart < ( dToolDiam / 2 + 5) then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
@@ -1503,8 +1507,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
sMilling = ML.FindMilling( sMchType)
|
||||
sPrefix = 'L2CS_'
|
||||
nExtendMach = nUseMillOnSide
|
||||
if nUseMillOnSide == 2 then
|
||||
bRemoveToolRadius = true
|
||||
if nUseMillOnSide == 2 then
|
||||
bRemoveToolRadius = true
|
||||
end
|
||||
-- se testa da sotto
|
||||
if nSide ~= 1 and BD.DOWN_HEAD then
|
||||
|
||||
@@ -834,7 +834,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
-- determinazione materiale da asportare
|
||||
local dSawThickCheck = dSawThick
|
||||
if dSawThick2 > 0 and bDoubleHorizCut then
|
||||
dSawThickCheck = min( dSawThick, dSawThick2)
|
||||
dSawThickCheck = max( min( dSawThick, dSawThick2), dOvmTail)
|
||||
end
|
||||
local dMaxElev = 0
|
||||
if vtN:getX() > 0 then
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
==== Beam Update Log ====
|
||||
Versione 3.1c2 (18/03/2026)
|
||||
- Added : in LapJoint (solo L030) aggiunto Q02 per fare solo contorno per forme a "C" e tunnel; Q17 spessore di eventuale codolo
|
||||
- Modif : per LapJoint e simili il Q06 per antischeggia ora contempla il valore 3 per scegliere la strategia in automatico (lama o fresa)
|
||||
- Modif : in LapJoint migliorie nella lavorazione delle tasche aperte
|
||||
- Modif : in LongDoubleCut e LapJoint lunghe migliorata scelta fresa in caso di tasca che guarda verso il basso
|
||||
- Fixed : in forature in doppio con svuotatura corretto ultimo step
|
||||
- Fixed : in split correzione in caso di materiale di coda molto sottile e testa sotto
|
||||
- Fixed : in LongDoubleCut e LapJoint lunghe eliminata passate finale dopo taglio di coda se non è presente un grezzo successivo
|
||||
|
||||
Versione 3.1c1 (04/03/2026)
|
||||
- Fixed : correzione in ordinamento (fori vs tagli)
|
||||
- Fixed : in drilling rimosso preforo duplicato
|
||||
|
||||
Versione 3.1b1 (26/02/2026)
|
||||
- Added : in LapJoint lunghe gestito Q14 per lavorare discorde
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '3.1b1'
|
||||
VERSION = '3.1c2'
|
||||
MIN_EXE = '3.1b1'
|
||||
|
||||
Reference in New Issue
Block a user