- varie modifiche ai tagli di lama per DownUp, caso solo 2d
- in FaceData.GetEdgesInfo si scrivono anche i ptStart e ptEnd; IsFaceRhomboid diventa IsFaceParallelogram - in BeamLib aggiunta IsEdgeOnBox
This commit is contained in:
+16
-13
@@ -136,6 +136,8 @@ function FaceData.GetEdgesInfo( ProcOrId, idFace )
|
||||
end
|
||||
CurrentEdge.bIsStartOpen = EdgesEgt[nPreviousEdgeIndex].Open
|
||||
CurrentEdge.bIsEndOpen = EdgesEgt[nNextEdgeIndex].Open
|
||||
CurrentEdge.ptStart = Point3d( EdgesEgt[i].Start)
|
||||
CurrentEdge.ptEnd = Point3d( EdgesEgt[nNextEdgeIndex].Start)
|
||||
CurrentEdge.sType = 'Standard'
|
||||
CurrentEdge.id = i - 1
|
||||
|
||||
@@ -216,13 +218,13 @@ function FaceData.GetFacesInfo( Proc, Part, FacesToGet)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function FaceData.IsFaceRectangular( Face)
|
||||
function FaceData.IsFaceRectangle( Face)
|
||||
-- recupero gruppo per geometrie temporanee
|
||||
local idTempGroup = BeamLib.GetTempGroup()
|
||||
|
||||
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Face.idTrimesh, Face.id, idTempGroup)
|
||||
if nContourCnt > 1 then
|
||||
error( 'IsFaceRectangular : too many loops')
|
||||
error( 'IsFaceRectangle : too many loops')
|
||||
end
|
||||
|
||||
local bIsRectangular = EgtCurveIsARectangle( nContourId)
|
||||
@@ -231,13 +233,13 @@ function FaceData.IsFaceRectangular( Face)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function FaceData.IsFaceRhomboid( Face)
|
||||
function FaceData.IsFaceParallelogram( Face)
|
||||
-- recupero gruppo per geometrie temporanee
|
||||
local idTempGroup = BeamLib.GetTempGroup()
|
||||
|
||||
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Face.idTrimesh, Face.id, idTempGroup)
|
||||
if nContourCnt > 1 then
|
||||
error( 'IsFaceRhomboid : too many loops')
|
||||
error( 'IsFaceParallelogram : too many loops')
|
||||
end
|
||||
|
||||
local bIsTrapezoid = EgtCurveIsATrapezoid( nContourId)
|
||||
@@ -255,21 +257,22 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- calcola l'elevazione di un lato rispetto al box passato
|
||||
function FaceData.GetEdgeElevationInBBox( Face, Edge, b3Raw )
|
||||
function FaceData.GetEdgeElevationInBBox( Face, Edge, b3Box )
|
||||
-- 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)
|
||||
-- ptMid è traslato leggermente all'interno per assicurare l'intersezione con il box
|
||||
local dExtraLength = 500 * GEO.EPS_SMALL
|
||||
local ptMid = ( ptEdge1 + ptEdge2) / 2 + Edge.vtN * dExtraLength
|
||||
local idEdgeTrimesh
|
||||
|
||||
local dElevation = EgtSurfTmFacetElevationInBBox( idEdgeTrimesh, 0, b3Raw, true, GDB_ID.ROOT)
|
||||
-- piano di taglio del box orientato come la normale del lato e passante da ptMid
|
||||
idEdgeTrimesh = EgtSurfTmPlaneInBBox( idTempGroup, ptMid, Edge.vtN, b3Box, GDB_RT.GLOB)
|
||||
|
||||
-- al calcolo dell'elevazione devo aggiungere la lunghezza di cui avevo traslato il ptMid
|
||||
local dElevation = EgtSurfTmFacetElevationInBBox( idEdgeTrimesh, 0, b3Box, true, GDB_ID.ROOT) + dExtraLength
|
||||
|
||||
return dElevation
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user