- modificate STR0002 e FaceData per lavorare facce tunnel per Bevel-1-Through con vtNY o vtNZ = 0

This commit is contained in:
luca.mazzoleni
2025-05-20 19:26:56 +02:00
parent 9d961977b2
commit e2532b29f6
2 changed files with 20 additions and 7 deletions
+18 -3
View File
@@ -228,15 +228,27 @@ end
-------------------------------------------------------------------------------------------------------------
-- TODO valutare refactoring per mettere i calcoli del tunnel in una funzione
-- TODO creare le facce tunnel solo se non ci sono già. Verirficare all'inizio se già presente in AddGrpId e nel caso riferire all'id di quella esistente e ricalcolare solo le informazioni della faccia.
-- TODO test iniziale replicato in GetMainFaces
local function GetTunnelFaces( Proc, Part)
local TunnelAddedFaces = {}
if not ( Proc.Topology.bIsThrough and Proc.Topology.bAllRightAngles and Proc.nFct < 5) then
if not ( ( Proc.Topology.bIsThrough and Proc.Topology.bAllRightAngles and Proc.nFct < 5)
or ( Proc.Topology.sName == 'Bevel-1-Through' and ( abs( Proc.Faces[1].vtN:getY()) < GEO.EPS_SMALL or abs( Proc.Faces[1].vtN:getZ()) < GEO.EPS_SMALL))) then
error( 'GetTunnelFaces : Topology not implemented')
end
-- direzione del tunnel
local vtTunnelDirection = Proc.Faces[1].vtN ^ Proc.Faces[ Proc.Faces[1].Adjacencies[1] + 1].vtN
local vtTunnelDirection = V_NULL()
if Proc.nFct == 1 then
if Proc.Faces[1].vtN:getY() < GEO.EPS_SMALL then
vtTunnelDirection = Y_AX()
else
vtTunnelDirection = Z_AX()
end
else
vtTunnelDirection = Proc.Faces[1].vtN ^ Proc.Faces[ Proc.Faces[1].Adjacencies[1] + 1].vtN
end
-- centro del tunnel
local frTunnel = Frame3d( Proc.Faces[1].ptCenter, vtTunnelDirection)
@@ -561,6 +573,7 @@ end
-------------------------------------------------------------------------------------------------------------
-- recupero facce principali della feature, in base alla topologia
-- TODO test iniziale replicato in GetTunnelFaces
function FaceData.GetMainFaces( Proc, Part)
EgtOutLog( '---MainFaces START---')
@@ -571,7 +584,9 @@ function FaceData.GetMainFaces( Proc, Part)
Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Bevel' or
Proc.Topology.sFamily == 'DoubleBevel' or Proc.Topology.sFamily == 'Cut' then
if Proc.Topology.bIsThrough and Proc.Topology.bAllRightAngles and Proc.nFct < 5 then
if ( Proc.Topology.bIsThrough and Proc.Topology.bAllRightAngles and Proc.nFct < 5)
or ( Proc.Topology.sName == 'Bevel-1-Through' and ( abs( Proc.Faces[1].vtN:getY()) < GEO.EPS_SMALL or abs( Proc.Faces[1].vtN:getZ()) < GEO.EPS_SMALL)) then
MainFaces.TunnelAddedFaces = GetTunnelFaces( Proc, Part)
end