DataBeam :

- aggiunta gestione rotazioni di 90gradi (abilitata da BD.ROT90 e compatibilmente con sezione)
- migliorato ordinamento fori
- migliorata classificazione Contorni Liberi.
This commit is contained in:
Dario Sassi
2020-05-19 15:40:07 +00:00
parent c7411fe35d
commit 1c7db5d845
6 changed files with 188 additions and 64 deletions
+23 -13
View File
@@ -1,4 +1,4 @@
-- ProcessDrill.lua by Egaltech s.r.l. 2020/03/31
-- ProcessDrill.lua by Egaltech s.r.l. 2020/05/15
-- Gestione calcolo forature per Travi
-- Tabella per definizione modulo
@@ -84,15 +84,19 @@ function ProcessDrill.Split( Proc, b3Raw)
local dLen = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local bOpen = ( Proc.Fce ~= 0)
-- recupero flag abilitazione split (0=auto,1=no)
local bCanSplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
if not bCanSplit then
return false
end
-- recupero la lavorazione
local sDrilling, _, dMaxMat = ML.FindDrilling( dDiam)
if not sDrilling then
dMaxMat = 0
end
if not sDrilling then dMaxMat = 0 end
-- restituisco se va fatto in doppio (solo fori orizzontali)
local DRILL_EXTRA = 5
return ( bOpen and dLen + DRILL_EXTRA > dMaxMat + 10 * GEO.EPS_SMALL and abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6))
local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6))
return ( bOpen and dLen + DRILL_EXTRA > dMaxMat + 10 * GEO.EPS_SMALL and ( bHoriz or BD.ROT90))
end
---------------------------------------------------------------------
@@ -109,19 +113,25 @@ function ProcessDrill.Classify( Proc, b3Raw)
local dLen = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
if Proc.Flg == -2 then
vtExtr = - vtExtr
ptCen = ptCen + vtExtr * dLen
-- se lavorato in doppio, devo considerare il lato più sfavorevole
if Proc.Flg == 2 or Proc.Flg == -2 then
if vtExtr:getZ() > 0 then
vtExtr = - vtExtr
ptCen = ptCen + vtExtr * dLen
end
end
-- verifico se troppo inclinato e quindi non lavorabile
if not ( Proc.Fcs == 5 or Proc.Fcs == 6 or Proc.Fce == 5 or Proc.Fce == 6) and abs( vtExtr:getX()) > BD.DRILL_VX_MAX then
return false, false
return false, false, false
end
local bOpen = ( Proc.Fce ~= 0)
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + dDiam / 2 and not Proc.Head and not Proc.Tail)
-- verifico se il foro è fattibile solo da sotto
local bDown = (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1))
return true, bDown
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
return true, not BD.ROT90, BD.ROT90
else
return true, false, false
end
end
---------------------------------------------------------------------