DataBeam :

- migliorata scelta punto di attacco lavorazione tenoni (meglio gestita testa sopra/sotto)
- corretta scelta lavorazione tenoni per macchine con testa da sotto
- corretta scelta lavorazione BH per feature BH (ora si tiene conto anche dell'affondamento).
This commit is contained in:
DarioS
2022-05-20 15:52:56 +02:00
parent c9b0f1e90d
commit 1b86003ed8
4 changed files with 91 additions and 56 deletions
+21 -14
View File
@@ -1,4 +1,4 @@
-- BeamLib.lua by Egaltech s.r.l. 2022/05/03
-- BeamLib.lua by Egaltech s.r.l. 2022/05/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.
@@ -11,6 +11,7 @@
-- 2022/01/11 In GetNearest*Opposite ridotto vantaggio XY rispetto a Z da 1 -> 0.9 a 1 -> 0.99.
-- 2022/04/05 Modifiche a GetNzLimDownUp per FAST.
-- 2022/05/03 Ulteriore limitazione a GetNzLimDownUp per FAST.
-- 2022/05/18 Correzioni e migliorie a PutStartNearestToEdge.
-- Tabella per definizione modulo
local BeamLib = {}
@@ -194,30 +195,36 @@ function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw, bDown)
-- recupero il versore normale al piano di lavoro o estrusione
local vtN = EgtCurveExtrusion( nCrvId, GDB_ID.ROOT)
-- coefficienti per riportare la distanza nel piano di lavoro
local dCoeffX = 1 / ( sqrt( 1 - vtN:getX() * vtN:getX()))
local dCoeffY = 1 / ( sqrt( 1 - vtN:getY() * vtN:getY()))
local dCoeffZ = 1 / ( sqrt( 1 - vtN:getZ() * vtN:getZ()))
local dCoeffY = 0
if abs( vtN:getY()) < 0.999 then dCoeffY= 1 / ( sqrt( 1 - vtN:getY() * vtN:getY())) end
local dCoeffZ = 0
if abs( vtN:getZ()) < 0.999 then dCoeffZ = 1 / ( sqrt( 1 - vtN:getZ() * vtN:getZ())) end
-- cerco l'estremo più vicino al box e lo imposto come inizio (se da sotto escludo Zmax e viceversa)
local dUopt = 0
local dDopt = GEO.INFINITO
local dZopt = GEO.INFINITO
local dUi, dUf = EgtCurveDomain( nCrvId)
for dU = dUi, dUf, 0.5 do
local ptP = EgtUP( nCrvId, dU, GDB_ID.ROOT)
if ptP then
local vtDp = EgtUV( nCrvId, dU, -1, GDB_ID.ROOT)
local vtDs = EgtUV( nCrvId, dU, 1, GDB_ID.ROOT)
local bTg = ( vtDp and vtDs and vtDp * vtDs > 0.96)
if ptP and bTg then
local vtMin = ptP - b3Raw:getMin()
local vtMax = ptP - b3Raw:getMax()
local dD = abs( vtMin:getX()) * dCoeffX
dD = min( abs( vtMax:getX()) * dCoeffX, dD)
dD = min( abs( vtMin:getY()) * dCoeffY, dD)
local dD = abs( vtMin:getY()) * dCoeffY
dD = min( abs( vtMax:getY()) * dCoeffY, dD)
if bDown then
dD = min( abs( vtMin:getZ()) * dCoeffZ, dD)
else
dD = min( abs( vtMax:getZ()) * dCoeffZ, dD)
end
if dD < dDopt + GEO.EPS_SMALL then
dD = min( abs( vtMin:getZ()) * dCoeffZ, dD)
dD = min( abs( vtMax:getZ()) * dCoeffZ, dD)
local dZ = abs( EgtIf( bDown, vtMin:getZ(), vtMax:getZ())) * dCoeffZ
if dD < dDopt + 10 and dZ < dZopt + GEO.EPS_SMALL then
dUopt = dU
dDopt = min( dD, dDopt)
dZopt = dZ
elseif dD < dDopt - 10 or ( dD < dDopt + GEO.EPS_SMALL and dZ < dZopt + GEO.EPS_SMALL) then
dDopt = dD
dUopt = dU
dZopt = dZ
end
end
end