diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index 7fc2c10..4cc612d 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2019/04/26 +-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2019/05/25 -- Gestione calcolo doppio taglio longitudinale per Travi -- Tabella per definizione modulo @@ -6,6 +6,7 @@ local ProcessLong2Cut = {} -- Include require( 'EgtBase') +local BL = require( 'BeamLib') EgtOutLog( ' ProcessLongDoubleCut started', 1) @@ -56,9 +57,16 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) nSide = -1 end -- angolo diedro per stabilire se taglio convesso - local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT) - local ptM = ( ptP1 + ptP2) / 2 - local bConvex = ( dAng >= 0) + local bInt, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT) + local ptM + local bConvex + if bInt then + ptM = ( ptP1 + ptP2) / 2 + bConvex = ( dAng >= 0) + else + ptM = ( ptC[1] + ptC[2]) / 2 + bConvex = true + end -- analisi del taglio local vOrd = {} local vFaceUse = {} @@ -79,10 +87,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) end end local vWidth = {} - local vtDiff1 = ptC[vOrd[1]] - ptM - vWidth[vOrd[1]] = 2 * sqrt( vtDiff1:getY() * vtDiff1:getY() + vtDiff1:getZ() * vtDiff1:getZ()) - local vtDiff2 = ptC[vOrd[2]] - ptM - vWidth[vOrd[2]] = 2 * sqrt( vtDiff2:getY() * vtDiff2:getY() + vtDiff2:getZ() * vtDiff2:getZ()) + _, _, vWidth[vOrd[1]] = BL.GetFaceHvRefDim( Proc.Id, vOrd[1] - 1) + _, _, vWidth[vOrd[2]] = BL.GetFaceHvRefDim( Proc.Id, vOrd[2] - 1) -- Se non รจ sotto : lavorazione Long2Cut if nSide ~= - 1 then