- in FACEBYBLADE modifiche e refactoring per contemplare nuova gestione DownUp

This commit is contained in:
luca.mazzoleni
2025-10-30 13:20:15 +01:00
parent 84cd799565
commit ecd2147e83
3 changed files with 90 additions and 72 deletions
+21 -20
View File
@@ -218,12 +218,7 @@ end
-------------------------------------------------------------------------------------------------------------
function FaceData.IsFaceRectangular( Face)
-- recupero gruppo per geometrie temporanee
local bIsTempGroupToDelete = false
local idTempGroup = BeamLib.GetTempGroup()
if not idTempGroup then
idTempGroup = BeamLib.CreateTempGroup()
bIsTempGroupToDelete = true
end
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Face.idTrimesh, Face.id, idTempGroup)
if nContourCnt > 1 then
@@ -232,23 +227,13 @@ function FaceData.IsFaceRectangular( Face)
local bIsRectangular = EgtCurveIsARectangle( nContourId)
-- se necessario, elimino il gruppo temporaneo
if bIsTempGroupToDelete then
EgtErase( idTempGroup)
end
return bIsRectangular
end
-------------------------------------------------------------------------------------------------------------
function FaceData.IsFaceRhomboid( Face)
-- recupero gruppo per geometrie temporanee
local bIsTempGroupToDelete = false
local idTempGroup = BeamLib.GetTempGroup()
if not idTempGroup then
idTempGroup = BeamLib.CreateTempGroup()
bIsTempGroupToDelete = true
end
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Face.idTrimesh, Face.id, idTempGroup)
if nContourCnt > 1 then
@@ -265,14 +250,30 @@ function FaceData.IsFaceRhomboid( Face)
bIsRhomboid = true
end
-- se necessario, elimino il gruppo temporaneo
if bIsTempGroupToDelete then
EgtErase( idTempGroup)
end
return bIsRhomboid
end
-------------------------------------------------------------------------------------------------------------
-- calcola l'elevazione di un lato rispetto al box passato
function FaceData.GetEdgeElevationInBBox( Face, Edge, b3Raw )
-- recupero gruppo per geometrie temporanee
local idTempGroup = BeamLib.GetTempGroup()
-- costruzione trimesh rettangolare centrata sul lato
-- TODO sostituire EgtSurfTmFacetOppositeSide con punti direttamente in Edge
local ptEdge1, _, ptEdge2 = EgtSurfTmFacetOppositeSide( Face.idTrimesh, Face.id, -Edge.vtN, GDB_ID.ROOT)
local vtEdge = ptEdge2 - ptEdge1
local vtMove = ( Edge.vtN ^ vtEdge)
local ptRectangleVertex1 = ptEdge1 + vtMove * 100 * GEO.EPS_SMALL
local ptRectangleVertex2 = ptEdge2 + vtMove * 100 * GEO.EPS_SMALL
local ptRectangleVertex3 = ptEdge1 - vtMove * 100 * GEO.EPS_SMALL
local idEdgeTrimesh = EgtSurfTmRectangle( idTempGroup, ptRectangleVertex1, ptRectangleVertex2, ptRectangleVertex3, GDB_RT.GLOB)
local dElevation = EgtSurfTmFacetElevationInBBox( idEdgeTrimesh, 0, b3Raw, true, GDB_ID.ROOT)
return dElevation
end
-------------------------------------------------------------------------------------------------------------
local function CompareEdgesBottomFace( EdgeA, EdgeB)
-- prima i lati con facce adiacenti