Compare commits
74 Commits
2.6f1
...
Ticket#1985
| Author | SHA1 | Date | |
|---|---|---|---|
| 4685b6bde6 | |||
| 3a063bd2cf | |||
| 710a1fe070 | |||
| d818492d67 | |||
| e55e33c40a | |||
| 8cadb25261 | |||
| 2622b58cad | |||
| b5be932955 | |||
| 44ac2f8c2a | |||
| 0b928e987f | |||
| c213c3f059 | |||
| 330698b6aa | |||
| eb1ef693c4 | |||
| 862751c84a | |||
| e5a30c38d3 | |||
| e83d8db1cc | |||
| 9de88ffe84 | |||
| ffaf33c62e | |||
| 8c0389582b | |||
| ebe3d79c11 | |||
| f8c40739da | |||
| fa5aac926e | |||
| 749cd1e2bb | |||
| 587aaaafce | |||
| 2cfa7caba7 | |||
| fc0fba5bd3 | |||
| 94159f88f3 | |||
| 4961d2d528 | |||
| 7b22f5cc47 | |||
| 5047d5b652 | |||
| 7f9b880ff7 | |||
| 7e457a22b0 | |||
| 3c080e2b1a | |||
| 9d3edbfb54 | |||
| adf465c5e2 | |||
| 23f695fd56 | |||
| 52f347def1 | |||
| 028688b88a | |||
| cde5b137ae | |||
| d0cf5887d3 | |||
| afc4c6aaff | |||
| caa1875309 | |||
| 2e2c2188ce | |||
| 0acd75bece | |||
| db691cefe4 | |||
| d0ecd175c2 | |||
| 7e6d4189ef | |||
| abbc200504 | |||
| 9e4597b739 | |||
| d84d146701 | |||
| 00ff8818da | |||
| d5c582f890 | |||
| bc8b0490b7 | |||
| 5aad9dcbf2 | |||
| 8a582f512f | |||
| 1fde2e5fec | |||
| 7a89501cc9 | |||
| 89acdcc8f8 | |||
| f7c082e5b1 | |||
| 938c46b9d8 | |||
| 917bf5ec4b | |||
| 27d4ab3309 | |||
| 0ece2d91f4 | |||
| e08b53d5cf | |||
| a330b2fd7f | |||
| acdd4e10fb | |||
| ee6afb65c1 | |||
| ea9db1631b | |||
| 6513e75408 | |||
| 0e7d878f10 | |||
| 8bd0e5d145 | |||
| d8ecfc8463 | |||
| e52a9c66b6 | |||
| f3785f8644 |
+3
-2
@@ -461,7 +461,7 @@ else
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
@@ -525,7 +525,8 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
|
||||
end
|
||||
|
||||
-- *** Genero programma CN *** ( se richiesto)
|
||||
if BEAM.FLAG == 0 or BEAM.FLAG == 4 then
|
||||
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
|
||||
if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then
|
||||
EgtOutLog( ' +++ Generating NC part program >>>')
|
||||
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
|
||||
if EgtGetExeVersion then
|
||||
|
||||
+3
-2
@@ -562,7 +562,7 @@ else
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
@@ -626,7 +626,8 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
|
||||
end
|
||||
|
||||
-- *** Genero programma CN *** ( se richiesto)
|
||||
if BEAM.FLAG == 0 or BEAM.FLAG == 4 then
|
||||
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
|
||||
if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then
|
||||
EgtOutLog( ' +++ Generating NC part program >>>')
|
||||
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
|
||||
if EgtGetExeVersion then
|
||||
|
||||
+48
-9
@@ -844,6 +844,16 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||
return false
|
||||
end
|
||||
-- se primo è ribasso e secondo è una mortasa a coda di rondine, il ribasso va sempre prima a meno che la mortasa a coda di rondine non sia di testa
|
||||
if LapJoint.Identify(B1) and B1.PassedByDtMortise and DtMortise.SideIdentify(B2) and
|
||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||
return true
|
||||
end
|
||||
-- se primo è mortasa a coda di rondine e secondo è ribasso, la mortasa a coda di rondine va sempre dopo a meno che la mortasa a coda di rondine non sia di testa
|
||||
if DtMortise.SideIdentify(B1) and LapJoint.Identify(B2) and B2.PassedByDtMortise and
|
||||
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
||||
return false
|
||||
end
|
||||
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
|
||||
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
|
||||
return false
|
||||
@@ -1275,6 +1285,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
|
||||
local bOk = true
|
||||
local sErr = ''
|
||||
local nNewPhase = -1
|
||||
local AddedIds
|
||||
EgtOutLog( ' * Process ' .. tostring( Proc.Id) .. ' *', 1)
|
||||
-- se intestatura ( 1-340-X )
|
||||
if Hcut.Identify( Proc) then
|
||||
@@ -1300,7 +1311,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
|
||||
elseif Long2Cut.Identify( Proc) then
|
||||
-- se due facce longitudinali, eseguo doppio taglio longitudinale
|
||||
if Long2Cut.GetLongFacesCount( Proc) == 2 then
|
||||
bOk, sErr = Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
bOk, sErr, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- altrimenti eseguo singolo taglio longitudinale
|
||||
else
|
||||
bOk, sErr = LongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
@@ -1318,7 +1329,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
|
||||
-- o se rivestimento ( 3/4-034-X) o se mezzolegno chalet ( 4-037-X) o se tasca ( 4-039-X) o se taglio triangolato ( 4-120-X)
|
||||
elseif LapJoint.Identify( Proc) then
|
||||
-- esecuzione mezzo-legno o scanalatura
|
||||
bOk, sErr = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
bOk, sErr, _, AddedIds = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se smusso ( 3/4-036-X)
|
||||
elseif Chamfer.Identify( Proc) then
|
||||
-- esecuzione smusso
|
||||
@@ -1423,7 +1434,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
|
||||
EgtOutLog( sErr)
|
||||
bOk = false
|
||||
end
|
||||
return bOk, sErr, ( nNewPhase or -1)
|
||||
return bOk, sErr, ( nNewPhase or -1), AddedIds
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -2002,6 +2013,10 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
|
||||
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove' or Mortise.Identify( Proc)) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
Proc.PassedByHole = true
|
||||
end
|
||||
-- verifico se feature tipo LapJoint è attraversata da almeno una mortasa a coda di rondine
|
||||
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
|
||||
-- verifiche per specchiature
|
||||
if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then
|
||||
-- forature
|
||||
@@ -2096,7 +2111,8 @@ function BeamExec.ProcessFeatures()
|
||||
-- flag feature precedente in doppio
|
||||
local nPrevDouble = 0
|
||||
-- inserisco le lavorazioni da lavorare ribaltate
|
||||
for i = 1, #vProc do
|
||||
local i = 1
|
||||
while i <= #vProc do
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and Proc.Down then
|
||||
@@ -2107,7 +2123,13 @@ function BeamExec.ProcessFeatures()
|
||||
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
|
||||
Proc.PrevDouble = nPrevDouble
|
||||
nPrevDouble = Proc.Double
|
||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||
local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||
-- lavorazioni da fare dopo separazione
|
||||
if AddedIds and #AddedIds > 0 then
|
||||
for j = 1, #AddedIds do
|
||||
table.insert( vProc, AddedIds[j])
|
||||
end
|
||||
end
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
@@ -2137,6 +2159,7 @@ function BeamExec.ProcessFeatures()
|
||||
EgtSetInfo( nDispId, 'ROT', -2)
|
||||
end
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
-- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard
|
||||
if not bSplitRot then
|
||||
@@ -2178,7 +2201,8 @@ function BeamExec.ProcessFeatures()
|
||||
local nPrevDouble = 0
|
||||
-- inserisco le lavorazioni da lavorare ruotate
|
||||
local nSideMchOk = 0
|
||||
for i = 1, #vProc do
|
||||
local i = 1
|
||||
while i <= #vProc do
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and Proc.Side then
|
||||
@@ -2189,7 +2213,13 @@ function BeamExec.ProcessFeatures()
|
||||
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
|
||||
Proc.PrevDouble = nPrevDouble
|
||||
nPrevDouble = Proc.Double
|
||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
||||
local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
||||
-- lavorazioni da fare dopo separazione
|
||||
if AddedIds and #AddedIds > 0 then
|
||||
for j = 1, #AddedIds do
|
||||
table.insert( vProc, AddedIds[j])
|
||||
end
|
||||
end
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
@@ -2222,6 +2252,7 @@ function BeamExec.ProcessFeatures()
|
||||
EgtSetInfo( nDispId, 'ROT', -1)
|
||||
end
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
-- se non sono state inserite lavorazioni di fianco, elimino la fase perchè inutile e dannosa
|
||||
if nSideMchOk == 0 then
|
||||
@@ -2248,7 +2279,8 @@ function BeamExec.ProcessFeatures()
|
||||
-- flag feature precedente in doppio
|
||||
local nPrevDouble = 0
|
||||
-- inserisco le lavorazioni non ribaltate della trave
|
||||
for i = 1, #vProc do
|
||||
local i = 1
|
||||
while i <= #vProc do
|
||||
-- creo la lavorazione
|
||||
local Proc = vProc[i]
|
||||
if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then
|
||||
@@ -2259,7 +2291,13 @@ function BeamExec.ProcessFeatures()
|
||||
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
|
||||
Proc.PrevDouble = nPrevDouble
|
||||
nPrevDouble = Proc.Double
|
||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||
local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||
-- lavorazioni da fare dopo separazione
|
||||
if AddedIds and #AddedIds > 0 then
|
||||
for j = 1, #AddedIds do
|
||||
table.insert( vProc, AddedIds[j])
|
||||
end
|
||||
end
|
||||
if not bOk then
|
||||
nTotErr = nTotErr + 1
|
||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
||||
@@ -2287,6 +2325,7 @@ function BeamExec.ProcessFeatures()
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
end
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
EgtOutLog( ' *** End AddMachinings ***', 1)
|
||||
-- passo al grezzo successivo
|
||||
|
||||
+8
-1
@@ -734,7 +734,9 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
if BD.C_SIMM then
|
||||
if BD.GetNzLimDownUp then
|
||||
return BD.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
elseif BD.C_SIMM then
|
||||
return -0.484
|
||||
elseif BD.TURN then
|
||||
return -2
|
||||
@@ -1186,6 +1188,11 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetFacetsInfo( Proc, b3Raw)
|
||||
|
||||
if Proc.Fct > 20 then
|
||||
return nil
|
||||
end
|
||||
|
||||
local Face = {}
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Proc.PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local vAdj
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
|
||||
-- se faccia non troppo lunga, con un lato piccolo e non diretta troppo verso il basso, non servono dice
|
||||
local dMaxLen = BD.MAX_LEN_DICE or 600
|
||||
if dLen < dMaxLen and dWidth < dMaxLen and
|
||||
( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and ( vtN:getZ() > dNzLimDwnUp or BD.DOWN_HEAD) then
|
||||
( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and vtN:getZ() > dNzLimDwnUp then
|
||||
return nil, nil, nil
|
||||
end
|
||||
|
||||
|
||||
+91
-35
@@ -28,6 +28,7 @@
|
||||
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
-- 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
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FacesBySaw = {}
|
||||
@@ -44,7 +45,7 @@ local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
|
||||
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
|
||||
EgtOutLog( 'FacesBySaw.MakeParallelOne', 3)
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
@@ -75,7 +76,7 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
|
||||
local bLioTang
|
||||
local Ktp = 1.1
|
||||
if BD.KIOTP then Ktp = BD.KIOTP end
|
||||
if Ktp * dLi2Tang < dLiPerp then
|
||||
if bForceTangentLeadInOut or ( Ktp * dLi2Tang < dLiPerp) then
|
||||
bLioTang = true
|
||||
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
|
||||
if BD.TURN then
|
||||
@@ -191,7 +192,7 @@ local function GetNameSolidFaceIncludingLine( b3Solid, ptP1Comp, ptP2Comp)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth)
|
||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut, Par5Alternative)
|
||||
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
|
||||
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
|
||||
Par5 == MCH_MILL_FU.PARAL_TOP or
|
||||
@@ -199,7 +200,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
Par5 == MCH_MILL_FU.PARAL_BACK or
|
||||
Par5 == MCH_MILL_FU.PARAL_LEFT or
|
||||
Par5 == MCH_MILL_FU.PARAL_RIGHT) then
|
||||
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
|
||||
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
|
||||
end
|
||||
-- la lama ha asse perpendicolare alla faccia
|
||||
EgtOutLog( 'FacesBySaw.MakeOne', 3)
|
||||
@@ -208,6 +209,8 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
-- risolvo parametro ambiguo
|
||||
local nOrthoOpposite
|
||||
local vtOrthO
|
||||
local nOrthoOppositeAlternative
|
||||
local vtOrthOAlternative
|
||||
if isVector3d( Par5) then
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( Par5, vtN)
|
||||
vtOrthO = Vector3d( Par5)
|
||||
@@ -215,6 +218,15 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
nOrthoOpposite = Par5
|
||||
vtOrthO = BL.GetVersRef( Par5)
|
||||
end
|
||||
if Par5Alternative then
|
||||
if isVector3d( Par5Alternative) then
|
||||
nOrthoOppositeAlternative = BL.GetNearestOrthoOpposite( Par5Alternative, vtN)
|
||||
vtOrthOAlternative = Vector3d( Par5Alternative)
|
||||
else
|
||||
nOrthoOppositeAlternative = Par5Alternative
|
||||
vtOrthOAlternative = BL.GetVersRef( Par5Alternative)
|
||||
end
|
||||
end
|
||||
EgtOutLog( 'VtOrthO='..tostring( vtOrthO)..' FaceUse='..tostring( nOrthoOpposite), 3)
|
||||
-- verifico se testa da sotto oppure se lavorazione sotto con testa da sopra
|
||||
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
|
||||
@@ -234,13 +246,34 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
end
|
||||
local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
|
||||
local bInvert = bForceInvert
|
||||
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
|
||||
-- l'inversione può essere comandata da rotazione lama (direzione concorde, legata anche a DownUp) oppure da direzione Z del percorso (si preferisce lavorare dal basso verso l'alto per limitare le corse)
|
||||
-- se c'è disaccordo tra rotazione e direzione si cambia il lato di lavoro, se possibile. Se ciò non è possbile comanda la direzione.
|
||||
if bInvert == nil then
|
||||
if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
|
||||
if bIsSawCCW ~= bDownUp then
|
||||
bInvert = ( ptP2:getZ() < ptP1:getZ() + 100 * GEO.EPS_SMALL)
|
||||
local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||
local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL)
|
||||
if ( bIsSawCCW ~= bDownUp) and bIsMachiningDownwards then
|
||||
bInvert = true
|
||||
elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then
|
||||
if Par5Alternative then
|
||||
bInvert = true
|
||||
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)
|
||||
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)
|
||||
return true, ''
|
||||
end
|
||||
vtV1 = - vtV1
|
||||
elseif bIsMachiningDownwards or not bIsMachiningUpwards then
|
||||
bInvert = true
|
||||
else
|
||||
bInvert = false
|
||||
end
|
||||
else
|
||||
bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||
bInvert = false
|
||||
end
|
||||
else
|
||||
local vtTmp = ptP2 - ptP1 ; vtTmp:normalize()
|
||||
@@ -250,6 +283,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
if bInvert then
|
||||
ptP1, ptP2 = ptP2, ptP1
|
||||
vtV1, vtV2 = vtV2, vtV1
|
||||
dAccStart, dAccEnd = dAccEnd, dAccStart
|
||||
end
|
||||
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
|
||||
local dAllStart = 0
|
||||
@@ -328,8 +362,26 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptPa1, ptPa2, vtV1, vtV2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
|
||||
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
|
||||
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
||||
local dLiCompLength = 0
|
||||
-- attacco tangente
|
||||
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
|
||||
local dLi2Tang = 0
|
||||
local dLi2Perp = 0
|
||||
local dLo2Tang = 0
|
||||
local dLo2Perp = 0
|
||||
local dLi2CompLength = 0
|
||||
|
||||
-- si predilige un attacco tangenziale (con calcolo automatico di quanto uscire) se faccia che guarda in giù, non troppo orientata verso X e linea non troppo inclinata in X
|
||||
-- non si fa se macchina tipo PF e pezzo alto perchè la lama, uscendo da sopra, toccherebbe la traversa
|
||||
-- TODO si potranno togliere i limiti sulle normali quando si implementerà un modo per calcolare Lead In / Out correttamente in tutti i casi
|
||||
--
|
||||
if bSpecialTangentLeadInOut and not bIsBiLinea and ( vtN:getZ() < - 0.087) and ( abs( vtN:getX()) < 0.258) and ( abs( vtTg:getX()) < 0.1736) and ( abs( vtN:getY()) < 0.5 or ( BD.MAX_DIM_HTCUT_HBEAM > 0 or ( b3Raw:getDimZ() < 420))) then
|
||||
dLi2Tang = 0
|
||||
dLi2Perp = BD.CUT_EXTRA
|
||||
dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC
|
||||
dLo2Tang = dSawDiam / 2
|
||||
else
|
||||
dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
|
||||
end
|
||||
local dLenLi2 = abs( dLi2Tang)
|
||||
local dLenLo2 = abs( dLo2Tang)
|
||||
|
||||
@@ -400,7 +452,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
dLoPerp = BD.COLL_SIC
|
||||
else
|
||||
bLioTang = true
|
||||
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
|
||||
dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength
|
||||
end
|
||||
end
|
||||
-- posizione braccio
|
||||
@@ -473,6 +525,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
if BD.TURN and bLioTang == 1 then EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TG_PERP) end
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
|
||||
EgtSetMachiningParam( MCH_MP.LICOMPLEN, dLiCompLength)
|
||||
if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
||||
@@ -514,6 +567,25 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
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
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
local dSawThick = 5
|
||||
local dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- dati delle facce
|
||||
local ptC = {}
|
||||
local vtN = {}
|
||||
@@ -529,10 +601,10 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
local ptM = ( ptT1 + ptT2) / 2
|
||||
local vtTg = ptT2 - ptT1 ; vtTg:normalize()
|
||||
local bConvex = ( dAngT > 0)
|
||||
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg)
|
||||
-- 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)
|
||||
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or abs( vtN[2]:getY()) < 0.174)
|
||||
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))
|
||||
if not bDownHead and ( not bFaceOk[1] or not bFaceOk[2]) then
|
||||
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
@@ -567,25 +639,6 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
nUpInd = nBigInd
|
||||
nOtInd = nSmaInd
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
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
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
local dSawThick = 5
|
||||
local dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- calcolo extra taglio
|
||||
local dCutExtra = 0
|
||||
if dAngT < -91 and dAngT > -179 then
|
||||
@@ -622,7 +675,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd])
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
@@ -682,14 +736,16 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
end
|
||||
-- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire)
|
||||
if vCuts[i][j] then
|
||||
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
end
|
||||
-- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire)
|
||||
if vCuts[i+1][j] then
|
||||
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bSpecialTangentLeadInOut = ( ( i + 1) % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
@@ -384,8 +384,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
-- verifico se posso usare lo stesso utensile della testa attiva
|
||||
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo
|
||||
if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then
|
||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo, a meno che non siano entrambi grandi (truciolatori)
|
||||
if ( not sH1Param or not sH1Param.TDiam or ( sH1Param.TDiam < 75 and ToolParams.TDiam < 75 and sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam)) and ( not sH2Param or not sH2Param.TDiam or ( sH2Param.TDiam < 75 and ToolParams.TDiam < 75 and sH2Param.TDiam < 1.25 * ToolParams.TDiam)) then
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
end
|
||||
end
|
||||
@@ -414,12 +414,14 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
end
|
||||
end
|
||||
if MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi
|
||||
-- se entrambi gli utensili sono piccoli (no truciolatori) e uno dei due è molto più grande dell'altro scelgo quello senza fare altre analisi
|
||||
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
|
||||
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
if sH1Param.TDiam < 75 or sH2Param.TDiam < 75 then
|
||||
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
||||
|
||||
@@ -151,7 +151,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO
|
||||
-- se va fatto, inserisco la lavorazione
|
||||
if bCut then
|
||||
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
|
||||
if bOk then
|
||||
@@ -242,7 +243,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO
|
||||
-- se va fatto, inserisco la lavorazione
|
||||
if bCut then
|
||||
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
|
||||
if bOk then
|
||||
|
||||
+22
-6
@@ -542,9 +542,14 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if j ~= 1 then
|
||||
vtNewOrthoO = -vtOrthoO
|
||||
if not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.708 end
|
||||
if BD.GetNzLimDownUp then
|
||||
dVzLimDwnUp = BD.GetNzLimDownUp( b3Raw, vtN, V_NULL(), true)
|
||||
elseif not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then
|
||||
dVzLimDwnUp = -0.708
|
||||
end
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- tutti gli altri casi vengono saltati
|
||||
@@ -566,8 +571,17 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
end
|
||||
end
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
|
||||
if BD.GetNzLimDownUp then
|
||||
dVzLimDwnUp = BD.GetNzLimDownUp( b3Raw, vtN, V_NULL(), true)
|
||||
elseif not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then
|
||||
dVzLimDwnUp = -0.708
|
||||
end
|
||||
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local vtOrthoOAlternative
|
||||
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)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
@@ -749,14 +763,16 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire)
|
||||
if vCuts[i][j] then
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
end
|
||||
-- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire)
|
||||
if vCuts[i+1][j] then
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -521,7 +521,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
|
||||
-- applico lavorazione
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -533,7 +534,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
|
||||
-- applico lavorazione
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
|
||||
@@ -1433,7 +1433,8 @@ local function MakeAuxCut( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol
|
||||
return true
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail}
|
||||
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- imposto la nota nel gruppo aggiuntivo di lavorazione per evitare di tagliare una seconda volta
|
||||
|
||||
@@ -210,7 +210,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB)
|
||||
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom)
|
||||
if not bOk then return bOk, sErr end
|
||||
|
||||
@@ -207,7 +207,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- altrimenti applico taglio di lama
|
||||
else
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
|
||||
if not bOk then return bOk, sErr end
|
||||
@@ -216,7 +217,7 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'DtTenon'
|
||||
local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
@@ -173,7 +173,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw )
|
||||
for j = nVerticalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
||||
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
||||
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw)
|
||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER
|
||||
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
|
||||
return bOk, sErr
|
||||
@@ -359,7 +360,8 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
for j = nHorizontalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw)
|
||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||
|
||||
+188
-70
@@ -105,6 +105,9 @@
|
||||
-- 2024/04/15 In SideMillAsSaw gestito anche rabbet
|
||||
-- 2024/04/17 In MakeMoreLongFaces corretto calcolo divisione in parti per evitare problemi di ceil con interi perfetti (ceil(3) = 3 o 4??)
|
||||
-- 2024/04/22 In IsTailFeature se LapJoint a 2 facce che taglia intera sezione, deve essere fatto dopo taglio di coda
|
||||
-- 2024/06/18 In MakeByMillAsSaw si cerca di orientare il motore verso il lato più vicino (rispetto a dove è la feature)
|
||||
-- 2024/06/28 In VerifySideMillAsSaw modificato criterio ricerca utensile in base a normale della faccia
|
||||
-- 2024/07/04 In IsTailFeature controllo per spostare lapjoint dopo taglio di separazione per lavorazioni tipo BH
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLapJoint = {}
|
||||
@@ -138,6 +141,9 @@ local Q_SIDE_ROUGH_TOOL = '' -- i
|
||||
local Q_ANTISPLINT_TYPE = '' -- i
|
||||
local Q_BLADE_ON_ALONG_FACE = '' -- i
|
||||
local Q_MAX_ELEVATION = '' -- d
|
||||
local Q_SAW_PLUS_CHAIN = '' -- i
|
||||
local Q_FORCE_CHAINSAW = '' -- i
|
||||
|
||||
|
||||
-- variabile smussi
|
||||
local bMadeChamfer
|
||||
@@ -179,6 +185,7 @@ local function AssignQIdent( Proc)
|
||||
Q_MAX_ELEVATION = 'Q10'
|
||||
Q_STAIRCASE = ''
|
||||
Q_SAW_PLUS_CHAIN = 'Q11'
|
||||
Q_FORCE_CHAINSAW = 'Q12'
|
||||
|
||||
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
||||
Q_FORCE_BLADE = 'Q01' -- i
|
||||
@@ -564,8 +571,19 @@ local function VerifySideMillAsSaw( Proc, nAddGrpId, vtN, dDiam, dFacElev)
|
||||
return false
|
||||
end
|
||||
-- Recupero la lavorazione
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtN:getZ() < BD.NZ_MINA)
|
||||
local sMillingOnSide = ML.FindMilling( 'SideMillAsBlade', nil, nil, nil, nil, not bDownHead, bDownHead)
|
||||
local bDownHead
|
||||
local sMillingOnSide
|
||||
-- se ho testa da sotto e lap-joint diretto verso il basso, cerco prima testa sotto
|
||||
if BD.DOWN_HEAD and vtN:getZ() < BD.NZ_MINA then
|
||||
bDownHead = true
|
||||
sMillingOnSide = ML.FindMilling( 'SideMillAsBlade_H2', nil, nil, nil, nil, not bDownHead, bDownHead)
|
||||
end
|
||||
-- se non ha trovato su testa sotto, cerco su testa sopra
|
||||
if not sMillingOnSide then
|
||||
bDownHead = false
|
||||
sMillingOnSide = ML.FindMilling( 'SideMillAsBlade', nil, nil, nil, nil, not bDownHead, bDownHead)
|
||||
end
|
||||
|
||||
if not sMillingOnSide then
|
||||
return false
|
||||
end
|
||||
@@ -762,7 +780,11 @@ 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
|
||||
return false
|
||||
if bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 80% della lunghezza della trave
|
||||
if Proc.Box:getDimX() > b3Solid:getDimX() - 1 or
|
||||
@@ -1169,7 +1191,8 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, nCha
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
-- applico lavorazione
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local nCutFacet = EgtSurfTmFacetCount( AddId)
|
||||
if nCutFacet == 1 then
|
||||
return Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
@@ -2529,7 +2552,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||
|
||||
-- Se variabile globale indica che lo smusso è gi stato fatto, esco
|
||||
-- Se variabile globale indica che lo smusso è già stato fatto, esco
|
||||
if bMadeChamfer then
|
||||
return 0
|
||||
end
|
||||
@@ -2543,6 +2566,7 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
|
||||
end
|
||||
-- ottengo le curve di contorno libero
|
||||
local nAuxId1, nAuxId2, nNumIdAux
|
||||
local bIsOpenPath = false
|
||||
if bIs3Faces then
|
||||
-- estraggo i percorsi
|
||||
nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
@@ -2553,6 +2577,36 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
|
||||
else
|
||||
nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
if not nNumIdAux then nNumIdAux = 0 end
|
||||
-- se non è una curva chiusa bisogna estrarre le sole curve da lavorare
|
||||
if Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then
|
||||
local IdsToMachine = {}
|
||||
bIsOpenPath = true
|
||||
local nFirstId, nIdCount = EgtExplodeCurveCompo( nAuxId1)
|
||||
for i = nFirstId, nFirstId + nIdCount - 1, 1 do
|
||||
-- se segmento di retta
|
||||
if EgtGetType( i) == GDB_TY.CRV_LINE then
|
||||
local _, nEntitiesCount = EgtCurveDomain(i)
|
||||
for j = 0, nEntitiesCount - 1 do
|
||||
local ptStart = EgtUP( i, j, GDB_RT.GLOB)
|
||||
local ptEnd = EgtUP( i, j + 1, GDB_RT.GLOB)
|
||||
if ( AreSameVectorApprox( vtOrtho, X_AX()) and ( abs( ptStart:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or
|
||||
AreSameVectorApprox( vtOrtho, -X_AX()) and ( abs( ptStart:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or
|
||||
AreSameVectorApprox( vtOrtho, Y_AX()) and ( abs( ptStart:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or
|
||||
AreSameVectorApprox( vtOrtho, -Y_AX()) and ( abs( ptStart:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or
|
||||
AreSameVectorApprox( vtOrtho, Z_AX()) and ( abs( ptStart:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or
|
||||
AreSameVectorApprox( vtOrtho, -Z_AX()) and ( abs( ptStart:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL)
|
||||
) then
|
||||
table.insert( IdsToMachine, i)
|
||||
end
|
||||
end
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
local ptNear = EgtSurfTmFacetCenter(Proc.Id, 0, GDB_ID.ROOT)
|
||||
nAuxId1 = EgtCurveCompoByReorder( nAddGrpId, IdsToMachine, ptNear, true, GDB_ID.ROOT)
|
||||
nNumIdAux = 1
|
||||
end
|
||||
end
|
||||
|
||||
local dExtra = 2
|
||||
@@ -2572,13 +2626,20 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
|
||||
end
|
||||
else
|
||||
AuxId = nAuxId1 + i - 1
|
||||
vtExtr, _, _ = EgtCurveArea( AuxId)
|
||||
end
|
||||
if vtExtr then
|
||||
if not bIs3Faces then
|
||||
if bIsOpenPath then
|
||||
_, vtExtr = EgtCurveIsFlat( AuxId)
|
||||
else
|
||||
vtExtr, _, _ = EgtCurveArea( AuxId)
|
||||
end
|
||||
if vtExtr then
|
||||
local fFrCurve = EgtGetGlobFrame( AuxId)
|
||||
vtExtr:toGlob( fFrCurve)
|
||||
if bIsOpenPath and vtExtr * vtOrtho < GEO.EPS_SMALL then
|
||||
vtExtr = -vtExtr
|
||||
end
|
||||
end
|
||||
end
|
||||
if vtExtr then
|
||||
-- if bIs3Faces and i == nNumIdAux then
|
||||
-- vtExtr = -vtExtr
|
||||
-- end
|
||||
@@ -2666,7 +2727,8 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
if abs( dLen - dMaxLen) < 5 then
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT)
|
||||
if vtN:getY() > 0.5 or vtN:getZ() > 0.5 then
|
||||
local bPositionedToYm = Proc.Box:getMax():getY() < ( b3Raw:getMin():getY() + b3Raw:getMax():getY()) / 2
|
||||
if ( bPositionedToYm and vtN:getY() < 0.5) or ( not bPositionedToYm and vtN:getY() > 0.5) or vtN:getZ() > 0.5 then
|
||||
nFacAdj = vAdj[i]
|
||||
dMaxLen = dLen
|
||||
end
|
||||
@@ -2821,6 +2883,12 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local nOk, sErr = MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||
if nOk < 0 then return false, sErr end
|
||||
end
|
||||
-- slot aperta su due lati
|
||||
elseif Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then
|
||||
if nChamfer > 0 then
|
||||
local nOk, sErr = MakeChamfer( Proc, false, nAddGrpId, rfFac:getVersZ(), b3Solid, nil, dDepthCham)
|
||||
if nOk < 0 then return false, sErr end
|
||||
end
|
||||
end
|
||||
if not dDepth then dDepth = dElev end
|
||||
-- Recupero le facce adiacenti alla principale
|
||||
@@ -3176,6 +3244,11 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
end
|
||||
-- valuto l'angolo tra le due facce
|
||||
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, nFacInd, nFacet, GDB_ID.ROOT)
|
||||
if not bAdj then
|
||||
local sErr = 'Error : Faces not adjacent'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local ptPm = (ptP1+ptP2)/2
|
||||
-- ottengo il boundingBox e prendo le dimensioni lungo la normale (Z locale) che rappresenta l'elevazione della faccia
|
||||
-- laterale sul punto medio della linea in comune
|
||||
@@ -3297,6 +3370,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
-- se si lavora una faccia orizzontale e la dimensione X della feature è sufficiente, blocco l'asse B per evitare sollecitazioni inutili
|
||||
local b3Face = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
|
||||
if BD.C_SIMM and AreSameOrOppositeVectorApprox( tvtN[2], Z_AX()) and b3Face:getDimX() > BD.LONGCUT_ENDLEN then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
if bLapJointAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
@@ -3330,7 +3408,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eventuale massima elevazione imposta dall'utente
|
||||
local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
|
||||
if dMaxElev and dMaxElev < 1 then dMaxElev = nil end
|
||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||
dElev = dMaxElev or dElev
|
||||
local sWarn
|
||||
local dDepth = dElev
|
||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
@@ -3341,11 +3423,7 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
-- eventuale massima elevazione imposta dall'utente
|
||||
local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
|
||||
if dMaxElev and dMaxElev < 1 then dMaxElev = nil end
|
||||
dMaxElev = dMaxElev or dElev
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';'
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
if bOpenOutRaw then
|
||||
sNotes = sNotes .. 'OpenOutRaw=1;'
|
||||
@@ -5077,22 +5155,29 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw)
|
||||
local nErr
|
||||
nErr, sErr = EgtGetLastMachMgrError()
|
||||
-- se mortasatura e l'errore è compatibile (Axes values not calculable) si prova con l'altra configurazione dell'asse bloccato
|
||||
-- TODO valutare se c'è modo di capire preventivamente la configurazione dell'asse bloccato e quindi rimuovere questa parte di codice
|
||||
if Machining.Type == MCH_OY.MORTISING and nErr == 2507 then
|
||||
if Machining.BlockedAxis.Orientation == 'perpendicular' then
|
||||
Machining.BlockedAxis.Orientation = 'parallel'
|
||||
else
|
||||
Machining.BlockedAxis.Orientation = 'perpendicular'
|
||||
if Machining.Type == MCH_OY.MORTISING then
|
||||
-- se errore "Axes values not calculable" si prova con l'altra configurazione dell'asse bloccato
|
||||
if nErr == 2507 then
|
||||
if Machining.BlockedAxis.Orientation == 'perpendicular' then
|
||||
Machining.BlockedAxis.Orientation = 'parallel'
|
||||
else
|
||||
Machining.BlockedAxis.Orientation = 'perpendicular'
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut))
|
||||
if Machining.SuggestedAngles.Index == 1 then
|
||||
Machining.SuggestedAngles.Index = 2
|
||||
else
|
||||
Machining.SuggestedAngles.Index = 1
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index))
|
||||
sErr = ''
|
||||
bIsApplyOk = ML.ApplyMachining( true, false)
|
||||
-- se errore "Outstroke" e permesso ToolInvert provo ad invertire il lato di lavorazione
|
||||
elseif Machining.AllowToolInvert and nErr == 2508 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, not Machining.ToolInvert)
|
||||
sErr = ''
|
||||
bIsApplyOk = ML.ApplyMachining( true, false)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut))
|
||||
if Machining.SuggestedAngles.Index == 1 then
|
||||
Machining.SuggestedAngles.Index = 2
|
||||
else
|
||||
Machining.SuggestedAngles.Index = 1
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index))
|
||||
sErr = ''
|
||||
bIsApplyOk = ML.ApplyMachining( true, false)
|
||||
end
|
||||
if not bIsApplyOk then
|
||||
nErr, sErr = EgtGetLastMachMgrError()
|
||||
@@ -5149,18 +5234,16 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
||||
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found'
|
||||
Cutting.CanApply = false
|
||||
EgtOutLog( Cutting.Message)
|
||||
return Cutting
|
||||
end
|
||||
Cutting.Type = MCH_OY.MILLING
|
||||
Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name)
|
||||
|
||||
-- verifica dimensioni tasca compatibili
|
||||
-- verifica dimensioni tasca e direzione compatibili
|
||||
-- se tasca meno spessa della lama la strategia non è applicabile
|
||||
if Cutting.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then
|
||||
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade thickness'
|
||||
Cutting.CanApply = false
|
||||
EgtOutLog( Cutting.Message)
|
||||
return Cutting
|
||||
end
|
||||
if #( Proc.MainFaces.SideFaces) > 1 then
|
||||
-- se tasca più stretta della lama la strategia non è applicabile
|
||||
@@ -5168,9 +5251,13 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
||||
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade diameter'
|
||||
Cutting.CanApply = false
|
||||
EgtOutLog( Cutting.Message)
|
||||
return Cutting
|
||||
end
|
||||
end
|
||||
if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA then
|
||||
Cutting.CanApply = false
|
||||
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : skipped sawblade from bottom'
|
||||
EgtOutLog( Cutting.Message)
|
||||
end
|
||||
|
||||
-- parametri della lavorazione
|
||||
-- inizio e fine aperti o chiusi
|
||||
@@ -5301,6 +5388,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.CanApply = true
|
||||
Mortising.Message = ''
|
||||
Mortising.ProcId = Proc.Id
|
||||
Mortising.AllowToolInvert = false
|
||||
local bNeedToMachineOtherSide = false
|
||||
local dTestCornerRadius = 43
|
||||
-- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend
|
||||
@@ -5344,18 +5432,21 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - chainsaw not found'
|
||||
Mortising.CanApply = false
|
||||
EgtOutLog( Mortising.Message)
|
||||
return Mortising
|
||||
end
|
||||
Mortising.Type = MCH_OY.MORTISING
|
||||
Mortising.Tool = SawPlusChain.GetToolFromMachining( Mortising.Name)
|
||||
|
||||
-- in caso di tunnel da un lato permetto eventuale inversione lato di lavoro in caso di errori di applicazione (es: Outstroke)
|
||||
if Proc.Topology == 'Tunnel' and sMortisingType == 'OneSide' or sMortisingType == 'OneSideAndExtend' then
|
||||
Mortising.AllowToolInvert = true
|
||||
end
|
||||
|
||||
-- verifica dimensioni tasca compatibili
|
||||
-- se tasca meno spessa della sega a catena la strategia non è applicabile
|
||||
if Mortising.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then
|
||||
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw thickness'
|
||||
Mortising.CanApply = false
|
||||
EgtOutLog( Mortising.Message)
|
||||
return Mortising
|
||||
end
|
||||
if #( Proc.MainFaces.SideFaces) > 1 then
|
||||
-- se tasca più stretta della sega a catena la strategia non è applicabile
|
||||
@@ -5363,9 +5454,13 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw width'
|
||||
Mortising.CanApply = false
|
||||
EgtOutLog( Mortising.Message)
|
||||
return Mortising
|
||||
end
|
||||
end
|
||||
if EdgeToMachine.ToolDirection:getZ() < - 10 * GEO.EPS_ANG_SMALL then
|
||||
Mortising.CanApply = false
|
||||
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : skipped chainsaw from bottom'
|
||||
EgtOutLog( Mortising.Message)
|
||||
end
|
||||
|
||||
-- parametri della lavorazione
|
||||
-- inizio e fine aperti o chiusi
|
||||
@@ -5429,7 +5524,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
|
||||
Mortising.SuggestedAngles = {}
|
||||
Mortising.SuggestedAngles.Index = 1
|
||||
Mortising.SuggestedAngles.VtN = FaceToMachine.VtN
|
||||
Mortising.SuggestedAngles.VtOrthO = EdgeToMachine.ToolDirection
|
||||
Mortising.SuggestedAngles.VtOrtho = EdgeToMachine.ToolDirection
|
||||
-- approccio e retrazione
|
||||
Mortising.LeadIn, Mortising.LeadOut = SawPlusChain.CalculateLeadInOut( Mortising, EdgeToMachine)
|
||||
-- eventuale step verticale
|
||||
@@ -5522,9 +5617,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
local bIsCuttingOk = false
|
||||
if Cutting.CanApply then
|
||||
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
||||
end
|
||||
if not bIsCuttingOk then
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
if not bIsCuttingOk then
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
end
|
||||
end
|
||||
local dBottomDepthToMachine = Cutting.RadialOffset
|
||||
-- lato opposto del tunnel
|
||||
@@ -5533,9 +5628,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
bIsCuttingOk = false
|
||||
if Cutting.CanApply then
|
||||
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
||||
end
|
||||
if not bIsCuttingOk then
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
if not bIsCuttingOk then
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
end
|
||||
end
|
||||
else
|
||||
-- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
|
||||
@@ -5546,9 +5641,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
bIsCuttingOk = false
|
||||
if Cutting.CanApply then
|
||||
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
||||
end
|
||||
if not bIsCuttingOk then
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
if not bIsCuttingOk then
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eventuale lavorazione di lama - lato della tasca in cui finisce la lavorazione
|
||||
@@ -5557,9 +5652,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
bIsCuttingOk = false
|
||||
if Cutting.CanApply then
|
||||
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
||||
end
|
||||
if not bIsCuttingOk then
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
if not bIsCuttingOk then
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
end
|
||||
end
|
||||
end
|
||||
-- la lama è arrivata sul fondo e tasca passante, non servono ulteriori lavorazioni
|
||||
@@ -5593,9 +5688,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
bIsMortisingOk = false
|
||||
if Mortising.CanApply then
|
||||
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
|
||||
end
|
||||
if not bIsMortisingOk then
|
||||
return bIsMortisingOk, Mortising.Message
|
||||
if not bIsMortisingOk then
|
||||
return bIsMortisingOk, Mortising.Message
|
||||
end
|
||||
end
|
||||
else
|
||||
-- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
|
||||
@@ -5606,9 +5701,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
bIsMortisingOk = false
|
||||
if Mortising.CanApply then
|
||||
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
|
||||
end
|
||||
if not bIsMortisingOk then
|
||||
return bIsMortisingOk, Mortising.Message
|
||||
if not bIsMortisingOk then
|
||||
return bIsMortisingOk, Mortising.Message
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eventuale lavorazione di sega a catena - lato della tasca in cui finisce la lavorazione
|
||||
@@ -5617,9 +5712,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
bIsMortisingOk = false
|
||||
if Mortising.CanApply then
|
||||
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
|
||||
end
|
||||
if not bIsMortisingOk then
|
||||
return bIsMortisingOk, Mortising.Message
|
||||
if not bIsMortisingOk then
|
||||
return bIsMortisingOk, Mortising.Message
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5702,23 +5797,38 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if nChamfer < 0 then
|
||||
return false, sErrCham
|
||||
end
|
||||
-- eventuale forzatura sega a catena
|
||||
local bForceChainsaw = ( EgtGetInfo( Proc.Id, Q_FORCE_CHAINSAW, 'i') or 0) > 0
|
||||
-- se è un tunnel provo a vedere se è possibile lavorarlo con la svuotatura o con la sega catena
|
||||
if bClosedOrthoFaces then
|
||||
local bTryWithBlades = true
|
||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace
|
||||
-- forzata sega a catena
|
||||
if bForceChainsaw then
|
||||
-- ottengo le dimensioni del tunnel
|
||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = BL.GetTunnelDimension( Proc, nPartId)
|
||||
-- lavoro fessura con svuotature (singola o doppia contrapposta)
|
||||
local sMyMchFind = 'Pocket'
|
||||
local nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
|
||||
else
|
||||
local sMyMchFind = 'Pocket'
|
||||
local nOk, sErr
|
||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
|
||||
nLundIdFace = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
|
||||
if nOk < 0 then
|
||||
return false, sErr
|
||||
elseif nOk > 0 then
|
||||
bTryWithBlades = false
|
||||
if nOk < 0 then
|
||||
return false, sErr
|
||||
elseif nOk > 0 then
|
||||
bTryWithBlades = false
|
||||
end
|
||||
end
|
||||
-- Se la svuotatura precedente non è stata fatta e chamfer non è mutuamente esclusivo provo con la sega-catena
|
||||
if bTryWithBlades and nChamfer < 2 then
|
||||
-- verifico se posso farlo con la sega-catena
|
||||
local bMakeChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick, _, dSawWidth = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
|
||||
if bMakeChainSaw then
|
||||
-- se forzata sega a catena devo verificare se inserire lo smusso
|
||||
if bForceChainsaw and nChamfer > 0 then
|
||||
local nOk, sErr = MakeChamfer( Proc, false, nAddGrpId, vtOrtho, b3Solid, nLundIdFace, dDepthCham)
|
||||
if nOk < 0 then return -1, sErr end
|
||||
end
|
||||
-- Ricalcolo l'affondamento tenendo conto di eventuale inclinazione
|
||||
local dSlDepth
|
||||
local frSlDh = Frame3d( Proc.Box:getCenter(), vtOrtho)
|
||||
@@ -6174,6 +6284,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if bMillDown and BD.GetBottomToolMaxTotLen then
|
||||
dMaxTotLen = BD.GetBottomToolMaxTotLen( vtN)
|
||||
end
|
||||
local dUserMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
|
||||
-- ricerca lavorazione
|
||||
local sPocketing
|
||||
local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
|
||||
@@ -6181,10 +6292,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
_, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind)
|
||||
bMillDown = false
|
||||
end
|
||||
-- se l'utente ha definito un'elevazione custom dUserMaxElev si lavora sempre la faccia standard
|
||||
if sMyPocketing and
|
||||
( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or
|
||||
( bIsL and nUseRoughTool == 0) or
|
||||
( Proc.Prc == 25 and not bIsU and not bIsL)) then
|
||||
( Proc.Prc == 25 and not bIsU and not bIsL)) or
|
||||
( dUserMaxElev and dUserMaxElev > 10 * GEO.EPS_SMALL) then
|
||||
sPocketing = sMyPocketing
|
||||
end
|
||||
if bMillDown then
|
||||
@@ -6203,6 +6316,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if bForceSideMill then
|
||||
sPocketing = nil
|
||||
end
|
||||
-- se forzata sega a catena
|
||||
if bForceChainsaw then
|
||||
sPocketing = nil
|
||||
end
|
||||
-- leggo parametro Q
|
||||
local nQAntisplintResult = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0
|
||||
-- se lavorazione fresa come lama disabilito eventuale antischeggia
|
||||
@@ -6424,8 +6541,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
end
|
||||
end
|
||||
-- in tutti gli altri casi lancio la MakeByPockets (lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo)
|
||||
else
|
||||
-- in tutti gli altri casi, a meno che non sia forzata sega a catena, lancio la MakeByPockets
|
||||
-- lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo
|
||||
elseif not bForceChainsaw then
|
||||
-- se 2 facce setto i parametri corretti per la MakeByPockets
|
||||
if bForceSideMill and Proc.Fct == 2 then
|
||||
bIs3Faces = false
|
||||
@@ -7181,13 +7299,13 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- leggo i parametri Q per utilizzare la fresa di fianco e/o lama
|
||||
local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
|
||||
local bUseBlade = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') == 1
|
||||
local bOk, sMyWarn = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool)
|
||||
local bOk, sMyWarn, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool)
|
||||
-- se non sono riuscito a farlo di lama, riprovo con la fresa
|
||||
if not bOk and bUseBlade then
|
||||
bUseBlade = false
|
||||
return Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool)
|
||||
else
|
||||
return bOk, sMyWarn
|
||||
return bOk, sMyWarn, nil, AddedIds
|
||||
end
|
||||
-- prima faccia terminale
|
||||
elseif b3Fac1:getDimX() < 1 and abs( vtN2:getX()) < GEO.EPS_SMALL then
|
||||
|
||||
@@ -1391,7 +1391,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
||||
-- inverto se utensile antiorario per garantire senso di percorrenza migliore
|
||||
local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
||||
local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) > 0
|
||||
-- setto workside e eventuale inversione
|
||||
if bInvert then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
|
||||
@@ -37,6 +37,7 @@ EgtOutLog( ' ProcessLongDoubleCut started', 1)
|
||||
-- Dati
|
||||
local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
|
||||
local dLimMinPiece = BD.LEN_SHORT_PART or 1000
|
||||
|
||||
@@ -324,6 +325,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local nFaceLimit, tFaceLong, ptC, vtN = IdentifyFaces( Proc)
|
||||
local dLen = Proc.Box:getDimX()
|
||||
|
||||
-- inizializzazione tabella con eventuali lavorazioni create a posteriori da ritornare al chiamante
|
||||
local AddedIds = {}
|
||||
|
||||
-- recupero lunghezza grezzo totale da info sulla macchinata
|
||||
local dBarLen = EgtGetInfo( EgtGetCurrMachGroup(), 'BARLEN', 'd')
|
||||
local dOvmHead = b3Raw:getMax():getX() - b3Solid:getMax():getX()
|
||||
@@ -945,18 +949,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
-- altrimenti concavo
|
||||
else
|
||||
-- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco.
|
||||
for k = 1, #vOrd do
|
||||
if vWidth[vOrd[k]] + BD.CUT_SIC > dMaxDepth then
|
||||
if not( ProcessLong2Cut.Identify( Proc)) then
|
||||
return false
|
||||
else
|
||||
local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[k]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
if not sWarn then sWarn = '' end
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- si percorrono i lati alto e basso della faccia
|
||||
for i = 1, nC do
|
||||
-- Posizione braccio portatesta
|
||||
@@ -986,6 +978,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco.
|
||||
local dCheckDepth = 0
|
||||
if bCanUseBlade then
|
||||
dCheckDepth = dMaxDepth
|
||||
elseif bCanUseUnderBlade then
|
||||
dCheckDepth = dMaxDepthDn
|
||||
end
|
||||
if vWidth[vOrd[j]] + 100 * GEO.EPS_SMALL > dCheckDepth then
|
||||
if not( ProcessLong2Cut.Identify( Proc)) then
|
||||
return false
|
||||
else
|
||||
local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[j]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dCheckDepth, 1) .. ')'
|
||||
if not sWarn then sWarn = '' end
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
end
|
||||
end
|
||||
-- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama
|
||||
if nSide <= 0 and bCanUseUnderBlade then
|
||||
if ( vWidth[vOrd[j]] / 2) > dMaxDepthDn then
|
||||
@@ -999,7 +1007,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local dLioPerp
|
||||
|
||||
if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90
|
||||
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0)
|
||||
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0)
|
||||
-- se la faccia è più grande del massimo materiale lama, allora limito lavorazione
|
||||
if dMinOffsBigFace > 0 then
|
||||
dOffset = dMinOffsBigFace
|
||||
@@ -1011,7 +1019,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC
|
||||
else -- il secondo ridotto della distanza minima e della componente spessore della lama
|
||||
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0)
|
||||
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0)
|
||||
-- se la faccia è più grande del massimo materiale lama, allora limito lavorazione
|
||||
if dMinOffsBigFace > 0 then
|
||||
dOffset = dMinOffsBigFace
|
||||
@@ -1070,12 +1078,27 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
local ptP1LineToMachine, _, ptP2LineToMachine = EgtSurfTmFacetOppositeSide( Proc.Id, vOrd[j] - 1, BL.GetVersRef( vFaceUse[vOrd[j]]), GDB_ID.ROOT)
|
||||
local vtTg = ptP2LineToMachine - ptP1LineToMachine ; vtTg:normalize()
|
||||
local bIsMachiningInverted = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
if bIsMachiningInverted then
|
||||
vtTg = -vtTg
|
||||
end
|
||||
if BD.C_SIMM then
|
||||
if abs( vtN[vOrd[j]]:getX()) < GEO.EPS_SMALL then
|
||||
nSCC = EgtIf( ( vtTg:getX() > GEO.EPS_SMALL), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
else
|
||||
nSCC = MCH_SCC.NONE
|
||||
end
|
||||
else
|
||||
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- determino e imposto l'utilizzo della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[j]])
|
||||
-- imposto angolo 3° asse rot
|
||||
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( EgtIf( bCanUseUnderBlade, sCuttingDn, sCutting), 'perpendicular', b3Raw, vtN, vtOut))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -1254,6 +1277,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
if Proc.bMoveAfterSplit then
|
||||
nC = 1
|
||||
dStartDist = Proc.Box:getDimX() - ( dToolDiam / 2 + 5)
|
||||
dEndDist = - ( dToolDiam / 2 + 5)
|
||||
end
|
||||
if nIni == 2 then
|
||||
dStartDist, dEndDist = dEndDist, dStartDist
|
||||
dStartAccDist, dEndAccDist = dEndAccDist, dStartAccDist
|
||||
@@ -1365,6 +1393,19 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
if not Proc.MoveAfterSplit and not bEndFixed and not bConvex then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
local AddProc = { Id = AddId, Grp = 0, Prc = 12, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId, bMoveAfterSplit = true}
|
||||
Topology.Classify( AddProc, b3Raw)
|
||||
table.insert( AddedIds, AddProc)
|
||||
end
|
||||
|
||||
-- altrimenti lavorazione di fianco : Long2CutSide o Long2CutDown
|
||||
else
|
||||
@@ -1807,8 +1848,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
|
||||
return true, sWarn
|
||||
end
|
||||
return true, sWarn, nil, AddedIds
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return ProcessLong2Cut
|
||||
|
||||
@@ -417,7 +417,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB)
|
||||
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom)
|
||||
if not bOk then return bOk, sErr end
|
||||
|
||||
@@ -307,7 +307,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- altrimenti applico taglio di lama
|
||||
else
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
|
||||
@@ -311,7 +311,8 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- altrimenti applico taglio di lama
|
||||
else
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
|
||||
@@ -311,7 +311,8 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- altrimenti applico taglio di lama
|
||||
else
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
|
||||
@@ -258,7 +258,8 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- altrimenti applico taglio di lama
|
||||
else
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
|
||||
@@ -293,7 +293,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- altrimenti applico taglio di lama
|
||||
else
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
|
||||
@@ -134,7 +134,8 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- applico taglio di lama
|
||||
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
|
||||
if not bOk then return bOk, sErr end
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
-- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut.
|
||||
-- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour.
|
||||
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
|
||||
-- 2024/08/05 Se assimilabile ad un taglio (1 faccia) si considerare area non pinzabile testa/coda
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessSimpleScarf = {}
|
||||
@@ -148,7 +149,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
|
||||
-- se ci sono meno di due facce si riduce a una normale Cut
|
||||
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
||||
if nFacetCnt < 2 then
|
||||
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail)
|
||||
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail, true)
|
||||
return bOk, sErr
|
||||
end
|
||||
-- dati delle facce
|
||||
|
||||
@@ -272,7 +272,8 @@ 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
|
||||
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw)
|
||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER
|
||||
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
|
||||
return bOk, sErr
|
||||
@@ -607,7 +608,8 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
for j = nHorizontalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw)
|
||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||
|
||||
@@ -212,7 +212,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- applico lavorazione
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -223,7 +224,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- applico lavorazione
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -392,7 +394,8 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- applico lavorazione
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2022/11/03
|
||||
-- Gestione calcolo tacca a gradino per Travi
|
||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||
-- 2024/06/28 In MakeFourFaces aggiunta copia del parametro PartId sulla nuova Proc
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessStepJointNotch = {}
|
||||
@@ -384,7 +385,7 @@ local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidt
|
||||
EgtSurfTmSwapFacets( AddId, 1, 3)
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
-- applico lavorazione
|
||||
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
|
||||
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
Topology.Classify( NewProc, b3Raw)
|
||||
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth)
|
||||
@@ -481,7 +482,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
-- se diretta verso Z
|
||||
elseif abs( vtExtr:getZ()) > 0.99 then
|
||||
elseif abs( vtExtr:getZ()) > 0.99 and not ( BD.DOWN_HEAD or nTypePos == 0) then
|
||||
-- se diretta verso Z+
|
||||
if vtExtr:getZ() > 0 then
|
||||
-- se sborda verso Z+ abilito solo la lavorazione della parte normale
|
||||
@@ -506,7 +507,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local dExtra = 2
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'Mark'
|
||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||
local bDownHead = BD.DOWN_HEAD and vtExtr:getZ() < GEO.EPS_SMALL
|
||||
local sMilling, bH2
|
||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
if not sMilling then
|
||||
@@ -539,6 +540,14 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
if bExeOpposite then
|
||||
bDownHead = BD.DOWN_HEAD and vtExtr:getZ() > - GEO.EPS_SMALL
|
||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
bDownHead = ( bDownHead and bH2)
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtAddMachining( sName2, sMilling)
|
||||
|
||||
@@ -200,7 +200,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
else
|
||||
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bFromBottom = ( bShortPart and vtExtr:getZ() > 0.25)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
|
||||
if not bOk then
|
||||
|
||||
@@ -232,7 +232,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
|
||||
-- se va fatto, inserisco la lavorazione
|
||||
if bCut then
|
||||
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
|
||||
if bOk then
|
||||
@@ -330,7 +331,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
|
||||
-- se va fatto, inserisco la lavorazione
|
||||
if bCut then
|
||||
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
|
||||
if bOk then
|
||||
|
||||
@@ -1,5 +1,41 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.6h2 (26/08/2024)
|
||||
- Added : in BatchProcess e New si verifica l'abilitazione alla generazione con EgtVerifyKeyOption
|
||||
- Modif : in FacesBySaw introdotti attacchi tangenziali solo da un lato, limitati a facce con Z negative
|
||||
- Modif : in LapJoint -> tunnel lo smusso funziona anche se è forzata la sega a catena
|
||||
- Modif : in LapJoint -> svuotatura, se l'utente ha definito un'elevazione custom si lavora sempre la faccia standard
|
||||
- Modif : in FacesBySaw -> MakeOne aggiunta la possibilità di passare una direzione di lavoro alternativa per poter rispettare contemporaneamente la direzione di lavoro concorde e la direzione di taglio.
|
||||
|
||||
Versione 2.6h1 (20/08/2024)
|
||||
- Modif : in SimpleScarf, se assimilabile a un taglio, si considera area non pinzabile
|
||||
- Modif : in LapJoint gestito smusso nel caso Groove-Blind-RightAngles-Parallel-4
|
||||
- Modif : varie modifiche ai tagli di lama per evitare chiusura rulli pneumatici e finecorsa
|
||||
- Modif : in BatchProcessNew, se presente flag apposito in EgtCam5, si evita la generazione
|
||||
|
||||
Versione 2.6g4 (19/07/2024)
|
||||
- Modif : in BatchProcess e BatchProcessNew si forza ricalcolo ogni volta che si è in situazione di CHECK o CHECK + GENERATE
|
||||
|
||||
Versione 2.6g3 (07/07/2024)
|
||||
- Added : aggiunta possibilità di funzione GetNzLimDownUp specifica per ogni macchina
|
||||
- Modif : anche nel taglio a cubetti si chiama GetNzLimDownUp di macchina, se presente, per decidere limite orientamento lama verso il basso
|
||||
- Modif : in BeamExec inserito controllo massimo numero di facce per lanciare GetFacetsInfo
|
||||
- Fixed : in LapJoint corretto typo in nome variabile che provocava mancata impostazione asse bloccato
|
||||
|
||||
Versione 2.6g2 (04/07/2024)
|
||||
- Modif : le lavorazioni BlockHaus, se vicine alla coda, vengono spostate dopo il taglio di separazione
|
||||
|
||||
Versione 2.6g1 (01/07/2024)
|
||||
- Modif : in LongDoubleCut gestita correttamente SCC per lama
|
||||
- Modif : in MachiningLib miglioramenti a scelta testa ottimizzata
|
||||
- Modif : in ProcessDtTenon correzione in scelta testa
|
||||
- Modif : In LapJoint -> VerifySideMillAsSaw modificato criterio ricerca utensile in base a normale della faccia
|
||||
- Fixed : in MakeAntiSplintBySaw se non si trova adiacenza tra le facce si restituisce errore
|
||||
- Fixed : In StepJointNotch, MakeFourFaces corretta copia feature con PartId mancante
|
||||
|
||||
Versione 2.6f2 (17/06/2024)
|
||||
- Modif : correzione a tagli a cubetti (ripristinata versione pre 2.6f1)
|
||||
|
||||
Versione 2.6f1 (06/06/2024)
|
||||
- Added : Q04 (tipo longcut) abilitato anche in RidgeLap (T30), se riconducibile a 2 facce
|
||||
- Modif : migliorie al taglio a cubetti
|
||||
|
||||
+2
-2
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.6f1'
|
||||
MIN_EXE = '2.6e2'
|
||||
VERSION = '2.6h2'
|
||||
MIN_EXE = '2.6h1'
|
||||
|
||||
Reference in New Issue
Block a user