DataBeam :

- prime modifiche per lavorazione fori in Doppio
- correzione a attacchi/uscite dei profili di Testa
- modifiche a punto di attacco tenone se lavorato con testa da sotto.
This commit is contained in:
Dario Sassi
2020-12-31 11:31:27 +00:00
parent b7133b5ffd
commit a8a97eae97
8 changed files with 138 additions and 173 deletions
+7 -3
View File
@@ -180,7 +180,7 @@ function BeamLib.PutStartOnLonger( nCrvId)
end
-------------------------------------------------------------------------------------------------------------
function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw)
function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw, bDown)
-- verifico che la curva sia chiusa
if not EgtCurveIsClosed( nCrvId) then return false end
-- recupero il versore normale al piano di lavoro o estrusione
@@ -189,7 +189,7 @@ function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw)
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()))
-- cerco l'estremo più vicino al box e lo imposto come inizio (escluso Zmin)
-- 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 dUi, dUf = EgtCurveDomain( nCrvId)
@@ -202,7 +202,11 @@ function BeamLib.PutStartNearestToEdge( nCrvId, b3Raw)
dD = min( abs( vtMax:getX()) * dCoeffX, dD)
dD = min( abs( vtMin:getY()) * dCoeffY, dD)
dD = min( abs( vtMax:getY()) * dCoeffY, dD)
dD = min( abs( vtMax:getZ()) * dCoeffZ, 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
dDopt = dD
dUopt = dU