- TestElleShape 3 e 4 spostati in WallLib

- a DoubleCut aggiunto riconoscimento della sola L011
- in WallLib aggiunta funzione GetProcessAffectedFaces che restituisce le facce del grezzo interessate dalla feature
- in WallExec aggiunte alle Proc informazioni sulle facce della feature
- alcune modifiche iniziali per Mirror
This commit is contained in:
luca.mazzoleni
2023-06-20 09:35:25 +02:00
parent ac853fc74c
commit 1236d196ba
5 changed files with 158 additions and 61 deletions
+84
View File
@@ -316,5 +316,89 @@ function WallLib.GetNearestOrthoOpposite( vtRef, vtNorm)
return nil
end
---------------------------------------------------------------------
function WallLib.TestElleShape3( nIdGeom, nNumFacet)
-- valida solo nel caso di tre facce
if nNumFacet ~= 3 then return false end
-- determino se L con una faccia terminale o U con tre facce
local bIsL = true
for i = 1, 3 do
local vFacAdj = EgtSurfTmFacetAdjacencies( nIdGeom, i - 1)[1]
-- le conto
local nCount = 0
for j = 1, #vFacAdj do
if vFacAdj[j] >= 0 then
nCount = nCount + 1
end
end
if nCount == 1 then
bIsL = false
break
end
end
return bIsL
end
---------------------------------------------------------------------
function WallLib.TestElleShape4( nIdGeom, nNumFacet)
-- valida solo nel caso di quattro facce
if nNumFacet ~= 4 then return false end
-- determino se L con due facce terminali o O
local nFac3Adj = 0
local dMinArea3 = GEO.INFINITO * GEO.INFINITO
local dMaxArea2 = 0
for i = 1, 4 do
local vFacAdj = EgtSurfTmFacetAdjacencies( nIdGeom, i - 1)[1]
-- le conto
local nCount = 0
for j = 1, #vFacAdj do
if vFacAdj[j] >= 0 then
nCount = nCount + 1
end
end
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( nIdGeom, i - 1, GDB_ID.ROOT)
local dArea = dH * dV
if nCount == 2 then
dMaxArea2 = max( dMaxArea2, dArea)
elseif nCount == 3 then
dMinArea3 = min( dMinArea3, dArea)
nFac3Adj = nFac3Adj + 1
end
end
if nFac3Adj ~= 2 then return false end
-- verifico se L profonda oppure lunga
if dMinArea3 < dMaxArea2 then
return 1
else
return 2
end
end
-------------------------------------------------------------------------------------------------------------
-- restituisce le facce del grezzo interessate dalla feature Proc
function WallLib.GetProcessAffectedFaces( Proc, nPartId)
local b3Part = EgtGetBBoxGlob( nPartId, GDB_BB.STANDARD)
local vtFacesAffected = { Bottom = false, Back = false, Top = false, Front = false, Left = false, Right = false}
if Proc.Box:getMin():getZ() < b3Part:getMin():getZ() + 10 * GEO.EPS_SMALL then
vtFacesAffected.Bottom = true
end
if Proc.Box:getMax():getY() > b3Part:getMax():getY() - 10 * GEO.EPS_SMALL then
vtFacesAffected.Back = true
end
if Proc.Box:getMax():getZ() > b3Part:getMax():getZ() - 10 * GEO.EPS_SMALL then
vtFacesAffected.Top = true
end
if Proc.Box:getMin():getY() < b3Part:getMin():getY() + 10 * GEO.EPS_SMALL then
vtFacesAffected.Front = true
end
if Proc.Box:getMin():getX() < b3Part:getMin():getX() + 10 * GEO.EPS_SMALL then
vtFacesAffected.Left = true
end
if Proc.Box:getMax():getX() > b3Part:getMax():getX() - 10 * GEO.EPS_SMALL then
vtFacesAffected.Right = true
end
return vtFacesAffected
end
-------------------------------------------------------------------------------------------------------------
return WallLib