- in LapJoint -> MakeLongMoreFaces modifiche finali per correzione caso tunnel lungo; da testare
This commit is contained in:
+25
-19
@@ -5551,7 +5551,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local ptC0, vtN0 = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
local ptC1, vtN1 = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
||||
local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, 2, GDB_ID.ROOT)
|
||||
if vtN0:getX() < 0.0175 and vtN1:getX() < 0.0175 and vtN2:getX() < 0.0175 then
|
||||
if abs( vtN0:getX()) < 0.0175 and abs( vtN1:getX()) < 0.0175 and abs( vtN2:getX()) < 0.0175 then
|
||||
local dWidth = 0
|
||||
if vtN0 * vtN1 < -0.9998 then
|
||||
bAddEndCapLeftSide = true
|
||||
@@ -5567,17 +5567,15 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
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
|
||||
bAddEndCapLeftSide = true
|
||||
bAddEndCapRightSide = 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)
|
||||
vtN[i] = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||
end
|
||||
-- calcolo l'orientamento del tunnel
|
||||
local vtOrtho
|
||||
@@ -5592,9 +5590,11 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
local ptMaxBox = Proc.Box:getMax()
|
||||
-- per creare le superfici di cap nei tunnel serve aggiungere una faccia di fondo
|
||||
-- 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)
|
||||
local b3SolidExtended = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
b3SolidExtended:expand( 100 * GEO.EPS_SMALL)
|
||||
-- superficie di fondo
|
||||
nSurfBottomId = EgtSurfTmPlaneInBBox( nAddGrpId, ptMaxBox, vtOrtho, b3SolidExtended, GDB_ID.ROOT)
|
||||
end
|
||||
-- la divido in parti lungo X
|
||||
@@ -5603,14 +5603,16 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_MAXLEN), 2)
|
||||
local dPartLen = Proc.Box:getDimX() / nPart
|
||||
local Xmin = Proc.Box:getMin():getX()
|
||||
-- trimesh per la creazione degli EndCap
|
||||
local AddIdCopy = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
-- aggiunta di eventuale fondo alla trimesh per creare correttamente le superfici EndCap
|
||||
if nSurfBottomId then EgtSurfTmAdd( AddIdCopy, nSurfBottomId) end
|
||||
local nCapIdLeftSide, nCapIdRightSide
|
||||
for i = 1, nPart do
|
||||
local nCapIdLeftSide, nCapIdRightSide
|
||||
-- eseguo divisione
|
||||
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
if i > 1 or bAddEndCapLeftSide then
|
||||
-- definizione del piano
|
||||
-- definizione del piano sinsitro
|
||||
local dAdd = EgtIf( i > 1, dAddLen, 0)
|
||||
local ptOn = Point3d( Xmin - dAdd + ( i - 1) * dPartLen, 0, 0)
|
||||
local vtN = -X_AX()
|
||||
@@ -5622,14 +5624,16 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
nCapIdLeftSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
||||
if not nCapIdLeftSide 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
|
||||
if i > 1 then
|
||||
-- taglio della superficie lato sinistro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
||||
end
|
||||
-- taglio della superficie lato sinistro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
||||
-- se esiste, aggiunta del tappo sinistro
|
||||
if nCapIdLeftSide then
|
||||
AddId = EgtSurfTmBySewing( nAddGrpId, { AddId, nCapIdLeftSide})
|
||||
@@ -5642,6 +5646,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
if i < nPart then
|
||||
-- definizione del piano destro
|
||||
local ptOn = Point3d( Xmin + i * dPartLen, 0, 0)
|
||||
local vtN = X_AX()
|
||||
-- taglio della superficie lato destro
|
||||
@@ -5654,11 +5659,11 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
nCapIdRightSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
||||
if not nCapIdRightSide 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
|
||||
end
|
||||
-- se esiste, aggiunta del tappo destro
|
||||
@@ -5669,6 +5674,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo inserimento in modo da ordinare da X+ a X-
|
||||
table.insert( vAddId, 1, AddId)
|
||||
end
|
||||
EgtErase( AddIdCopy)
|
||||
-- applico le lavorazioni sulle diverse parti
|
||||
local sWarn
|
||||
local bPrevBhSideMill
|
||||
|
||||
Reference in New Issue
Block a user