- Introduzione uso variabili in WallData per riconoscere fori lunghi

- Aggiunta gestione dei fori lunghi orizzontali non passanti con creazione grezzo rispettando minima dimensione grezzo
This commit is contained in:
Emmanuele Sassi
2021-12-16 09:46:30 +01:00
parent 0f25503bde
commit d382620a1e
2 changed files with 57 additions and 5 deletions
+38 -4
View File
@@ -140,10 +140,8 @@ function WPD.RotateClassify( Proc)
local dLen = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
-- se foro da 35 orizzontale
local HorizDrillDiam = 35
local HorizDrillTol = 4
if dDiam <= HorizDrillDiam + HorizDrillTol and dDiam >= HorizDrillDiam - HorizDrillTol and vtExtr:getZ() > -0.1 and vtExtr:getZ() < 0.1 then
-- se foro orizzontale con punta lunga
if dDiam <= WD.HOR_DRILL_DIAM + WD.DRILL_TOL and dDiam >= WD.HOR_DRILL_DIAM - WD.DRILL_TOL and vtExtr:getZ() > -0.1 and vtExtr:getZ() < 0.1 then
-- se orientato perpendicolare ad X
if AreSameOrOppositeVectorApprox( vtExtr, X_AX()) then
nRot0 = 0
@@ -165,6 +163,42 @@ function WPD.RotateClassify( Proc)
end
function WPD.IsHorizLongDrill( Proc)
-- recupero e verifico l'entità foro
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then
return false
end
-- recupero i dati del foro
local dDiam = 2 * EgtArcRadius( AuxId)
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
return dDiam <= WD.HOR_DRILL_DIAM + WD.DRILL_TOL and dDiam >= WD.HOR_DRILL_DIAM - WD.DRILL_TOL and vtExtr:getZ() > -0.1 and vtExtr:getZ() < 0.1
end
function WPD.UseMinYForLongDrill( Proc)
if WPD.IsHorizLongDrill( Proc) then
-- recupero e verifico l'entità foro
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then
return false
end
-- recupero i dati del foro
local dDiam = 2 * EgtArcRadius( AuxId)
local dLen = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)
-- se foro lungo orizzontale e piu' lungo della punta o orientato in Y-
if dDiam <= WD.HOR_DRILL_DIAM + WD.DRILL_TOL and dDiam >= WD.HOR_DRILL_DIAM - WD.DRILL_TOL and vtExtr:getZ() > -0.1 and vtExtr:getZ() < 0.1 and
( (bOpen and dLen > WD.HOR_DRILL_LEN) or ( not bOpen and vtExtr:getY() < 0)) then
return true
end
end
return false
end
---------------------------------------------------------------------
-- Verifica se da lavorare in due metà
function WPD.Split( Proc, b3Raw)