DataBeam :

- migliorie varie.
This commit is contained in:
Dario Sassi
2019-08-07 18:30:58 +00:00
parent e865cc6726
commit 0bf374a53f
5 changed files with 46 additions and 19 deletions
+1
View File
@@ -524,6 +524,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
else
Proc.Flg = 0
bAllOk = false
table.insert( Stats, {Err = 1, Msg='Error : classify failed', CutId=Proc.CutId, TaskId=Proc.TaskId})
end
end
-- se necessario ribaltamento, assegno intestatura alla fase ribaltata
+8
View File
@@ -364,6 +364,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId)
-- recupero le facce non in sottosquadra e con il maggior numero di adiacenze
local nFacInd = {}
local nMaxAdj = 0
local nSupAdj = 0
for i = 1, nFacCnt do
if not vUcut[i] then
if vAdj[i] > nMaxAdj then
@@ -374,6 +375,13 @@ function BeamLib.GetFaceWithMostAdj( nSurfId)
table.insert( nFacInd, i - 1)
end
end
if vAdj[i] > nSupAdj then
nSupAdj = vAdj[i]
end
end
-- verifico non ci sia una faccia in sottosquadra con adiacenza superiore
if nSupAdj > nMaxAdj then
return -2, GEO.INFINITO
end
-- premio la faccia con minore elevazione
local nFacOpt, nFacOpt2
+10 -8
View File
@@ -1,4 +1,4 @@
-- DiceCut.lua by Egaltech s.r.l. 2019/07/01
-- DiceCut.lua by Egaltech s.r.l. 2019/08/07
-- Gestione dei piano paralleli nei tagli lunghi
-- Tabella per definizione modulo
@@ -359,15 +359,17 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
end
-- calcolo la direzione dei piani ortogonali
local vtO = VectorFromUprightOrtho( vtNInner)
vtO:rotate( vtNInner, 90)
-- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente
if abs( vtO:getY()) > abs( vtO:getX()) and vtNInner:getZ() > -0.5 then
if vtNInner:getZ() > -0.05 or vtNInner:getZ() < -0.5 then
vtO:rotate( vtNInner, 90)
else
if ptCInner:getX() > BBoxRawPart:getCenter():getX() then
if vtO:getX() < 0 then vtO = - vtO end
-- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente
if abs( vtO:getY()) > abs( vtO:getX()) and vtNInner:getZ() > -0.5 then
vtO:rotate( vtNInner, 90)
else
if vtO:getX() > 0 then vtO = - vtO end
if ptCInner:getX() > BBoxRawPart:getCenter():getX() then
if vtO:getX() < 0 then vtO = - vtO end
else
if vtO:getX() > 0 then vtO = - vtO end
end
end
end
-- calcolo le dimensioni dell'offset e se dove posizionare la prima faccia:
+7 -3
View File
@@ -1,4 +1,4 @@
-- ProcessMortise.lua by Egaltech s.r.l. 2019/03/22
-- ProcessMortise.lua by Egaltech s.r.l. 2019/08/07
-- Gestione calcolo mortase a coda di rondice per Travi
-- Tabella per definizione modulo
@@ -71,8 +71,12 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
end
end
-- verifico se necessarie più passate
local dDist = dist( EgtSP( AuxId, GDB_RT.GLOB), EgtEP( AuxId, GDB_RT.GLOB))
-- verifico se necessarie più passate (distanza all'imbocco ortogonale all'asse)
local vtDiff = EgtEP( AuxId, GDB_RT.GLOB) - EgtSP( AuxId, GDB_RT.GLOB)
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
vtAx:normalize()
local vtOrtDiff = vtDiff - vtDiff * vtAx * vtAx
local dDist = vtOrtDiff:len()
if dDist < dToolDiam + 0.5 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Dt mortise too narrow'
EgtOutLog( sErr)
+20 -8
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/07/30
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/08/07
-- Gestione calcolo mezzo-legno per Travi
-- Tabella per definizione modulo
@@ -225,16 +225,28 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
end
-- scelta faccia da lavorare
local nFacInd
-- se entrambe possibili, scelgo quella con la normale più perpendicolare all'asse trave (se uguali, quella verso X+)
-- se entrambe possibili
if bFaceOk[0] and bFaceOk[1] then
if abs( abs( vtN[0]:getX()) - abs( vtN[1]:getX())) < GEO.EPS_SMALL then
if ptM:getX() > b3Raw:getCenter():getX() then
nFacInd = EgtIf( vtN[0]:getX() > vtN[1]:getX(), 0, 1)
-- se in testa o coda, scelgo quella con la normale più parallela all'asse trave
if Proc.Head or Proc.Tail then
if vtN[0]:getZ() < BD.NZ_MINA then
nFacInd = 1
elseif vtN[1]:getZ() < BD.NZ_MINA then
nFacInd = 0
else
nFacInd = EgtIf( vtN[0]:getX() < vtN[1]:getX(), 0, 1)
nFacInd = EgtIf( abs( vtN[0]:getX()) > abs( vtN[1]:getX()), 0, 1)
end
-- altrimenti, scelgo quella con la normale più perpendicolare all'asse trave (se uguali, quella verso X+)
else
nFacInd = EgtIf( abs( vtN[0]:getX()) < abs( vtN[1]:getX()), 0, 1)
if abs( abs( vtN[0]:getX()) - abs( vtN[1]:getX())) < GEO.EPS_SMALL then
if ptM:getX() > b3Raw:getCenter():getX() then
nFacInd = EgtIf( vtN[0]:getX() > vtN[1]:getX(), 0, 1)
else
nFacInd = EgtIf( vtN[0]:getX() < vtN[1]:getX(), 0, 1)
end
else
nFacInd = EgtIf( abs( vtN[0]:getX()) < abs( vtN[1]:getX()), 0, 1)
end
end
elseif bFaceOk[0] then
nFacInd = 0
@@ -476,7 +488,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId)
assert( ( Proc.Fct > 2), 'Error : MakeMoreFaces in LapJoint with ' .. tostring( Proc.Fct) .. ' faces')
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
local nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id)
assert( nFacInd, 'Error : MakeMoreFaces could not find reference face')
assert( ( nFacInd and nFacInd >= 0), 'Error : MakeMoreFaces could not find reference face')
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
-- se orientata verso il basso, verifico l'alternativa