Compare commits

...

9 Commits

Author SHA1 Message Date
luca.mazzoleni d91c31974e Feature/AddPlaningL090:
-implementata feature L090 (Planing), gestita come LapJoint
-in LapJoint implementata, in caso di fresatura di lato con altezza tasca molto bassa, la contornatura con unica passata
-migliorato il funzionamento di AntiSplint (Mill e Saw)
2022-09-15 12:56:02 +02:00
luca.mazzoleni a217b95c35 Feature/AddPlaningL090:
aggiunta gestione feature L090 con  parametri Q per antischeggia e forzatura lavorazione di lato
2022-09-09 16:37:46 +02:00
luca.mazzoleni 05aae0b8f3 Merge branch 'Improvement/Ticket#788' into develop 2022-09-08 12:42:51 +02:00
luca.mazzoleni 629dfc1341 Improvement/Ticket#788:
In HeadCut e Split migliorato verso di lavorazione in caso di doubleCut
2022-09-08 11:29:31 +02:00
luca.mazzoleni e9cb756dc9 Revert "Merge branch 'Improvement/Ticket#788' into develop"
This reverts commit 9b888a0a59, reversing
changes made to 7762692597.
2022-09-08 09:17:16 +02:00
luca.mazzoleni 9b888a0a59 Merge branch 'Improvement/Ticket#788' into develop 2022-09-07 18:32:06 +02:00
luca.mazzoleni b141a512bb Improvement/Ticket#788:
in Split migliore scelta del lato di lavorazione in base alla posizione di default della lama
2022-09-07 18:31:51 +02:00
luca.mazzoleni d13f108dad Improvement/Ticket#788:
in HeadCut migliore scelta del lato di lavorazione in base alla posizione di default della lama
2022-09-07 14:57:19 +02:00
luca.mazzoleni 7762692597 Merge branch 'Refactoring/MoveSomeFunctionsToBeamLib' into develop 2022-09-01 16:17:51 +02:00
4 changed files with 217 additions and 53 deletions
+6 -2
View File
@@ -12,6 +12,7 @@
-- 2021/11/26 DS Spostate qui MakeOneFaceBySaw (ora MakeOne), CalcLeadInOutPerpGeom e CalcLeadInOutTangGeom. -- 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/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/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 -- Tabella per definizione modulo
local FacesBySaw = {} local FacesBySaw = {}
@@ -28,7 +29,7 @@ local BD = require( 'BeamData')
local ML = require( 'MachiningLib') 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 -- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
-- risolvo parametro ambiguo -- risolvo parametro ambiguo
@@ -51,7 +52,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
return true, '' return true, ''
end end
vtV1 = - vtV1 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 if bInvert then
ptP1, ptP2 = ptP2, ptP1 ptP1, ptP2 = ptP2, ptP1
vtV1, vtV2 = vtV2, vtV1 vtV1, vtV2 = vtV2, vtV1
+2 -1
View File
@@ -3,6 +3,7 @@
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio di tipo diceCut. -- 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/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/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 -- Tabella per definizione modulo
local ProcessHeadCut = {} local ProcessHeadCut = {}
@@ -251,7 +252,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
if bDoubleCut then if bDoubleCut then
for i = nCuts, 1, -1 do for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL 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 if not bOk then return false, sErr end
end end
end end
+207 -49
View File
@@ -51,6 +51,9 @@
-- 2022/07/12 In MakeByChainOrSaw aggiunto check per feature L20 usata in modo improprio e, nel caso, si passa a una lavorazione tasca. -- 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/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/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 -- Tabella per definizione modulo
local ProcessLapJoint = {} local ProcessLapJoint = {}
@@ -101,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 == 32) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) 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 == 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 == 37) or
( Proc.Grp == 4 and Proc.Prc == 39) or ( Proc.Grp == 4 and Proc.Prc == 39) or
( Proc.Grp == 4 and Proc.Prc == 120)) ( Proc.Grp == 4 and Proc.Prc == 120))
@@ -158,6 +162,9 @@ local function AssignQIdent( Proc)
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
Q_USE_MILL = 'Q02' -- i Q_USE_MILL = 'Q02' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- 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 end
-- le altre features gestite non hanno parametri Q -- le altre features gestite non hanno parametri Q
end end
@@ -2986,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) 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 if bMadeASbyBld then
sWarn = nil 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' sWarn = 'Warning : antisplint elevation is bigger than max tool depth'
end end
end end
@@ -3088,8 +3095,10 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo
end end
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente -- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
local sWarn local sWarn
local dDepth = dElev
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dElev) dDepth = dElev
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
dElev = dMaxDepth dElev = dMaxDepth
sWarn = 'Warning : elevation bigger than max tool depth' sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn) EgtOutLog( sWarn)
@@ -3110,7 +3119,7 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo
return false, sErr return false, sErr
end end
end end
return true, sWarn, sTuuidPk, dDiamTool return true, sWarn, sTuuidPk, dDiamTool, dDepth
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -3314,7 +3323,7 @@ local function GetUShapeWidth( Proc, nFacInd)
end 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 nFirstMachId
local bOrthoFaces local bOrthoFaces
@@ -3322,6 +3331,8 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
local sMchFind = 'Pocket' local sMchFind = 'Pocket'
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
local bBadMach = false 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 if sMchFindMaster and #sMchFindMaster > 0 then
sMchFind = sMchFindMaster sMchFind = sMchFindMaster
end end
@@ -3377,7 +3388,31 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
EgtInvertSurf( nSurfInt) EgtInvertSurf( nSurfInt)
end end
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) -- 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 -- estraggo il contorno dalla superfice per evitare i problemi con la svuotatura
-- e assegno l'estrusione -- e assegno l'estrusione
@@ -3403,7 +3438,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
else else
-- se direzione verso la verticale setto max affondamento possibile ed -- se direzione verso la verticale setto max affondamento possibile ed
-- emetto messaggio di warning perché non lavorabile interamente -- 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 dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
dElev = dMaxDepth dElev = dMaxDepth
sWarn = 'Warning : elevation bigger than max tool depth' sWarn = 'Warning : elevation bigger than max tool depth'
@@ -3438,29 +3473,49 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
local sErr = 'Impossible apply perpendicular pocketing: ' .. sPocketing local sErr = 'Impossible apply perpendicular pocketing: ' .. sPocketing
return -2, sErr return -2, sErr
end end
-- inserisco la lavorazione di svuotatura local sName
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local nMchFId
local nMchFId = EgtAddMachining( sName, sPocketing) if bMakeContour then
if not nMchFId then -- inserisco la lavorazione di contornatura
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing sName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
EgtOutLog( sErr) nMchFId = EgtAddMachining( sName, sMilling)
return -1, sErr 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 end
-- prendo l'id della prima lavorazione inserita -- prendo l'id della prima lavorazione inserita
if not nFirstMachId then if not nFirstMachId then
nFirstMachId = nMchFId nFirstMachId = nMchFId
end end
-- aggiungo geometria if bMakeContour then
EgtSetMachiningGeometry( {{ nPathInt, -1}}) -- 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) -- verifico se devo invertire direzione utensile (in caso di direzione verso la verticale)
local bInvertMach local bInvertMach
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then if not bMakeContour then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
bInvertMach = true EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti bInvertMach = true
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then -- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
bInvertMach = true EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
bInvertMach = true
end
end end
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
@@ -3481,11 +3536,50 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN) EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
end end
-- inverto il percorso di lavorazione per lavorare sinistro -- 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 -- 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 -- 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;' sNotes = sNotes .. 'VMRS=0;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
-- eseguo -- eseguo
@@ -3528,20 +3622,36 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
EgtOutLog( sWarn) EgtOutLog( sWarn)
end end
end end
-- inserisco la lavorazione di svuotatura if bMakeContour then
local sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) -- inserisco la lavorazione di contornatura
local nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing)) sName = 'ProfOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
if not nMchFId then nMchFId = EgtAddMachining( sName, sMilling)
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing) if not nMchFId then
EgtOutLog( sErr) local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
return -1, sErr 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 end
-- prendo l'id della prima lavorazione inserita -- prendo l'id della prima lavorazione inserita
if not nFirstMachId then if not nFirstMachId then
nFirstMachId = nMchFId nFirstMachId = nMchFId
end end
-- aggiungo geometria if bMakeContour then
EgtSetMachiningGeometry( {{ nPathInt, -1}}) -- aggiungo geometria per contornatura
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
else
-- altrimenti aggiungo geometria per svuotatura
EgtSetMachiningGeometry( {{ nPathInt, -1}})
end
-- imposto direzione utensile opposta -- imposto direzione utensile opposta
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
@@ -3563,11 +3673,49 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN) EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
end end
-- inverto il percorso di lavorazione per lavorare sinistro -- inverto il percorso di lavorazione per lavorare sinistro
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
-- imposo affondamento -- 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
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 -- 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;' sNotes = sNotes .. 'VMRS=0;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
-- eseguo -- eseguo
@@ -4918,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 -- 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: -- 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 -- 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 bMadeASbyBld = false
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1) 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()) 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 bOk
local bSawDown = ( bMillDown and not bMillUp) 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 if not bOk then return false, sWarn end
end end
-- in base al flag interno e al numero di facce e se ha forma ad U -- in base al flag interno e al numero di facce e se ha forma ad U
@@ -4994,7 +5145,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam) dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
end end
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind) 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 not bOk then return false, sWarn2 end
if sWarn2 then if sWarn2 then
if not sWarn then sWarn = '' end if not sWarn then sWarn = '' end
@@ -5005,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 and ( bIsU or bIsL) then
if nChamfer < 2 and nQAntisplintResult == 2 then if nChamfer < 2 and nQAntisplintResult == 2 then
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw, local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide, nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth, nil, nil, nil, b3Solid, dDepth,
bOneShot, nFirstMachId) bOneShot, nFirstMachId)
if sWarn2 then if sWarn2 then
if not sWarn then sWarn = '' end if not sWarn then sWarn = '' end
@@ -5035,7 +5186,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
bSetOpenBorders = true bSetOpenBorders = true
end end
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, 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 nOk == -2 then
if not sMchFind then if not sMchFind then
sMchFind = sMchFindBackUp sMchFind = sMchFindBackUp
@@ -5055,10 +5206,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
sWarn = sErr sWarn = sErr
-- se ho antischeggia con fresa le inserisco -- se ho antischeggia con fresa le inserisco
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then -- 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 if nChamfer < 2 and nQAntisplintResult == 2 then
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw, local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide, nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth, nil, nil, nil, b3Solid, dFacElevOri,
bOneShot, nFirstMachId) bOneShot, nFirstMachId)
if sWarn2 then if sWarn2 then
if not sWarn then sWarn = '' end if not sWarn then sWarn = '' end
@@ -5151,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 -- 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: -- 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 -- 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 bMadeASbyBld = false
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1) 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()) 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 bOk
local bSawDown = ( bMillDown and not bMillUp) 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 if not bOk then return false, sWarn end
end end
if nChamfer < 2 and nQAntisplintResult == 2 then if nChamfer < 2 and nQAntisplintResult == 2 then
@@ -5396,7 +5551,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- in base al tipo di feature attribuisco il significato dei parametri Q -- in base al tipo di feature attribuisco il significato dei parametri Q
AssignQIdent( Proc) AssignQIdent( Proc)
-- se non forzate frese, uso la lama -- 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 local nForceUseBladeOnNotContinueFace
-- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature -- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature
if bUseBlade then if bUseBlade then
@@ -5523,6 +5678,9 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se piccola, con fresa -- 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 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) 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 -- altrimenti, con lama
else else
return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
+2 -1
View File
@@ -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/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/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/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 -- Tabella per definizione modulo
local ProcessSplit = {} local ProcessSplit = {}
@@ -428,7 +429,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
for i = nCuts, 1, -1 do for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL local dCutOffset = ( i - 1) * dOffsL
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;') 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 if not bOk then return false, sErr end
end end
end end