DataBeam :

- migliorie e correzioni.
This commit is contained in:
Dario Sassi
2019-07-15 07:00:32 +00:00
parent 19df7d3338
commit d39116d84f
5 changed files with 164 additions and 82 deletions
+20 -12
View File
@@ -1,4 +1,4 @@
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2019/07/08
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2019/07/12
-- Gestione calcolo doppio taglio longitudinale per Travi
-- Tabella per definizione modulo
@@ -38,10 +38,20 @@ end
-- Applicazione della lavorazione
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- dati delle facce
local nFc = {0,1}
local ptC = {}
local vtN = {}
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
if Proc.Fct == 3 then
if abs( vtN[1]:getX()) > 0.5 then
nFc = {2,1}
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 2, GDB_ID.ROOT)
elseif abs( vtN[2]:getX()) > 0.5 then
nFc = {0,2}
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, 2, GDB_ID.ROOT)
end
end
local dLen = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD):getDimX()
-- verifico che il doppio taglio longitudinale non sia orientato verso il basso
--if vtN[1]:getZ() < - 0.707 or vtN[2]:getZ() < - 0.707 then
@@ -51,22 +61,20 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
--end
-- verifico posizione (+1=sopra, -1=sotto, 0=sui lati)
local nSide = 0
if vtN[1]:getZ() > -GEO.EPS_SMALL and vtN[2]:getZ() > -GEO.EPS_SMALL then
if vtN[1]:getZ() > -10 * GEO.EPS_SMALL and vtN[2]:getZ() > -10 * GEO.EPS_SMALL then
nSide = 1
elseif vtN[1]:getZ() < GEO.EPS_SMALL and vtN[2]:getZ() < GEO.EPS_SMALL then
elseif vtN[1]:getZ() < 10 * GEO.EPS_SMALL and vtN[2]:getZ() < 10 * GEO.EPS_SMALL then
nSide = -1
end
-- angolo diedro per stabilire se taglio convesso
local bInt, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
local ptM
local bInt, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, nFc[1], nFc[2], GDB_ID.ROOT)
local bConvex
if bInt then
ptM = ( ptP1 + ptP2) / 2
bConvex = ( dAng >= 0)
else
ptM = ( ptC[1] + ptC[2]) / 2
bConvex = true
end
local ptM = ( ptC[1] + ptC[2]) / 2
local bOrtho = ( abs( dAng + 90) < 1)
-- analisi del taglio
local vOrd = {}
@@ -88,8 +96,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
end
end
local vWidth = {}
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, 1 - 1)
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, 2 - 1)
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, nFc[1])
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, nFc[2])
-- Se non è sotto : lavorazione Long2Cut
if nSide ~= - 1 then
@@ -122,7 +130,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- ciclo sulle parti
local nM = 0
for j = 1, nC do
-- se facce ortogonali (concave), lavoro solo quella con versore maggiomente verso l'alto
-- se facce ortogonali (concave), lavoro solo quella con versore maggiormente verso l'alto
local nIni, nFin = 1, 2
if bOrtho then
if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then
@@ -162,7 +170,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, vOrd[i] - 1}})
EgtSetMachiningGeometry( {{ Proc.Id, nFc[vOrd[i]]}})
-- limito opportunamente la lavorazione
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
@@ -242,7 +250,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, vOrd[i] - 1}})
EgtSetMachiningGeometry( {{ Proc.Id, nFc[vOrd[i]]}})
-- limito opportunamente la lavorazione
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)