- in LapJoint -> MakeLongMoreFaces modifiche parziali per correzione caso tunnel lungo

This commit is contained in:
luca.mazzoleni
2023-09-18 15:25:23 +02:00
parent 6902620f5d
commit 7ce6ca9f13
+38 -6
View File
@@ -5566,6 +5566,36 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
dAddLen = min( dWidth, 100) / 2
end
end
-- verifico se applicare gestione speciale per tunnel
-- per creare le superfici di cap nei tunnel serve aggiungere una faccia di fondo
local nSurfBottomId
if Proc.Topology == 'Tunnel' and Proc.AffectedFaces.Front then
bAddEndCap = true
dAddLen = 225
-- recupero centro e normale delle facce
local ptC = {}
local vtN = {}
for i = 1, Proc.Fct do
ptC[i], vtN[i] = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT)
end
-- calcolo l'orientamento del tunnel
local vtOrtho
local bAdj = EgtSurfTmFacetsContact( Proc.Id, 0, 1)
if bAdj then
vtOrtho = vtN[1] ^ vtN[2]
else
if Proc.Fct >= 3 then
vtOrtho = vtN[1] ^ vtN[3]
else
return 0, 0, 0
end
end
local ptMaxBox = Proc.Box:getMax()
-- recupero il box della trave e lo ingrandisco di poco per essere sicuro di avere intersezione con il piano di fondo
local b3SolidExtended = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
b3SolidExtended:expand( 100 * GEO.EPS_SMALL)
nSurfBottomId = EgtSurfTmPlaneInBBox( nAddGrpId, ptMaxBox, vtOrtho, b3SolidExtended, GDB_ID.ROOT)
end
-- la divido in parti lungo X
local vAddId = {}
local bAllWithEndCap = bAddEndCap
@@ -5583,17 +5613,19 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se richiesto, creazione tappo
local CapId
if bAddEndCap then
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOn, vtN, AddId, nAddGrpId, GDB_RT.GLOB)
local AddIdTemp = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
if nSurfBottomId then EgtSurfTmAdd( AddIdTemp, nSurfBottomId) end
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOn, vtN, AddIdTemp, nAddGrpId, GDB_RT.GLOB)
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
EgtCloseCurveCompo( nFirstId)
CapId = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
if not CapId then bAllWithEndCap = false end
end
if nFirstId then
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
EgtErase( nId)
end
end
-- if nFirstId then
-- for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
-- EgtErase( nId)
-- end
-- end
end
-- taglio della superficie
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)