Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d91c31974e | |||
| a217b95c35 | |||
| 05aae0b8f3 | |||
| 629dfc1341 | |||
| e9cb756dc9 | |||
| 9b888a0a59 | |||
| b141a512bb | |||
| d13f108dad | |||
| 7762692597 | |||
| 04b0650f96 | |||
| 8b31881abb | |||
| 055d8bd4d3 | |||
| b0e10cee87 | |||
| a9e43984a2 | |||
| 1e93303981 | |||
| 7fec3d6584 | |||
| e61cc2ba08 | |||
| 516a56c8b5 | |||
| 2482338a12 | |||
| 0528ac4a31 | |||
| 4e77597b7d | |||
| 058babe605 | |||
| a7676c7331 | |||
| f1abaeaac3 | |||
| 5db6398725 | |||
| a8924f4425 | |||
| e4c5a2e06d | |||
| 29ed56df16 |
@@ -16,6 +16,7 @@
|
||||
-- 2022/07/12 A GetFaceHvRefDim aggiunta possibilità di confronto e limitazione dimensioni con grezzo/pezzo (conta solo la sezione).
|
||||
-- 2022/07/26 Aggiunta la funzione FindFaceBestOrientedAsAxis, precedentemente in ProcessLapJoint
|
||||
-- 2022/07/26 Alla funzione FindFaceBestOrientedAsAxis aggiunta la possibilità di escludere una faccia dalla ricerca
|
||||
-- 2022/09/01 Aggiunte le funzioni GetTunnelDimension, CalcCollisionSafety, SetOpenSide, precedentemente in ProcessLapJoint.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamLib = {}
|
||||
@@ -814,5 +815,237 @@ function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
|
||||
return nFaceIndMax, ptC, vtN
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetTunnelDimension( Proc, nPartId)
|
||||
-- sono necessarie almeno due facce
|
||||
if Proc.Fct < 2 then return 0, 0, 0 end
|
||||
-- recupero l'ingombro della trave
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- recupero centro e normale delle facce
|
||||
local ptC = {}
|
||||
local vtN = {}
|
||||
for i = 1, Proc.Fct do
|
||||
ptC[i], vtN[i] = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||
end
|
||||
-- calcolo l'orientamento del tunnel
|
||||
local vtOrtho
|
||||
local bAdj = EgtSurfTmFacetsContact( Proc.Id, 0, 1)
|
||||
if bAdj then
|
||||
vtOrtho = vtN[1] ^ vtN[2]
|
||||
else
|
||||
if Proc.Fct >= 3 then
|
||||
vtOrtho = vtN[1] ^ vtN[3]
|
||||
else
|
||||
return 0, 0, 0
|
||||
end
|
||||
end
|
||||
-- ottengo il boundingBox e prendo le dimensioni lungo la direzione (Z locale) che rappresenta la profondità della fessura
|
||||
local frFc = Frame3d( ptC[1], vtOrtho) ;
|
||||
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
|
||||
local dDepth = b3BoxLoc:getDimZ()
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
EgtOutLog( 'Error : missing AddGroup')
|
||||
return 0, 0, 0
|
||||
end
|
||||
-- centro del bounding box locale
|
||||
local ptCen = b3BoxLoc:getCenter()
|
||||
ptCen:toGlob( frFc)
|
||||
-- creo superficie intermedia
|
||||
local nSurfInt = EgtSurfTmPlaneInBBox( nAddGrpId, ptCen, vtOrtho, b3Solid, GDB_ID.ROOT)
|
||||
if not nSurfInt then return 0, 0, 0 end
|
||||
-- ritaglio la superficie con le facce della fessura
|
||||
for i = 1, Proc.Fct do
|
||||
EgtCutSurfTmPlane( nSurfInt, ptC[i], -vtN[i], false, GDB_ID.ROOT)
|
||||
end
|
||||
local frSurfInt, dDimMax, dDimMin = EgtSurfTmFacetMinAreaRectangle( nSurfInt, 0, GDB_ID.ROOT)
|
||||
-- cerco la faccia con larghezza pari a dimensione massima della fessura
|
||||
local nLongIdFace = 0
|
||||
for i = 1, Proc.Fct do
|
||||
if abs( vtN[i] * frSurfInt:getVersX()) < 0.5 then
|
||||
nLongIdFace = i - 1
|
||||
break
|
||||
end
|
||||
end
|
||||
return dDimMin, dDimMax, dDepth, vtOrtho, nLongIdFace, nSurfInt
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.CalcCollisionSafety( vtDir)
|
||||
local dCollSic = 10 * BD.COLL_SIC
|
||||
if abs( vtDir:getX()) > 0.999 or abs( vtDir:getY()) > 0.999 or abs( vtDir:getZ()) > 0.999 then
|
||||
dCollSic = 0
|
||||
elseif abs( vtDir:getX()) > 0.996 or abs( vtDir:getY()) > 0.996 or abs( vtDir:getZ()) > 0.996 then
|
||||
dCollSic = 1 * BD.COLL_SIC
|
||||
elseif abs( vtDir:getX()) > 0.89 or abs( vtDir:getY()) > 0.89 or abs( vtDir:getZ()) > 0.89 then
|
||||
dCollSic = 2.5 * BD.COLL_SIC
|
||||
elseif abs( vtDir:getX()) > 0.86 or abs( vtDir:getY()) > 0.86 or abs( vtDir:getZ()) > 0.86 then
|
||||
dCollSic = 4 * BD.COLL_SIC
|
||||
elseif abs( vtDir:getX()) > 0.707 or abs( vtDir:getY()) > 0.707 or abs( vtDir:getZ()) > 0.707 then
|
||||
dCollSic = 5.5 * BD.COLL_SIC
|
||||
end
|
||||
return dCollSic
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint)
|
||||
|
||||
-- fondo tra loro le curve compatibili
|
||||
EgtMergeCurvesInCurveCompo( nPathInt)
|
||||
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
||||
local pLastPIni, pLastPEnd
|
||||
|
||||
-- faccio una copia della curva e la esplodo
|
||||
if nStartIdEnt then
|
||||
-- prendo i punti
|
||||
for i = 1, nNumEnt do
|
||||
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
||||
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
||||
-- Se normale lungo la Z considero il box in X e Y
|
||||
if abs(vtOrtho:getZ()) > 0.999 then
|
||||
-- se corrisponde a X
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Y
|
||||
elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- altrimenti se normale lungo la Y considero il box in X e Z
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then
|
||||
-- se corrisponde a X
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Z
|
||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- caso che non dovrebbe mai capitare ma gestito per completezza
|
||||
-- altrimenti se normale lungo la X considero il box in Y e Z
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then
|
||||
-- se corrisponde a Y
|
||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Z
|
||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- se asse Z orizzontale verifico se si avvicina piú a Y
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 then
|
||||
if abs(vtOrtho:getY()) > 0.75 then
|
||||
-- se corrisponde a Z
|
||||
if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
end
|
||||
-- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+
|
||||
elseif abs(vtOrtho:getY()) < 0.001 then
|
||||
if abs(vtOrtho:getZ()) > 0.75 then
|
||||
-- se corrisponde a Y
|
||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se devo cambiare il punto di partenza
|
||||
if nStartPoint then
|
||||
if pLastPIni and pLastPEnd then
|
||||
-- calcolo il punto medio con gli ultimi punti utilizzati
|
||||
local ptPs = ( pLastPIni + pLastPEnd) / 2
|
||||
EgtChangeClosedCurveStartPoint( nPathInt, ptPs, GDB_RT.GLOB)
|
||||
-- se devo eliminare la parte open
|
||||
if nStartPoint == 2 then
|
||||
EgtRemoveCurveCompoCurve( nPathInt, true)
|
||||
EgtRemoveCurveCompoCurve( nPathInt, false)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
-- 2021/11/26 DS Spostate qui MakeOneFaceBySaw (ora MakeOne), CalcLeadInOutPerpGeom e CalcLeadInOutTangGeom.
|
||||
-- 2022/04/12 DS Aggiunta gestione speciale cubetti con fresa da sotto.
|
||||
-- 2022/06/29 DS In MakeTwo modificato controllo facce dirette verso il basso.
|
||||
-- 2022/09/08 In MakeOne aggiunto argomento bForceInvert per poter forzare l'inversione del percorso.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FacesBySaw = {}
|
||||
@@ -28,7 +29,7 @@ local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
-- risolvo parametro ambiguo
|
||||
@@ -51,7 +52,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
return true, ''
|
||||
end
|
||||
vtV1 = - vtV1
|
||||
local bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||
local bInvert = bForceInvert
|
||||
if bInvert == nil then
|
||||
bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||
end
|
||||
if bInvert then
|
||||
ptP1, ptP2 = ptP2, ptP1
|
||||
vtV1, vtV2 = vtV2, vtV1
|
||||
|
||||
+10
-5
@@ -14,6 +14,8 @@
|
||||
-- 2022/07/18 Se Q04=1, aggiunto LongCut anche dal lato per macchine tipo PF1250.
|
||||
-- 2022/08/12 I tagli di lama inclinati in coda ora partono dal centro e non dall'esterno.
|
||||
-- 2022/08/24 Disabilitato il dicing per i tagli meno spessi della lama.
|
||||
-- 2022/08/25 In caso di AdvTail con taglio lungo Y la profondità di lavorazione è opportunamente diminuita.
|
||||
-- 2022/08/30 Modificata la condizione che determina l'utilizzo della testa da sotto. Ora controlla se la trave è più grande del doppio della massima larghezza del cubetto.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessCut = {}
|
||||
@@ -486,14 +488,17 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
else
|
||||
vtOrthoO = -X_AX()
|
||||
end
|
||||
elseif Proc.Head then
|
||||
vtOrthoO = EgtIf( vtN:getY() > -0.02, -Y_AX(), Y_AX())
|
||||
else
|
||||
if vtN:getZ() < dVzLimDwnUp or Proc.Tail then
|
||||
if vtN:getZ() < dVzLimDwnUp or Proc.Head or Proc.Tail then
|
||||
vtOrthoO = EgtIf( vtN:getY() > -0.02, -Y_AX(), Y_AX())
|
||||
else
|
||||
vtOrthoO = EgtIf( vtN:getY() > 0.02, Y_AX(), -Y_AX())
|
||||
end
|
||||
-- se è una lavorazione da anticipare diminuisco la profondità del taglio per evitare collisioni con l'albero della lama
|
||||
if Proc.AdvTail then
|
||||
local _, dH = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
dCutExtra = min( -BD.ADVANCE_TAIL_OFFS, -dH + dMaxDepth)
|
||||
end
|
||||
end
|
||||
-- taglio
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
@@ -718,9 +723,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
||||
return true
|
||||
end
|
||||
end
|
||||
-- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -20deg e sbandato oltre 1deg oppure sezione larga o pezzo corto)
|
||||
-- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -20deg e sbandato oltre 1deg oppure sezione più larga di 2 cubetti o pezzo corto)
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtN:getZ() < -0.341 and
|
||||
( abs( vtN:getY()) > 0.017 or b3Raw:getDimY() > 2 * ( BD.MAX_DIM_HTCUT - BD.CUT_EXTRA_MIN) or b3Raw:getDimX() < BD.LEN_SHORT_PART))
|
||||
( abs( vtN:getY()) > 0.017 or b3Raw:getDimY() > 2 * ( BD.MAX_DIM_DICE - BD.CUT_EXTRA_MIN) or b3Raw:getDimX() < BD.LEN_SHORT_PART))
|
||||
local bDownTurn = ( BD.TURN and vtN:getZ() < -0.017)
|
||||
local bTopHead = ( BD.DOWN_HEAD and ( vtN:getZ() > -0.342 or not bDownHead))
|
||||
-- recupero la lavorazione
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2022/07/11
|
||||
-- Gestione calcolo doppi tagli di lama per Travi
|
||||
-- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDoubleCut = {}
|
||||
@@ -188,6 +189,293 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bPocketDown)
|
||||
-- tipo di svuotatura
|
||||
local sMchFind = EgtIf( sMchFindMaster and #sMchFindMaster > 0, sMchFindMaster, 'Pocket')
|
||||
-- ricerca della svuotatura
|
||||
local sPocketing
|
||||
if dDepth then
|
||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.8 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.6 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0.4 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
||||
ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen)
|
||||
else
|
||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen)
|
||||
end
|
||||
if not sPocketing then
|
||||
return false
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local bUsePocketing = false
|
||||
local dMaxDepth = 0
|
||||
local dToolDiam = 0
|
||||
if EgtMdbSetCurrMachining( sPocketing) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
bUsePocketing = true
|
||||
end
|
||||
return bUsePocketing, sPocketing, dMaxDepth, dToolDiam
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
||||
-- fondo tra loro le curve compatibili
|
||||
EgtMergeCurvesInCurveCompo( nPathInt)
|
||||
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
||||
local pLastPIni, pLastPEnd
|
||||
-- faccio una copia della curva e la esplodo
|
||||
if nStartIdEnt then
|
||||
-- ciclo i lati della curva e controllo per ognuno se giace in uno dei piani limite del pezzo: se sì allora il lato è aperto
|
||||
for i = 1, nNumEnt do
|
||||
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
||||
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- scrivo nelle proprietà della curva quali sono i lati aperti
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
-- se ci sono già altri lati aperti
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
-- se è l'unico
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Solid)
|
||||
local nFirstMachId
|
||||
local sWarn
|
||||
local sMchFind = 'OpenPocket'
|
||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
||||
local bBadMach = false
|
||||
-- ottengo le dimensioni del tunnel
|
||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||
-- posso utilizzare utensile con diametro doppio della dimensione minima
|
||||
dDimMin = min( 2 * dDimMin, BD.MAXDIAM_POCK_CORNER)
|
||||
local nPathInt
|
||||
-- verifico se è presente la testa da sotto e se è necessario usarla
|
||||
bMillDown = ( BD.DOWN_HEAD == true and abs( vtOrtho:getZ()) >= 0.707)
|
||||
-- cerco l'utensile di svuotatura per la testa sopra
|
||||
local bMakePocket, sPocketing, dMaxDepth, dDiamTool = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind)
|
||||
local bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn
|
||||
-- cerco anche l'utensile per la testa sotto, nel caso servisse
|
||||
if bMillDown then
|
||||
bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, true)
|
||||
-- se è negativo inverto il versore e la faccia
|
||||
if vtOrtho:getZ() < 0 then
|
||||
vtOrtho = -vtOrtho
|
||||
EgtInvertSurf( nSurfInt)
|
||||
end
|
||||
end
|
||||
if bMakePocket then
|
||||
-- gestione svuotatura da un solo lato o anche dal lato opposto (se non verticale)
|
||||
-- estraggo il contorno dalla superfice per evitare i problemi con la svuotatura
|
||||
-- e assegno l'estrusione
|
||||
nPathInt = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId)
|
||||
EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB)
|
||||
SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
||||
-- variabili per parametri lavorazione
|
||||
local dMachDepth
|
||||
local dElev = 0
|
||||
local bDoubleSide
|
||||
local bOneShot
|
||||
local bComplete = true
|
||||
-- imposto altezza aggiuntiva di elevazione
|
||||
local dCollSic = BL.CalcCollisionSafety( vtOrtho)
|
||||
-- se possibile svuotare completamente da una sola parte
|
||||
if dMaxDepth > ( dDepth + BD.CUT_EXTRA + dCollSic) then
|
||||
dMachDepth = ( dDepth / 2) + BD.CUT_EXTRA
|
||||
dElev = dDepth + BD.CUT_EXTRA
|
||||
bOneShot = true
|
||||
else
|
||||
-- se direzione verso la verticale setto max affondamento possibile ed
|
||||
-- emetto messaggio di warning perché non lavorabile interamente
|
||||
if abs( vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
||||
dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
|
||||
dElev = dMaxDepth
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
bComplete = false
|
||||
-- altrimenti setto il flag per fare la svuotatura da due parti
|
||||
else
|
||||
-- se l'altezza utensile riesce a lavorare completamente da due parti
|
||||
if dMaxDepth > ( dDepth / 2) + dCollSic + BD.CUT_EXTRA_MIN then
|
||||
dMachDepth = BD.CUT_EXTRA_MIN
|
||||
dElev = ( dDepth / 2) + BD.CUT_EXTRA_MIN
|
||||
-- altrimenti non si riesce in due passate, limito la profondità e setto l'elevazione
|
||||
else
|
||||
dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
|
||||
dElev = dMaxDepth
|
||||
-- se molto inclinato rispetto alla normale della faccia di riferimento, lavorazione non idonea per probabili collisioni
|
||||
local vtRef = Y_AX()
|
||||
if abs( vtOrtho:getX()) > abs( vtOrtho:getY()) and abs( vtOrtho:getX()) > abs( vtOrtho:getZ()) then
|
||||
vtRef = X_AX()
|
||||
elseif abs( vtOrtho:getZ()) > abs( vtOrtho:getX()) and abs( vtOrtho:getZ()) > abs( vtOrtho:getY()) then
|
||||
vtRef = Z_AX()
|
||||
end
|
||||
if abs( vtOrtho * vtRef) < 0.5 then
|
||||
bBadMach = true
|
||||
end
|
||||
end
|
||||
bDoubleSide = true
|
||||
end
|
||||
end
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||
EgtOutLog( sErr)
|
||||
return -1, sErr
|
||||
end
|
||||
-- prendo l'id della prima lavorazione inserita
|
||||
if not nFirstMachId then
|
||||
nFirstMachId = nMchFId
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
||||
-- verifico se devo invertire direzione utensile (in caso di direzione verso la verticale)
|
||||
local bInvertMach
|
||||
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
bInvertMach = true
|
||||
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
|
||||
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
bInvertMach = true
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if AreSameOrOppositeVectorApprox( vtOrtho, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtOrtho:getX()) < 0.1 then
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtOrtho:getY() < GEO.EPS_SMALL then
|
||||
nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
-- inverto il percorso di lavorazione per lavorare sinistro
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
-- imposto affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return -1, sErr
|
||||
end
|
||||
end
|
||||
-- se posso applicare la svuotatura sul lato opposto
|
||||
if bDoubleSide then
|
||||
-- se ho la lavorazione da sotto ricalcolo in base a questa lavorazione
|
||||
if bMakePocketDn then
|
||||
-- sPocketing = sPocketingDn
|
||||
-- dMaxDepth = dMaxDepthDn
|
||||
-- dDiamTool = dDiamToolDn
|
||||
-- se l'altezza utensile riesce a lavorare completamente da due parti
|
||||
if dMaxDepthDn > ( dDepth / 2) + dCollSic + BD.CUT_EXTRA_MIN then
|
||||
dMachDepth = BD.CUT_EXTRA_MIN
|
||||
dElev = ( dDepth / 2) + BD.CUT_EXTRA_MIN
|
||||
-- altrimenti non si riesce in due passate, limito la profondità e setto l'elevazione
|
||||
else
|
||||
dMachDepth = dMaxDepthDn - ( dDepth / 2) - dCollSic
|
||||
dElev = dMaxDepthDn
|
||||
bComplete = false
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
else
|
||||
-- se anche lavorando dal lato opposto non riesco a svuotare completamente la fessura
|
||||
-- setto i parametri affondamento ed emetto warning
|
||||
if dMaxDepth < ( dDepth / 2) + BD.CUT_EXTRA + dCollSic then
|
||||
dMachDepth = dMaxDepth - (dDepth / 2) - dCollSic
|
||||
dElev = dMaxDepth
|
||||
bComplete = false
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing))
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing)
|
||||
EgtOutLog( sErr)
|
||||
return -1, sErr
|
||||
end
|
||||
-- prendo l'id della prima lavorazione inserita
|
||||
if not nFirstMachId then
|
||||
nFirstMachId = nMchFId
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
||||
-- imposto direzione utensile opposta
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if AreSameVectorApprox( vtOrtho, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtOrtho:getX()) < 0.1 then
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtOrtho:getY() < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
-- inverto il percorso di lavorazione per lavorare sinistro
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
-- imposo affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return -1, sErr
|
||||
end
|
||||
end
|
||||
end
|
||||
return 1, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId
|
||||
end
|
||||
return 0, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, bOrthoFaces
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
@@ -273,6 +561,31 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
local sCutType = EgtIf( bHead, 'HeadSide', 'TailSide')
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtNm:getZ() < BD.NZ_MINB)
|
||||
-- per tutte le macchine tranne la Fast, controllo se ci sono tagli troppo inclinati e troppo profondi per la lama
|
||||
-- in tal caso richiamo la lavorazione con fresa dal lato
|
||||
if BD.C_SIMM and not bDownHead then
|
||||
local sCutting = ML.FindCutting( sCutType, nil, bDownHead)
|
||||
if not sCutting then
|
||||
local sErr = 'Error : cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
local _, _, dDimV1 = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
local _, _, dDimV2 = BL.GetFaceHvRefDim( Proc.Id, 1, b3Raw)
|
||||
local bFace1TooLongForBlade, bFace2TooLongForBlade = ( dDimV1 >= dMaxDepth), ( dDimV2 >= dMaxDepth)
|
||||
local dFace1Ang, dFace2Ang = vtN[1]:getZ(), vtN[2]:getZ()
|
||||
if bFace1TooLongForBlade and dFace1Ang < ( BD.CUT_VZ_MIN or -0.485) or bFace2TooLongForBlade and dFace2Ang < ( BD.CUT_VZ_MIN or -0.485) then
|
||||
local bOk, sErr = MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Solid)
|
||||
return bOk, sErr
|
||||
end
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, false, bDownHead)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- segnalazione ingombro di testa o coda
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio di tipo diceCut.
|
||||
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessHeadCut = {}
|
||||
@@ -251,7 +252,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
if bDoubleCut then
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
@@ -281,16 +282,18 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dAccStart = 0
|
||||
local dVzLimDwnUp
|
||||
if BD.TURN then dVzLimDwnUp = -2 end
|
||||
-- eseguo i tagli da sotto necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- eseguo i tagli da sopra necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
|
||||
+227
-300
@@ -50,6 +50,10 @@
|
||||
-- 2022/07/05 Modifiche per sega a catena di testa e relativa MaxElev.
|
||||
-- 2022/07/12 In MakeByChainOrSaw aggiunto check per feature L20 usata in modo improprio e, nel caso, si passa a una lavorazione tasca.
|
||||
-- 2022/08/11 Aggiunta lavorazione tunnel splittata con sega a catena per tutte le macchine ad esclusione della Fast.
|
||||
-- 2022/09/01 Spostate le funzioni GetTunnelDimension, CalcCollisionSafety, SetOpenSide in BeamLib.
|
||||
-- 2022/09/15 Implementata gestione feature Planing L090, gestita come LapJoint
|
||||
-- Implementata, in caso di fresatura di lato con altezza tasca molto bassa, la contornatura con unica passata
|
||||
-- Migliorata gestione AntiSplint (Mill e Saw)
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLapJoint = {}
|
||||
@@ -100,6 +104,7 @@ function ProcessLapJoint.Identify( Proc)
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or
|
||||
( Proc.Grp == 4 and Proc.Prc == 37) or
|
||||
( Proc.Grp == 4 and Proc.Prc == 39) or
|
||||
( Proc.Grp == 4 and Proc.Prc == 120))
|
||||
@@ -157,6 +162,9 @@ local function AssignQIdent( Proc)
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
||||
Q_USE_MILL = 'Q02' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90 then
|
||||
Q_ANTISPLINT_TYPE = 'Q03' -- i
|
||||
Q_SIDE_ROUGH_TOOL = 'Q04' -- i
|
||||
end
|
||||
-- le altre features gestite non hanno parametri Q
|
||||
end
|
||||
@@ -444,62 +452,6 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
|
||||
return bUseBHSideMill, bHead, bHeadDir, sMilling, dToolThick, dToolDiam
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetTunnelDimension( Proc, nPartId)
|
||||
-- sono necessarie almeno due facce
|
||||
if Proc.Fct < 2 then return 0, 0, 0 end
|
||||
-- recupero l'ingombro della trave
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- recupero centro e normale delle facce
|
||||
local ptC = {}
|
||||
local vtN = {}
|
||||
for i = 1, Proc.Fct do
|
||||
ptC[i], vtN[i] = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||
end
|
||||
-- calcolo l'orientamento del tunnel
|
||||
local vtOrtho
|
||||
local bAdj = EgtSurfTmFacetsContact( Proc.Id, 0, 1)
|
||||
if bAdj then
|
||||
vtOrtho = vtN[1] ^ vtN[2]
|
||||
else
|
||||
if Proc.Fct >= 3 then
|
||||
vtOrtho = vtN[1] ^ vtN[3]
|
||||
else
|
||||
return 0, 0, 0
|
||||
end
|
||||
end
|
||||
-- ottengo il boundingBox e prendo le dimensioni lungo la direzione (Z locale) che rappresenta la profondità della fessura
|
||||
local frFc = Frame3d( ptC[1], vtOrtho) ;
|
||||
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
|
||||
local dDepth = b3BoxLoc:getDimZ()
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
EgtOutLog( 'Error : missing AddGroup')
|
||||
return 0, 0, 0
|
||||
end
|
||||
-- centro del bounding box locale
|
||||
local ptCen = b3BoxLoc:getCenter()
|
||||
ptCen:toGlob( frFc)
|
||||
-- creo superficie intermedia
|
||||
local nSurfInt = EgtSurfTmPlaneInBBox( nAddGrpId, ptCen, vtOrtho, b3Solid, GDB_ID.ROOT)
|
||||
if not nSurfInt then return 0, 0, 0 end
|
||||
-- ritaglio la superficie con le facce della fessura
|
||||
for i = 1, Proc.Fct do
|
||||
EgtCutSurfTmPlane( nSurfInt, ptC[i], -vtN[i], false, GDB_ID.ROOT)
|
||||
end
|
||||
local frSurfInt, dDimMax, dDimMin = EgtSurfTmFacetMinAreaRectangle( nSurfInt, 0, GDB_ID.ROOT)
|
||||
-- cerco la faccia con larghezza pari a dimensione massima della fessura
|
||||
local nLongIdFace = 0
|
||||
for i = 1, Proc.Fct do
|
||||
if abs( vtN[i] * frSurfInt:getVersX()) < 0.5 then
|
||||
nLongIdFace = i - 1
|
||||
break
|
||||
end
|
||||
end
|
||||
return dDimMin, dDimMax, dDepth, vtOrtho, nLongIdFace, nSurfInt
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetFaceAdj( Proc, nFacInd, dH, dV)
|
||||
|
||||
@@ -534,23 +486,6 @@ local function GetFaceAdj( Proc, nFacInd, dH, dV)
|
||||
return nFacAdj
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function CalcCollisionSafety( vtDir)
|
||||
local dCollSic = 10 * BD.COLL_SIC
|
||||
if abs( vtDir:getX()) > 0.999 or abs( vtDir:getY()) > 0.999 or abs( vtDir:getZ()) > 0.999 then
|
||||
dCollSic = 0
|
||||
elseif abs( vtDir:getX()) > 0.996 or abs( vtDir:getY()) > 0.996 or abs( vtDir:getZ()) > 0.996 then
|
||||
dCollSic = 1 * BD.COLL_SIC
|
||||
elseif abs( vtDir:getX()) > 0.89 or abs( vtDir:getY()) > 0.89 or abs( vtDir:getZ()) > 0.89 then
|
||||
dCollSic = 2.5 * BD.COLL_SIC
|
||||
elseif abs( vtDir:getX()) > 0.86 or abs( vtDir:getY()) > 0.86 or abs( vtDir:getZ()) > 0.86 then
|
||||
dCollSic = 4 * BD.COLL_SIC
|
||||
elseif abs( vtDir:getX()) > 0.707 or abs( vtDir:getY()) > 0.707 or abs( vtDir:getZ()) > 0.707 then
|
||||
dCollSic = 5.5 * BD.COLL_SIC
|
||||
end
|
||||
return dCollSic
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
||||
-- verifico siano una o due facce
|
||||
@@ -758,7 +693,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
||||
-- se facce formano un tunnel e sono ortogonali
|
||||
if bClosedOrthoFaces then
|
||||
-- ottengo le dimensioni del tunnel
|
||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||
EgtErase( nSurfInt)
|
||||
-- verifico se può essere fatto con svuotatura
|
||||
if VerifyPocket( Proc, dDimMin) then
|
||||
@@ -1323,165 +1258,6 @@ local function CheckToInvert( AuxId, bPositive)
|
||||
return false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint)
|
||||
|
||||
-- fondo tra loro le curve compatibili
|
||||
EgtMergeCurvesInCurveCompo( nPathInt)
|
||||
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
||||
local pLastPIni, pLastPEnd
|
||||
|
||||
-- faccio una copia della curva e la esplodo
|
||||
if nStartIdEnt then
|
||||
-- prendo i punti
|
||||
for i = 1, nNumEnt do
|
||||
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
||||
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
||||
-- Se normale lungo la Z considero il box in X e Y
|
||||
if abs(vtOrtho:getZ()) > 0.999 then
|
||||
-- se corrisponde a X
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Y
|
||||
elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- altrimenti se normale lungo la Y considero il box in X e Z
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then
|
||||
-- se corrisponde a X
|
||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Z
|
||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- caso che non dovrebbe mai capitare ma gestito per completezza
|
||||
-- altrimenti se normale lungo la X considero il box in Y e Z
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then
|
||||
-- se corrisponde a Y
|
||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
-- altrimenti se corrisponde a Z
|
||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
-- se asse Z orizzontale verifico se si avvicina piú a Y
|
||||
elseif abs(vtOrtho:getZ()) < 0.001 then
|
||||
if abs(vtOrtho:getY()) > 0.75 then
|
||||
-- se corrisponde a Z
|
||||
if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
end
|
||||
-- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+
|
||||
elseif abs(vtOrtho:getY()) < 0.001 then
|
||||
if abs(vtOrtho:getZ()) > 0.75 then
|
||||
-- se corrisponde a Y
|
||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||
-- setto l'entità open
|
||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||
if #sActInfo > 0 then
|
||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||
else
|
||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||
end
|
||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||
pLastPIni = pPini
|
||||
pLastPEnd = pPend
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se devo cambiare il punto di partenza
|
||||
if nStartPoint then
|
||||
if pLastPIni and pLastPEnd then
|
||||
-- calcolo il punto medio con gli ultimi punti utilizzati
|
||||
local ptPs = ( pLastPIni + pLastPEnd) / 2
|
||||
EgtChangeClosedCurveStartPoint( nPathInt, ptPs, GDB_RT.GLOB)
|
||||
-- se devo eliminare la parte open
|
||||
if nStartPoint == 2 then
|
||||
EgtRemoveCurveCompoCurve( nPathInt, true)
|
||||
EgtRemoveCurveCompoCurve( nPathInt, false)
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeRoundCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacInd, nAddGrpId, dDiam, bMillDown, bDoubleSide)
|
||||
@@ -1728,7 +1504,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
return false, sErr
|
||||
end
|
||||
-- distanza di sicurezza per evitare collisioni
|
||||
dCollSic = CalcCollisionSafety( vtN1)
|
||||
dCollSic = BL.CalcCollisionSafety( vtN1)
|
||||
-- elevazione massima della faccia
|
||||
dMaxElev = BL.GetFaceElevation( Proc.Id, nFacInd, nPartId)
|
||||
-- ciclo tutta la tabella
|
||||
@@ -1773,7 +1549,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFirstId = EgtCopyGlob( nPathInt, nAddGrpId)
|
||||
nNumId = 1
|
||||
-- distanza di sicurezza per evitare collisioni
|
||||
dCollSic = CalcCollisionSafety( vtOrtho)
|
||||
dCollSic = BL.CalcCollisionSafety( vtOrtho)
|
||||
-- calcolo elevazione dalla faccia trasversale aggiunta
|
||||
local dSurfIntElev = BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
|
||||
if bDoubleSide then
|
||||
@@ -1798,7 +1574,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
-- normale alla faccia aggiunta
|
||||
vtN1 = Vector3d( vtOrtho)
|
||||
-- imposto i lati aperti
|
||||
SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||
BL.SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||
end
|
||||
|
||||
-- se non trovato il percorso, esco
|
||||
@@ -2550,7 +2326,7 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
|
||||
if bIs3Faces then
|
||||
-- nAuxId1, _ = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId)
|
||||
-- EgtModifyCurveExtrusion( nAuxId1, vtOrtho, GDB_RT.GLOB)
|
||||
-- SetOpenSide( nAuxId1, vtOrtho, b3Solid, nAddGrpId, 1)
|
||||
-- BL.SetOpenSide( nAuxId1, vtOrtho, b3Solid, nAddGrpId, 1)
|
||||
-- nNumIdAux = 2
|
||||
|
||||
-- estraggo i percorsi
|
||||
@@ -2666,7 +2442,7 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
end
|
||||
if bOrthoFaces then
|
||||
-- ottengo le dimensioni del tunnel
|
||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||
end
|
||||
-- Recupero le facce adiacenti alla principale
|
||||
local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacInd)[1]
|
||||
@@ -2827,7 +2603,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
|
||||
if bOrthoFaces then
|
||||
-- ottengo le dimensioni del tunnel
|
||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||
-- verifico la direzione
|
||||
-- se devo inserire il chamfer
|
||||
if nChamfer > 0 then
|
||||
@@ -3217,7 +2993,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if bMadeASbyBld then
|
||||
sWarn = nil
|
||||
if abs(dExtraOffs) > 0 then
|
||||
if not bReduceDepth and abs(dExtraOffs) > 0 then
|
||||
sWarn = 'Warning : antisplint elevation is bigger than max tool depth'
|
||||
end
|
||||
end
|
||||
@@ -3319,8 +3095,10 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo
|
||||
end
|
||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||
local sWarn
|
||||
local dDepth = dElev
|
||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dElev)
|
||||
dDepth = dElev
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
dElev = dMaxDepth
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
@@ -3341,7 +3119,7 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
return true, sWarn, sTuuidPk, dDiamTool
|
||||
return true, sWarn, sTuuidPk, dDiamTool, dDepth
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -3545,7 +3323,7 @@ local function GetUShapeWidth( Proc, nFacInd)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders)
|
||||
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
||||
|
||||
local nFirstMachId
|
||||
local bOrthoFaces
|
||||
@@ -3553,6 +3331,8 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
local sMchFind = 'Pocket'
|
||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
||||
local bBadMach = false
|
||||
-- minima altezza della tasca sotto alla quale fa una contornatura invece di una svuotatura
|
||||
local dMinFaceElevForPocket = 20
|
||||
if sMchFindMaster and #sMchFindMaster > 0 then
|
||||
sMchFind = sMchFindMaster
|
||||
end
|
||||
@@ -3575,7 +3355,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
-- se è un tunnel verifico se è possibile usare la svuotatura
|
||||
if bOrthoFaces then
|
||||
-- ottengo le dimensioni del tunnel
|
||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||
-- se due facce posso utilizzare utensile con diametro doppio della dimensione minima
|
||||
if Proc.Fct == 2 then
|
||||
dDimMin = 2 * dDimMin
|
||||
@@ -3608,7 +3388,31 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
EgtInvertSurf( nSurfInt)
|
||||
end
|
||||
end
|
||||
if bMakePocket then
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
local bMakeContour = false
|
||||
local sMilling
|
||||
if dFacElev < dMinFaceElevForPocket and ( bIsU or bIsL) and ( Proc.Fct == 2 or Proc.Fct == 3) and abs( vtN:getZ()) > 0.996 then
|
||||
bMakeContour = true
|
||||
-- recupero la lavorazione di contornatura
|
||||
sMilling = ML.FindMilling( 'Prof', nil, nil, nil, nil, not bMillDown, bMillDown)
|
||||
if not sMilling then
|
||||
local sMyWarn = 'Warning : Prof not found in library'
|
||||
EgtOutLog( sMyWarn)
|
||||
return true, sMyWarn
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
dDiamTool = 50
|
||||
dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dToolMaxDepth
|
||||
end
|
||||
end
|
||||
end
|
||||
if bMakePocket or bMakeContour then
|
||||
-- gestione svuotatura da un solo lato o anche dal lato opposto (se non verticale)
|
||||
-- estraggo il contorno dalla superfice per evitare i problemi con la svuotatura
|
||||
-- e assegno l'estrusione
|
||||
@@ -3616,7 +3420,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB)
|
||||
-- se ho 3 facce oppure se forzato, ciclo sulle entià del percorso per segnare quelle che sono aperte.
|
||||
if bIs3Faces or bSetOpenBorders then
|
||||
SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
||||
BL.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
||||
end
|
||||
-- variabili per parametri lavorazione
|
||||
local dMachDepth
|
||||
@@ -3625,7 +3429,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
local bOneShot
|
||||
local bComplete = true
|
||||
-- imposto altezza aggiuntiva di elevazione
|
||||
local dCollSic = CalcCollisionSafety( vtOrtho)
|
||||
local dCollSic = BL.CalcCollisionSafety( vtOrtho)
|
||||
-- se possibile svuotare completamente da una sola parte
|
||||
if dMaxDepth > ( dDepth + BD.CUT_EXTRA + dCollSic) then
|
||||
dMachDepth = ( dDepth / 2) + BD.CUT_EXTRA
|
||||
@@ -3634,7 +3438,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
else
|
||||
-- se direzione verso la verticale setto max affondamento possibile ed
|
||||
-- emetto messaggio di warning perché non lavorabile interamente
|
||||
if abs( vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
||||
if abs( vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD and not bMakeContour then
|
||||
dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
|
||||
dElev = dMaxDepth
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
@@ -3669,29 +3473,49 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
local sErr = 'Impossible apply perpendicular pocketing: ' .. sPocketing
|
||||
return -2, sErr
|
||||
end
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||
EgtOutLog( sErr)
|
||||
return -1, sErr
|
||||
local sName
|
||||
local nMchFId
|
||||
if bMakeContour then
|
||||
-- inserisco la lavorazione di contornatura
|
||||
sName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
nMchFId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return -1, sErr
|
||||
end
|
||||
else
|
||||
-- altrimenti inserisco la lavorazione di svuotatura
|
||||
sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
nMchFId = EgtAddMachining( sName, sPocketing)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||
EgtOutLog( sErr)
|
||||
return -1, sErr
|
||||
end
|
||||
end
|
||||
-- prendo l'id della prima lavorazione inserita
|
||||
if not nFirstMachId then
|
||||
nFirstMachId = nMchFId
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
||||
if bMakeContour then
|
||||
-- aggiungo geometria per contornatura
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
|
||||
else
|
||||
-- altrimenti aggiungo geometria per svuotatura
|
||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
||||
end
|
||||
-- verifico se devo invertire direzione utensile (in caso di direzione verso la verticale)
|
||||
local bInvertMach
|
||||
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
bInvertMach = true
|
||||
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
|
||||
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
bInvertMach = true
|
||||
if not bMakeContour then
|
||||
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
bInvertMach = true
|
||||
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
|
||||
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
bInvertMach = true
|
||||
end
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
@@ -3712,11 +3536,50 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
end
|
||||
-- inverto il percorso di lavorazione per lavorare sinistro
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
if not bMakeContour then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
end
|
||||
-- imposto affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
||||
if not bMakeContour then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
||||
end
|
||||
-- se contornatura doppia anticipo la fine della lavorazione a metà trave
|
||||
if bMakeContour and bDoubleSide then
|
||||
EgtSetMachiningParam( MCH_MP.OFFSL, dDepth / 2)
|
||||
end
|
||||
-- se contornatura cerco la direzione di lavoro migliore e setto attacco e allungamenti
|
||||
if bMakeContour then
|
||||
local nFaceUse = BL.GetNearestParalOpposite( vtOrtho)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- quantità di cui allargare la contornatura per andare in tangenza con lo spigolo, nel caso di altezza tasca minore di D/2 fresa
|
||||
local dAddWorkWidth = EgtIf( dFacElev < dDiamTool / 2, -sqrt( dFacElev * dDiamTool - dFacElev * dFacElev), -dDiamTool / 2)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||
if bIsU then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
||||
elseif bIsL then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 30)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 30)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
||||
end
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
local sNotes = ''
|
||||
if not bMakeContour then
|
||||
sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
end
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
-- eseguo
|
||||
@@ -3759,20 +3622,36 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing))
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing)
|
||||
EgtOutLog( sErr)
|
||||
return -1, sErr
|
||||
if bMakeContour then
|
||||
-- inserisco la lavorazione di contornatura
|
||||
sName = 'ProfOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
nMchFId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return -1, sErr
|
||||
end
|
||||
else
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing))
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing)
|
||||
EgtOutLog( sErr)
|
||||
return -1, sErr
|
||||
end
|
||||
end
|
||||
-- prendo l'id della prima lavorazione inserita
|
||||
if not nFirstMachId then
|
||||
nFirstMachId = nMchFId
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
||||
if bMakeContour then
|
||||
-- aggiungo geometria per contornatura
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
|
||||
else
|
||||
-- altrimenti aggiungo geometria per svuotatura
|
||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
||||
end
|
||||
-- imposto direzione utensile opposta
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
-- imposto posizione braccio porta testa
|
||||
@@ -3794,11 +3673,49 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
end
|
||||
-- inverto il percorso di lavorazione per lavorare sinistro
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
-- imposo affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
-- imposto affondamento
|
||||
if not bMakeContour then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
||||
end
|
||||
-- se contornatura doppia anticipo la fine della lavorazione a metà trave
|
||||
if bMakeContour and bDoubleSide then
|
||||
EgtSetMachiningParam( MCH_MP.OFFSL, dDepth / 2)
|
||||
end
|
||||
-- se contornatura cerco la direzione di lavoro migliore
|
||||
if bMakeContour then
|
||||
local nFaceUse = BL.GetNearestParalOpposite( vtOrtho)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- quantità di cui allargare la contornatura per andare in tangenza con lo spigolo, nel caso di altezza tasca minore di D/2 fresa
|
||||
local dAddWorkWidth = EgtIf( dFacElev < dDiamTool / 2, -sqrt( dFacElev * dDiamTool - dFacElev * dFacElev), -dDiamTool / 2)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||
if bIsU then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
||||
elseif bIsL then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 30)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 30)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
||||
end
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
sNotes = ''
|
||||
if not bMakeContour then
|
||||
sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
end
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
-- eseguo
|
||||
@@ -3824,7 +3741,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
end
|
||||
if bPock3rd then
|
||||
-- recupero la distanza di sicurezza aggiuntiva
|
||||
local dFacCollSic = CalcCollisionSafety( vtN)
|
||||
local dFacCollSic = BL.CalcCollisionSafety( vtN)
|
||||
-- scelgo se lavorare da sotto
|
||||
local bFacPocketDn = ( bMakePocketDn and vtN:getZ() < -0.174)
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
@@ -4218,7 +4135,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
end
|
||||
-- prendo il primo versore
|
||||
_, vtN1 = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
dCollSic = CalcCollisionSafety( vtN1) or 0
|
||||
dCollSic = BL.CalcCollisionSafety( vtN1) or 0
|
||||
-- se direzione tende verso una delle alle 3 direzioni azzero l'altezza extra
|
||||
if abs( vtN1:getX()) > 0.7 or abs( vtN1:getY()) > 0.7 or abs( vtN1:getZ()) > 0.7 then dCollSic = 0 end
|
||||
|
||||
@@ -4275,7 +4192,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
-- alrimenti ho la faccia aggiunta
|
||||
else
|
||||
|
||||
dCollSic = CalcCollisionSafety( vtOrtho)
|
||||
dCollSic = BL.CalcCollisionSafety( vtOrtho)
|
||||
nFirstId = EgtCopyGlob( nPathInt, nAddGrpId)
|
||||
nNumId = 1
|
||||
-- calcolo elevazione dalla faccia trasversale aggiunta
|
||||
@@ -4299,7 +4216,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
end
|
||||
end
|
||||
vtN1 = Vector3d(vtOrtho)
|
||||
local bOkPath = SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||
local bOkPath = BL.SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||
-- se non ho un percorso chiuso estraggo i percorsi
|
||||
if bOkPath then
|
||||
-- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati
|
||||
@@ -4868,7 +4785,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- imposto altezza aggiuntiva di elevazione
|
||||
local dCollSic = CalcCollisionSafety( vtN)
|
||||
local dCollSic = BL.CalcCollisionSafety( vtN)
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259)
|
||||
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342)
|
||||
@@ -5135,7 +5052,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- se devo inserire il chamfer
|
||||
if ( ( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and nChamfer > 0 then
|
||||
-- ottengo le dimensioni dello pseudotunnel
|
||||
local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||
local _, _, _, vtOrtho, _, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||
if nOk < 0 then return false, sErr end
|
||||
end
|
||||
@@ -5149,13 +5066,16 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- 2021.07.16 Per poter eseguire antischeggia di lama su feature che non sono passanti da faccia a faccia
|
||||
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
|
||||
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
|
||||
-- non fa mai antischeggia di lama se la faccia è rivolta verso il basso, a meno che ci sia una testa sotto
|
||||
local bMadeASbyBld = false
|
||||
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
|
||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD) then
|
||||
local bOk
|
||||
local bSawDown = ( bMillDown and not bMillUp)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bSawDown, true)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
||||
if not bOk then return false, sWarn end
|
||||
end
|
||||
-- in base al flag interno e al numero di facce e se ha forma ad U
|
||||
@@ -5184,7 +5104,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
tvtNx[2] = vtN
|
||||
local ptPs = ptC
|
||||
dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd)
|
||||
dCollSic = CalcCollisionSafety( tvtNx[2])
|
||||
dCollSic = BL.CalcCollisionSafety( tvtNx[2])
|
||||
local dMachDepth = dFacElev + dCollSic
|
||||
local frFacRec, dFacDim1, dFacDim2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
-- limito il diametro utensile massimo a 100 per queste lavorazioni
|
||||
@@ -5225,7 +5145,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
||||
end
|
||||
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
||||
if not bOk then return false, sWarn2 end
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
@@ -5236,8 +5156,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide,
|
||||
vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth,
|
||||
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||
nil, nil, nil, b3Solid, dDepth,
|
||||
bOneShot, nFirstMachId)
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
@@ -5266,7 +5186,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
bSetOpenBorders = true
|
||||
end
|
||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
||||
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders)
|
||||
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
||||
if nOk == -2 then
|
||||
if not sMchFind then
|
||||
sMchFind = sMchFindBackUp
|
||||
@@ -5286,10 +5206,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
sWarn = sErr
|
||||
-- se ho antischeggia con fresa le inserisco
|
||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
||||
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide,
|
||||
vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth,
|
||||
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||
nil, nil, nil, b3Solid, dFacElevOri,
|
||||
bOneShot, nFirstMachId)
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
@@ -5371,7 +5292,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- se devo inserire il chamfer
|
||||
if ( ( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and nChamfer > 0 then
|
||||
-- ottengo le dimensioni dello pseudotunnel
|
||||
local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||
local _, _, _, vtOrtho, _, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||
if nOk < 0 then return false, sErr end
|
||||
end
|
||||
@@ -5382,13 +5303,16 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- 2021.07.16 Per poter eseguire antischeggia di lama su feature che non sono passanti da faccia a faccia
|
||||
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
|
||||
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
|
||||
-- non fa mai antischeggia di lama se la faccia è rivolta verso il basso, a meno che ci sia una testa sotto
|
||||
local bMadeASbyBld = false
|
||||
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
|
||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD) then
|
||||
local bOk
|
||||
local bSawDown = ( bMillDown and not bMillUp)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bSawDown)
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
||||
if not bOk then return false, sWarn end
|
||||
end
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
@@ -5627,7 +5551,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- in base al tipo di feature attribuisco il significato dei parametri Q
|
||||
AssignQIdent( Proc)
|
||||
-- se non forzate frese, uso la lama
|
||||
local bUseBlade = EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1
|
||||
local bUseBlade = EgtIf( Proc.Prc == 90, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1)
|
||||
local nForceUseBladeOnNotContinueFace
|
||||
-- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature
|
||||
if bUseBlade then
|
||||
@@ -5754,6 +5678,9 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- se piccola, con fresa
|
||||
if not bUseBlade and ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then
|
||||
return MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
-- se è una spianatura a una faccia richiamo la LongCut
|
||||
elseif Proc.Prc == 90 then
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- altrimenti, con lama
|
||||
else
|
||||
return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
@@ -5798,7 +5725,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local nChamfer, dDepthCham, sErrCham = EvaluateQParam( Proc)
|
||||
-- se smusso da fare
|
||||
if nChamfer > 0 then
|
||||
local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||
local _, _, _, vtOrtho, _, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||
if nOk < 0 then return false, sErr end
|
||||
end
|
||||
|
||||
@@ -323,8 +323,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( 'ptC=' .. tostring( ptC) ..' vtN=' .. tostring( vtN), 3)
|
||||
-- Se mortasa chiusa
|
||||
if not bOpenBtm then
|
||||
-- verifico che la mortasa non sia orientata verso il basso (limite -5 deg) o che ci sia una testa da sotto o un rinvio angolare
|
||||
if vtN:getZ() < -0.1 and not BD.DOWN_HEAD and not BD.ANG_TRASM then
|
||||
-- verifico che la mortasa non sia orientata verso il basso (limite -5 deg) o che ci sia una testa da sotto o un rinvio angolare o macchina Turn
|
||||
if vtN:getZ() < -0.1 and not BD.DOWN_HEAD and not BD.ANG_TRASM and not BD.TURN then
|
||||
local sErr = 'Error : Mortise from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
|
||||
@@ -440,7 +440,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local sMillingDown
|
||||
if bDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
sMillingDown = ML.FindMilling( 'Prof_H2', nil, nil, nil, nil, false, true)
|
||||
if not sMillingDown then
|
||||
@@ -448,7 +448,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sWarn)
|
||||
bDouble = false
|
||||
end
|
||||
else
|
||||
elseif not BD.TURN then
|
||||
sWarn = 'Warning in profiling : depth (' .. EgtNumToString( dProfDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dToolMaxDepth, 1) .. ')'
|
||||
EgtOutLog( sWarn)
|
||||
bDouble = false
|
||||
@@ -489,7 +489,9 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- imposto l'affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
local dOriOffset = 0
|
||||
@@ -588,7 +590,9 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
local dOriOffset = 0
|
||||
@@ -633,7 +637,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se parametro Q disabilitato, e consentito anche in alcuni casi lavorarlo con la feature da sotto
|
||||
-- inserisco eventuale finitura faccia finale (ortogonale alla trave o, se da sotto, parallela)
|
||||
if EgtGetInfo( Proc.Id, sEnableExtraMillUpperFace, 'i') ~= 1 and bLastTrim and
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD))) then
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD or BD.TURN))) then
|
||||
sName = 'ProfV_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchVId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchVId then
|
||||
@@ -659,6 +663,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -669,7 +674,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se parametro Q disabilitato, e consentito anche in alcuni casi lavorarlo con la feature da sotto
|
||||
-- inserisco eventuale finitura faccia finale (ortogonale alla trave o, se da sotto, parallela)
|
||||
if EgtGetInfo( Proc.Id, sEnableExtraMillUpperFace, 'i') ~= 1 and bFirstTrim and
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD))) then
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD or BD.TURN))) then
|
||||
sName = 'ProfV2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchV2Id = EgtAddMachining( sName, sMilling)
|
||||
if not nMchV2Id then
|
||||
@@ -692,6 +697,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -440,7 +440,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local sMillingDown
|
||||
if bDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
sMillingDown = ML.FindMilling( 'Prof_H2', nil, nil, nil, nil, false, true)
|
||||
if not sMillingDown then
|
||||
@@ -448,7 +448,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sWarn)
|
||||
bDouble = false
|
||||
end
|
||||
else
|
||||
elseif not BD.TURN then
|
||||
sWarn = 'Warning in profiling : depth (' .. EgtNumToString( dProfDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dToolMaxDepth, 1) .. ')'
|
||||
EgtOutLog( sWarn)
|
||||
bDouble = false
|
||||
@@ -489,7 +489,9 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- imposto l'affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
local dOriOffset = 0
|
||||
@@ -588,7 +590,9 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local bFinish
|
||||
local dOriOffset = 0
|
||||
@@ -633,7 +637,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se parametro Q disabilitato, e consentito anche in alcuni casi lavorarlo con la feature da sotto
|
||||
-- inserisco eventuale finitura faccia finale (ortogonale alla trave o, se da sotto, parallela)
|
||||
if EgtGetInfo( Proc.Id, sEnableExtraMillUpperFace, 'i') ~= 1 and bLastTrim and
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD))) then
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD or BD.TURN))) then
|
||||
sName = 'ProfV_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchVId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchVId then
|
||||
@@ -659,6 +663,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -669,7 +674,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se parametro Q disabilitato, e consentito anche in alcuni casi lavorarlo con la feature da sotto
|
||||
-- inserisco eventuale finitura faccia finale (ortogonale alla trave o, se da sotto, parallela)
|
||||
if EgtGetInfo( Proc.Id, sEnableExtraMillUpperFace, 'i') ~= 1 and bFirstTrim and
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD))) then
|
||||
( nSide ~= -1 or ( nSide == -1 and ( EgtGetInfo( Proc.Id, sMachFacesUnderneath, 'i') == 1 or BD.DOWN_HEAD or BD.TURN))) then
|
||||
sName = 'ProfV2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchV2Id = EgtAddMachining( sName, sMilling)
|
||||
if not nMchV2Id then
|
||||
@@ -692,6 +697,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -701,12 +707,13 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- aggiorno ingombro testa o coda per presa
|
||||
if nSide ~= 1 then
|
||||
if nSide ~= 1 then -- se feature di fianco o da sotto
|
||||
if bHead then
|
||||
BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMin():getX())
|
||||
else
|
||||
BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX())
|
||||
end
|
||||
-- altrimenti feature da sopra
|
||||
else
|
||||
if bHead then
|
||||
BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMax():getX())
|
||||
|
||||
@@ -500,20 +500,20 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
if abs( vtRef:getZ()) > 0.1 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
||||
dHCI = 0.75 * dHCI
|
||||
else
|
||||
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
end
|
||||
dHCI = 0.75 * dHCI
|
||||
BL.UpdateHCING( nRawId, dHCI)
|
||||
elseif Proc.Tail then
|
||||
local dTCI = 0
|
||||
if abs( vtRef:getZ()) > 0.1 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
||||
dTCI = 0.75 * dTCI
|
||||
else
|
||||
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
end
|
||||
dTCI = 0.75 * dTCI
|
||||
BL.UpdateTCING( nRawId, dTCI)
|
||||
end
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make.
|
||||
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessSplit = {}
|
||||
@@ -428,7 +429,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
@@ -464,11 +465,14 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dAccStart = 0
|
||||
-- limiti da sotto
|
||||
local dVzLimDwnUp
|
||||
if BD.TURN then dVzLimDwnUp = -2 end
|
||||
-- eseguo i tagli da sotto necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- eseguo i tagli da sopra necessari
|
||||
@@ -480,7 +484,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
else
|
||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -46,7 +46,7 @@ function ProcessText.Make( Proc, nPhase, nRawId, nPartId)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico che il testo non sia orientato verso il basso (-5 deg)
|
||||
if vtN:getZ() < - 0.1 and not BD.DOWN_HEAD then
|
||||
if vtN:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.TURN then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Text from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
|
||||
Reference in New Issue
Block a user