DataBeam :

- in DiceCut ora si fanno i cubetti anche quando le facce superano la massima lunghezza anche se strette
- in Cut corretto orientamento testa per tagli particolari
- rifatta Classify di DoubleCut
- in Drill migliorato controllo ingombro pinza portautensile
- in Tenon e DtTenon portato a 6 il massimo numero di passi.
This commit is contained in:
Dario Sassi
2020-09-25 05:51:49 +00:00
parent 56e5cfc517
commit 14d500e4ab
7 changed files with 79 additions and 51 deletions
+4 -9
View File
@@ -1,4 +1,4 @@
-- BeamExec.lua by Egaltech s.r.l. 2020/07/29
-- BeamExec.lua by Egaltech s.r.l. 2020/09/24
-- Libreria esecuzione lavorazioni per Travi
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
@@ -564,7 +564,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
bOk, bDown = Cut.Classify( Proc, b3Raw)
-- se doppio taglio
elseif DoubleCut.Identify( Proc) then
bOk, bDown = DoubleCut.Classify( Proc)
bOk, bDown = DoubleCut.Classify( Proc, b3Raw)
-- se taglio longitudinale
elseif LongCut.Identify( Proc) then
bOk, bDown = LongCut.Classify( Proc)
@@ -737,13 +737,8 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se doppio taglio ( 1/2-011-X)
elseif DoubleCut.Identify( Proc) then
-- se due facce, eseguo doppio taglio
if Proc.Fct == 2 then
bOk, sErr = DoubleCut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti eseguo singolo taglio
else
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
-- esecuzione doppio taglio
bOk, sErr = DoubleCut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se taglio longitudinale ( 0/3/4-010-X)
elseif LongCut.Identify( Proc) then
-- esecuzione taglio longitudinale
+4 -2
View File
@@ -147,8 +147,10 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
local dLen = Box:getDimX()
local dWidth = Box:getDimY()
-- se faccia con un lato piccolo e non diretta troppo verso il basso, non servono dice
if ( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and vtN:getZ() > dNzLimDwnUp then
-- se faccia non troppo lunga, con un lato piccolo e non diretta troppo verso il basso, non servono dice
local dMaxLen = BD.MAX_LEN_DICE or 600
if dLen < dMaxLen and dWidth < dMaxLen and
( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and vtN:getZ() > dNzLimDwnUp then
return nil, nil, nil
end
+37 -15
View File
@@ -1,4 +1,4 @@
-- ProcessCut.lua by Egaltech s.r.l. 2020/09/22
-- ProcessCut.lua by Egaltech s.r.l. 2020/09/24
-- Gestione calcolo singoli tagli di lama per Travi
-- Tabella per definizione modulo
@@ -38,8 +38,7 @@ function ProcessCut.Classify( Proc, b3Raw)
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
-- confronto anche qua la distanza maggiore della faccia con la massima distanza del DiceCut
-- e se il rapporto supera il 2 (implica che genera 3 tagli) dichiaro impossibile la lavorazione
if DimH and BD.MAX_DIM_DICE and abs(BD.MAX_DIM_DICE) > 20 * GEO.EPS_SMALL and
abs( DimH / BD.MAX_DIM_DICE) > 2 then
if DimH and BD.MAX_DIM_DICE and abs( BD.MAX_DIM_DICE) > 20 * GEO.EPS_SMALL and abs( DimH / BD.MAX_DIM_DICE) > 2 then
return true, true
end
end
@@ -266,7 +265,17 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if #vCuts[i-1] > 0 then
vtO = EgtSurfTmFacetNormVersor( vCuts[i-1][1], 0, GDB_ID.ROOT)
elseif vCuts[i+1] and #vCuts[i+1] > 0 then
vtO = EgtSurfTmFacetNormVersor( vCuts[i+1][1], 0, GDB_ID.ROOT)
-- lunghezza faccia nell'eventuale direzione ortogonale
local asseX = EgtSurfTmFacetNormVersor( vCuts[i+1][1], 0, GDB_ID.ROOT)
local asseY = asseX ^ vtN
local Frame = Frame3d( ptC, ptC + asseX, ptC + asseY)
local b3Fac = EgtGetBBoxRef( vCuts[i][1], GDB_BB.STANDARD, Frame)
-- se lunghezza inferiore al limite, accetto la direzione
if b3Fac:getDimX() < dMaxDepth - BD.CUT_EXTRA then
vtO = asseX
else
bNoPerpCuts = true
end
else
bNoPerpCuts = true
end
@@ -288,7 +297,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
end
-- lavoro la faccia
for j = 1, #vCuts[i] do
-- se taglio dal basso
-- se taglio dal basso
if bDownCut then
-- se strato pari composto da 1 o 2 elementi
if ( i % 2) == 0 and #vCuts[i] <= 2 then
@@ -328,27 +337,40 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
end
-- altrimenti tagli diretti della faccia
else
-- tagli molto di lato e inclinati sono permessi fino a -45deg
if abs( vtN:getX()) < 0.5 then dNzLimDwnUp = -0.707 end
-- lavoro la faccia
local vtOrthoO
if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
vtOrthoO = -Z_AX()
elseif bHorizCut then
vtOrthoO = Z_AX()
elseif Proc.Head and abs( vtN:getY()) > 0.259 and vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
vtOrthoO = X_AX()
elseif Proc.Tail and abs( vtN:getY()) > 0.259 and vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
vtOrthoO = -X_AX()
elseif vtN:getY() > -0.02 then
if not Proc.Head then
vtOrthoO = -Y_AX()
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and abs( vtN:getY()) > 0.259 and vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
if Proc.Head then
vtOrthoO = X_AX()
else
vtOrthoO = -X_AX()
end
elseif vtN:getZ() < dNzLimDwnUp and abs( vtN:getY()) > 0.259 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
if Proc.Head then
vtOrthoO = X_AX()
else
vtOrthoO = -X_AX()
end
elseif vtN:getY() > -0.02 then
if Proc.Head then
vtOrthoO = Y_AX()
else
vtOrthoO = -Y_AX()
end
else
vtOrthoO = -Y_AX()
if Proc.Head then
vtOrthoO = Y_AX()
else
vtOrthoO = -Y_AX()
end
end
-- tagli molto di lato e inclinati sono permessi fino a -45deg
if abs( vtN:getX()) < 0.5 then dNzLimDwnUp = -0.707 end
-- taglio
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dNzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
+24 -15
View File
@@ -1,4 +1,4 @@
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2020/09/15
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2020/09/24
-- Gestione calcolo doppi tagli di lama per Travi
-- Tabella per definizione modulo
@@ -25,20 +25,27 @@ end
---------------------------------------------------------------------
-- Classificazione della feature
function ProcessDoubleCut.Classify( Proc)
-- numero delle facce
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
-- se due facce, verifico se convesso
local bConvex = true
if nFacetCnt == 2 then
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
bConvex = not bAdj or ( dAng > 0)
end
-- verifico le normali delle facce
for i = 1, nFacetCnt do
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
if not bConvex and ( vtN:getZ() < - 0.72 or ( vtN:getZ() < - 0.259 and Proc.Box:getDimX() > BD.MAX_DIM_DICE)) then
return true, true
function ProcessDoubleCut.Classify( Proc, b3Raw)
--se una faccia, uso la classificazione dei tagli singoli
if Proc.Fct == 1 then return Cut.Classify( Proc, b3Raw) end
-- verifico se convesso
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
local bConvex = ( not bAdj or ( dAng > 0))
if bConvex then return true, false end
-- verifico le normali delle facce per tagli da sotto
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw)
for i = 1, 2 do
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, i-1, GDB_ID.ROOT)
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
if bDownCut then
-- dimensione della faccia perpendicolare alla linea di intersezione tra le facce
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, 2-i, GDB_ID.ROOT)
local vtX = vtN2 ^ vtN
local frRef = Frame3d( ptC, ptC + 100 * vtX, ptC + 100 * vtN2)
local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, i-1, GDB_BB.STANDARD, frRef)
if b3Ref:getDimY() > BD.MAX_DIM_DICE then
return true, true
end
end
end
return true, false
@@ -134,6 +141,8 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se singola faccia, passo a quella lavorazione
if Proc.Fct == 1 then return Cut.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
+6 -6
View File
@@ -1,4 +1,4 @@
-- ProcessDrill.lua by Egaltech s.r.l. 2020/09/16
-- ProcessDrill.lua by Egaltech s.r.l. 2020/09/24
-- Gestione calcolo forature per Travi
-- Tabella per definizione modulo
@@ -203,7 +203,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local sErr = 'Error : drilling not found in library'
EgtOutLog( sErr)
return false, sErr
-- altrimenti rifaccio la ricerca foratura senza passare altezza uensile
-- altrimenti rifaccio la ricerca foratura senza passare altezza utensile
else
dCheckDepth = nil
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh = ML.FindDrilling( dDiam)
@@ -242,12 +242,12 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local dSubL1 = 0
local dSubL2 = 0
local dSubL3 = 0
-- se foro su testa o coda e inclinato, limito il massimo affondamento
-- se foro non su testa o coda e inclinato, limito il massimo affondamento
if not ( ( Proc.Fcs == 5 or Proc.Fcs == 6) or ( bToInvert and ( Proc.Fce == 5 or Proc.Fce == 6))) then
local CosB = abs( vtExtr:getX())
if CosB < BD.DRILL_VX_MAX then
local TgA = CosB / sqrt( 1 - CosB * CosB)
dSubL1 = ( dDiamTh - dToolDiam) / 2 * TgA
dSubL1 = ( dDiamTh / 2 + 2) * TgA
else
dMaxDepth = 0
end
@@ -257,7 +257,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local CosB = abs( vtExtr:getZ())
if CosB < BD.DRILL_VX_MAX then
local TgA = CosB / sqrt( 1 - CosB * CosB)
dSubL2 = ( dDiamTh - dToolDiam) / 2 * TgA
dSubL2 = ( dDiamTh / 2 + 2) * TgA
else
dMaxDepth = 0
end
@@ -267,7 +267,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local CosB = abs( vtExtr:getY())
if CosB < BD.DRILL_VX_MAX then
local TgA = CosB / sqrt( 1 - CosB * CosB)
dSubL3 = ( dDiamTh - dToolDiam) / 2 * TgA
dSubL3 = ( dDiamTh / 2 + 2) * TgA
else
dMaxDepth = 0
end
+2 -2
View File
@@ -249,8 +249,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
dMaxDist = 2 * ( b3DtTen:getRadius() - b3DtAux:getRadius())
end
EgtOutLog( 'MaxDist=' .. EgtNumToString( dMaxDist, 3), 3)
-- Cicli di lavorazione (max 5)
local MAX_PASS = 5
-- Cicli di lavorazione (max 6)
local MAX_PASS = 6
local nStep = min( ceil( dMaxDist / ( 0.7 * dTDiam)), MAX_PASS)
local dStep = min( dMaxDist, 0.7 * dTDiam * MAX_PASS) / nStep
for i = nStep, 1, -1 do
+2 -2
View File
@@ -247,8 +247,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
dTenH = dMaxDepth
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
end
-- determino il numero di passate concentriche (max 5)
local MAX_PASS = 5
-- determino il numero di passate concentriche (max 6)
local MAX_PASS = 6
local nPass = min( ceil( dPockL / ( 0.7 * dMillDiam)), MAX_PASS)
local dStep = min( dPockL, 0.7 * dMillDiam * MAX_PASS) / nPass
for i = nPass, 1, -1 do