implemento gestione MaxElev per affondamento foro

This commit is contained in:
luca.mazzoleni
2022-06-30 16:55:02 +02:00
parent 7dd6cf81eb
commit 2ae06e9abf
2 changed files with 14 additions and 9 deletions
+1 -2
View File
@@ -123,7 +123,6 @@ local FreeContour = require( 'ProcessFreeContour')
local Decor = require( 'ProcessDecor')
EgtOutLog( ' BeamExec started', 1)
EgtMdbSetGeneralParam( MCH_GP.MAXDEPTHSAFE, BD.COLL_SIC)
EgtMdbSave()
@@ -1322,7 +1321,7 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt
-- se esiste intersezione tra il foro e la feature di coda
elseif vMachineBeforeIntersectingDrillings.Tail.Box and vProc[i].Box:getMin():getX() < vMachineBeforeIntersectingDrillings.Tail.Box:getMax():getX() + 100 * GEO.EPS_SMALL and
vMachineBeforeIntersectingDrillings.Tail.Box:getMin():getX() < vProc[i].Box:getMax():getX() + 100 * GEO.EPS_SMALL then
vProc[i].MachineAfterTailCutId = vMachineBeforeIntersectingDrillings.Tail.Id
vProc[i].MachineAfterTailCutId = vMachineBeforeIntersectingDrillings.Tail.Id
end
end
end
+13 -7
View File
@@ -395,25 +395,31 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local sMyWarn
-- test
if Proc.MachineAfterHeadCutId then
local dMaxElev = dDepth
if Proc.MachineAfterHeadCutId or Proc.MachineAfterTailCutId then
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
local dMoveDistance, ptPointOnSurface = EgtPointSurfTmDist( ptCen, Proc.MachineAfterHeadCutId, GDB_RT.GLOB)
local vtMove = -vtExtr * dMoveDistance
EgtMove( AuxId, vtMove, GDB_RT.GLOB)
EgtModifyCurveThickness( Proc.MachineAfterHeadCutId, dLen - dMoveDistance)
if ( Proc.MachineAfterHeadCutId and vtExtr:getX() < 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() > 0) then
local vtMove = -vtExtr * dLen
ptCen:move( vtMove)
end
local bIntersectionOk, _, vDistance = EgtLineSurfTmInters( ptCen, -vtExtr, Proc.MachineAfterHeadCutId or Proc.MachineAfterTailCutId, GDB_RT.GLOB)
if bIntersectionOk == true then
dMaxElev = abs( vDistance[1])
end
end
-- fine test
if dDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
if dMaxElev > dMaxDepth + 10 * GEO.EPS_SMALL then
sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
dDepth = dMaxDepth
EgtOutLog( sMyWarn)
end
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
local sUserNotes = 'VMRS=0;'
-- aggiungo alle note massima elevazione (coincide con affondamento)
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dDepth, 1) .. ';'
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';'
-- se foro passante, aggiungo questa qualifica alle note
if ( sType == 'Drill' or sType == 'Drill_H2') and bOpen then
sUserNotes = sUserNotes .. 'Open=1;'