Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad8a7bf73f | |||
| 4a21a4be36 | |||
| aafe565474 | |||
| b6ef0a8d7a | |||
| 779f2105ba | |||
| c2b9c4b19f | |||
| 8eadb81e91 | |||
| 2bac228fe9 | |||
| c312e72fd2 | |||
| fd4683e4fa | |||
| 70661aa3d2 | |||
| a82486e9fb | |||
| cd4a7d3b91 | |||
| 3764c58394 | |||
| e49b505fbe | |||
| 72c1eb81f3 | |||
| 037ac0d030 | |||
| f1b64b1496 | |||
| 69ab03f3ec | |||
| 3b86cd9633 | |||
| 56fc63d5ff | |||
| f27eeb9c3d | |||
| 5d603a57db | |||
| 6f45e63f11 | |||
| eb8c78b7b1 | |||
| 4eefdf0842 | |||
| b536c30a88 | |||
| 9a0ea2e431 | |||
| d61a47755c | |||
| c6b8b74f26 | |||
| 53cd49bed1 | |||
| 2f4a77c73e | |||
| 64a3f75b31 | |||
| 000358b6a6 | |||
| 6c16e7b70a | |||
| 1ae32451e5 | |||
| 4c68955ba2 | |||
| bf2742c6c7 |
+16
-2
@@ -59,9 +59,23 @@ end
|
||||
local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag
|
||||
EgtOutLog( sLog)
|
||||
|
||||
-- Cancello file di log specifico
|
||||
local sLogFile = EgtChangePathExtension( BEAM.FILE, '.txt')
|
||||
EgtEraseFile( sLogFile)
|
||||
-- in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check
|
||||
if BEAM.FLAG == 0 then
|
||||
local hLogFile = io.open( sLogFile, 'r')
|
||||
if hLogFile then
|
||||
for line in hLogFile:lines() do
|
||||
if EgtStartsWith( line, 'ERR') and tonumber( EgtSplitString( line, '=')[2] or 0) > 0 then
|
||||
BEAM.FLAG = 4
|
||||
break
|
||||
end
|
||||
end
|
||||
hLogFile:close()
|
||||
end
|
||||
end
|
||||
|
||||
-- Cancello file di log specifico
|
||||
EgtEraseFile( sLogFile)
|
||||
|
||||
-- Funzioni per scrittura su file di log specifico
|
||||
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
||||
|
||||
+16
-2
@@ -45,9 +45,23 @@ end
|
||||
local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag
|
||||
EgtOutLog( sLog)
|
||||
|
||||
-- Cancello file di log specifico
|
||||
local sLogFile = EgtChangePathExtension( BEAM.FILE, '.txt')
|
||||
EgtEraseFile( sLogFile)
|
||||
-- in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check
|
||||
if BEAM.FLAG == 0 then
|
||||
local hLogFile = io.open( sLogFile, 'r')
|
||||
if hLogFile then
|
||||
for line in hLogFile:lines() do
|
||||
if EgtStartsWith( line, 'ERR') and tonumber( EgtSplitString( line, '=')[2] or 0) > 0 then
|
||||
BEAM.FLAG = 4
|
||||
break
|
||||
end
|
||||
end
|
||||
hLogFile:close()
|
||||
end
|
||||
end
|
||||
|
||||
-- Cancello file di log specifico
|
||||
EgtEraseFile( sLogFile)
|
||||
|
||||
-- Funzioni per scrittura su file di log specifico
|
||||
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
|
||||
|
||||
+25
-6
@@ -835,13 +835,13 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if B2.AdvTail and ( not Split.Identify( B1) or not B1.Tail) then
|
||||
return true
|
||||
end
|
||||
-- se primo è foro e secondo è un ribasso, il foro va sempre prima a meno che il ribasso non sia di testa
|
||||
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and B2.PassedByHole and
|
||||
-- se primo è foro e secondo è un ribasso o tenone, il foro va sempre prima a meno che il ribasso non sia di testa
|
||||
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2) or Tenon.Identify(B2)) and B2.PassedByHole and
|
||||
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
||||
return true
|
||||
end
|
||||
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo a meno che il ribasso non sia di testa
|
||||
if ( LapJoint.Identify(B1) or Mortise.Identify(B1))and B1.PassedByHole and Drill.Identify(B2) and
|
||||
-- se primo è un ribasso e secondo è un foro o tenone, il ribasso va sempre dopo a meno che il ribasso non sia di testa
|
||||
if ( LapJoint.Identify(B1) or Mortise.Identify(B1) or Tenon.Identify(B1)) and B1.PassedByHole and Drill.Identify(B2) and
|
||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||
return false
|
||||
end
|
||||
@@ -1221,7 +1221,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
||||
bOk, bDown, bSide = ProfHead.Classify( Proc, b3Raw)
|
||||
-- se contorno libero
|
||||
elseif FreeContour.Identify( Proc) then
|
||||
bOk, bDown, bSide = FreeContour.Classify( Proc, b3Raw)
|
||||
bOk, bDown, bSide, bDownSideOnHeadOk = FreeContour.Classify( Proc, b3Raw)
|
||||
-- se decorazione
|
||||
elseif Decor.Identify( Proc) then
|
||||
bOk, bDown = Decor.Classify( Proc)
|
||||
@@ -1231,7 +1231,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
||||
end
|
||||
-- assegno risultato
|
||||
if bOk then
|
||||
-- non ammessa feature di testa da lavorare ribaltata o ruotata
|
||||
-- non ammessa feature di testa da lavorare ribaltata o ruotata (lettura laser)
|
||||
if Proc.Head and ( bDown or bSide) and not bDownSideOnHeadOk then
|
||||
Proc.Flg = 0
|
||||
Proc.Down = true
|
||||
@@ -2034,6 +2034,14 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
|
||||
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove') and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
Proc.PassedByDtMortise = true
|
||||
end
|
||||
-- se tenone è attraversato da foro allora il foro deve essere fatto prima
|
||||
if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
Proc.PassedByHole = true
|
||||
end
|
||||
-- se tenone di coda è attraversato da foro allora anche il foro deve essere di coda
|
||||
if Tenon.Identify( Proc) and Proc.Tail and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
ProcB.Tail = true
|
||||
end
|
||||
-- verifiche per specchiature
|
||||
if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then
|
||||
-- forature
|
||||
@@ -2107,6 +2115,17 @@ function BeamExec.ProcessFeatures()
|
||||
PrintFeatures( vProc, b3Raw)
|
||||
end
|
||||
EgtOutLog( ' *** AddMachinings ***', 1)
|
||||
-- scrivo nel RawPart se ci sono feature lavorate con trave ruotata a 90 o 180 deg
|
||||
if bSomeSide then
|
||||
EgtSetInfo( nRawId, 'ROTATE90', 1)
|
||||
else
|
||||
EgtSetInfo( nRawId, 'ROTATE90', 0)
|
||||
end
|
||||
if bSomeDown then
|
||||
EgtSetInfo( nRawId, 'ROTATE180', 1)
|
||||
else
|
||||
EgtSetInfo( nRawId, 'ROTATE180', 0)
|
||||
end
|
||||
-- verifico se comunque necessario taglio di testa
|
||||
local bNeedHCut = VerifyNeedForHeadCut( vProc, bSomeDown, bSomeSide)
|
||||
-- inserisco corrispondenze di tagli coincidenti con mortase normali o a coda di rondine di testa
|
||||
|
||||
@@ -1239,6 +1239,40 @@ function BeamLib.GetFacetsInfo( Proc, b3Raw)
|
||||
return Face
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetEdgesInfo( Proc, Face)
|
||||
local Edges = {}
|
||||
local nFaceType, vEdges = EgtSurfTmGetFacetOutlineInfo( Proc.Id, Face.Id, GDB_ID.ROOT)
|
||||
|
||||
if nFaceType < 1 then
|
||||
for j = 1, #vEdges do
|
||||
local nPreviousEdgeIndex = j - 1
|
||||
if j == 1 then
|
||||
nPreviousEdgeIndex = #vEdges
|
||||
end
|
||||
local nNextEdgeIndex = j + 1
|
||||
if j == #vEdges then
|
||||
nNextEdgeIndex = 1
|
||||
end
|
||||
|
||||
local CurrentEdge = {}
|
||||
CurrentEdge.AdjacentFaceId = vEdges[j].Adj
|
||||
CurrentEdge.ToolDirection = Vector3d( vEdges[j].Norm)
|
||||
CurrentEdge.Length = vEdges[j].Len
|
||||
CurrentEdge.Elevation = vEdges[j].Elev
|
||||
CurrentEdge.IsOpen = vEdges[j].Open
|
||||
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
|
||||
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
|
||||
|
||||
table.insert( Edges, CurrentEdge)
|
||||
end
|
||||
else
|
||||
error( 'Face with closed hole')
|
||||
end
|
||||
|
||||
return Edges
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
|
||||
function BeamLib.GetAdjacencyMatrix( Proc)
|
||||
|
||||
+14
-8
@@ -29,6 +29,7 @@
|
||||
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
||||
-- 2024/03/27 In MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST
|
||||
-- 2024/06/18 In MakeOne in caso di inversione del percorso, si scambia anche accorciamento start con end
|
||||
-- 2024/09/12 In MakeOne per settare il FaceUse si usa il versore nelle UserNotes
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FacesBySaw = {}
|
||||
@@ -232,8 +233,8 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
|
||||
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
|
||||
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
|
||||
-- linea o bilinea di lavorazione (qui uso nOrthoOpposite per ripetere esattamente il calcolo del Mach)
|
||||
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BL.GetVersRef( nOrthoOpposite), GDB_ID.ROOT)
|
||||
-- linea o bilinea di lavorazione
|
||||
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, vtOrthO, GDB_ID.ROOT)
|
||||
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
|
||||
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
|
||||
EgtOutLog( sWarn, 1)
|
||||
@@ -260,7 +261,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
nOrthoOpposite = nOrthoOppositeAlternative
|
||||
vtOrthO = vtOrthOAlternative
|
||||
-- avendo riassegnato la direzione di lavoro, i dati della linea vanno ricalcolati
|
||||
ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BL.GetVersRef( nOrthoOpposite), GDB_ID.ROOT)
|
||||
ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, vtOrthO, GDB_ID.ROOT)
|
||||
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
|
||||
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
|
||||
EgtOutLog( sWarn, 1)
|
||||
@@ -283,7 +284,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
if bInvert then
|
||||
ptP1, ptP2 = ptP2, ptP1
|
||||
vtV1, vtV2 = vtV2, vtV1
|
||||
dAccStart, dAccEnd = dAccEnd, dAccStart
|
||||
-- se l'inversione è forzata dall'esterno, anche gli accorciamenti che arrivano dall'esterno si prendono per buoni
|
||||
if bForceInvert == nil then
|
||||
dAccStart, dAccEnd = dAccEnd, dAccStart
|
||||
end
|
||||
end
|
||||
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
|
||||
local dAllStart = 0
|
||||
@@ -422,14 +426,14 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
local bLioTang
|
||||
local Ktp = 1.1
|
||||
if BD.KIOTP then Ktp = BD.KIOTP end
|
||||
if ( not bDownUp or abs( vtTg:getY()) > 0.5) and
|
||||
if ( bForceTangentLeadInOut or ( not bDownUp or abs( vtTg:getY()) > 0.5) and
|
||||
( not bDownHead or abs( vtTg:getZ()) < 0.51) and
|
||||
abs( vtTg:getX()) < 0.9848 and
|
||||
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5) and not bDownHead) or
|
||||
( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 300 and BD.C_SIMM and BD.MAX_HEIGHT > 450 and b3Box:getDimX() > BD.LEN_SHORT_PART) or
|
||||
( abs( vtTg:getZ()) < 0.51 and ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) or
|
||||
Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo) or
|
||||
( BD.TURN == 2 and vtRef:getZ() < -0.1)) then
|
||||
( BD.TURN == 2 and vtRef:getZ() < -0.1))) then
|
||||
if BD.TURN == 2 then
|
||||
if vtTg:getY() < -0.1 then
|
||||
bLioTang = 1
|
||||
@@ -512,6 +516,8 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
local sNoteVtFaceUse = 'VtFaceUse=' .. EgtNumToString( vtOrthO:getX(),3) .. ',' .. EgtNumToString( vtOrthO:getY(),3) .. ',' .. EgtNumToString( vtOrthO:getZ(),3) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteVtFaceUse)
|
||||
-- imposto posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto inversione e lato correzione
|
||||
@@ -603,8 +609,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
local bConvex = ( dAngT > 0)
|
||||
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg), oppure in testa o in coda e non troppo distanti dal grezzo esterno
|
||||
local bFaceOk = {}
|
||||
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or abs( vtN[1]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[1].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
||||
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or abs( vtN[2]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[2].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
||||
bFaceOk[1] = ( vtN[1]:getZ() >= ( BD.CUT_VZ_MIN or BD.NZ_MINB) or abs( vtN[1]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[1].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
||||
bFaceOk[2] = ( vtN[2]:getZ() >= ( BD.CUT_VZ_MIN or BD.NZ_MINB) or abs( vtN[2]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[2].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
||||
if not bDownHead and ( not bFaceOk[1] or not bFaceOk[2]) then
|
||||
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+13
-5
@@ -46,7 +46,14 @@ local ML = require( 'MachiningLib')
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
function ProcessCut.Identify( Proc)
|
||||
return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10)
|
||||
-- se richiesto si forza fresatura
|
||||
Proc.bForceMill = ( Proc.prc == 30 and ( ( EgtGetInfo( Proc.Id, 'Q07', 'd') or 0) == 1))
|
||||
|
||||
if Proc.bForceMill then
|
||||
return false
|
||||
else
|
||||
return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -254,7 +261,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione con testa da sopra
|
||||
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf)
|
||||
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, bForceTangentLeadInOut)
|
||||
-- ingombro del grezzo
|
||||
b3Raw = b3Raw or EgtGetRawPartBBox( nRawId)
|
||||
-- ingombro del pezzo
|
||||
@@ -581,7 +588,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
if ( i % 2 == 0) and ( Proc.Fct == 1) and bNoPerpCuts then
|
||||
vtOrthoOAlternative = - vtOrthoO
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut, nil, vtOrthoOAlternative)
|
||||
bForceTangentLeadInOut = bForceTangentLeadInOut and ( ( i % 2) ~= 0)
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut, bForceTangentLeadInOut, vtOrthoOAlternative)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
@@ -821,7 +829,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf)
|
||||
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf, bForceTangentLeadInOut)
|
||||
-- sovramateriale di coda
|
||||
dOvmTail = dOvmTail or BD.OVM_MID
|
||||
-- ingombro del grezzo
|
||||
@@ -860,7 +868,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
||||
local bNoDicing = false
|
||||
-- se taglio con testa da sopra
|
||||
if not bDownHead and not bDownTurn then
|
||||
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf)
|
||||
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, bForceTangentLeadInOut)
|
||||
bNoDicing = bNoDicing2
|
||||
if not bOk then return false, sErr end
|
||||
-- altrimenti taglio con testa da sotto
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
-- 2024/03/13 Aggiunta gestione Predrill
|
||||
-- 2024/03/18 Per Predrill corretta direzione estrusione per fori con direzione verso il basso
|
||||
-- 2024/09/04 Gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato
|
||||
-- 2024/09/10 In GetData corretta gestione modifica diametro foro
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDrill = {}
|
||||
@@ -102,9 +103,10 @@ function ProcessDrill.GetData( Proc, b3Raw)
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
-- verifico se foro da adattare
|
||||
if EgtExistsInfo( Proc.Id, 'DiamUser') then
|
||||
if AuxId then AuxId = AuxId + Proc.Id end
|
||||
if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then
|
||||
EgtModifyArcRadius( AuxId, BD.USER_HOLE_DIAM / 2)
|
||||
local nNewAuxId
|
||||
if AuxId then nNewAuxId = AuxId + Proc.Id end
|
||||
if AuxId and EgtGetType( nNewAuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then
|
||||
EgtModifyArcRadius( nNewAuxId, BD.USER_HOLE_DIAM / 2)
|
||||
end
|
||||
end
|
||||
-- recupero diametro e lunghezza
|
||||
|
||||
@@ -31,6 +31,8 @@ local Q_DEPTH_CHAMFER = 'Q02' -- d
|
||||
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
|
||||
local Q_ONLY_CHAMFER = 'Q00' -- i
|
||||
local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
|
||||
local Q_IGNORE_LASER_PROBLEMS = 'Q07'
|
||||
local Q_FORCE_CLAMPABLE_AREA = 'Q08'
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
@@ -99,6 +101,8 @@ end
|
||||
function ProcessFreeContour.Classify( Proc, b3Raw)
|
||||
-- verifico se di tipo pocket
|
||||
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
|
||||
-- verifico se forzata esecuzione anche se di testa e ribaltata o ruotata (lettura laser)
|
||||
local bDownSideOnHeadOk = ( EgtGetInfo( Proc.Id, Q_IGNORE_LASER_PROBLEMS, 'd') or 0) == 1
|
||||
-- recupero la curva associata
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
if not AuxId then return false end
|
||||
@@ -107,23 +111,23 @@ function ProcessFreeContour.Classify( Proc, b3Raw)
|
||||
-- se tasca
|
||||
if bPocket then
|
||||
local bDown = ( vtN:getZ() < - 0.5)
|
||||
return true, bDown, false
|
||||
return true, bDown, false, bDownSideOnHeadOk
|
||||
-- se altrimenti profilo orizzontale
|
||||
elseif abs( vtN:getZ()) < 0.5 then
|
||||
return true, false, false
|
||||
return true, false, false, bDownSideOnHeadOk
|
||||
-- se altrimenti profilo verticale che non interessa tutta la sezione
|
||||
elseif Proc.Box:getDimZ() < 0.9 * b3Raw:getDimZ() then
|
||||
local bDown = ( vtN:getZ() < - 0.5)
|
||||
return true, bDown, false
|
||||
return true, bDown, false, bDownSideOnHeadOk
|
||||
-- altrimenti è profilo verticale che interessa tutta la sezione
|
||||
else
|
||||
-- recupero la massima capacità di lavoro dell'utensile da utilizzare
|
||||
local sMilling, dMaxDepth = ML.FindMilling( 'FreeContour')
|
||||
if not sMilling then dMaxDepth = 0 end
|
||||
if Proc.Box:getDimZ() > dMaxDepth and BD.ROT90 then
|
||||
return true, false, true
|
||||
return true, false, true, bDownSideOnHeadOk
|
||||
else
|
||||
return true, false, false
|
||||
return true, false, false, bDownSideOnHeadOk
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -713,7 +717,13 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eventuale segnalazione ingombro di testa o coda
|
||||
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
|
||||
local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
|
||||
if Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ then
|
||||
local bRawPartHas90Rotation = ( ( EgtGetInfo( nRawId, 'ROTATE90', 'd') or 0) == 1)
|
||||
-- eventuale forzatura area feature pinzabile
|
||||
local bForceClampableArea = ( ( EgtGetInfo( Proc.Id, Q_FORCE_CLAMPABLE_AREA, 'd') or 0) == 1)
|
||||
-- se la feature è passante top/down oppure se è passante e si ruota di 90deg considero sempre non pinzabile; in alternativa si valuta in base all'ingombro
|
||||
if not bForceClampableArea and ( ( Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ) or
|
||||
( Proc.AffectedFaces.Top and Proc.AffectedFaces.Bottom and ( AreSameOrOppositeVectorApprox( vtExtr, Z_AX()))) or
|
||||
( Proc.AffectedFaces.Front and Proc.AffectedFaces.Back and bRawPartHas90Rotation)) then
|
||||
if Proc.Head then
|
||||
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
BL.UpdateHCING( nRawId, dOffs)
|
||||
@@ -722,6 +732,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
BL.UpdateTCING( nRawId, dOffs)
|
||||
end
|
||||
end
|
||||
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw)
|
||||
for j = nVerticalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
||||
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER
|
||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER and not BD.DOWN_HEAD
|
||||
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -252,7 +252,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCut
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- taglio verticale
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, '', b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, '', b3Raw, true)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
return true, sWarn
|
||||
@@ -290,7 +290,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCut
|
||||
if i == 1 and HeadCutType.sType =='Precut' then
|
||||
dCutOffset = dStartOffset
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
||||
@@ -494,7 +494,11 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
end
|
||||
-- tagli aggiuntivi non necessari
|
||||
else
|
||||
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true)
|
||||
local bForceTangentLeadInOut = false
|
||||
if BD.PRESS_ROLLER then
|
||||
bForceTangentLeadInOut = true
|
||||
end
|
||||
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nil, bForceTangentLeadInOut)
|
||||
end
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
+82
-47
@@ -155,18 +155,22 @@ local bTrySidePocketAtFirst = true
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
function ProcessLapJoint.Identify( Proc)
|
||||
return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or
|
||||
(( 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))
|
||||
if Proc.bForceMill then
|
||||
return true
|
||||
else
|
||||
return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or
|
||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or
|
||||
(( 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))
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -781,7 +785,7 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
||||
-- verifico se è in coda
|
||||
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
|
||||
if dEndDist > BD.MAX_DIST_HTFEA then
|
||||
if bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
|
||||
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
@@ -986,8 +990,11 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bUp, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.PARAL_RIGHT))
|
||||
end
|
||||
-- imposto lato di correzione
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
if not bUp then EgtSetMachiningParam( MCH_MP.INVERT, true) end
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
if not bUp then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
if vtN:getY() < GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
|
||||
@@ -3472,6 +3479,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
|
||||
local sMchFind = 'Pocket'
|
||||
local dAngLimit = 40
|
||||
local sWarn
|
||||
|
||||
-- se feature é larga come trave imposto openpocket
|
||||
if nDiffWidth == 0 then
|
||||
@@ -3485,6 +3493,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
-- calcolo l'angolo dalla verticale dall'angolo tra le due facce, perchè la feature potrebbe essere ruotata sulla Z locale della
|
||||
-- faccia principale e quindi la componente X del versore della faccia potrebbe dare un valore non coerente
|
||||
local dDiffFromSqAng = dAng + 90
|
||||
-- informazioni sul lato da lavorare
|
||||
local Edges = BL.GetEdgesInfo( Proc, Proc.Face[nSideFace + 1])
|
||||
local EdgeToMachine = {}
|
||||
for i = 1, #Edges do
|
||||
local CurrentEdge = Edges[i]
|
||||
if CurrentEdge.AdjacentFaceId == nBaseFace then
|
||||
EdgeToMachine = CurrentEdge
|
||||
end
|
||||
end
|
||||
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
||||
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
||||
-- applico la svuotatura
|
||||
@@ -3510,14 +3527,28 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nSideFace}})
|
||||
-- imposto uso faccia
|
||||
local nFaceUse = BL.GetNearestOrthoOpposite(tvtN[1])
|
||||
-- imposto vettore direzione e faceUse
|
||||
local vtFaceUse = EdgeToMachine.ToolDirection
|
||||
local sUserNotes = ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtFaceUse', EgtNumToString( vtFaceUse:getX(),3) .. ',' .. EgtNumToString( vtFaceUse:getY(),3) .. ',' .. EgtNumToString( vtFaceUse:getZ(),3))
|
||||
local nFaceUse = BL.GetNearestOrthoOpposite( vtFaceUse)
|
||||
-- aggiusto i parametri
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, 1)
|
||||
-- imposto allungamenti iniziale e finale
|
||||
if EdgeToMachine.IsStartOpen then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dDiamTool / 2)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dDiamTool / 2)
|
||||
end
|
||||
if EdgeToMachine.IsEndOpen then
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dDiamTool / 2)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dDiamTool / 2)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
if tvtN[2]:getY() < GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
|
||||
@@ -3525,9 +3556,9 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
-- 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)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
@@ -3547,36 +3578,27 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
bOpenStart = true
|
||||
bOpenEnd = true
|
||||
else
|
||||
local vAdj2 = EgtSurfTmFacetAdjacencies( Proc.Id, (nBaseFace))[1]
|
||||
for j = 1, #vAdj2 do
|
||||
if vAdj2[j] == (nSideFace) then
|
||||
-- Se non esiste faccia adiacente a lato precedente -> inizio aperto
|
||||
local i = EgtIf( j > 1, j - 1, #vAdj2)
|
||||
while vAdj2[i] == (nSideFace) do
|
||||
i = EgtIf( i > 1, i - 1, #vAdj2)
|
||||
end
|
||||
bOpenStart = ( vAdj2[i] < 0)
|
||||
-- Se non esiste faccia adiacente a lato successivo -> fine aperto
|
||||
local k = EgtIf( j < #vAdj2, j + 1, 1)
|
||||
while vAdj2[k] == (nSideFace) do
|
||||
k = EgtIf( k < #vAdj2, k + 1, 1)
|
||||
end
|
||||
bOpenEnd = ( vAdj2[k] < 0)
|
||||
end
|
||||
end
|
||||
bOpenStart = EdgeToMachine.IsStartOpen
|
||||
bOpenEnd = EdgeToMachine.IsEndOpen
|
||||
end
|
||||
local sMilling
|
||||
if nUseRoughTool > 0 then
|
||||
sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk)
|
||||
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
|
||||
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk) end
|
||||
else
|
||||
sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk)
|
||||
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut') end
|
||||
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk) end
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
sMilling = ML.FindMilling( 'LongSmallCut')
|
||||
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
else
|
||||
sWarn = 'Warning : lapjoint chamfer angle machined with different tool'
|
||||
end
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dTDiam = 50
|
||||
@@ -3602,7 +3624,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- sistemazione inversione del percorso
|
||||
local nWrkSide = EgtGetMachiningParam( MCH_MP.WORKSIDE)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, ( nWrkSide ~= MCH_MILL_WS.RIGHT))
|
||||
local bInvert = nWrkSide ~= MCH_MILL_WS.RIGHT
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
if bInvert then
|
||||
bOpenStart, bOpenEnd = bOpenEnd, bOpenStart
|
||||
end
|
||||
-- setto a 0 eventuali offset
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
-- calcolo elevazione per allungamenti attacchi con fianchi chiusi
|
||||
@@ -3625,7 +3651,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||
if bOpenEnd then
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||
end
|
||||
end
|
||||
end
|
||||
if bOpenEnd then
|
||||
@@ -3638,8 +3668,12 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||
if bOpenStart then
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eseguo
|
||||
@@ -3650,7 +3684,8 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
end
|
||||
end
|
||||
end
|
||||
return true
|
||||
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -7241,7 +7276,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 = EgtIf( Proc.Prc == 90, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1)
|
||||
local bUseBlade = EgtIf( Proc.Prc == 90 or Proc.bForceMill, 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
|
||||
|
||||
@@ -1393,7 +1393,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
if not Proc.MoveAfterSplit and not bEndFixed and not bConvex then
|
||||
if not Proc.bMoveAfterSplit and not bEndFixed and not bConvex then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
|
||||
@@ -209,7 +209,12 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
|
||||
else
|
||||
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
-- se feature inclinata, si va oltre ingombro del box. Si considera metà dell'ingombro della faccia inclinata
|
||||
if vtN[vFaceOrd[2]] and vtN[vFaceOrd[2]]:getZ() > 0 then
|
||||
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() - ( vtN[vFaceOrd[2]]:getZ() * b3Raw:getDimZ())
|
||||
else
|
||||
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
end
|
||||
end
|
||||
BL.UpdateHCING( nRawId, dHCI)
|
||||
elseif Proc.Tail then
|
||||
@@ -218,7 +223,12 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
|
||||
else
|
||||
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
-- se feature inclinata, si va oltre ingombro del box. Si considera metà dell'ingombro della faccia inclinata
|
||||
if vtN[vFaceOrd[2]] and vtN[vFaceOrd[2]]:getZ() > 0 then
|
||||
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX() - ( vtN[vFaceOrd[2]]:getZ() * b3Raw:getDimZ())
|
||||
else
|
||||
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
end
|
||||
end
|
||||
BL.UpdateTCING( nRawId, dTCI)
|
||||
end
|
||||
|
||||
@@ -196,28 +196,47 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
||||
end
|
||||
end
|
||||
|
||||
local dDiceFaceMaxH = 0
|
||||
local dDiceFaceMinH = GEO.INFINITO
|
||||
-- controllo per eseguire solo un taglio ottimizzato
|
||||
local bExecJustOneCut = false
|
||||
local dDiceFaceDim = GEO.INFINITO
|
||||
if ( i % 2) == 0 then
|
||||
for cont = 1, #vCuts[i] do
|
||||
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][cont], 0)
|
||||
dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH)
|
||||
-- calcolo lato orizzontale minore ipotizzando sia un trapezio
|
||||
local dDiceFaceH2 = ( 2 * EgtSurfArea( vCuts[i][cont]) ) / dDiceFaceV - dDiceFaceH
|
||||
dDiceFaceMinH = min( dDiceFaceMinH, dDiceFaceH2)
|
||||
-- se feature verso Z, si ammette anche lavorazione in doppio
|
||||
if AreSameVectorApprox( vtRef, Z_AX()) then
|
||||
if dMaxDepth * 2 > dDiceFaceH + BD.CUT_EXTRA then
|
||||
bExecJustOneCut = true
|
||||
dDiceFaceDim = dDiceFaceH
|
||||
break
|
||||
end
|
||||
elseif AreSameVectorApprox( vtRef, Y_AX()) or AreSameVectorApprox( vtRef, -Y_AX()) then
|
||||
if dMaxDepth > dDiceFaceV + BD.CUT_EXTRA then
|
||||
bExecJustOneCut = true
|
||||
dDiceFaceDim = dDiceFaceV
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se si può fare, faccio unico taglio parallelo
|
||||
if ( i % 2) == 0 and ( dMaxDepth > dDiceFaceMaxH - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN) then
|
||||
if bExecJustOneCut then
|
||||
local bDoubleCut = false
|
||||
local dCutExtra = BD.CUT_EXTRA
|
||||
if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then
|
||||
if dMaxDepth < dDiceFaceDim then
|
||||
bDoubleCut = true
|
||||
dCutExtra = - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN
|
||||
end
|
||||
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
|
||||
local nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
|
||||
if Proc.Tail then
|
||||
|
||||
local nFaceUseCut1, nFaceUseCut2
|
||||
-- se feature rivolta verso alto setto direzione taglio davanti e dietro
|
||||
if AreSameVectorApprox( vtRef, Z_AX()) then
|
||||
nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
|
||||
-- altrimenti taglio da sopra
|
||||
else
|
||||
nFaceUseCut2 = MCH_MILL_FU.ORTHO_DOWN
|
||||
end
|
||||
|
||||
if Proc.Tail and AreSameVectorApprox( vtRef, Z_AX()) then
|
||||
nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1
|
||||
end
|
||||
if bDoubleCut then
|
||||
|
||||
@@ -352,7 +352,7 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes)
|
||||
for j = nVerticalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
||||
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER
|
||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER and not BD.DOWN_HEAD
|
||||
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw, nil, nil, nil, bForceTangentLeadInOut)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -438,7 +438,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
|
||||
if i == 1 and TailCutType.sType ~= 'Precut' then
|
||||
sInfo = 'Cut'
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, sInfo, b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, sInfo, b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
return true, sWarn
|
||||
@@ -488,7 +488,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
|
||||
if i == nCuts and TailCutType.bHorizCut and BD.C_SIMM and not BD.DOWN_HEAD then
|
||||
sNotes = EgtSetValInNotes( sNotes, 'StartZmax', 2)
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
||||
@@ -766,7 +766,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
end
|
||||
-- tagli aggiuntivi non necessari
|
||||
else
|
||||
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT)
|
||||
local bForceTangentLeadInOut = false
|
||||
if BD.PRESS_ROLLER then
|
||||
bForceTangentLeadInOut = true
|
||||
end
|
||||
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nil, bForceTangentLeadInOut)
|
||||
end
|
||||
if sNotesFinal then
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ EgtEnableDebug( false)
|
||||
--NEST.MACHINE = 'Essetre-90480019_MW'
|
||||
--NEST.FLAG = 3
|
||||
|
||||
local sLog = ' +++ BeamNestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN["1"]
|
||||
local sLog = ' +++ BeamNestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN[1]
|
||||
EgtOutLog( sLog)
|
||||
|
||||
-- flag per abilitare statistiche in log
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.6j1 (10/10/2024)
|
||||
- Modif : se la macchina è tipo BlockHaus, i LapJoint vengono fatti prima del taglio di separazione
|
||||
- Modif : se tenone di coda è attraversato da foro allora anche il foro sarà di coda
|
||||
- Modif : migliorato ordinamento per tenoni con foro secante
|
||||
- Modif : in FreeContour migliorato pinzaggio
|
||||
- Modif : in LapJoint miglioramenti vari alla lavorazione delle facce oblique
|
||||
- Modif : In RidgeLap l'ingombro testa coda considera inclinazione feature per pinzaggio
|
||||
- Added : in FreeContour aggiunta Q08 per forzare come pinzabile l'area della feature e Q07 per ignorare possibili problemi di lettura laser
|
||||
- Added : in tagli aggiunta Q07 per forzare uso fresa
|
||||
|
||||
Versione 2.6i3 (08/10/2024)
|
||||
- Modif : In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio.
|
||||
|
||||
Versione 2.6i2 (13/09/2024)
|
||||
- Modif : in FacesBySaw si invertono gli accorciamenti solo se l'inversione del percorso non è forzata dall'esterno; adeguati HeadCut e Split
|
||||
- Modif : in nesting correzione in lettura array per cambio dll di lettura
|
||||
- Modif : in BatchProcess e New, in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check
|
||||
- Modif : in FacesBySaw per settare il FaceUse si usa il versore nelle UserNotes
|
||||
- Modif : in HeadCut, Split modifiche ai tagli aggiuntivi orizzontali e verticali; disattivati attacchi tangenziali per tagli aggiuntivi verticali in PF1250
|
||||
- Fixed : in ProcessDrill In GetData corretta gestione modifica diametro foro
|
||||
|
||||
Versione 2.6i1 (09/09/2024)
|
||||
- Added : refactoring e modifiche a HeadCut e Split per introduzione pretagli a zero sul grezzo, per evitare problemi con pezzi non lunghi quanto ci si aspetta
|
||||
- Added : in Mark, gestita la lavorazione del testo
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.6i1'
|
||||
VERSION = '2.6j1'
|
||||
MIN_EXE = '2.6e5'
|
||||
|
||||
Reference in New Issue
Block a user