From b83f427a55c9d94cc9b5105861aeff27f02bf102 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 5 Jul 2022 18:40:16 +0200 Subject: [PATCH] piccola modifica per bypassare il check precedente che azzera MaxDepth --- LuaLibs/ProcessDrill.lua | 57 ++++++---------------------------------- 1 file changed, 8 insertions(+), 49 deletions(-) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index a7e2b36..12f5130 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -319,6 +319,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- se foro non su testa o coda e inclinato local bInMid = false local bInvertFcse = ( bToInvert and Proc.Flg ~= -2) + -- tengo via il valore originale di MaxDepth per poter eventualmente bypassare i check successivi + local dMaxDepthOri = dMaxDepth if ( not bInvertFcse and Proc.Fcs ~= 5 and Proc.Fcs ~= 6) or ( bInvertFcse and Proc.Fce ~= 5 and Proc.Fce ~= 6) then bInMid = true local CosB = abs( vtExtr:getX()) @@ -392,53 +394,23 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) nSCC = MCH_SCC.NONE end EgtSetMachiningParam( MCH_MP.SCC, nSCC) - - ----------------------------------------- - -- aggiusto l'affondamento --- local sMyWarn --- local dMaxElev = dDepth --- local dToolAddLength = 0 --- -- se c'è un taglio precedente di testa o coda posso impostare MaxElev per allungare il percorso --- -- considero solo i fori "entranti" in testa o coda --- if ( Proc.MachineAfterHeadCutId and vtExtr:getX() > 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() < 0) then --- local ptCen = EgtCP( AuxId, GDB_RT.GLOB) --- local bIntersectionOk, _, vDistance = EgtLineSurfTmInters( ptCen, -vtExtr, Proc.MachineAfterHeadCutId or Proc.MachineAfterTailCutId, GDB_RT.GLOB) --- dHoleToCutDistance = vDistance[1] --- -- il segno della distanza data dalla funzione di intersezione mi indica dove sia la geometria del foro --- if bIntersectionOk then --- if dHoleToCutDistance > 0 then --- dMaxElev = dLen - dHoleToCutDistance --- elseif dHoleToCutDistance < 0 then --- dMaxElev = -dHoleToCutDistance --- end --- dToolAddLength = dLen - dMaxElev --- end --- end --- if dDepth - dToolAddLength > dMaxDepth + 10 * GEO.EPS_SMALL then --- sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth - dToolAddLength, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' --- if dMaxDepth == 0 or dToolAddLength == 0 then --- dDepth = dMaxDepth --- dMaxElev = dDepth --- elseif abs( dMaxElev - dDepth) > GEO.EPS_SMALL then --- dDepth = dLen --- end --- EgtOutLog( sMyWarn) --- end - ------------------------------------------ - -- aggiusto affondamento e MaxElev local dMaxElev = dDepth local sMyWarn if dDepth > dMaxDepth + 10 * GEO.EPS_SMALL then -- se c'è un taglio precedente di testa o coda posso impostare MaxElev per allungare il percorso -- considero solo i fori "entranti" in testa o coda - if (( Proc.MachineAfterHeadCutId and vtExtr:getX() > 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() < 0)) and dMaxDepth ~= 0 then + if (( Proc.MachineAfterHeadCutId and vtExtr:getX() > 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() < 0)) then local ptCen = EgtCP( AuxId, GDB_RT.GLOB) local bIntersectionOk, _, vDistance = EgtLineSurfTmInters( ptCen, -vtExtr, Proc.MachineAfterHeadCutId or Proc.MachineAfterTailCutId, GDB_RT.GLOB) dHoleToCutDistance = vDistance[1] -- setto MaxElev -- il segno della distanza data dalla funzione di intersezione mi indica dove sia la geometria del foro if bIntersectionOk then + -- se MaxDepth era stato settato a 0 per disattivare la lavorazione gli riassegno il valore originale + if dMaxDepth == 0 then + dMaxDepth = dMaxDepthOri + end if dHoleToCutDistance > 0 then dMaxElev = dLen - dHoleToCutDistance elseif dHoleToCutDistance < 0 then @@ -450,6 +422,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth - dToolAddLength, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' dDepth = dLen else + -- se non lavoro la massima lunghezza disponibile devo correggere MaxElev dMaxElev = dMaxElev - dLen + dDepth end -- se per qualche motivo fallisce l'intersezione torno al caso standard @@ -468,20 +441,6 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) EgtOutLog( sMyWarn) end end - - - - - - - - - - - - - - EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- Note utente con dichiarazione nessuna generazione sfridi per Vmill local sUserNotes = 'VMRS=0;'