Compare commits
72 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 78a3e907ce | |||
| 63133c8813 | |||
| 58e32bdfd0 | |||
| 6528e6e77c | |||
| 48f1ac5e4d | |||
| fbca8d3abd | |||
| 6c61edc338 | |||
| 6643673196 | |||
| 7d33ea6799 | |||
| 7dd0c14f5f | |||
| 232adff332 | |||
| d55caac3c9 | |||
| 3edc65b785 | |||
| eb4f709db3 | |||
| f6316cc75a | |||
| bd8a551005 | |||
| 1729e57dbf | |||
| 261ce7992d | |||
| 48a1139eea | |||
| 70b2002a24 | |||
| f14cb632d6 | |||
| f019633466 | |||
| 57833ebad9 | |||
| 04a4458562 | |||
| b150b5387d | |||
| ce05aed8c9 | |||
| 6820d88560 | |||
| ae31898e05 | |||
| eb1878c17c | |||
| 468fb5debc | |||
| 67fa66cf4f | |||
| e4b4e846ef | |||
| 102bdc8018 | |||
| 5ca2c39506 | |||
| 2c3aaf01dc | |||
| f52bf933a1 | |||
| 993a022894 | |||
| 60448c217a | |||
| 3a5338c29b | |||
| 7177b58836 | |||
| bedb274c0f | |||
| 1df1529bd1 | |||
| 51a8ad95b2 | |||
| 394fb2194f | |||
| 9288304051 | |||
| 99b77ff1e0 | |||
| 5885954f22 | |||
| 440c739e9c | |||
| 026c86297e | |||
| d4454331c0 | |||
| bb5b135694 | |||
| c94e6f858b | |||
| 49f5ba9cc9 | |||
| 1ed912ebfd | |||
| d1d204b260 | |||
| 3cd3557b12 | |||
| 70b0c3d3d2 | |||
| 2798616813 | |||
| fa74016932 | |||
| f309179270 | |||
| 9a6e4f8904 | |||
| ba2ff5a7a7 | |||
| d10b99dc3c | |||
| 743270ed4d | |||
| ad0f4048aa | |||
| cb7a114124 | |||
| b9a9ce1479 | |||
| 812adeed34 | |||
| 4b41948819 | |||
| 77599a8c68 | |||
| 4f43d74d41 | |||
| 92d0ac2e93 |
+69
-2
@@ -144,6 +144,12 @@ local function UpdateAuxData( sAuxFile)
|
||||
EgtSetInfo( BtlInfoId, 'LOAD90', sLoad90)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito UNLOAD, aggiorno
|
||||
local sUnload = EgtGetStringFromIni( 'AuxData', 'UNLOAD', '', sAuxFile)
|
||||
if sUnload ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'UNLOAD', sUnload)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito PROJID, aggiorno
|
||||
local sProjId = EgtGetStringFromIni( 'AuxData', 'PROJID', '', sAuxFile)
|
||||
if sProjId ~= '' then
|
||||
@@ -241,7 +247,11 @@ if bToProcess then
|
||||
EgtEraseFile( sNgeFile)
|
||||
-- eseguo import
|
||||
EgtNewFile()
|
||||
if not EgtImportBtl( BEAM.FILE, EIB_FL.TS3_POS + EIB_FL.USEUATTR) then
|
||||
local nBtlFlag = EIB_FL.TS3_POS + EIB_FL.USEUATTR
|
||||
if BD.USE_PART_OFFSET then
|
||||
nBtlFlag = nBtlFlag + EIB_FL.PARTOFFSET
|
||||
end
|
||||
if not EgtImportBtl( BEAM.FILE, nBtlFlag) then
|
||||
BEAM.ERR = 13
|
||||
BEAM.MSG = 'Error importing BTL file : ' .. BEAM.FILE
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||
@@ -381,7 +391,7 @@ if bToProcess then
|
||||
end
|
||||
end
|
||||
|
||||
-- Verifico sezione barra non troppo piccola
|
||||
-- Verifico sezione barra non troppo piccola
|
||||
if dRawW < BD.MIN_WIDTH - 10 * GEO.EPS_SMALL or dRawH < BD.MIN_HEIGHT - 10 * GEO.EPS_SMALL then
|
||||
local sOut = 'Sezione (' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' ..
|
||||
'sotto i limiti della macchina (' .. EgtNumToString( BD.MIN_WIDTH, 2) .. ' x ' .. EgtNumToString( BD.MIN_HEIGHT, 2) .. ')'
|
||||
@@ -391,6 +401,63 @@ if bToProcess then
|
||||
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||
return
|
||||
end
|
||||
|
||||
-- Se presente offset da btl, verifico se offset uguale per tutti i pezzi
|
||||
if BD.USE_PART_OFFSET then
|
||||
vBeamErr = {}
|
||||
local sPartOffset = EgtGetInfo( vBeam[1].Id, 'PARTOFFSET', 's') or ''
|
||||
local vPartOffset = EgtSplitString( sPartOffset)
|
||||
local dRotAng = EgtGetInfo( vBeam[1].Id, 'ROTATED_OK', 'd') or 0
|
||||
|
||||
for i = 2, #vBeam do
|
||||
local sPartOffsetCurrent = EgtGetInfo( vBeam[i].Id, 'PARTOFFSET', 's') or ''
|
||||
local vPartOffsetCurrent = EgtSplitString( sPartOffsetCurrent)
|
||||
local dRotAngCurrent = EgtGetInfo( vBeam[i].Id, 'ROTATED_OK', 'd') or 0
|
||||
local dRotAngDelta = abs( dRotAngCurrent - dRotAng)
|
||||
if ( #vPartOffset == 5) and ( #vPartOffsetCurrent == 5) then
|
||||
if dRotAngDelta < GEO.EPS_ANG_SMALL then
|
||||
if ( vPartOffsetCurrent[2] ~= vPartOffsetCurrent[2])
|
||||
or ( vPartOffsetCurrent[3] ~= vPartOffset[3])
|
||||
or ( vPartOffsetCurrent[4] ~= vPartOffset[4])
|
||||
or ( vPartOffsetCurrent[5] ~= vPartOffset[5]) then
|
||||
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
elseif dRotAngDelta - 180 < GEO.EPS_ANG_SMALL then
|
||||
if ( vPartOffsetCurrent[2] ~= vPartOffsetCurrent[4])
|
||||
or ( vPartOffsetCurrent[3] ~= vPartOffset[5])
|
||||
or ( vPartOffsetCurrent[4] ~= vPartOffset[2])
|
||||
or ( vPartOffsetCurrent[5] ~= vPartOffset[3]) then
|
||||
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
-- se pezzo ruotato di 90deg rispetto al principale, al momento si dà sempre errore
|
||||
else
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
else
|
||||
if sPartOffsetCurrent ~= sPartOffset then
|
||||
table.insert( vBeamErr, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if #vBeamErr > 0 then
|
||||
local sOut = 'Part offset not consistent in beam(s) : '
|
||||
for i = #vBeamErr, 1, -1 do
|
||||
local sSeparator = ', '
|
||||
if i == 1 then
|
||||
sSeparator = ''
|
||||
end
|
||||
sOut = sOut .. vBeam[vBeamErr[i]].Name .. sSeparator
|
||||
end
|
||||
BEAM.ERR = 17
|
||||
BEAM.MSG = sOut
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Lunghezza della barra
|
||||
local dRawL = ( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'BARLEN', 'd') or 12000) + 0.1
|
||||
|
||||
+164
-69
@@ -304,7 +304,7 @@ local function NeedTopologyFeature( Proc)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT, bCreatePreDrill)
|
||||
local dRawW = b3Raw:getDimY()
|
||||
local dRawH = b3Raw:getDimZ()
|
||||
-- recupero le feature
|
||||
@@ -365,7 +365,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
-- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento)
|
||||
Proc.Diam, Proc.Len, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw)
|
||||
-- verifico se devo inserire i prefori
|
||||
if Drill.IsPredrillNeeded( Proc) then
|
||||
if Drill.IsPredrillNeeded( Proc) and bCreatePreDrill then
|
||||
local bAddProc, PredrillProc= Drill.AddPredrillFromDrillProc( Proc)
|
||||
if bAddProc then
|
||||
table.insert( vProc, PredrillProc)
|
||||
@@ -576,11 +576,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
-- salvo nota con lunghezza grezzo
|
||||
-- Recupero l'identificativo del gruppo di lavoro corrente
|
||||
local nMGrpId = EgtGetCurrMachGroup()
|
||||
-- Lunghezza della barra
|
||||
local dBarLen = EgtGetInfo( nMGrpId, 'BARLEN', 'd')
|
||||
if not dBarLen then
|
||||
EgtSetInfo( nMGrpId, 'BARLEN', dRawL)
|
||||
end
|
||||
|
||||
-- Area tavola
|
||||
local b3Tab = EgtGetTableArea()
|
||||
@@ -592,6 +587,18 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
-- Impostazione dell'attrezzaggio di default
|
||||
EgtImportSetup()
|
||||
|
||||
-- se pretagli di coda sono attivi, aumento di 10mm la lunghezza del grezzo per fare effettivamente tagliare del materiale.
|
||||
-- Altrimenti le lavorazioni pensano di essere nel vuoto e si muovono in rapido
|
||||
if BD.PRECUT_TAIL and VerifyBigSectionCut( dRawW, dRawH) then
|
||||
dRawL = dRawL + 10
|
||||
end
|
||||
|
||||
-- Lunghezza della barra
|
||||
local dBarLen = EgtGetInfo( nMGrpId, 'BARLEN', 'd')
|
||||
if not dBarLen then
|
||||
EgtSetInfo( nMGrpId, 'BARLEN', dRawL)
|
||||
end
|
||||
|
||||
-- Inserimento dei pezzi con il loro grezzo
|
||||
local Cnt = 0
|
||||
local Len = dRawL
|
||||
@@ -617,12 +624,16 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
local vProc = CollectFeatures( Pz, b3Solid, 0)
|
||||
local bSFinishingNeeded, nReplacedHeadCutFeatureId, nHeadCuttingFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
local bEFinishingNeeded, nReplacedTailCutFeatureId, nTailCuttingFeatureId = AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
-- Scrivo gli di delle facce di taglio custom: serviranno dopo per calcolare l'elevazione rispetto a queste
|
||||
-- Scrivo gli id delle facce di taglio custom: serviranno dopo per calcolare l'elevazione rispetto a queste
|
||||
if nHeadCuttingFeatureId then
|
||||
EgtSetInfo( vBeam[i].Id, 'HEADCUTFEATUREID', nHeadCuttingFeatureId)
|
||||
else
|
||||
EgtRemoveInfo( vBeam[i].Id, 'HEADCUTFEATUREID')
|
||||
end
|
||||
if nTailCuttingFeatureId then
|
||||
EgtSetInfo( vBeam[i].Id, 'TAILCUTFEATUREID', nTailCuttingFeatureId)
|
||||
else
|
||||
EgtRemoveInfo( vBeam[i].Id, 'TAILCUTFEATUREID')
|
||||
end
|
||||
if bBigSectionCut then
|
||||
-- lascio in coda solo il materiale necessario; il resto verrà tolto nell'head cut successivo
|
||||
@@ -870,6 +881,45 @@ local function ReorderTruncatingCuts( vProc, nPartId)
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- mi assicuro che vengano rispettate le dipendenze tra le feature
|
||||
local function ReorderFeatureWithDependency( vProc)
|
||||
-- si riordina considerando le dipendenze con alcuni limiti:
|
||||
-- * se ci sono dipendenze incrociate il risultato finale non è controllato ( A->B e B->C e C->A)
|
||||
-- * se ci sono dipendenze opposte va in errore ( A->B e B->A)
|
||||
|
||||
-- si sistemano le feature da lavorare prima
|
||||
local i = 1
|
||||
local nMaxIter = ( #vProc * #vProc) + 1
|
||||
local nIter = 0
|
||||
while i <= #vProc do
|
||||
nIter = nIter + 1
|
||||
if nIter > nMaxIter then
|
||||
error( "UNEXPECTED ERROR ON DEPENDENCY")
|
||||
end
|
||||
|
||||
-- si controllano solo i fori
|
||||
if Drill.Identify( vProc[i]) and vProc[i].Dependency and vProc[i].Dependency.ExecBefore and vProc[i].Dependency.ExecBefore.Id then
|
||||
local nRefId = vProc[i].Dependency.ExecBefore.Id
|
||||
local nRefIndex
|
||||
|
||||
for j = 1, #vProc do
|
||||
if i ~= j and vProc[j].Id == nRefId then
|
||||
nRefIndex = j
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- se il processo deve stare prima, ma ora è dopo
|
||||
if nRefIndex and nRefIndex < i then
|
||||
table.insert( vProc, nRefIndex, table.remove( vProc, i))
|
||||
i = max( nRefIndex - 1, 1)
|
||||
end
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function OrderFeatures( vProc, b3Raw, nPartId)
|
||||
|
||||
@@ -1192,6 +1242,9 @@ local function OrderFeatures( vProc, b3Raw, nPartId)
|
||||
end
|
||||
|
||||
ReorderTruncatingCuts( vProc, nPartId)
|
||||
|
||||
-- si riverificano feature con dipendenze
|
||||
ReorderFeatureWithDependency( vProc)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -1448,7 +1501,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
|
||||
-- se foratura ( 3/4-040-X)
|
||||
elseif Drill.Identify( Proc) then
|
||||
-- esecuzione foratura
|
||||
bOk, sErr = Drill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
bOk, sErr = Drill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se giunzione francese ( 1/2-035-X)
|
||||
elseif FrenchRidgeLap.Identify( Proc) then
|
||||
-- esecuzione giunzione francese
|
||||
@@ -1920,10 +1973,7 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
|
||||
sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true)
|
||||
dMachiningDepth = dMaxDepth or dMachiningDepth
|
||||
end
|
||||
if not sDrilling
|
||||
or ( sType ~= 'Drill' and ( sType ~= 'Pocket'or ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)))
|
||||
or not EgtMdbSetCurrMachining( sDrilling) then
|
||||
|
||||
if not sDrilling or not EgtMdbSetCurrMachining( sDrilling) then
|
||||
return
|
||||
end
|
||||
local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP)
|
||||
@@ -2036,14 +2086,18 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt
|
||||
if vDistHead and #vDistHead > 0 then
|
||||
-- verifico che il foro sia di testa
|
||||
if ( bOpen or ( not bOpen and vtExtr:getX() > 0 and vProc[i].Fcs ~= 0) or ( not bOpen and vtExtr:getX() < 0 and vProc[i].Fce ~= 0)) then
|
||||
vProc[i].MachineAfterHeadCutId = vMachineBeforeIntersectingDrillings.Head.Id
|
||||
if vProc[i].Dependency and vProc[i].Dependency.ExecAfter and vProc[i].Dependency.ExecAfter.Id == vMachineBeforeIntersectingDrillings.Head.Id then
|
||||
vProc[i].MachineAfterHeadCutId = vMachineBeforeIntersectingDrillings.Head.Id
|
||||
end
|
||||
vProc[i].Head = true
|
||||
end
|
||||
-- se esiste intersezione tra il foro e la feature di coda
|
||||
elseif vDistTail and #vDistTail > 0 then
|
||||
-- verifico che il foro sia di coda
|
||||
if ( bOpen or ( not bOpen and vtExtr:getX() < 0 and vProc[i].Fcs ~= 0) or ( not bOpen and vtExtr:getX() > 0 and vProc[i].Fce ~= 0)) then
|
||||
vProc[i].MachineAfterTailCutId = vMachineBeforeIntersectingDrillings.Tail.Id
|
||||
if vProc[i].Dependency and vProc[i].Dependency.ExecAfter and vProc[i].Dependency.ExecAfter.Id == vMachineBeforeIntersectingDrillings.Tail.Id then
|
||||
vProc[i].MachineAfterTailCutId = vMachineBeforeIntersectingDrillings.Tail.Id
|
||||
end
|
||||
vProc[i].Tail = true
|
||||
end
|
||||
end
|
||||
@@ -2051,6 +2105,7 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw)
|
||||
if Proc.Id == ProcMirror.Id then return false end
|
||||
@@ -2117,63 +2172,103 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
|
||||
-- ciclo tutte le feature
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
-- calcolo topologia della feature
|
||||
if NeedTopologyFeature( Proc) then
|
||||
Topology.Classify( Proc, b3Raw)
|
||||
-- se non richiesto, setto 'SPECIAL'
|
||||
else
|
||||
Proc.Topology = 'SPECIAL'
|
||||
Proc.TopologyLongName = Proc.Topology
|
||||
end
|
||||
-- controllo la feature con tutte le altre per recuperare le dipendenze
|
||||
for j = 1, #vProc do
|
||||
local ProcB = vProc[j]
|
||||
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
|
||||
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
|
||||
-- se foro in coda non setto la dipendenza
|
||||
if not ProcB.AffectedFaces.Left then
|
||||
Proc.PassedByHole = true
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
end
|
||||
if vProc and #vProc > 0 and nPartId then
|
||||
-- recupero ID per tagli troncanti testa e coda
|
||||
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i') or 0
|
||||
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i') or 0
|
||||
-- ciclo tutte le feature
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
-- calcolo topologia della feature
|
||||
if NeedTopologyFeature( Proc) then
|
||||
Topology.Classify( Proc, b3Raw)
|
||||
-- se non richiesto, setto 'SPECIAL'
|
||||
else
|
||||
Proc.Topology = 'SPECIAL'
|
||||
Proc.TopologyLongName = Proc.Topology
|
||||
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) and DtMortise.IsDeeper( ProcB, b3Raw) then
|
||||
Proc.PassedByDtMortise = true
|
||||
end
|
||||
-- se tenone è attraversato da foro allora il foro deve essere fatto prima
|
||||
if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
Proc.PassedByHole = true
|
||||
end
|
||||
-- verifiche per specchiature
|
||||
if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then
|
||||
-- forature
|
||||
if BD.DOUBLE_HEAD_DRILLING and Drill.Identify( Proc) and Drill.Identify( ProcB) and not Proc.Mirror then
|
||||
if AreDrillingsMirrored( Proc, ProcB, b3Raw) then
|
||||
Proc.Mirror = ProcB
|
||||
-- controllo la feature con tutte le altre per recuperare le dipendenze
|
||||
for j = 1, #vProc do
|
||||
-- non si controlla feature con sé stessa
|
||||
if i ~= j then
|
||||
local ProcB = vProc[j]
|
||||
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
|
||||
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
|
||||
-- se foro in coda non setto la dipendenza
|
||||
if not ProcB.AffectedFaces.Left then
|
||||
Proc.PassedByHole = true
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
end
|
||||
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) and DtMortise.IsDeeper( ProcB, b3Raw) then
|
||||
Proc.PassedByDtMortise = true
|
||||
end
|
||||
-- se tenone è attraversato da foro allora il foro deve essere fatto prima
|
||||
if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
Proc.PassedByHole = true
|
||||
end
|
||||
-- se taglio attraversato da foro, si definisce precedenza in base ad angolo
|
||||
if Drill.Identify( Proc) and Cut.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
-- recupero e verifico l'entità foro
|
||||
local DrillAuxId = ( EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0) + Proc.Id
|
||||
local vtDrillExtr = EgtCurveExtrusion( DrillAuxId, GDB_RT.GLOB)
|
||||
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
|
||||
local ptCut, vtCutN = EgtSurfTmFacetCenter( ProcB.Id, 0, GDB_ID.ROOT)
|
||||
local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10
|
||||
if GetAngle( vtDrillExtr, vtCutN) > dMaxAngleDrillOnCut then
|
||||
if bOpen and GetAngle( -vtDrillExtr, vtCutN) < dMaxAngleDrillOnCut then
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecAfter = ProcB
|
||||
else
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecBefore = ProcB
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecAfter = Proc
|
||||
end
|
||||
else
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecAfter = ProcB
|
||||
end
|
||||
end
|
||||
-- verifiche per specchiature
|
||||
if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then
|
||||
-- forature
|
||||
if BD.DOUBLE_HEAD_DRILLING and Drill.Identify( Proc) and Drill.Identify( ProcB) and not Proc.Mirror then
|
||||
if AreDrillingsMirrored( Proc, ProcB, b3Raw) then
|
||||
Proc.Mirror = ProcB
|
||||
end
|
||||
end
|
||||
end
|
||||
-- verifiche per tagli troncanti testa e coda: devono sempre essere subito dopo il taglio di testa e il taglio di coda, rispettivamente
|
||||
if Proc.Prc == 340 and ProcB == nHeadCuttingFeatureId then
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecBefore = ProcB
|
||||
elseif Proc == nHeadCuttingFeatureId and ProcB.Prc == 340 then
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
elseif Proc.Prc == 350 and ProcB == nTailCuttingFeatureId then
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecBefore = ProcB
|
||||
elseif Proc == nTailCuttingFeatureId and ProcB.Prc == 350 then
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
end
|
||||
-- se una feature deve essere lavorata prima dei tagli troncanti, si setta che non esiste taglio troncante
|
||||
if Proc.Dependency and Proc.Dependency.ExecBefore and Proc.Dependency.ExecBefore.Id == nHeadCuttingFeatureId then
|
||||
-- EgtRemoveInfo( nPartId, 'HEADCUTFEATUREID')
|
||||
end
|
||||
if Proc.Dependency and Proc.Dependency.ExecBefore and Proc.Dependency.ExecBefore.Id == nTailCuttingFeatureId then
|
||||
-- EgtRemoveInfo( nPartId, 'TAILCUTFEATUREID')
|
||||
end
|
||||
end
|
||||
end
|
||||
-- verifiche per tagli troncanti testa e coda: devono sempre essere subito dopo il taglio di testa e il taglio di coda, rispettivamente
|
||||
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
|
||||
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
|
||||
if Proc.Prc == 340 and ProcB == nHeadCuttingFeatureId then
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecBefore = ProcB
|
||||
elseif Proc == nHeadCuttingFeatureId and ProcB.Prc == 340 then
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
elseif Proc.Prc == 350 and ProcB == nTailCuttingFeatureId then
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecBefore = ProcB
|
||||
elseif Proc == nTailCuttingFeatureId and ProcB.Prc == 350 then
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2213,7 +2308,7 @@ function BeamExec.ProcessFeatures()
|
||||
local dCurrOvmH = EgtGetInfo( nRawId, 'HOVM', 'd') or 0
|
||||
local dCurrOvmT = EgtGetInfo( nRawId, 'TOVM', 'd') or 0
|
||||
-- recupero le feature di lavorazione della trave
|
||||
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT, true)
|
||||
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
|
||||
GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
|
||||
|
||||
|
||||
@@ -1393,6 +1393,11 @@ function BeamLib.GetToolFromMachining( sMachiningName)
|
||||
else
|
||||
Tool.IsOnAggregate = false
|
||||
end
|
||||
Tool.StemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or 0
|
||||
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
|
||||
if Tool.StemDiameter > Tool.Diameter + GEO.EPS_SMALL then
|
||||
Tool.MaxDepth = Tool.MaxDepth - BD.COLL_SIC
|
||||
end
|
||||
-- altri utensili al momento non previsti
|
||||
else
|
||||
error( 'Wrong tool type')
|
||||
@@ -1403,5 +1408,39 @@ function BeamLib.GetToolFromMachining( sMachiningName)
|
||||
return Tool
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
--- copia una tabella lua in modo ricorsivo, ossia mantiene indipendenti anche tutte le sottotabelle
|
||||
--- ATTENZIONE: in caso di modifiche vanno gestiti anche i tipi custom; sarebbe meglio metterla nel LuaLibs
|
||||
function BeamLib.TableCopyDeep( OriginalTable)
|
||||
-- controllo se oggetto passato è valido, altrimenti errore. Non deve mai succedere
|
||||
if not OriginalTable then
|
||||
error( "TableCopyDeep : can't copy nil object")
|
||||
end
|
||||
local CopiedTable = {}
|
||||
for key, value in pairs( OriginalTable) do
|
||||
if type( value) == "table" then
|
||||
if isBBox3d( value) then
|
||||
CopiedTable[ key] = BBox3d( value)
|
||||
elseif isColor3d( value) then
|
||||
CopiedTable[ key] = Color3d( value)
|
||||
elseif isFrame3d( value) then
|
||||
CopiedTable[ key] = Frame3d( value)
|
||||
elseif isPoint3d( value) then
|
||||
CopiedTable[ key] = Point3d( value)
|
||||
elseif isQuaternion( value) then
|
||||
CopiedTable[ key] = Quaternion( value)
|
||||
elseif isVector3d( value) then
|
||||
CopiedTable[ key] = Vector3d( value)
|
||||
else
|
||||
CopiedTable[ key] = BeamLib.TableCopyDeep( value)
|
||||
end
|
||||
else
|
||||
CopiedTable[ key] = value
|
||||
end
|
||||
end
|
||||
|
||||
return CopiedTable
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
+1
-1
@@ -423,7 +423,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
||||
-- se piani non ortogonali, diminuisco la distanza di offset opportunamente
|
||||
local originalOffsetP = OffsetP
|
||||
if not bGetOrtoPlanes then
|
||||
local dCoeff = ( vtNPlanes ^ vtNBond):len()
|
||||
local dCoeff = max( ( vtNPlanes ^ vtNBond):len(), 0.5)
|
||||
OffsetP = OffsetP * dCoeff
|
||||
OffsetO = OffsetO * dCoeff
|
||||
end
|
||||
|
||||
@@ -30,7 +30,7 @@ local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, v
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||
-- imposto note utente
|
||||
local sNotes = ''
|
||||
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
-- eventuale massima elevazione
|
||||
if dMaxElev > 0.1 then
|
||||
sNotes = EgtSetValInNotes( sNotes, 'MaxElev', EgtNumToString( dMaxElev, 2))
|
||||
|
||||
@@ -596,14 +596,16 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
||||
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- vtFaceUse non funziona correttaemnte in caso che il lato da lavorare sia a 45°. Potrebbe ritornare una trilinea, non gestibile. Quindi si setta l'EDGE
|
||||
-- vtFaceUse non funziona correttamente in caso che il lato da lavorare sia a 45°. Potrebbe ritornare una trilinea, non gestibile. Quindi si setta l'EDGE
|
||||
local nEdgeFaceUse = GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
|
||||
if nEdgeFaceUse and ( AreSameOrOppositeDirApprox( vtOrthO:getX(), 0.707) or AreSameOrOppositeDirApprox( vtOrthO:getY(), 0.707) or AreSameOrOppositeDirApprox( vtOrthO:getZ(), 0.707)) then
|
||||
local sNoteEdgeFaceUse = 'EdgesFaceUse=' .. EgtNumToString( nEdgeFaceUse) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteEdgeFaceUse)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'EdgesFaceUse', EgtNumToString( nEdgeFaceUse))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
else
|
||||
local sNoteVtFaceUse = 'VtFaceUse=' .. EgtNumToString( vtOrthO:getX(),3) .. ',' .. EgtNumToString( vtOrthO:getY(),3) .. ',' .. EgtNumToString( vtOrthO:getZ(),3) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteVtFaceUse)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtFaceUse', EgtNumToString( vtOrthO:getX(), 3) .. ',' .. EgtNumToString( vtOrthO:getY(), 3) .. ',' .. EgtNumToString( vtOrthO:getZ(), 3))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- imposto allungamenti iniziale e finale (in caso si utilizzi EDGE, non serve prolungare o accorciare)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
|
||||
|
||||
@@ -139,6 +139,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function VerifyMill( Machining, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
|
||||
if ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and
|
||||
( Machining.Type ~= 'FloatingAggregate' or abs( Machining.Tool.MaxMat - dDepth) < 100 * GEO.EPS_SMALL) and
|
||||
( not sTuuidMstr or sTuuidMstr == Machining.Tool.UUID) and
|
||||
( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and
|
||||
( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then
|
||||
@@ -227,7 +228,11 @@ function GetMachinings( MachiningType, sType)
|
||||
table.insert( validMachinings, Machining)
|
||||
-- se non è tastatura, recupero dati utensile
|
||||
if MachiningType ~= MCH_MY.PROBING then
|
||||
if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
|
||||
-- caso speciale utensile su aggregato flottante
|
||||
if MachiningType == MCH_MY.MILLING and sType == 'FloatingAggregate' then
|
||||
local sNotes = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
|
||||
Machining.Tool.MaxMat = EgtGetValInNotes( sNotes, 'TOOL_OVERHANG', 'd') or -1
|
||||
elseif ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
|
||||
Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth()
|
||||
else
|
||||
Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
|
||||
+123
-34
@@ -37,6 +37,7 @@ EgtOutLog( ' ProcessDrill started', 1)
|
||||
-- Dati
|
||||
local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
local FreeContour = require( 'ProcessFreeContour')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
@@ -134,7 +135,8 @@ function ProcessDrill.Split( Proc, b3Raw)
|
||||
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
|
||||
-- recupero flag abilitazione split (0=auto,1=no)
|
||||
local bTrySplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
|
||||
if not bTrySplit then
|
||||
local bOnlyContour = ( EgtGetInfo( Proc.Id, 'Q04', 'i') == 1)
|
||||
if ( not bTrySplit) or bOnlyContour then
|
||||
return false
|
||||
end
|
||||
-- restituisco se va fatto in doppio (solo fori orizzontali)
|
||||
@@ -313,9 +315,39 @@ local function GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
return nFac, CosB, vFaces
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetSCC( Proc, vtExtr, b3Solid, bDrillAngTrasm, nPhase)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
|
||||
if bDrillAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtExtr:getX()) < 0.1 then
|
||||
local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000)
|
||||
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtExtr:getY() > 0.1 then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
else
|
||||
nSCC = MCH_SCC.NONE
|
||||
end
|
||||
|
||||
return nSCC
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- Se forzato contorno foro forzo richiamo a FreeContour e uscita dalla funzione
|
||||
if EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then
|
||||
return FreeContour.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- default per costanti
|
||||
BD.DRILL_VX_MAX_ANGLEDRILL = ( BD.DRILL_VX_MAX_ANGLEDRILL or 0.928)
|
||||
-- ingombro del pezzo
|
||||
@@ -354,10 +386,11 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local nFac, CosB
|
||||
-- se non già richiesta inversione e invertibile
|
||||
if not bToInvert and Proc.Flg == 1 and -vtExtr:getZ() >= BD.DRILL_VZ_MIN then
|
||||
-- se il foro è cieco o dalla faccia sotto o troppo inclinato all'inizio, lo inverto
|
||||
local nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
if Proc.Fcs == 0 or (( nFac == 2 or CosB > BD.DRILL_VX_MAX) and bOpen) then
|
||||
bToInvert = true
|
||||
end
|
||||
@@ -389,10 +422,11 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
||||
|
||||
local dMaxDepthOri
|
||||
local vFaces
|
||||
if sDrilling then
|
||||
-- Determino la faccia di inizio del foro e dati correlati
|
||||
local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
-- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
|
||||
@@ -400,7 +434,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
if BD.C_SIMM and CosB > 0.866 then
|
||||
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
|
||||
end
|
||||
local dMaxDepthOri = dMaxDepth
|
||||
dMaxDepthOri = dMaxDepth
|
||||
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
||||
-- se utensile scelto non arriva in fondo, cerco il più lungo
|
||||
if dMaxDepth < GEO.EPS_SMALL * 10 then
|
||||
@@ -527,6 +561,17 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
||||
-- Verifico inclinazione foro nei limiti
|
||||
local bTryDrill = EgtIf( dMaxDepth > 0, ( CosB < BD.DRILL_VX_MAX), false)
|
||||
-- se il foro deve essere eseguito dopo un taglio, potrebbe essere perchè il taglio crea una superficie perpendicolare
|
||||
if Proc.Dependency and Proc.Dependency.ExecAfter then
|
||||
local ptCut, vtCutN = EgtSurfTmFacetCenter( Proc.Dependency.ExecAfter.Id, 0, GDB_ID.ROOT)
|
||||
local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10
|
||||
local dAngle = GetAngle( vtExtr, vtCutN)
|
||||
CosB = cos( dAngle)
|
||||
if dAngle < dMaxAngleDrillOnCut then
|
||||
-- controllo di essere nei limiti
|
||||
bTryDrill = true
|
||||
end
|
||||
end
|
||||
if ( CosB > 0.8 * BD.DRILL_VX_MAX and CosB < BD.DRILL_VX_MAX_ANGLEDRILL) then
|
||||
-- cerco le forature speciali AngleDrill
|
||||
local sDrilling3, sType3, dMaxDepth3 = ML.FindAngleDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown)
|
||||
@@ -577,6 +622,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
dDepth = dMaxDepth
|
||||
dMaxElev = dMaxDepth
|
||||
end
|
||||
|
||||
-- inserisco la lavorazione
|
||||
local sName = EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sDrilling)
|
||||
@@ -587,6 +633,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- eventuali note utente
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
-- eventuale inversione
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' or sType == 'Predrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
|
||||
@@ -594,31 +642,25 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if bDrillAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtExtr:getX()) < 0.1 then
|
||||
local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000)
|
||||
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtExtr:getY() > 0.1 then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
else
|
||||
nSCC = MCH_SCC.NONE
|
||||
end
|
||||
local nSCC = GetSCC( Proc, vtExtr, b3Solid, bDrillAngTrasm, nPhase)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto affondamento
|
||||
if Proc.Double and Proc.Double > 0 and dDepth > Proc.MachDepthDouble + 10 * GEO.EPS_SMALL then
|
||||
sMyWarn = 'Warning in double head drilling : depth (' .. EgtNumToString( dDepth, 1) .. ') reduced to (' .. EgtNumToString( Proc.MachDepthDouble, 1) .. ') to match H2 max tool depth'
|
||||
dDepth = Proc.MachDepthDouble
|
||||
dMaxElev = Proc.MachDepthDouble
|
||||
local dLastStepDepth
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
if ( sType == 'Pocket_AT' or sType == 'Pocket') then
|
||||
if bOpen then
|
||||
local dReduceDepth = MIRROR_POCKETS_MIN_DISTANCE / 2 + 10
|
||||
dLastStepDepth = dDepth + dReduceDepth
|
||||
dDepth = dDepth - dReduceDepth
|
||||
end
|
||||
else
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'LastStep', MIRROR_DRILLINGS_MIN_DISTANCE / 2 + 15)
|
||||
end
|
||||
if dDepth > Proc.MachDepthDouble + 10 * GEO.EPS_SMALL then
|
||||
sMyWarn = 'Warning in double head drilling : depth (' .. EgtNumToString( dDepth, 1) .. ') reduced to (' .. EgtNumToString( Proc.MachDepthDouble, 1) .. ') to match H2 max tool depth'
|
||||
dDepth = Proc.MachDepthDouble
|
||||
dMaxElev = Proc.MachDepthDouble
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- imposto il valore della distanza di sicurezza per l'attacco. Se il valore del db utensili è troppo basso lo alzo a 10.
|
||||
@@ -626,11 +668,19 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
local dMinStartPos = 10
|
||||
local dStartPos = max( dMinStartPos, dToolDbStartPos)
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, dStartPos)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||
local sUserNotes = EgtSetVal( 'VMRS', 0) .. ';'
|
||||
-- dichiarazione nessuna generazione sfridi per Vmill
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
-- aggiungo alle note massima elevazione (coincide con affondamento)
|
||||
if dMaxElev then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 1))
|
||||
local dCustomMaxElev
|
||||
if Proc.dCustomMaxElev and type( Proc.dCustomMaxElev) == "number" and Proc.dCustomMaxElev > 10 * GEO.EPS_SMALL then
|
||||
dCustomMaxElev = Proc.dCustomMaxElev
|
||||
end
|
||||
if dMaxElev or dCustomMaxElev then
|
||||
if dCustomMaxElev then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dCustomMaxElev, 1))
|
||||
else
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 1))
|
||||
end
|
||||
end
|
||||
-- se foro passante, aggiungo questa qualifica alle note
|
||||
if ( sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill') and bOpen then
|
||||
@@ -656,7 +706,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
if not bOk then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
else
|
||||
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||
@@ -664,6 +714,45 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sWarn
|
||||
else
|
||||
-- se DrillPocket passante in doppio si fa lavorazione aggiuntiva dell'ultimo step
|
||||
if Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then
|
||||
local idMachiningLastStep = EgtCopyMachining( EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)), sName)
|
||||
EgtSetCurrMachining( idMachiningLastStep)
|
||||
if dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
sMyWarn = 'Warning in drill pocket last step: depth (' .. EgtNumToString( dLastStepDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
dLastStepDepth = dMaxDepth
|
||||
end
|
||||
local dMaxElevLastStep = dLastStepDepth - dDepth
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElevLastStep, 1))
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dLastStepDepth)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', '')
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', '')
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
local bOkLastStep = ML.ApplyMachining( true, false)
|
||||
if not bOkLastStep and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
end
|
||||
bOkLastStep = ML.ApplyMachining( true, false)
|
||||
end
|
||||
if not bOkLastStep then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
else
|
||||
local _, sWarnLastStep = EgtGetMachMgrWarning( 0)
|
||||
if not bOkLastStep then
|
||||
sWarnLastStep = 'Drillpocket double : incomplete, last step missing'
|
||||
end
|
||||
local sPreviousWarn = sMyWarn or sWarn
|
||||
if sWarnLastStep then
|
||||
if not sPreviousWarn then sPreviousWarn = '' end
|
||||
sMyWarn = EgtIf( #sPreviousWarn > 0, sPreviousWarn .. '\n' .. sWarnLastStep, sWarnLastStep)
|
||||
end
|
||||
end
|
||||
end
|
||||
return true, ( sMyWarn or sWarn)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -383,11 +383,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- se con tasca, la lavoro (mai in doppio)
|
||||
if bPocket then
|
||||
-- recupero il contorno della tasca (seconda curva ausiliaria)
|
||||
local sVal = EgtGetInfo( Proc.Id, 'AUXID')
|
||||
local vsAuxId = EgtSplitString( sVal)
|
||||
local vAuxId = EgtGetInfo( Proc.Id, 'AUXID', 'vi')
|
||||
local Aux2Id
|
||||
if vsAuxId and #vsAuxId >=2 then
|
||||
Aux2Id = tonumber( vsAuxId[2])
|
||||
if vAuxId and #vAuxId >=2 then
|
||||
Aux2Id = vAuxId[2]
|
||||
end
|
||||
if Aux2Id then Aux2Id = Aux2Id + Proc.Id end
|
||||
if not Aux2Id or ( EgtGetType( Aux2Id) & GDB_FY.GEO_CURVE) == 0 then
|
||||
@@ -423,7 +422,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Aux2Id, -1}})
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dMaxMat - 0.1, 1) .. '; VMRS=0;'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -534,7 +535,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
end
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dAltMort, 1) .. '; VMRS=0;'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dAltMort, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
@@ -635,20 +638,44 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
|
||||
local ptS = EgtSP( AuxId, GDB_ID.ROOT)
|
||||
local ptE = EgtEP( AuxId, GDB_ID.ROOT)
|
||||
-- in presenza di pocket imposto dati ingresso e uscita
|
||||
if bPocket then
|
||||
-- recupero il contorno della tasca (seconda curva ausiliaria)
|
||||
local vAuxId = EgtGetInfo( Proc.Id, 'AUXID', 'vi')
|
||||
-- si prende il centro del percorso da svuotare ( non si controlla che sia presente perchè già verificata in precedenza)
|
||||
local ptPocketCenter = EgtGP( Proc.Id + vAuxId[2], GDB_ID.ROOT)
|
||||
-- calcolo componente tangente e lineare di ingresso
|
||||
local vtS = EgtSV( Proc.Id + vAuxId[1], GDB_ID.ROOT) -- vettore entrante percorso
|
||||
local vtOffS = EgtSV( Proc.Id + vAuxId[1], GDB_ID.ROOT) ; vtOffS:rotate( vtExtr, 90) -- vettore da punto iniziale a centro utensile
|
||||
local vtStartToCenter = ptPocketCenter - ( ptS + ( vtOffS * ( dToolDiam/2))) -- vettore da centro utensilenel punto iniziale e centro del percorso da svuotare
|
||||
local dLenStartToCenter = vtStartToCenter:len() -- distanza da centro utensile a centro del percorso da svuotare
|
||||
local dStartTangComp = abs( vtStartToCenter * vtS) -- prodotto scalare tra vettore entrante e vettore tra centro utensilee percordo da svuotare (componente tangente)
|
||||
local dStartPerpComp = sqrt( dLenStartToCenter^2 - dStartTangComp^2) -- pitagora tra componente tangente e la lunghezza tra i due centri
|
||||
-- calcolo componente tangente e lineare di uscita
|
||||
local vtE = EgtEV( Proc.Id + vAuxId[1], GDB_ID.ROOT)
|
||||
local vtOffE = EgtEV( Proc.Id + vAuxId[1], GDB_ID.ROOT) ; vtOffE:rotate( vtExtr, 90)
|
||||
local vtEndToCenter = ptPocketCenter - ( ptE + ( vtOffE * ( dToolDiam/2)))
|
||||
local dLenEndToCenter = vtEndToCenter:len()
|
||||
local dEndTangComp = abs( vtEndToCenter * vtE)
|
||||
local dEndPerpComp = sqrt( dLenEndToCenter^2 - dEndTangComp^2)
|
||||
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, 5)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 5)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 5)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, dStartTangComp)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dStartPerpComp)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, dEndTangComp)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dEndPerpComp)
|
||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||
-- altrimenti verifico se sono bilanciati ingresso e uscita, per evitare inizio o fine nel legno
|
||||
else
|
||||
local ptS = EgtSP( AuxId, GDB_ID.ROOT)
|
||||
local ptE = EgtEP( AuxId, GDB_ID.ROOT)
|
||||
local dDistS = abs( ( ptS - rfDtMrt:getOrigin()) * rfDtMrt:getVersX())
|
||||
local dDistE = abs( ( ptE - rfDtMrt:getOrigin()) * rfDtMrt:getVersX())
|
||||
local dIni, dFin = EgtCurveDomain( AuxId)
|
||||
@@ -672,7 +699,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if bMultipleZPasses then
|
||||
dMaxElev = dVerticalStep
|
||||
end
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
|
||||
if bPocket then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
|
||||
|
||||
@@ -109,8 +109,9 @@ local function ApplyPocket( Proc, sPocketing, nStep, dSurfStep, nIdSurf, vtExtr)
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||
if dSurfStep > 0 then
|
||||
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
-- imposto elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dSurfStep, 2) .. ';'
|
||||
sNotes = EgtSetValInNotes( sNotes, 'MaxElev', EgtNumToString( dSurfStep, 2))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
@@ -322,7 +323,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- sistemo i parametri
|
||||
local dOffs = ( i - 1) * dStep
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dDtTenH, 1)) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDtTenH, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
@@ -436,7 +438,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
|
||||
-- imposto elevazione
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dDtTenH, 1)) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDtTenH, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
|
||||
-- imposto posizione braccio porta testa
|
||||
|
||||
@@ -29,11 +29,13 @@ local ML = require( 'MachiningLib')
|
||||
local Q_DIM_STRIP = 'Q01' -- d
|
||||
local Q_DEPTH_CHAMFER = 'Q02' -- d
|
||||
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
|
||||
local Q_ONLY_CONTOUR = 'Q04' -- i, valido solo per drill
|
||||
local Q_ONLY_CHAMFER = 'Q00' -- i
|
||||
local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
|
||||
local Q_IGNORE_LASER_PROBLEMS = 'Q07'
|
||||
local Q_FORCE_CLAMPABLE_AREA = 'Q08'
|
||||
local Q_INVERT_LAST_PATH = 'Q09'
|
||||
local Q_MAX_ELEVATION = 'Q10' -- d
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
@@ -184,6 +186,8 @@ local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham, bDownHead)
|
||||
EgtOutLog( sErr)
|
||||
return -1, 0, sErr
|
||||
end
|
||||
else
|
||||
sMilling = ''
|
||||
end
|
||||
|
||||
return nChamfer, dDepth, sMilling
|
||||
@@ -235,6 +239,7 @@ end
|
||||
local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
local bContourFromDrill = EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') == 1
|
||||
-- ingombro del pezzo
|
||||
local Ls = EgtGetFirstNameInGroup( nPartId, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
@@ -259,7 +264,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- verifico se in testa o coda
|
||||
local bHead = Proc.Head
|
||||
-- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva
|
||||
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true)
|
||||
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true, nil)
|
||||
-- recupero la lavorazione
|
||||
local bTopHead = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.1)
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
||||
@@ -631,6 +636,14 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- eventuale elevazione forzata
|
||||
local dCustomMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
|
||||
if dCustomMaxElev and dCustomMaxElev < 1 then dCustomMaxElev = nil end
|
||||
if dCustomMaxElev then
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dCustomMaxElev, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
end
|
||||
-- assegno affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
end
|
||||
@@ -663,7 +676,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
|
||||
-- assegno lato di lavoro
|
||||
if Proc.Grp == 0 then
|
||||
if bContourFromDrill then
|
||||
dWorkSide = MCH_MILL_WS.LEFT
|
||||
elseif Proc.Grp == 0 then
|
||||
dWorkSide = MCH_MILL_WS.CENTER
|
||||
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) or ( Proc.Grp == 1 and bToolInv) or ( Proc.Grp == 2 and bToolInv) then
|
||||
dWorkSide = MCH_MILL_WS.LEFT
|
||||
@@ -695,6 +710,14 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToolInvert)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, dWorkSide)
|
||||
-- setto valori specifici se lavorazione nel pieno del solo contorno di un foro
|
||||
if bContourFromDrill then
|
||||
local dWorkStep = max( ( EgtGetMachiningParam( MCH_MP.STEP) or 0) * 0.75, dToolDiam)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dWorkStep)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.GLIDE)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, dWorkStep)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, dWorkStep)
|
||||
end
|
||||
|
||||
|
||||
-- posizione braccio porta testa
|
||||
@@ -897,7 +920,9 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- imposto elevazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- imposto eventuale offset radiale, se impostato dall'utente
|
||||
local dRadialOffset = EgtGetInfo( Proc.Id, Q_RADIAL_OFFSET, 'd') or 0
|
||||
if abs( dRadialOffset) > 10 * GEO.EPS_SMALL then
|
||||
@@ -993,6 +1018,10 @@ function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
Q_DEPTH_CHAMFER = 'Q01'
|
||||
Q_DIM_STRIP = 'Q02'
|
||||
end
|
||||
if Proc.Prc == 40 then
|
||||
Q_DIM_STRIP = ''
|
||||
Q_OVERMAT_FOR_FINISH = ''
|
||||
end
|
||||
-- recupero la tipologia
|
||||
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
|
||||
-- se svuotatura
|
||||
|
||||
@@ -196,7 +196,11 @@ local function MakeHeadChamfer( idProc, nPartId)
|
||||
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.RIGHT))
|
||||
|
||||
local dQ09Value = EgtGetInfo( idProc, 'Q09', 'd')
|
||||
if not dQ09Value then
|
||||
dQ09Value = 0.1
|
||||
end
|
||||
local bChamferedEdge = dQ09Value > 0
|
||||
dQ09Value = EgtIf( bChamferedEdge, max( dQ09Value, 0.1), min( dQ09Value, -0.1))
|
||||
|
||||
local nIdFirstEntity, nEntityCnt = EgtExplodeCurveCompo( nLoopId)
|
||||
local p3MidPoint = EgtMP( nIdFirstEntity, GDB_ID.GRID)
|
||||
@@ -232,6 +236,9 @@ local function MakeHeadChamfer( idProc, nPartId)
|
||||
end
|
||||
EgtChangeClosedCurveStartPoint( idGeom, p3MidPoint, GDB_RT.GRID)
|
||||
|
||||
-- reimposto la griglia
|
||||
EgtSetGridFrame()
|
||||
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local dExtra = 2
|
||||
local sName1 = 'HeadCham_' .. ( EgtGetName( idProc) or tostring( idProc))
|
||||
|
||||
+522
-121
@@ -150,7 +150,10 @@ local Q_MAX_ELEVATION = '' -- d
|
||||
local Q_SAW_PLUS_CHAIN = '' -- i
|
||||
local Q_FORCE_CHAINSAW = '' -- i
|
||||
local Q_CHAINSAW_FROM_SIDE = '' -- i
|
||||
local Q_MILL_AS_BLADE_CONVENTIONAL = '' -- i
|
||||
local Q_CONVENTIONAL_MILLING = '' -- i
|
||||
local Q_CLEAN_CORNER = '' -- 1
|
||||
local Q_FLOATING_AGGREGATE = '' -- i
|
||||
local Q_DIM_STRIP = '' -- d
|
||||
|
||||
-- variabile smussi
|
||||
local bMadeChamfer
|
||||
@@ -199,14 +202,15 @@ local function AssignQIdent( Proc)
|
||||
Q_FORCE_CHAINSAW = 'Q12'
|
||||
-- TODO da riportare a Q13 quando è sistemata la gestione del movimento in macchina nell'attacco laterale
|
||||
Q_CHAINSAW_FROM_SIDE = 'Q999'
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = ''
|
||||
Q_CONVENTIONAL_MILLING = ''
|
||||
Q_CLEAN_CORNER = ''
|
||||
Q_FLOATING_AGGREGATE = ''
|
||||
|
||||
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
||||
Q_FORCE_BLADE = 'Q01' -- i
|
||||
Q_DEPTH_CHAMFER = 'Q04' -- d
|
||||
Q_ONLY_CHAMFER = 'Q05' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17 then
|
||||
Q_DEPTH_CHAMFER = 'Q01' -- d
|
||||
Q_ONLY_CHAMFER = 'Q02' -- i
|
||||
@@ -227,33 +231,36 @@ local function AssignQIdent( Proc)
|
||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_DEPTH_CHAMFER = 'Q07' -- d
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
||||
Q_CLEAN_CORNER = 'Q15' -- i
|
||||
Q_FLOATING_AGGREGATE = 'Q16' -- i
|
||||
Q_DIM_STRIP = 'Q17' -- d
|
||||
elseif ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 30 then
|
||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
||||
Q_SIDE_ROUGH_TOOL = 'Q01' -- i
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q02' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33 then
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
||||
Q_USE_MILL = 'Q02' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
elseif ( Proc.Grp == 4) and Proc.Prc == 37 then
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 4) and Proc.Prc == 39 then
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
||||
Q_USE_MILL = 'Q02' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90 then
|
||||
Q_ANTISPLINT_TYPE = 'Q03' -- i
|
||||
Q_SIDE_ROUGH_TOOL = 'Q04' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
||||
end
|
||||
-- le altre features gestite non hanno parametri Q
|
||||
end
|
||||
@@ -1051,7 +1058,9 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'VMRS=0;')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -1186,7 +1195,9 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'VMRS=0;')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -1219,7 +1230,9 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'VMRS=0;')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -1382,8 +1395,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV
|
||||
end
|
||||
end
|
||||
-- applico elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenEnd, 0, - dTDiam / 2))
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenStart, 0, - dTDiam / 2))
|
||||
@@ -1701,8 +1715,9 @@ local function MakeRoundCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
local bInvert = CheckToInvert( AuxId, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( ( tFacAdj[i][3] + dDepth), 1) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( ( tFacAdj[i][3] + dDepth), 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if ML.ApplyMachining( true, false) then
|
||||
@@ -1945,8 +1960,9 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
local bInvert = CheckToInvert( nIdPath, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bInvertMach, not bInvert, bInvert))
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( ( dMaxElev + dMachDepth), 1) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev + dMachDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if ML.ApplyMachining( true, false) then
|
||||
@@ -2008,8 +2024,9 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
local bInvert = CheckToInvert( nIdPath, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvert)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( ( dMaxElev + dMachDepth), 1) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev + dMachDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if ML.ApplyMachining( true, false) then
|
||||
@@ -2222,7 +2239,9 @@ local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacI
|
||||
-- setto affondamento 0
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, 0)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||
local sUserNotes = 'VMRS=0;MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -2374,10 +2393,10 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
|
||||
local dMinStartPos = 10
|
||||
local dStartPos = max( dMinStartPos, dToolDbStartPos)
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, dStartPos)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
-- aggiungo alle note massima elevazione (coincide con affondamento)
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dDepth, 1) .. ';'
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione (coincide con affondamento)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -2397,6 +2416,221 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
|
||||
return true, sMyWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunnelDepth, dDimStrip, nPhase)
|
||||
|
||||
local dCollSic = BL.CalcCollisionSafety( vtTunnelDirection)
|
||||
local bMultipleHeadsAvailble = BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS
|
||||
local bMillFromBottom = vtTunnelDirection:getZ() < BD.NZ_MINA
|
||||
local bMillFromBottomOpposite = -vtTunnelDirection:getZ() < BD.NZ_MINA
|
||||
local sWarn = ''
|
||||
|
||||
-- ricerca lavorazione lato principale
|
||||
local sMilling = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not bMillFromBottom, bMillFromBottom)
|
||||
if not sMilling then
|
||||
local sErr = 'Warning : SmallToolContour not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- dati utensile
|
||||
local Tool = BL.GetToolFromMachining( sMilling)
|
||||
|
||||
-- verifica necessità lavorazione opposta
|
||||
local bOppositeMillingNeeded
|
||||
local bMainMillingReachesFullDepth = Tool.MaxDepth > dTunnelDepth + dCollSic - dDimStrip
|
||||
local bMainMillingReachesHalfDepth = bMainMillingReachesFullDepth or ( Tool.MaxDepth > dTunnelDepth / 2 + dCollSic - dDimStrip / 2)
|
||||
if bMainMillingReachesFullDepth and not bMultipleHeadsAvailble then
|
||||
bOppositeMillingNeeded = false
|
||||
else
|
||||
bOppositeMillingNeeded = true
|
||||
end
|
||||
|
||||
-- ricera lavorazione lato opposto
|
||||
local sMillingOpposite = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not bMillFromBottomOpposite, bMillFromBottomOpposite)
|
||||
if bOppositeMillingNeeded and not sMillingOpposite then
|
||||
local sErr = 'Warning : Opposite SmallToolContour not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- dati utensile
|
||||
local ToolOpposite = BL.GetToolFromMachining( sMillingOpposite)
|
||||
|
||||
local bOppositMillingReachesHalfDepth = ToolOpposite.MaxDepth > dTunnelDepth / 2 + dCollSic - dDimStrip / 2
|
||||
|
||||
-- applicazione lavorazione lato principale
|
||||
local sName = 'Contour_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local idMachining = EgtAddMachining( sName, sMilling)
|
||||
if not idMachining then
|
||||
local sErr = 'Error : impossible add machining ' .. sName .. '-' .. sMilling
|
||||
return false, sErr
|
||||
end
|
||||
-- geometria
|
||||
EgtSetMachiningGeometry( {{ idContourPath, -1}})
|
||||
-- lato di lavoro sinistro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- inversione direzione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
|
||||
-- SCC
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if AreSameOrOppositeVectorApprox( vtTunnelDirection, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtTunnelDirection:getX()) < 0.1 then
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtTunnelDirection:getY() < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- gestione attacco e uscita
|
||||
if EgtCurveIsClosed( idContourPath) then
|
||||
-- attacco e uscita a quarto di cerchio senza allungamenti a inizio e fine
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0.5 * Tool.Diameter)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||
else
|
||||
-- nessun attacco e uscita, allungo inizio e fine di raggio utensile + 5mm (per evitare controllo collisioni)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.NONE)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Tool.Diameter / 2 + 5)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Tool.Diameter / 2 + 5)
|
||||
end
|
||||
-- affondamento - la curva è a metà tasca quindi affondamento 0 significa che la lavorazione arriva a metà tasca
|
||||
local dDepth
|
||||
-- c'è la lavorazione opposta
|
||||
if bOppositeMillingNeeded then
|
||||
-- si arriva a metà tasca
|
||||
if bMainMillingReachesHalfDepth then
|
||||
dDepth = -dDimStrip / 2
|
||||
-- si arriva al massimo raggiungibile
|
||||
else
|
||||
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
||||
sWarn = 'Warning : incomplete'
|
||||
end
|
||||
-- non c'è lavorazione opposta
|
||||
else
|
||||
-- si arriva fino in fondo
|
||||
if bMainMillingReachesFullDepth then
|
||||
dDepth = dTunnelDepth / 2 - dDimStrip
|
||||
-- si arriva al massimo raggiungibile
|
||||
else
|
||||
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
||||
sWarn = 'Warning : incomplete'
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTunnelDepth / 2 + dDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
local bMillingOk
|
||||
if ML.ApplyMachining( true, false) then
|
||||
_, sWarn = EgtGetMachMgrWarning( 0)
|
||||
if EgtIsMachiningEmpty() then
|
||||
EgtSetOperationMode( idMachining, false)
|
||||
end
|
||||
bMillingOk = true
|
||||
-- altrimenti lavorazione non applicata
|
||||
else
|
||||
_, sWarn = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( idMachining, false)
|
||||
bMillingOk = false
|
||||
end
|
||||
|
||||
-- eventuale lavorazione opposta
|
||||
local bMillingOppositeOk
|
||||
if bOppositeMillingNeeded then
|
||||
local sName = 'ContourOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local idMachining = EgtAddMachining( sName, sMillingOpposite)
|
||||
if not idMachining then
|
||||
local sErr = 'Error : impossible add machining ' .. sName .. '-' .. sMilling
|
||||
return false, sErr
|
||||
end
|
||||
-- geometria
|
||||
EgtSetMachiningGeometry( {{ idContourPath, -1}})
|
||||
-- lato di lavoro sinistro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- inversione direzione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
-- SCC
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if AreSameOrOppositeVectorApprox( vtTunnelDirection, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtTunnelDirection:getX()) < 0.1 then
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtTunnelDirection:getY() < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- gestione attacco e uscita
|
||||
if EgtCurveIsClosed( idContourPath) then
|
||||
-- attacco e uscita a quarto di cerchio senza allungamenti a inizio e fine
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0.5 * Tool.Diameter)
|
||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||
else
|
||||
-- nessun attacco e uscita, allungo inizio e fine di raggio utensile + 5mm (per evitare controllo collisioni)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.NONE)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Tool.Diameter / 2 + 5)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Tool.Diameter / 2 + 5)
|
||||
end
|
||||
-- affondamento - la curva è a metà tasca quindi affondamento 0 significa che la lavorazione arriva a metà tasca
|
||||
local dDepth
|
||||
-- si arriva a metà tasca
|
||||
if bOppositMillingReachesHalfDepth then
|
||||
dDepth = -dDimStrip / 2
|
||||
-- si arriva al massimo raggiungibile
|
||||
else
|
||||
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
||||
sWarn = 'Warning : incomplete'
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTunnelDepth / 2 + dDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if ML.ApplyMachining( true, false) then
|
||||
_, sWarn = EgtGetMachMgrWarning( 0)
|
||||
if EgtIsMachiningEmpty() then
|
||||
EgtSetOperationMode( idMachining, false)
|
||||
end
|
||||
bMillingOppositeOk = true
|
||||
-- altrimenti lavorazione non applicata
|
||||
else
|
||||
_, sWarn = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( idMachining, false)
|
||||
bMillingOppositeOk = false
|
||||
end
|
||||
end
|
||||
|
||||
if bMillingOk or ( bOppositeMillingNeeded and bMillingOppositeOk) then
|
||||
return true, sWarn
|
||||
else
|
||||
local sErr = 'Error : Not applicable'
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ExtractExternalPaths( nPathInt, nNumIdAux, vtOrtho, b3Solid, nAddGrpId)
|
||||
local nAuxId1, nAuxId2
|
||||
@@ -2870,7 +3104,7 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local dOffs = ( i - 1) * dStep
|
||||
if vtN:getZ() < dVzLimDwnUp then dOffs = dOffs + dSawThick end
|
||||
-- forzatura lavorazione discorde in base a parametro Q su feature
|
||||
local nQ14Param = EgtGetInfo( Proc.Id, Q_MILL_AS_BLADE_CONVENTIONAL, 'd') or 0
|
||||
local nQ14Param = EgtGetInfo( Proc.Id, Q_CONVENTIONAL_MILLING, 'd') or 0
|
||||
local bForceInvert = nQ14Param == 1 or ( nQ14Param == 2 and vtN:getX() < 0.1 and Proc.AffectedFaces.Bottom)
|
||||
if bForceInvert and i == 1 then
|
||||
dStartDist, dEndDist = dEndDist, dStartDist
|
||||
@@ -2878,9 +3112,10 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local bOk, sErr, nMchId = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw, bForceInvert)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- setto l'elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( 0, 1) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', 0)
|
||||
-- applico elevazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- tolgo eventuale step
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -3202,8 +3437,9 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
--EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1))
|
||||
end
|
||||
-- imposto massima elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 2) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 2))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
if EgtGetOutstrokeInfo() then
|
||||
@@ -3348,11 +3584,12 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local dFeed = EgtGetMachiningParam( MCH_MP.FEED) / 2
|
||||
EgtSetMachiningParam( MCH_MP.FEED, dFeed)
|
||||
end
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
if bAttackFromSide then
|
||||
sNotes = EgtSetValInNotes( sNotes, 'Plunge', 10)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'Plunge', 10)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
if EgtGetOutstrokeInfo() then
|
||||
@@ -3516,8 +3753,12 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, (nFaceRef)}})
|
||||
-- aggiungo geometria (se presente curva si lavora quella)
|
||||
if Proc.LoopIdFacInd then
|
||||
EgtSetMachiningGeometry( { Proc.LoopIdFacInd})
|
||||
else
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, (nFaceRef)}})
|
||||
end
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||
-- imposto posizione braccio porta testa
|
||||
@@ -3544,14 +3785,13 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- se tasca aperta e non lavorata col truciolatore, imposto opportuno attacco
|
||||
if sMchFind == 'OpenPocket' and nUseRoughTool == 0 then
|
||||
if ( sMchFind == 'OpenPocket' or sMchFind == 'OpenPocket_H2') and nUseRoughTool == 0 then
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
end
|
||||
if sMchFind == 'OpenPocket' and dDiamTool < 90 then
|
||||
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFaceRef, GDB_ID.ROOT)
|
||||
local bL = ( Proc.Fct < 4 or TestElleShape4( Proc) == 2)
|
||||
if bL and min( dH, dV) < 1.5 * dDiamTool then
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.ZIGZAG)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
if not bTipMill then
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_POCK_LI.HELIX)
|
||||
@@ -3574,13 +3814,22 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
if bOpenOutRaw then
|
||||
sNotes = sNotes .. 'OpenOutRaw=1;'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
-- Se forzato lato aperto lavorazione da curva forzo OpenOutRaw
|
||||
if( Proc.LoopIdFacInd and ( EgtGetInfo( Proc.LoopIdFacInd, 'OPEN', 'i') or -1) > -1) then
|
||||
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFaceRef, GDB_ID.ROOT)
|
||||
-- Se larghezza tasca uguale a larghezza utensile non permetto Invert
|
||||
if abs( min( dH, dV) - dDiamTool) < 50 * GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
end
|
||||
bOpenOutRaw = true
|
||||
end
|
||||
sNotes = sNotes .. ( EgtGetMachiningParam( MCH_MP.USERNOTES) or '')
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
if bOpenOutRaw then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'OpenOutRaw', 1)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
|
||||
@@ -3677,8 +3926,8 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nSideFace}})
|
||||
-- imposto vettore direzione e faceUse
|
||||
local vtFaceUse = EdgeToMachine.ToolDirection
|
||||
local sUserNotes = ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtFaceUse', EgtNumToString( vtFaceUse:getX(),3) .. ',' .. EgtNumToString( vtFaceUse:getY(),3) .. ',' .. EgtNumToString( vtFaceUse:getZ(),3))
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtFaceUse', EgtNumToString( vtFaceUse:getX(), 3) .. ',' .. EgtNumToString( vtFaceUse:getY(), 3) .. ',' .. EgtNumToString( vtFaceUse:getZ(), 3))
|
||||
local nFaceUse = BL.GetNearestOrthoOpposite( vtFaceUse)
|
||||
-- aggiusto i parametri
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
@@ -4126,12 +4375,12 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
end
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = ''
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
if not bMakeContour then
|
||||
sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
end
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) or EgtIsMachiningEmpty() then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
@@ -4266,12 +4515,12 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
end
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
sNotes = ''
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
if not bMakeContour then
|
||||
sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
end
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
@@ -4340,8 +4589,9 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
@@ -4611,9 +4861,10 @@ local function MakeAntiSplintByMill( Proc, nPartId, pPaths, nPathInt, vtN1,
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bInvertMach, not bInvert, bInvert))
|
||||
end
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
-- aggiungo alle note massima elevazione
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( ( dMaxElev + dMachDepth), 1) .. ';'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( ( dMaxElev + dMachDepth), 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if ML.ApplyMachining( true, false) then
|
||||
@@ -5272,7 +5523,7 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw)
|
||||
end
|
||||
|
||||
-- impostazione parametri lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
EgtSetMachiningGeometry( Machining.Geometry)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, Machining.Faceuse)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, Machining.SCC)
|
||||
@@ -6176,7 +6427,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nAdd
|
||||
-- forzo lato correzione a centrato
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
||||
-- leggo eventuali note esistenti della lavorazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
-- aggiungo alle note massima elevazione
|
||||
@@ -6629,7 +6880,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
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
|
||||
|
||||
-- TUNNEL: svuotatura o sega a catena
|
||||
if bClosedOrthoFaces then
|
||||
local bTryWithBlades = true
|
||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace
|
||||
@@ -6719,7 +6971,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
end
|
||||
end
|
||||
-- altrimenti non è una fessura
|
||||
|
||||
-- NO TUNNEL: tutti gli altri casi
|
||||
else
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
@@ -6755,6 +7008,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if bPrevBhSideMill == nil then
|
||||
bPrevBhSideMill = bMakeBySideMill
|
||||
end
|
||||
|
||||
-- SIDEMILL (tipo BLOCKHAUS)
|
||||
if bMakeBySideMill then
|
||||
-- se smusso non è esclusivo
|
||||
if nChamfer < 2 then
|
||||
@@ -6798,9 +7053,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dStep = min( dStep, dMaxMat)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dStep)
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dVcalc + dStep, 2) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dVcalc + dStep, 2))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- attacchi e uscite
|
||||
if vtN:getZ() > -0.5 or BD.TURN then
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
@@ -6888,7 +7144,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
end
|
||||
end
|
||||
-- altrimenti lavoro con svuotatura
|
||||
|
||||
-- TASCA GENERICA: si cerca il modo migliore di lavorare in base alla forma
|
||||
else
|
||||
local bSpecial3faces = false
|
||||
-- verifico se lavorando la faccia principale rimane esclusa molta sezione trasversale complessiva della feature (da box)
|
||||
@@ -6897,8 +7154,77 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if dH * dV < 0.9 * ( bBoxF:getDimX() * bBoxF:getDimY()) and nFacInd2 and dFacElev2 < 1.5 * dFacElev and not ( Proc.Topology == 'Groove' and Proc.Fct == 2) then
|
||||
bSpecial3faces = true
|
||||
end
|
||||
-- se riconosciuta gestione 3 facce (limitatamente per ora alla feature 20)
|
||||
if bSpecial3faces and Proc.Prc == 20 then
|
||||
|
||||
local bPocketFloatingAggregate = false
|
||||
-- se abilitata lavorazione con aggregato flottante
|
||||
local sMillingFloatingAggregate
|
||||
if Proc.Topology == 'Groove' and Proc.Fct == 4 and EgtGetInfo( Proc.Id, Q_FLOATING_AGGREGATE, 'i') == 1 then
|
||||
-- verifico se è possibile lavorare con utensile su aggregato flottante
|
||||
sMillingFloatingAggregate = ML.FindMilling( 'FloatingAggregate', dFacElev, nil, min( dH , dV))
|
||||
if sMillingFloatingAggregate then
|
||||
if EgtMdbSetCurrMachining( sMillingFloatingAggregate) then
|
||||
local sTuuidPk = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
|
||||
local dToolDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
-- la larghezza della tasca non può superare il doppio del diametro, la lavorazione deve essere fatta con una passata di contornatura
|
||||
if min( dH , dV) < dToolDiameter * 1.9 then
|
||||
bPocketFloatingAggregate = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- FRESATURA SPECIALE CON AGGREGATO FLOTTANTE
|
||||
if bPocketFloatingAggregate then
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Float_Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sMillingFloatingAggregate)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMillingFloatingAggregate
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- aggiungo geometria
|
||||
local Geometry = {}
|
||||
for Index = 1, Proc.Fct do
|
||||
if nFacInd ~= Index-1 then
|
||||
table.insert( Geometry, { Proc.Id, Index-1})
|
||||
end
|
||||
end
|
||||
EgtSetMachiningGeometry( Geometry)
|
||||
|
||||
-- imposto uso faccia
|
||||
local nFaceUse = BL.GetNearestParalOpposite( vtN)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- piccolo offset radiale per essere sicuri di lavorare anche con tasca larga come diametro fresa
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -0.01)
|
||||
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if AreSameVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtN:getX()) < 0.1 then
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtN:getY() < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- CASO SPECIALE 3 FACCE (se rimane esclusa molta sezione trasversale complessiva della feature, solo per feature 20)
|
||||
elseif bSpecial3faces and Proc.Prc == 20 then
|
||||
-- se smusso non è esclusivo
|
||||
if nChamfer < 2 then
|
||||
-- entrambe le facce non devono essere orientate verso il basso
|
||||
@@ -6998,8 +7324,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
end
|
||||
-- imposto elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dFacElev2, 1) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dFacElev2, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
@@ -7022,7 +7349,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if not bOk then return false, sWarn end
|
||||
end
|
||||
end
|
||||
-- altrimenti lavorazione di svuotatura o contornatura
|
||||
|
||||
-- SVUOTATURA O FRESATURA: si valuta se si può fare svuotatura o se provare altro
|
||||
else
|
||||
local bUseOtherFace
|
||||
local bLapJointAngTrasm = false
|
||||
@@ -7136,6 +7464,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
nUseRoughTool = 1
|
||||
end
|
||||
end
|
||||
-- se presente curva da lavorare con lato aperto
|
||||
if Proc.LoopIdFacInd and ( EgtGetInfo( Proc.LoopIdFacInd, 'OPEN', 'i') or -1) > -1 then
|
||||
sMchFind = 'OpenPocket'
|
||||
nUseRoughTool = 0
|
||||
end
|
||||
-- se abilitato rinvio da sotto
|
||||
if bLapJointAngTrasm then
|
||||
if not EgtEndsWith( sMchFind, '_AT') then
|
||||
@@ -7180,7 +7513,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
EgtErase( nSurfPartId)
|
||||
end
|
||||
end
|
||||
-- ricerca lavorazione
|
||||
|
||||
-- ricerca lavorazione di svuotatura
|
||||
local sPocketing
|
||||
local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
|
||||
if not sMyPocketing and bMillUp then
|
||||
@@ -7197,6 +7531,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if ( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or
|
||||
( bIsL and nUseRoughTool == 0) or
|
||||
( bIsL and Proc.Prc == 20) or
|
||||
( bIsL and not bSinglePart) or
|
||||
( Proc.Prc == 25 and not bIsU and not bIsL)) or
|
||||
( dCustomMaxElev and dCustomMaxElev > 10 * GEO.EPS_SMALL) then
|
||||
sPocketing = sMyPocketing
|
||||
@@ -7226,7 +7561,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local nQAntisplintResult = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0
|
||||
-- se lavorazione fresa come lama disabilito eventuale antischeggia
|
||||
if bSpecialMillOnSide then nQAntisplintResult = 0 end
|
||||
-- se non trovata una svuotatura adatta
|
||||
|
||||
-- NO SVUOTATURA (si deve provare altro)
|
||||
if not sPocketing then
|
||||
-- se forma a L provo con contornatura
|
||||
if bIsL and not bSpecialMillOnSide and not bForceSideMill then
|
||||
@@ -7367,6 +7703,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if ( bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU) or bForceSideMill then
|
||||
-- lavoro con svuotature (singola o doppia contrapposta)
|
||||
local sMyMchFind = EgtIf( bForceSideMill, 'OpenPocket', 'Pocket')
|
||||
if Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3'
|
||||
or Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' then
|
||||
sMyMchFind = 'OpenPocket'
|
||||
end
|
||||
local dDiamTool = 100
|
||||
local nPathInt, nSurfInt, bOneShot, nFirstMachId
|
||||
local bIs3Faces = true
|
||||
@@ -7434,7 +7774,6 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
bTryWithBlades = false
|
||||
-- se ho antischeggia con fresa le inserisco
|
||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||
@@ -7461,57 +7800,93 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- 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
|
||||
bOrthoFacesMaster = true
|
||||
bSetOpenBorders = true
|
||||
end
|
||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
||||
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
||||
if nOk == -3 then
|
||||
bTryWithBlades = true
|
||||
elseif nOk == -2 then
|
||||
if not sMchFind then
|
||||
sMchFind = sMchFindBackUp
|
||||
end
|
||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, nil, nil, not bMillDown, bMillDown)
|
||||
if not sPocketing then
|
||||
local sErr2 = 'Error : '..sMchFind..' not found in library'
|
||||
EgtOutLog( sErr2)
|
||||
return false, sErr2
|
||||
end
|
||||
bTryWithBlades = false
|
||||
sWarn = sErr
|
||||
elseif nOk < 0 then
|
||||
return false, sErr
|
||||
elseif nOk > 0 then
|
||||
bTryWithBlades = false
|
||||
sWarn = sErr
|
||||
-- se ho antischeggia con fresa le inserisco
|
||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
||||
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||
nil, nil, nil, b3Solid, dFacElevOri,
|
||||
bOneShot, nFirstMachId)
|
||||
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
||||
-- richiesto solo contorno
|
||||
if bOnlyContour then
|
||||
if Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' then
|
||||
-- direzione e faccia aggiunta del tunnel (la groove-3 passante è uno pseudotunnel)
|
||||
local _, _, dTunnelDepth, vtTunnelDirection, _, idAddedTunnelTmFace = BL.GetTunnelDimension( Proc, nPartId)
|
||||
-- si tiene il verso del tunnel dal lato Z positiva
|
||||
if vtTunnelDirection:getZ() < GEO.EPS_SMALL then
|
||||
vtTunnelDirection = -vtTunnelDirection
|
||||
EgtInvertSurf( idAddedTunnelTmFace)
|
||||
end
|
||||
-- elevazione della faccia aggiunta
|
||||
-- estrazione del contorno da lavorare
|
||||
local idContourPath = EgtExtractSurfTmLoops( idAddedTunnelTmFace, nAddGrpId)
|
||||
EgtModifyCurveExtrusion( idContourPath, vtTunnelDirection, GDB_RT.GLOB)
|
||||
-- si eliminano i lati aperti
|
||||
BL.SetOpenSide( idContourPath, b3Solid)
|
||||
BL.ChangeOrOpenStart( idContourPath, 2)
|
||||
-- spessore codolo da lasciare
|
||||
local dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 5
|
||||
local bOkContour, sWarn2 = MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunnelDepth, dDimStrip, nPhase)
|
||||
if bOkContour then
|
||||
return true, sWarn2
|
||||
else
|
||||
return false, sWarn2
|
||||
end
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
end
|
||||
else
|
||||
local sErr2 = 'Error : Cannot use ' .. Q_ONLY_CONTOUR .. ' on this feature'
|
||||
return false, sErr2
|
||||
end
|
||||
-- se abilitato dal parametro Q inserisco pulitura spigoli o contorno con fresa più piccola
|
||||
local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0
|
||||
if nContourSmallTool > 0 then
|
||||
local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown,
|
||||
bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid,
|
||||
dDepth, bOneShotm)
|
||||
if not bOk then return false, sWarn2 end
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
-- svuotatura
|
||||
else
|
||||
-- se 2 facce setto i parametri corretti per la MakeByPockets
|
||||
if bForceSideMill and Proc.Fct == 2 then
|
||||
bIs3Faces = false
|
||||
bOrthoFacesMaster = true
|
||||
bSetOpenBorders = true
|
||||
end
|
||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
||||
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
||||
if nOk == -3 then
|
||||
bTryWithBlades = true
|
||||
elseif nOk == -2 then
|
||||
if not sMchFind then
|
||||
sMchFind = sMchFindBackUp
|
||||
end
|
||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, nil, nil, not bMillDown, bMillDown)
|
||||
if not sPocketing then
|
||||
local sErr2 = 'Error : '..sMchFind..' not found in library'
|
||||
EgtOutLog( sErr2)
|
||||
return false, sErr2
|
||||
end
|
||||
bTryWithBlades = false
|
||||
sWarn = sErr
|
||||
elseif nOk < 0 then
|
||||
return false, sErr
|
||||
elseif nOk > 0 then
|
||||
bTryWithBlades = false
|
||||
sWarn = sErr
|
||||
-- se ho antischeggia con fresa le inserisco
|
||||
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||
nil, nil, nil, b3Solid, dFacElevOri,
|
||||
bOneShot, nFirstMachId)
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
end
|
||||
end
|
||||
-- se abilitato dal parametro Q inserisco pulitura spigoli o contorno con fresa più piccola
|
||||
local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0
|
||||
if nContourSmallTool > 0 then
|
||||
local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown,
|
||||
bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid,
|
||||
dDepth, bOneShotm)
|
||||
if not bOk then return false, sWarn2 end
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -7572,6 +7947,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- SVUOTATURA OK
|
||||
else
|
||||
-- se devo inserire il chamfer
|
||||
if ( ( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and nChamfer > 0 then
|
||||
@@ -7906,6 +8283,21 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local nFct = EgtSurfTmFacetCount( vAddId[i])
|
||||
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId, TaskId = Proc.TaskId, FeatureId = Proc.FeatureId, IsSplittedLapJoint = true, AffectedFaces = Proc.AffectedFaces, OkFromBottom = Proc.OkFromBottom}
|
||||
Topology.Classify( AddProc, b3Raw)
|
||||
-- con specifiche topologie si lavora la curva e si forza il lato aperto dove finisce la lavorazione precedente
|
||||
if i > 1 and
|
||||
( ( Proc.Topology == 'Groove' and Proc.IsThrough and Proc.Fct == 3 and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)
|
||||
or ( Proc.Topology == 'Groove' and Proc.Fct == 4 and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right))
|
||||
or Proc.Topology == 'Pocket') then
|
||||
local nFacInd = BL.GetFaceWithMostAdj( AddProc, nPartId)
|
||||
if type( nFacInd) == "number" and nFacInd >= 0 then
|
||||
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( vAddId[i], nFacInd, nAddGrpId)
|
||||
if nLoopId and nLoopCnt == 1 then
|
||||
local nEdgeId = BL.GetEdgeToMachineFromVector( vAddId[i], nFacInd, -X_AX())
|
||||
EgtSetInfo( nLoopId, 'OPEN', nEdgeId)
|
||||
AddProc.LoopIdFacInd = nLoopId
|
||||
end
|
||||
end
|
||||
end
|
||||
-- lasciare il false nel sesto parametro (perchè internamente viene verificato se diverso da nil)
|
||||
local bOk, sMyWarn
|
||||
bOk, sMyWarn, bPrevBhSideMill = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId, dOvmHead, bAllWithEndCap, bPrevBhSideMill, bAllWithEndCap)
|
||||
@@ -8117,7 +8509,9 @@ local function MakeStaircaseStep( Proc, nRawId, b3Raw, nPartId)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dMillVerticalStep)
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'VMRS=0;')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -8212,8 +8606,13 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- se lunghezza richiede spezzatura
|
||||
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
|
||||
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) or
|
||||
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( Proc.DistanceToNextPart > 1000 or Proc.Box:getDimX() > BD.LONGCUT_ENDLEN)) or
|
||||
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
|
||||
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
||||
if bOnlyContour then
|
||||
local sErr2 = 'Error : Cannot use ' .. Q_ONLY_CONTOUR .. ' on long features'
|
||||
return false, sErr2
|
||||
end
|
||||
-- una faccia
|
||||
if Proc.Fct == 1 then
|
||||
if bUseBlade then
|
||||
@@ -8240,7 +8639,9 @@ 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, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool)
|
||||
-- forzatura lavorazione discorde in base a parametro Q su feature
|
||||
local nQ14Param = EgtGetInfo( Proc.Id, Q_CONVENTIONAL_MILLING, 'd') or 0
|
||||
local bOk, sMyWarn, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool, nQ14Param)
|
||||
-- se non sono riuscito a farlo di lama, riprovo con la fresa
|
||||
if not bOk and bUseBlade then
|
||||
bUseBlade = false
|
||||
|
||||
@@ -483,9 +483,10 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dFacElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dFacElev, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
@@ -1425,8 +1426,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- eventuale nota utente per disabilitare controllo ingresso e uscita in grezzo
|
||||
if k < nO then
|
||||
local sNotes = 'OutRaw=3;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- aumento ingresso su spezzoni per evitare collisione durante approccio pezzo
|
||||
if bFront then
|
||||
-- se invertito si allunga ingresso su tutti tranne su ultimo
|
||||
|
||||
@@ -226,9 +226,10 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, nFacInd, d
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dFacElev, 1) .. ';'
|
||||
sNotes = sNotes .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dFacElev, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
@@ -319,7 +320,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster)
|
||||
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster, nUseConventionalMilling)
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
@@ -1131,8 +1132,17 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
elseif ( nSide ~= -1 or BD.DOWN_HEAD or BD.TURN) and nUseMillOnSide == 0 then
|
||||
-- determino la massima elevazione
|
||||
local dElev = 0
|
||||
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[1], b3Solid)
|
||||
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[2], b3Solid)
|
||||
|
||||
-- calcolo l'elevazione della faccia principale
|
||||
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[1]], b3Solid)
|
||||
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[2]], b3Solid)
|
||||
local bFacesSwapped = false
|
||||
if bInt and not bConvex and dFacElev1 - 10* GEO.EPS_SMALL > dFacElev2 then
|
||||
vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
|
||||
dFacElev1, dFacElev2 = dFacElev2, dFacElev1
|
||||
bFacesSwapped = true
|
||||
end
|
||||
|
||||
-- se facce concave e a 90 gradi, prendo l'elevazione minima
|
||||
if bOrtho then
|
||||
dElev = min( dFacElev1, dFacElev2)
|
||||
@@ -1141,7 +1151,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMilling
|
||||
local bDownHead = ( nSide == -1 and BD.DOWN_HEAD)
|
||||
local bDownHead = ( BD.DOWN_HEAD and ( nSide == -1 or AreSameVectorApprox( vtN[vOrd[1]], -Z_AX())))
|
||||
sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead)
|
||||
|
||||
if not sMilling then
|
||||
@@ -1173,10 +1183,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- se chiuso e corto, applico svuotatura con fresa opportuna
|
||||
if nFaceLimit == 3 and Proc.Box:getDimX() < 2 * dToolDiam then
|
||||
-- svuotatura della prima faccia longitudinale
|
||||
local bOk, sErr = MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, tFaceLong[1], dFacElev1)
|
||||
local bOk, sErr = MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, tFaceLong[vOrd[1]], dFacElev1)
|
||||
-- svuotatura della seconda faccia longitudinale
|
||||
if not bOk then return bOk, sErr end
|
||||
return MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, tFaceLong[2], dFacElev2)
|
||||
return MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, tFaceLong[vOrd[2]], dFacElev2)
|
||||
end
|
||||
-- determino gli estremi
|
||||
local dStartDist = 0
|
||||
@@ -1267,29 +1277,35 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local dLimitAngle = -0.5 - 20 * GEO.EPS_SMALL
|
||||
-- se facce ortogonali (concave), mantengo la lavorazione di testa sulla faccia più grande purchè non superi di 30 gradi il sottosquadra
|
||||
if bOrtho then
|
||||
if vtN[vOrd[1]]:getZ() > 0.001 and vtN[vOrd[2]]:getZ() > 0.001 then
|
||||
if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then
|
||||
nFin = 1
|
||||
else
|
||||
nIni = 2
|
||||
end
|
||||
if bDownHead and AreSameVectorApprox( vtN[vOrd[1]], -Z_AX()) then
|
||||
nFin = 1
|
||||
else
|
||||
if vtN[vOrd[1]]:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
elseif vtN[vOrd[2]]:getZ() < dLimitAngle then
|
||||
nFin = 1
|
||||
else
|
||||
if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then
|
||||
if vtN[vOrd[1]]:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
else
|
||||
nFin = 1
|
||||
end
|
||||
local vtN1 = vtN[vOrd[1]]
|
||||
local vtN2 = vtN[vOrd[2]]
|
||||
if vtN1:getZ() > 0.001 and vtN2:getZ() > 0.001 then
|
||||
if vtN1:getZ() >= vtN2:getZ() then
|
||||
nFin = 1
|
||||
else
|
||||
if vtN[vOrd[1]]:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
nIni = 2
|
||||
end
|
||||
else
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
elseif vtN2:getZ() < dLimitAngle then
|
||||
nFin = 1
|
||||
else
|
||||
if vtN1:getZ() >= vtN2:getZ() then
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
else
|
||||
nFin = 1
|
||||
end
|
||||
else
|
||||
nFin = 1
|
||||
if vtN1:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
else
|
||||
nFin = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1313,7 +1329,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- valore sovrapposizione tra passate con fresa di fianco
|
||||
local dOverLapExtend = 2
|
||||
-- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg)
|
||||
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN)))
|
||||
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( bDownHead or ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN))))
|
||||
-- Limitazioni della lavorazione
|
||||
local nPos = EgtIf( i == 1, j, nC - j + 1)
|
||||
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0))
|
||||
@@ -1380,15 +1396,19 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local dMySal, dMyEal = dSal, dEal
|
||||
if bFacesSwapped then
|
||||
dMySal, dMyEal = dMyEal, dMySal
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, tFaceLong[vOrd[i]]}})
|
||||
-- limito opportunamente la lavorazione
|
||||
if ( nSide == -1 and BD.DOWN_HEAD) then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dMyEal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dMySal)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dMySal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dMyEal)
|
||||
end
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
@@ -1399,6 +1419,28 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- imposto lato di lavoro e inversione
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bSide, true, false))
|
||||
|
||||
-- si aggiusta la direzione di lavoro in base a rotazione utensile e preferenza utente (nUseConventionalMilling da fuori o Q14)
|
||||
EgtMdbSetCurrMachining( sMilling)
|
||||
local bIsCurrentToolCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
||||
if nUseConventionalMilling == nil then
|
||||
nUseConventionalMilling = EgtGetInfo( Proc.Id, 'Q14', 'd') or 0
|
||||
end
|
||||
local bUseConventionalMilling = false
|
||||
if nUseConventionalMilling == 1 or ( nUseConventionalMilling == 2 and vtN[vOrd[i]]:getX() < 0.1 and Proc.AffectedFaces.Bottom) then
|
||||
bUseConventionalMilling = true
|
||||
end
|
||||
if bIsCurrentToolCCW ~= bUseConventionalMilling then
|
||||
local dCurrStartAddLen = EgtGetMachiningParam( MCH_MP.STARTADDLEN)
|
||||
local dCurrEndAddLen = EgtGetMachiningParam( MCH_MP.ENDADDLEN)
|
||||
local bCurrInvert = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
local nCurrWorkside = EgtGetMachiningParam( MCH_MP.WORKSIDE)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dCurrEndAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dCurrStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bCurrInvert)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nCurrWorkside == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
|
||||
-- imposto offset radiale (nullo se concavo o di lato)
|
||||
local dOffsR = EgtIf( k < nO, ( nO - k) * dStep, EgtIf( bConvex, - BD.CUT_EXTRA, 0))
|
||||
if bSide then dOffsR = 0 end
|
||||
@@ -1432,7 +1474,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left then
|
||||
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left and Proc.DistanceToNextPart < ( dToolDiam / 2 + 5) then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
@@ -1465,8 +1507,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
sMilling = ML.FindMilling( sMchType)
|
||||
sPrefix = 'L2CS_'
|
||||
nExtendMach = nUseMillOnSide
|
||||
if nUseMillOnSide == 2 then
|
||||
bRemoveToolRadius = true
|
||||
if nUseMillOnSide == 2 then
|
||||
bRemoveToolRadius = true
|
||||
end
|
||||
-- se testa da sotto
|
||||
if nSide ~= 1 and BD.DOWN_HEAD then
|
||||
@@ -1544,6 +1586,12 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- calcolo l'elevazione della faccia principale
|
||||
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[1]], b3Solid)
|
||||
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[2]], b3Solid)
|
||||
local bFacesSwapped = false
|
||||
if bInt and not bConvex and dFacElev1 - 10* GEO.EPS_SMALL > dFacElev2 then
|
||||
vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
|
||||
dFacElev1, dFacElev2 = dFacElev2, dFacElev1
|
||||
bFacesSwapped = true
|
||||
end
|
||||
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino al limite se l'elevazione della faccia è minore del raggio utensile
|
||||
if nUseMillOnSide <= 1 or nSide == -1 then
|
||||
local dFacElev = max( dFacElev1, dFacElev2)
|
||||
@@ -1642,6 +1690,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
dEndAccDist = 0
|
||||
end
|
||||
end
|
||||
if Proc.bMoveAfterSplit then
|
||||
nC = 1
|
||||
dStartDist = Proc.Box:getDimX() - ( dToolDiam / 2 + 5)
|
||||
dEndDist = - ( dToolDiam / 2 + 5)
|
||||
end
|
||||
-- ciclo sulle parti
|
||||
local nM = 0
|
||||
for j = 1, nC do
|
||||
@@ -1724,7 +1777,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local ptC3 = EgtSurfTmFacetCenter( Proc.Id, tFaceLong[vOrd[i]], GDB_ID.ROOT)
|
||||
local ptDir = ptC3 - ptM ; ptDir:normalize()
|
||||
-- se concave e dal versore Z della faccia (> -20°) o convesso e versore Z ( > -30°) decido se eseguire la lavoraione con la testa da sopra o da sotto
|
||||
if ( not bConvex and vtN[vOrd[i]]:getZ() > -0.9397 and ptDir:getZ() > 0) or
|
||||
if ( not bConvex and vtN[vOrd[i]]:getZ() > -0.9397 and ptDir:getZ() > -0.017) or
|
||||
( bConvex and vtN[vOrd[i]]:getZ() > -0.866 and ptDir:getZ() > 0) then
|
||||
sNameF = sPrefix .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
|
||||
nMchFId = EgtAddMachining( sNameF, sMilling)
|
||||
@@ -1832,9 +1885,39 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[i]])
|
||||
end
|
||||
end
|
||||
|
||||
if bFacesSwapped then
|
||||
local dCurrStartAddLen = EgtGetMachiningParam( MCH_MP.STARTADDLEN)
|
||||
local dCurrEndAddLen = EgtGetMachiningParam( MCH_MP.ENDADDLEN)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dCurrEndAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dCurrStartAddLen)
|
||||
end
|
||||
|
||||
-- imposto lato di lavoro e inversione
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
|
||||
-- si aggiusta la direzione di lavoro in base a rotazione utensile e preferenza utente (nUseConventionalMilling da fuori o Q14)
|
||||
EgtMdbSetCurrMachining( sMilling)
|
||||
local bIsCurrentToolCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
||||
if nUseConventionalMilling == nil then
|
||||
nUseConventionalMilling = EgtGetInfo( Proc.Id, 'Q14', 'd') or 0
|
||||
end
|
||||
local bUseConventionalMilling = false
|
||||
if nUseConventionalMilling == 1 or ( nUseConventionalMilling == 2 and vtN[vOrd[i]]:getX() < 0.1 and Proc.AffectedFaces.Bottom) then
|
||||
bUseConventionalMilling = true
|
||||
end
|
||||
if bIsCurrentToolCCW ~= bUseConventionalMilling then
|
||||
local dCurrStartAddLen = EgtGetMachiningParam( MCH_MP.STARTADDLEN)
|
||||
local dCurrEndAddLen = EgtGetMachiningParam( MCH_MP.ENDADDLEN)
|
||||
local bCurrInvert = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
local nCurrWorkside = EgtGetMachiningParam( MCH_MP.WORKSIDE)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dCurrEndAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dCurrStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bCurrInvert)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nCurrWorkside == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
|
||||
-- calcolo la componente dNz non in base alla classificazione della feature (sopra, sotto, fianchi) ma alla componente maggiore
|
||||
-- local dNz = EgtIf( nSide == 0, vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
|
||||
-- local dNz = EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
|
||||
|
||||
@@ -128,8 +128,9 @@ end
|
||||
local nFaceUse = BL.GetNearestParalOpposite( vtN)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- applico il parametro plunge, che setta la lavorazione per affondare solamente, senza lavorare tutto il contorno; 1: solo lato iniziale, 2: solo lato finale, 3: entrambi
|
||||
local sNotes = 'Plunge=3;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'Plunge' , 3)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- imposto angolo 3° asse rot
|
||||
local vtOrtho = BL.GetVersRef( nFaceUse)
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sMortising, 'perpendicular'))
|
||||
@@ -692,7 +693,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- imposto elevazione
|
||||
local sUserNotes = 'MaxElev=' .. EgtNumToString( dMorH, 1) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMorH, 1))
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
@@ -752,7 +754,9 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- setto profondità
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, -nDepthMin+BD.CUT_EXTRA)
|
||||
-- imposto elevazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (-nDepthMin+BD.CUT_EXTRA), 1) .. ';')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( (-nDepthMin+BD.CUT_EXTRA), 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -666,7 +666,9 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( (dToolMaxDepth/2), 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
@@ -716,7 +718,9 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dWidth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if BD.TURN then
|
||||
local nSCC = GetSccForTurn( vtN)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
|
||||
@@ -666,7 +666,9 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( (dToolMaxDepth/2), 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
@@ -716,7 +718,9 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dWidth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if BD.TURN then
|
||||
local nSCC = GetSccForTurn( vtN)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
|
||||
@@ -602,7 +602,9 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dWidth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- imposto tipo uso faccia
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||
if nSide == -1 then
|
||||
|
||||
@@ -657,7 +657,9 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dElev, 1))
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- imposto posizione braccio
|
||||
local nSCC = MCH_SCC.ADIR_YM
|
||||
if nSide == 0 then
|
||||
@@ -697,7 +699,9 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dElev, 1))
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- imposto posizione braccio
|
||||
local nSCC = MCH_SCC.ADIR_YM
|
||||
if nSide == 0 then
|
||||
|
||||
@@ -578,7 +578,9 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, vFaceOrd[2]-1}})
|
||||
-- imposto elevazione
|
||||
if dDistFaces then
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dDistFaces, 1) .. ';')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDistFaces, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
|
||||
@@ -198,7 +198,13 @@ local function MakeTailChamfer( idProc, nPartId, dDepthTailChamfer)
|
||||
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
|
||||
|
||||
local dQ09Value = EgtGetInfo( idProc, 'Q09', 'd')
|
||||
if not dQ09Value then
|
||||
dQ09Value = 0.1
|
||||
end
|
||||
local bChamferedEdge = dQ09Value > 0
|
||||
dQ09Value = EgtIf( bChamferedEdge, max( dQ09Value, 0.1), min( dQ09Value, -0.1))
|
||||
|
||||
|
||||
|
||||
local nIdFirstEntity, nEntityCnt = EgtExplodeCurveCompo( nLoopId)
|
||||
local p3MidPoint = EgtMP( nIdFirstEntity, GDB_ID.GRID)
|
||||
@@ -234,6 +240,9 @@ local function MakeTailChamfer( idProc, nPartId, dDepthTailChamfer)
|
||||
end
|
||||
EgtChangeClosedCurveStartPoint( idGeom, p3MidPoint, GDB_RT.GRID)
|
||||
|
||||
-- reimposto la griglia
|
||||
EgtSetGridFrame()
|
||||
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local dExtra = 2
|
||||
local sName1 = 'TailCham_' .. ( EgtGetName( idProc) or tostring( idProc))
|
||||
@@ -301,6 +310,10 @@ local function MakeCutByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dR
|
||||
local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT)
|
||||
local vtOrtho = BL.GetVersRef( nFaceUse)
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
|
||||
-- se il taglio è un precut, sto 10mm più all'interno per essere sicuro di tagliare effettivamente qualcosa
|
||||
if BD.PRECUT_TAIL and sNotes and sNotes:find( 'Precut;') then
|
||||
dRadialOffset = dRadialOffset - 10
|
||||
end
|
||||
-- imposto offset radiale per mantenere il materiale in coda per la finitura
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
|
||||
-- imposto eventuale allungamento percorso iniziale
|
||||
@@ -821,7 +834,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
-- determinazione materiale da asportare
|
||||
local dSawThickCheck = dSawThick
|
||||
if dSawThick2 > 0 and bDoubleHorizCut then
|
||||
dSawThickCheck = min( dSawThick, dSawThick2)
|
||||
dSawThickCheck = max( min( dSawThick, dSawThick2), dOvmTail)
|
||||
end
|
||||
local dMaxElev = 0
|
||||
if vtN:getX() > 0 then
|
||||
|
||||
@@ -181,8 +181,9 @@ local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchF
|
||||
-- La tasca ha sempre almeno un lato aperto, imposto opportuno attacco
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
-- imposto elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
|
||||
|
||||
@@ -236,7 +236,9 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, -dTenH + dDepth + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dDepth + dExtra, 1) .. ';')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDepth + dExtra, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- eseguo
|
||||
@@ -309,7 +311,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- sistemo i parametri
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dTenH - 100 * GEO.EPS_SMALL, 1)) .. ';'
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTenH - 100 * GEO.EPS_SMALL, 1))
|
||||
if i < nPass then sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3) end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
|
||||
@@ -451,12 +451,12 @@ local function MakeMillCut( Proc, i, j, k, sMilling, nFacInd, TabNAD, rfFac, dOf
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, ( dToolDiam * 0.75))
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, ( dToolDiam * 0.75))
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill solo in ultima passata in Z locale
|
||||
local sUserNotes
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
if i < nStep then
|
||||
sUserNotes = 'MaxElev=' .. EgtNumToString( dStep, 1) .. ';'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dStep, 1))
|
||||
else
|
||||
sUserNotes = 'VMRS=0;'
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dStep, 1) .. ';'
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dStep, 1))
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
|
||||
@@ -142,7 +142,9 @@ local function MakePocket( Proc, nRawId, b3Raw, nPartId)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, min( 0, dMaxDepth - vDepth[i]))
|
||||
-- imposto elevazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxDepth, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( true)
|
||||
EgtEnableDebug( false)
|
||||
|
||||
-- Imposto direttorio libreria specializzata per Travi
|
||||
EgtAddToPackagePath( BEAM.BASEDIR .. '\\LuaLibs\\?.lua')
|
||||
|
||||
+27
-1
@@ -1,6 +1,32 @@
|
||||
==== Beam Update Log ====
|
||||
Versione 3.1c1 (04/03/2026)
|
||||
- Fixed : correzione in ordinamento (fori vs tagli)
|
||||
- Fixed : in drilling rimosso preforo duplicato
|
||||
|
||||
Versione 2.7k1 (25/11/2024)
|
||||
Versione 3.1b1 (26/02/2026)
|
||||
- Added : in LapJoint lunghe gestito Q14 per lavorare discorde
|
||||
- Added : in forature ora sono possibili le DrillPocket in doppio (ultimo step fatto dalla testa principale)
|
||||
- Added : in FreeContour (contornatura) aggiunta Q10 per forzare massima elevazione
|
||||
- Modif : in LongDoubleCut e LapJoint lunghe migliorata la scelta della faccia da lavorare e altre migliorie
|
||||
- Modif : in LapJoint migliorie alle svuotature
|
||||
- Modif : in LapJoint lunghe, negli spezzoni successivi al primo, le svuotature considerano l'area svuotata precedente
|
||||
- Fixed : in forature in doppio si garantisce l'ultimo step per evitare collisioni delle punte o finecorsa
|
||||
- Fixed : in mortasa a coda di rondine tagliata corretti ingresso uscita in caso di svuotatura
|
||||
- Fixed : in tagli di testa e coda corretti smussi con P08 e P09
|
||||
|
||||
Versione 2.7l3 (23/12/2025)
|
||||
- Modif : nei fori che attraversano un taglio si decide la precedenza in base all'angolo tra foro e taglio stesso
|
||||
- Fixed : corretto precut in caso di sega a catena
|
||||
|
||||
Versione 2.7l2 (16/12/2025)
|
||||
- Added : in LapJoint pulizia spigoli con fresa a V su tasche non passanti
|
||||
|
||||
Versione 2.7l1 (10/12/2025)
|
||||
- Added : in LapJoint aggiunta gestione fresatura con aggregato flottante (Q specifica)
|
||||
- Modif : in LapJoint modfifiche alla lavorazione spigoli su faccia frontale o posteriore
|
||||
- Modif : in LapJoint lunghe, la spezzatura ora considera se è presente del grezzo dietro
|
||||
|
||||
Versione 2.7k1 (25/11/2025)
|
||||
- Added : in tagli di testa e coda aggiunti smussi con possibilità di raccordare o smussare spigoli
|
||||
- Added : in Lapjoint aggiunto Q14 per settare lavorazione discorde se longitudinale su faccia sotto
|
||||
- Modif : migliorati i tagli
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
-- Version.lua by Egaltech s.r.l. 2024/01/30
|
||||
-- Version.lua by Egaltech s.r.l. 2026/02/09
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.7k1'
|
||||
MIN_EXE = '2.7f2'
|
||||
VERSION = '3.1c1'
|
||||
MIN_EXE = '3.1b1'
|
||||
|
||||
Reference in New Issue
Block a user