DataBeam :
- correzioni per tagli su pezzi grossi - correzioni varie.
This commit is contained in:
+21
-8
@@ -1,4 +1,4 @@
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2019/07/25
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2019/09/04
|
||||
-- Libreria globale per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -616,10 +616,20 @@ function BeamLib.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dRad, vtRef, dCutExtra,
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, sNotes, b3Raw)
|
||||
-- risolvo paramentro ambiguo
|
||||
local nOrthoOpposite
|
||||
local vtOrthO
|
||||
if isVector3d( Par5) then
|
||||
nOrthoOpposite = BeamLib.GetNearestOrthoOpposite( Par5)
|
||||
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
|
||||
-- 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 dLen < 1.1 or dWidth < 1.1 then
|
||||
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
|
||||
@@ -635,11 +645,14 @@ function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, nOrthoOp
|
||||
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
|
||||
local dAllStart = 0
|
||||
local dAllEnd = 0
|
||||
-- se bilinea, scarto la parte corta
|
||||
-- se bilinea, scarto la parte più allineata con la direzione ortogonale
|
||||
if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then
|
||||
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
|
||||
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
|
||||
local dDist1 = dist( ptP1, ptPm)
|
||||
local dDist2 = dist( ptP2, ptPm)
|
||||
if dDist1 >= dDist2 then
|
||||
--if dDist1 >= dDist2 then
|
||||
if abs( vtTg1 * vtOrthO) < abs( vtTg2 * vtOrthO) then
|
||||
ptP2 = Point3d( ptPm)
|
||||
dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL
|
||||
else
|
||||
@@ -656,13 +669,13 @@ function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, nOrthoOp
|
||||
local bWsRight = ( bInvert ~= bDownUp)
|
||||
local nWorkSide = EgtIf( bWsRight, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||
-- Versore di riferimento
|
||||
local vtRef = BeamLib.GetVersRef( nOrthoOpposite)
|
||||
vtRef = vtRef - vtRef * vtN * vtN ; vtRef:normalize()
|
||||
local vtRef = Vector3d( vtTg)
|
||||
vtRef:rotate( vtN, EgtIf( bInvert, -90, 90))
|
||||
-- Versore esterno
|
||||
local vtOut = vtRef - vtRef * vtTg * vtTg ; vtOut:normalize()
|
||||
-- Versore ausiliario (direzione braccio)
|
||||
local vtAux = Vector3d( vtN:getX(), vtN:getY(), 0) ; vtAux:normalize()
|
||||
vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, - 90))
|
||||
vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, -90))
|
||||
if vtAux:isSmall() then
|
||||
vtAux = Vector3d( vtOut:getX(), vtOut:getY(), 0) ; vtAux:normalize()
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user