DataBeam :

- altre correzioni per fori inclinati (fronte/sopra)
- corretta gestione ingombro ghiera portautensili su fori inclinati con punte
- gestione distanza da pezzo successivo per  ribassi con sega a catena.
This commit is contained in:
Dario Sassi
2020-10-15 18:52:24 +00:00
parent 0a5c8a146b
commit a43e323df8
4 changed files with 79 additions and 24 deletions
+59 -10
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/10/14
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/10/15
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
@@ -1874,6 +1874,10 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
dDepthCham, b3FacesUsed)
local bOrthoFaces
local sWarn
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ottengo la distanza tra la fine del pezzo e il pezzo successivo
local dDistToNextPiece = EgtGetInfo( nRawId, 'BDST', 'd') or 5.4
if b3FacesUsed then
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
local nFacInd1, dFacElev1, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId, b3FacesUsed)
@@ -1935,6 +1939,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
-- Determino se estremi aperti o chiusi
local bOpenStart = false
local bOpenEnd = false
local vtNS, vtNE
-- se non ho la faccia di fondo ( che comporta essere una fessura) verifico se ho lati aperti
if not nBottomFace then
local vAdj2 = EgtSurfTmFacetAdjacencies( Proc.Id, nFacAdj)[1]
@@ -1947,12 +1952,20 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
i = EgtIf( i > 1, i - 1, #vAdj2)
end
bOpenStart = ( vAdj2[i] < 0)
-- se è chiusa acquisisco vettore faccia tappo
if not bOpenStart and vAdj2[i] >= 0 then
_, vtNS = EgtSurfTmFacetCenter( Proc.Id, vAdj2[i], GDB_ID.ROOT)
end
-- Se non esiste faccia adiacente a lato successivo -> fine aperto
local k = EgtIf( j < #vAdj2, j + 1, 1)
while vAdj2[k] == nFacInd do
k = EgtIf( k < #vAdj2, k + 1, 1)
end
bOpenEnd = ( vAdj2[k] < 0)
-- se è chiusa acquisisco vettore faccia tappo
if not bOpenEnd and vAdj2[k] >= 0 then
_, vtNE = EgtSurfTmFacetCenter( Proc.Id, vAdj2[k], GDB_ID.ROOT)
end
end
end
end
@@ -1993,8 +2006,6 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
end
-- Calcolo uso faccia
local nFaceUse = BL.GetNearestOrthoOpposite( rfFac:getVersZ())
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- Eseguo i tagli
local nStep = ceil( ( dV - 10 * GEO.EPS_SMALL) / dSawThick)
local dStep = 0
@@ -2006,6 +2017,14 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
-- in base all'elevazione calcolo l'impronta della lama
local dUsedBladeLen = sqrt( ((dSawDiam / 2)*(dSawDiam / 2)) - ( ( (dSawDiam / 2) - dElev) * ( (dSawDiam / 2) - dElev)))
-- controllo direzione taglio e se il minimo della feature sborda in coda
if not Proc.Tail and abs( vtN:getX()) < GEO.EPS_SMALL and abs( b3Solid:getMin():getX() - Proc.Box:getMin():getX()) < 100 * GEO.EPS_SMALL and dDistToNextPiece < dUsedBladeLen then
-- do avviso che la lama può sbordare nel pezzo successivo
sWarn = 'Warning on saw cut : Cut machining can damage next piece'
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
end
-- altrimenti con sega a catena
else
-- Recupero la lavorazione
@@ -2067,9 +2086,29 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
EgtSetMachiningGeometry( {{ Proc.Id, nFacAdj}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto accorciamento iniziale/finale per estremi aperti/chiusi
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, 0, - dSawWidth / 2))
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, 0, - dSawWidth / 2))
-- controllo direzione taglio e se il minimo della feature sborda in coda
if not Proc.Tail and abs( vtN:getX()) < GEO.EPS_SMALL and abs( b3Solid:getMin():getX() - Proc.Box:getMin():getX()) < 100 * GEO.EPS_SMALL then
-- se ho lato partenza aperto e lato uscita chiuso e direzione lato chiuso è negativa, allora controllo uscita lama
if bOpenStart and not bOpenEnd and vtNE:getX() < -0.99 and dDistToNextPiece < (dSawWidth / 2) then
-- imposto accorciamento iniziale per estremi aperti/chiusi
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dDistToNextPiece - 1 - (dSawWidth / 2))
else
-- imposto accorciamento iniziale per estremi aperti/chiusi
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, 0, - dSawWidth / 2))
end
-- se ho lato uscita aperto e lato partenza chiuso e direzione lato partenza è negativa, allora controllo uscita lama
if bOpenEnd and not bOpenStart and vtNS:getX() < -0.99 and dDistToNextPiece < (dSawWidth / 2) then
-- imposto accorciamento finale per estremi aperti/chiusi
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dDistToNextPiece - 1 - (dSawWidth / 2))
else
-- imposto accorciamento finale per estremi aperti/chiusi
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, 0, - dSawWidth / 2))
end
else
-- imposto accorciamento iniziale/finale per estremi aperti/chiusi
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, 0, - dSawWidth / 2))
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, 0, - dSawWidth / 2))
end
-- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, 'A=' .. EgtNumToString( d3RotAng))
-- imposto offset radiale
@@ -3244,8 +3283,17 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
elseif abs( vtN:getX()) > 0.707 or abs( vtN:getY()) > 0.707 or abs( vtN:getZ()) > 0.707 then
dCollSic = 5 * BD.COLL_SIC
end
-- settaggio voluto da Alessandro
local sMchFind = EgtIf( bSinglePart, 'Pocket', 'OpenPocket')
local nUseRoughTool = EgtIf( bSinglePart, 0, 1)
-- fino a che nelle svuotature non si può decidere il punto di inizio faccio delle valutazioni
-- se ho passi multipli controllo il numero delle facce
if not bSinglePart then
-- se ho 3 o più facce allora re-imposto il tipo di svuotatura
if ( Proc.Fct == 3 and bIsU) or Proc.Fct > 3 then
sMchFind = 'Pocket'
end
end
local dDiam = min( dH, dV)
local dDiamMax
local nUseRT
@@ -3264,7 +3312,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
end
-- verifico dalla forma se non posso prendere utensile grande
if ( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 2 and bIsL) or Proc.Fct == 1 then
if ( Proc.Fct == 3 and bIsU and bSinglePart) or ( Proc.Fct == 2 and bIsL) or Proc.Fct == 1 then
--ottengo un diametro utensile opportuno
dDiam, sMchFind, nUseRoughTool, dDiamMax = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic), nUseRoughTool)
if not dDiam and nUseRoughTool == 0 then
@@ -3381,6 +3429,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
return false, sErr
elseif nOk > 0 then
bTryWithBlades = false
sWarn = sErr
end
bOk = true
end
@@ -3399,9 +3448,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if not bOk and sStat == 'MNF' then
sPocketing = ML.FindPocketing( sMchFind, dDiam)
if not sPocketing then
local sErr = 'Error : pocketing not found in library'
EgtOutLog( sErr)
return false, sErr
local sErr2 = 'Error : pocketing not found in library'
EgtOutLog( sErr2)
return false, sErr2
end
else
return bOk, sWarn