DataBeam :

- aggiunta gestione feature 138 in coda su pezzo piccolo
- in LapJoint se richiesto truciolatore da Q e non fattibile, si dà errore.
This commit is contained in:
Dario Sassi
2020-08-17 18:14:10 +00:00
parent 8c9d3d3ce1
commit a28fb4c546
2 changed files with 175 additions and 29 deletions
+63 -7
View File
@@ -1,4 +1,4 @@
-- ProcessDovetail.lua by Egaltech s.r.l. 2020/08/03
-- ProcessDovetail.lua by Egaltech s.r.l. 2020/08/04
-- Gestione calcolo giunzione coda di rondine
-- Tabella per definizione modulo
@@ -219,6 +219,41 @@ local function VerifyIfRoughMill( dLargeFace, vtN, bCalcElev, dAngOnSide)
return false
end
---------------------------------------------------------------------
local function AddFaceToSurf( Proc, nPartId, b3Solid)
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
local nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
-- punto medio sulla faccia
local ptN = Point3d( b3Solid:getMin():getX(), ( b3Solid:getMin():getY() + b3Solid:getMax():getY())/2, ( b3Solid:getMin():getZ() + b3Solid:getMax():getZ())/2)
-- creo superficie intermedia
local nSurfInt = EgtSurfTmPlaneInBBox( nAddGrpId, ptN, -X_AX(), b3Solid, GDB_ID.ROOT)
-- se esiste la superfice aggiunta, la ritaglio la superficie con le facce
if nSurfInt then
-- inverto la normale
EgtInvertSurf( nSurfInt)
for i = 1, Proc.Fct do
local ptN, vtN = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT)
EgtCutSurfTmPlane( nSurfInt, ptN, -vtN, false, GDB_ID.ROOT)
end
-- unisco la nuova superfice
if nSurfInt then
local bOk = EgtSurfTmAdd( nNewProc, nSurfInt)
if bOk then
EgtErase( nSurfInt)
Proc.Id = nNewProc
Proc.Fct = EgtSurfTmFacetCount( nNewProc)
end
end
end
end
---------------------------------------------------------------------
-- Verifica se feature di testa
function ProcessDovetail.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
@@ -265,11 +300,21 @@ end
---------------------------------------------------------------------
-- Verifica se feature di coda
function ProcessDovetail.IsTailFeature( Proc, b3Raw)
-- recupero identificativo del pezzo
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- se una sola faccia
if Proc.Fct == 1 then
local _, vtN0 = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
if vtN0:getX() < -0.1 then
return true
-- controllo se il pezzo + piccolo e serve la lavorazione prima del taglio di separazione
if b3Solid:getDimX() > BD.LEN_SHORT_PART then
return true
else
-- aggiungo faccia
AddFaceToSurf( Proc, nPartId, b3Solid)
return false
end
end
end
-- verifico se è in coda
@@ -280,13 +325,17 @@ function ProcessDovetail.IsTailFeature( Proc, b3Raw)
if Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.6 * b3Raw:getDimX()) then
return false
end
-- recupero identificativo del pezzo
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
-- se due facce e interessa veramente la coda, allora di coda
if Proc.Fct <= 2 then
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
if Proc.Box:getMin():getX() < b3Solid:getMin():getX() + 1. then
return true
-- controllo se il pezzo + piccolo e serve la lavorazione prima del taglio di separazione
if b3Solid:getDimX() > BD.LEN_SHORT_PART then
return true
else
-- aggiungo faccia
AddFaceToSurf( Proc, nPartId, b3Solid)
return false
end
end
end
-- deve avere la normale principale diretta verso la coda
@@ -299,7 +348,14 @@ function ProcessDovetail.IsTailFeature( Proc, b3Raw)
if vtN:getX() > -0.499 then
return false
else
return true
-- controllo se il pezzo + piccolo e serve la lavorazione prima del taglio di separazione
if b3Solid:getDimX() > BD.LEN_SHORT_PART then
return true
else
-- aggiungo faccia
AddFaceToSurf( Proc, nPartId, b3Solid)
return false
end
end
end