DataBeam :

- in Contorni Liberi e Archi aggiunta gestione spessore codolo da parametri Q (solo se BD.DIM_STRIP = -1).
This commit is contained in:
Dario Sassi
2021-01-29 11:43:26 +00:00
parent 8b4b2bd282
commit ddeaf7559b
2 changed files with 31 additions and 20 deletions
+19 -15
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/11/20
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/01/29
-- Gestione calcolo profilo libero per Travi
-- Tabella per definizione modulo
@@ -15,9 +15,10 @@ local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
-- variabili assegnazione parametri Q
local sDepthChamferMill = 'Q02' -- d
local sOverMaterialForFinish = 'Q03' -- d
local sPreemptiveChamfer = 'Q00' -- i
local Q_DIM_STRIP = 'Q01' -- d
local Q_DEPTH_CHAMFER = 'Q02' -- d
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
local Q_ONLY_CHAMFER = 'Q00' -- i
---------------------------------------------------------------------
-- Riconoscimento della feature
@@ -115,17 +116,17 @@ function ProcessFreeContour.Classify( Proc, b3Raw)
end
---------------------------------------------------------------------
local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnlyCham)
local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham)
local nChamfer = 0
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- verifico che lo smusso sia richiesto
local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0
local dDepth = EgtGetInfo( Proc.Id, Q_DEPTH_CHAMFER, 'd') or 0
if dDepth > 0 then
nChamfer = 1
end
-- verifico se posso fare solo lo smusso
if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then
if EgtGetInfo( Proc.Id, Q_ONLY_CHAMFER, 'i') == 1 then
if dDepth > 0 then
nChamfer = nChamfer + 1
-- altrimenti se non ho l'affondamento esco
@@ -219,9 +220,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
local bDown = ( b3Aux:getMin():getZ() < b3Raw:getMin():getZ() + 5)
-- verifico se in testa o coda
local bHead = Proc.Head
-- verifico se sono presenti i parametri Q per la profondità smusso e
-- per eseguire in esclusiva solo lo smusso
local nChamfer, dDepthCham, sChamfer = VerifyCham( Proc, AuxId, nRawId, true, sDepthChamferMill, sPreemptiveChamfer)
-- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true)
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'FreeContour')
if not sMilling then
@@ -273,12 +273,16 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
local dOriDepth = dDepth
local nDouble = 1
local bCanDouble = abs( vtExtr:getY()) > 0.707 and bCross
local bCanDouble = ( abs( vtExtr:getY()) > 0.707 and bCross)
local dDimStrip = BD.DIM_STRIP
if dDimStrip < 0 then
dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0
end
local bStripOnSide = false
if bCross then
if nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX()) then
if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then
-- devo lasciare un codolo
dDepth = dDepth - BD.DIM_STRIP
dDepth = dDepth - dDimStrip
bStripOnSide = true
else
-- devo affondare un poco oltre
@@ -289,7 +293,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and nStep > 1 and
bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then
nDouble = 2
dDepth = min( ( b3Raw:getDimY() - BD.DIM_STRIP) * 0.5, dMaxDepth)
dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth)
else
-- se altezza geometria supera capacità taglio utensile ed è orizzontale setto per eseguire codolo in centro
if dDepth > dMaxDepth then
@@ -445,7 +449,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
-- verifico se devo fare sgrossatura più finitura
local dOffsetPar = EgtGetInfo( Proc.Id, sOverMaterialForFinish, 'i') or 0
local dOffsetPar = EgtGetInfo( Proc.Id, Q_OVERMAT_FOR_FINISH, 'i') or 0
-- eseguo
for i = 1, nStep do
for j = 1, nDouble do