DataWall :
- aggiunte fresature su fessure di fianco - l'elevazione delle facce viene calcolata rispetto al grezzo complessivo.
This commit is contained in:
+42
-5
@@ -1,4 +1,4 @@
|
||||
-- WallLib.lua by Egaltech s.r.l. 2020/07/15
|
||||
-- WallLib.lua by Egaltech s.r.l. 2020/11/18
|
||||
-- Libreria globale per Pareti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -40,9 +40,9 @@ function WallLib.CreateOrEmptyAddGroup( PartId)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function WallLib.GetPointDirDepth( nPartId, ptP, vtDir)
|
||||
function WallLib.GetPointDirDepth( nRawId, ptP, vtDir)
|
||||
-- recupero il solido del grezzo
|
||||
local nSolId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, 'Box')
|
||||
local nSolId = EgtGetFirstNameInGroup( nRawId, 'RawSolid')
|
||||
if not nSolId then return end
|
||||
-- interseco con la retta
|
||||
local bOk, vType, vPar = EgtLineSurfTmInters( ptP, vtDir, nSolId, GDB_RT.GLOB)
|
||||
@@ -70,14 +70,14 @@ function WallLib.GetPointDirDepth( nPartId, ptP, vtDir)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function WallLib.GetFaceElevation( nSurfId, nFac, nPartId)
|
||||
function WallLib.GetFaceElevation( nSurfId, nFac, nRawId)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFac, GDB_ID.ROOT)
|
||||
if not ptC or not vtN then return 0 end
|
||||
local frOCS = Frame3d( ptC, vtN) ;
|
||||
local b3Box = EgtGetBBoxRef( nSurfId, GDB_BB.STANDARD, frOCS)
|
||||
local dElev = b3Box:getDimZ()
|
||||
if nPartId then
|
||||
local _, dCenElev = WallLib.GetPointDirDepth( nPartId, ptC, vtN)
|
||||
local _, dCenElev = WallLib.GetPointDirDepth( nRawId, ptC, vtN)
|
||||
if dCenElev and dCenElev > dElev then
|
||||
dElev = dCenElev
|
||||
end
|
||||
@@ -253,5 +253,42 @@ function WallLib.GetNearestParalOpposite( vtRef)
|
||||
return nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function WallLib.GetNearestOrthoOpposite( vtRef, vtNorm)
|
||||
-- se definita anche la normale alla faccia, elimino la parte di vtRef parallela a questa
|
||||
local vtMyRef = Vector3d( vtRef)
|
||||
if vtNorm then
|
||||
vtMyRef = vtMyRef - ( vtMyRef * vtNorm) * vtNorm
|
||||
vtMyRef:normalize()
|
||||
end
|
||||
-- devo confrontare la componente orizzontale con quella verticale
|
||||
local dHorSq = vtMyRef:getX() * vtMyRef:getX() + vtMyRef:getY() * vtMyRef:getY()
|
||||
local dVertSq = vtMyRef:getZ() * vtMyRef:getZ()
|
||||
-- se prevalente la componente orizzontale
|
||||
if dHorSq >= dVertSq then
|
||||
if abs( vtMyRef:getX()) >= abs( vtMyRef:getY()) then
|
||||
if vtMyRef:getX() > 0 then
|
||||
return MCH_MILL_FU.ORTHO_LEFT
|
||||
else
|
||||
return MCH_MILL_FU.ORTHO_RIGHT
|
||||
end
|
||||
else
|
||||
if vtMyRef:getY() > 0 then
|
||||
return MCH_MILL_FU.ORTHO_FRONT
|
||||
else
|
||||
return MCH_MILL_FU.ORTHO_BACK
|
||||
end
|
||||
end
|
||||
-- altrimenti prevale la verticale
|
||||
else
|
||||
if vtMyRef:getZ() > 0 then
|
||||
return MCH_MILL_FU.ORTHO_DOWN
|
||||
else
|
||||
return MCH_MILL_FU.ORTHO_TOP
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return WallLib
|
||||
|
||||
Reference in New Issue
Block a user