- in FaceData e STR0002 gestito tunnel per topologie a 1 faccia con qualunque inclinazione

This commit is contained in:
luca.mazzoleni
2025-05-21 01:47:43 +02:00
parent e2532b29f6
commit 05dfa1da6c
2 changed files with 10 additions and 14 deletions
+8 -10
View File
@@ -202,7 +202,7 @@ function FaceData.GetFacesInfo( Proc, Part)
end
-------------------------------------------------------------------------------------------------------------
local function CompareEdges( EdgeA, EdgeB)
local function CompareEdgesBottomFace( EdgeA, EdgeB)
-- prima i lati con facce adiacenti
if ( EdgeA.idAdjacentFace > -1) and ( EdgeB.idAdjacentFace < 0) then
return true
@@ -233,7 +233,7 @@ local function GetTunnelFaces( Proc, Part)
local TunnelAddedFaces = {}
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
or ( Proc.nFct == 1 )) then
error( 'GetTunnelFaces : Topology not implemented')
end
@@ -241,11 +241,9 @@ local function GetTunnelFaces( Proc, Part)
-- direzione del tunnel
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
local EdgesSortedByElevation = BeamLib.TableCopyDeep( Proc.Faces[1].Edges)
table.sort( EdgesSortedByElevation, function (a, b) return a.dElevation > b.dElevation end )
vtTunnelDirection = Proc.Faces[1].vtN ^ EdgesSortedByElevation[1].vtN
else
vtTunnelDirection = Proc.Faces[1].vtN ^ Proc.Faces[ Proc.Faces[1].Adjacencies[1] + 1].vtN
end
@@ -282,7 +280,7 @@ local function GetTunnelFaces( Proc, Part)
-- TODO c'è un modo più elegante per raccogliere le informazioni delle facce aggiunte
TunnelAddedFaces.MiddleFaceTm.sType = 'Tunnel'
TunnelAddedFaces.MiddleFaceTm.nFct = Proc.nFct + 1
TunnelAddedFaces.MiddleFaceTm.nFct = EgtSurfTmFacetCount( TunnelAddedFaces.MiddleFaceTm.id)
TunnelAddedFaces.MiddleFaceTm.Faces = FaceData.GetFacesInfo( TunnelAddedFaces.MiddleFaceTm, Part)
return TunnelAddedFaces
@@ -342,7 +340,7 @@ local function GetBottomFaces( Proc)
EdgesSorted[#EdgesSorted].dLength = BottomFaces[1].Edges[i].dLength
EdgesSorted[#EdgesSorted].idAdjacentFace = BottomFaces[1].Edges[i].idAdjacentFace
end
table.sort( EdgesSorted, CompareEdges)
table.sort( EdgesSorted, CompareEdgesBottomFace)
local nFirstLongEdgeIndex
if #EdgesSorted > 0 then
nFirstLongEdgeIndex = EdgesSorted[1].nIndex
@@ -585,7 +583,7 @@ function FaceData.GetMainFaces( Proc, Part)
Proc.Topology.sFamily == 'DoubleBevel' or Proc.Topology.sFamily == 'Cut' 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
or ( Proc.nFct == 1) then
MainFaces.TunnelAddedFaces = GetTunnelFaces( Proc, Part)
end
+2 -4
View File
@@ -201,8 +201,7 @@ local function GetBestPocketingStrategy( Proc)
Milling = {}
Milling.bIsApplicable = false
if Proc.Topology.sName ~= 'DoubleBevel-2-Through'
and Proc.Topology.sName ~= 'Pocket-5-Blind'
and Proc.Topology.sName ~= 'Cut-1-Through' then
and Proc.Topology.sName ~= 'Pocket-5-Blind' then
if Proc.Topology.sName == 'Groove-4-Blind' then
ToolSearchParameters.dElevation = Proc.MainFaces.BottomFaces[2].dElevation
@@ -246,8 +245,7 @@ local function GetBestPocketingStrategy( Proc)
if Proc.Topology.sName ~= 'DoubleBevel-2-Through'
and Proc.Topology.sName ~= 'Pocket-5-Blind'
and Proc.Topology.sName ~= 'Groove-4-Blind'
and Proc.Topology.sName ~= 'Bevel-3-Blind'
and Proc.Topology.sName ~= 'Cut-1-Through' then
and Proc.Topology.sName ~= 'Bevel-3-Blind' then
if Proc.MainFaces.TunnelAddedFaces then -- Tunnel-4-Through, Groove-3-Through, Rabbet-2-Through, VGroove-2-Through
-- se lavoro di fianco, devo comunque rispettare il raggio massimo