DataBeam :

- corretta segnalazione sezione troppo piccola in BatchProcess
- minimo sovramateriale di testa che produce taglio di lama portato da 1mm a 0.1mm
- FacesBySaw.MakeTwo ora gestisce anche le prime due facce di una superficie con più facce
- in foratura corretta Split per il caso in cui non esista punta per il foro
- LapJoint riconoscibile di testa o coda se non più lunga del relativo massimo o del 60% della trave
- StepJoint ora gestisce i casi 2 e 4 facce
- StepJointNotch ora gestisce i casi 2 e 4 facce (larghe come la faccia della trave).
This commit is contained in:
Dario Sassi
2019-10-23 06:49:03 +00:00
parent 5ebe6c2c52
commit 7419add614
7 changed files with 341 additions and 31 deletions
+141 -6
View File
@@ -1,4 +1,4 @@
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2019/09/25
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2019/10/22
-- Gestione calcolo tacca a gradino per Travi
-- Tabella per definizione modulo
@@ -28,8 +28,8 @@ end
function ProcessStepJointNotch.Classify( Proc)
-- numero delle facce
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
-- gestisco solo 2 facce
if nFacetCnt ~= 2 then
-- gestisco solo 2 o 4 facce
if nFacetCnt ~= 2 and nFacetCnt ~= 4 then
return false, false
end
-- verifico le normali delle facce
@@ -44,8 +44,8 @@ function ProcessStepJointNotch.Classify( Proc)
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- Lavorazione di due facce
local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -127,7 +127,7 @@ function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local bFront = ( ptC[k]:getY() < ptPs:getY())
nOrthoOpposite = EgtIf( bFront, MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT)
else
local bOver = ( ptC[k]:getZ() > ptC[l]:getZ())
local bOver = true
nOrthoOpposite = EgtIf( bOver, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_TOP)
end
-- lavoro la faccia
@@ -148,5 +148,140 @@ function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
return true
end
---------------------------------------------------------------------
-- Lavorazione di due facce
local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- Prime due facce
local bOk, sErr = MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
-- Seconde due facce
-- 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
-- copio la superficie e scambio le facce
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId)
if AddId then
EgtSurfTmSwapFacets( AddId, 0, 2)
EgtSurfTmSwapFacets( AddId, 1, 3)
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
-- applico lavorazione
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
end
return true
end
---------------------------------------------------------------------
-- lavorazione smussi
local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- verifico che lo smusso sia richiesto
local dDepth = EgtGetInfo( Proc.Id, 'Q01', 'd') or 0
if dDepth < 0.1 then return true end
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- recupero e verifico l'entità curva associata
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or ( EgtGetType( AuxId) & 256) == 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing profile geometry'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati della curva e del profilo
local dWidth = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
-- eseguo lo smusso solo se direzione orizzontale
if abs( vtExtr:getZ()) > 0.1 then
local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped not horizontale chamfer'
EgtOutLog( sWarn)
return true
end
-- eseguo lo smusso solo se feature larga come la trave
if dWidth < b3Raw:getDimY() - 1 then
local sWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skipped chamfer (feature smaller than beam)'
EgtOutLog( sWarn)
return true
end
local dExtra = 2
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'Mark')
if not sMilling then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- Inserisco la lavorazione del lato standard
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch1Id = EgtAddMachining( sName1, sMilling)
if not nMch1Id then
local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- assegno affondamento e offset radiale
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
-- Inserisco la lavorazione del lato opposto
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtAddMachining( sName2, sMilling)
if not nMch2Id then
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- inverto direzione utensile
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
-- assegno affondamento e offset radiale
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
return true
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se due facce
if Proc.Fct == 2 then
local bOk, sErr = MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
-- se quattro facce
elseif Proc.Fct == 4 then
local bOk, sErr = MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
-- altrimenti errore
else
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' face number not allowed'
EgtOutLog( sErr)
return false, sErr
end
-- esecuzione eventuale smusso
return MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
---------------------------------------------------------------------
return ProcessStepJointNotch