DataBeam :
- correzione a Taglio Doppio concavo con faccia verso il basso e altra verticale.
This commit is contained in:
+32
-19
@@ -1,6 +1,7 @@
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2020/07/28
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2020/08/18
|
||||
-- Libreria globale per Travi
|
||||
-- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto.
|
||||
-- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamLib = {}
|
||||
@@ -240,20 +241,26 @@ function BeamLib.GetPointDirDepth( nPartId, ptP, vtDir)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetNearestParalOpposite( vtRef)
|
||||
function BeamLib.GetNearestParalOpposite( 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 = vtRef:getX() * vtRef:getX() + vtRef:getY() * vtRef:getY()
|
||||
local dVertSq =vtRef:getZ() * vtRef:getZ()
|
||||
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( vtRef:getX()) > abs( vtRef:getY()) then
|
||||
if vtRef:getX() > 0 then
|
||||
if abs( vtMyRef:getX()) > abs( vtMyRef:getY()) then
|
||||
if vtMyRef:getX() > 0 then
|
||||
return MCH_MILL_FU.PARAL_LEFT
|
||||
else
|
||||
return MCH_MILL_FU.PARAL_RIGHT
|
||||
end
|
||||
else
|
||||
if vtRef:getY() > 0 then
|
||||
if vtMyRef:getY() > 0 then
|
||||
return MCH_MILL_FU.PARAL_FRONT
|
||||
else
|
||||
return MCH_MILL_FU.PARAL_BACK
|
||||
@@ -261,7 +268,7 @@ function BeamLib.GetNearestParalOpposite( vtRef)
|
||||
end
|
||||
-- altrimenti prevale la verticale
|
||||
else
|
||||
if vtRef:getZ() > 0 then
|
||||
if vtMyRef:getZ() > 0 then
|
||||
return MCH_MILL_FU.PARAL_DOWN
|
||||
else
|
||||
return MCH_MILL_FU.PARAL_TOP
|
||||
@@ -271,20 +278,26 @@ function BeamLib.GetNearestParalOpposite( vtRef)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetNearestOrthoOpposite( vtRef)
|
||||
function BeamLib.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 = vtRef:getX() * vtRef:getX() + vtRef:getY() * vtRef:getY()
|
||||
local dVertSq =vtRef:getZ() * vtRef:getZ()
|
||||
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( vtRef:getX()) >= abs( vtRef:getY()) then
|
||||
if vtRef:getX() > 0 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 vtRef:getY() > 0 then
|
||||
if vtMyRef:getY() > 0 then
|
||||
return MCH_MILL_FU.ORTHO_FRONT
|
||||
else
|
||||
return MCH_MILL_FU.ORTHO_BACK
|
||||
@@ -292,7 +305,7 @@ function BeamLib.GetNearestOrthoOpposite( vtRef)
|
||||
end
|
||||
-- altrimenti prevale la verticale
|
||||
else
|
||||
if vtRef:getZ() > 0 then
|
||||
if vtMyRef:getZ() > 0 then
|
||||
return MCH_MILL_FU.ORTHO_DOWN
|
||||
else
|
||||
return MCH_MILL_FU.ORTHO_TOP
|
||||
@@ -701,18 +714,18 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
-- risolvo paramentro ambiguo
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
-- risolvo parametro ambiguo
|
||||
local nOrthoOpposite
|
||||
local vtOrthO
|
||||
if isVector3d( Par5) then
|
||||
nOrthoOpposite = BeamLib.GetNearestOrthoOpposite( Par5)
|
||||
nOrthoOpposite = BeamLib.GetNearestOrthoOpposite( Par5, vtN)
|
||||
vtOrthO = Vector3d( Par5)
|
||||
else
|
||||
nOrthoOpposite = Par5
|
||||
vtOrthO = BeamLib.GetVersRef( Par5)
|
||||
end
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
-- linea o bilinea di lavorazione (qui uso nOrthoOpposite per ripetere esattamente il calcolo del Mach)
|
||||
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BeamLib.GetVersRef( nOrthoOpposite), GDB_ID.ROOT)
|
||||
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
|
||||
|
||||
Reference in New Issue
Block a user