Compare commits
123 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ea64a9a3f4 | |||
| cac9ec767c | |||
| 85e6c3c86d | |||
| c548172635 | |||
| 9869d1a61e | |||
| e0c66df59b | |||
| c0156a4a97 | |||
| 93f1bc4d0d | |||
| adaeb1e19c | |||
| 2430b4e787 | |||
| b08710451a | |||
| 4adf62069f | |||
| b6e904845e | |||
| 118b9a88d2 | |||
| 73c86bd35f | |||
| 5de62b9563 | |||
| a7a9a23cf3 | |||
| 21fe8ca47d | |||
| 0f536b07c4 | |||
| 3e01fb36b0 | |||
| 3c4af3c335 | |||
| 9480453e57 | |||
| e98f924630 | |||
| eabbc883e4 | |||
| 8e19e87d3f | |||
| 0c4f57a90b | |||
| 77310576bd | |||
| 1e2f559937 | |||
| 6a6dc27560 | |||
| ab6ed79a0e | |||
| 7bb237f7d2 | |||
| 67bb55537e | |||
| 777179d1b2 | |||
| 06adbb0b5d | |||
| 872a3ec899 | |||
| 5dae07e2aa | |||
| fc26a8ad4a | |||
| 04046787e3 | |||
| a12aaf86bc | |||
| 70d16909f5 | |||
| 5007cda21f | |||
| 76d03160c5 | |||
| 534302f48e | |||
| 60d73199e4 | |||
| 71a51e56e1 | |||
| bf9791ca9c | |||
| 249cb4eea5 | |||
| 46cda4d472 | |||
| 72b0e7f4a4 | |||
| 0e02959467 | |||
| b7837fe95c | |||
| d66eaf5322 | |||
| 05ecf76312 | |||
| 6e3a1ddc7a | |||
| df47691da1 | |||
| 8a2200e0de | |||
| 0136ccac19 | |||
| 7ee683aeb8 | |||
| e81d1aef66 | |||
| 5331466c4f | |||
| 7a972cccc8 | |||
| 2ed5af9661 | |||
| e25c24a33a | |||
| aeca298feb | |||
| a09565cfb7 | |||
| 862b375ee5 | |||
| a34147ce15 | |||
| cb3ad1d24c | |||
| 06e266226a | |||
| 74b40a6ad7 | |||
| ab7971e5f9 | |||
| e188753f49 | |||
| 9b12a74591 | |||
| e17e8189f7 | |||
| a5d4503180 | |||
| 41f92e9dd4 | |||
| c5a6300d15 | |||
| bf5c12ec8a | |||
| 777ba74e4d | |||
| 268e578125 | |||
| 13f0545ebe | |||
| 445a76f543 | |||
| 4b52653a2e | |||
| ced290604a | |||
| 2c68515b93 | |||
| b26ad523ab | |||
| cd346b8536 | |||
| 2853731c4c | |||
| d31efb1f2a | |||
| e1702d1263 | |||
| 236254fed6 | |||
| 82f20f3c87 | |||
| adc75c0504 | |||
| 761778b87c | |||
| 5fa40fad99 | |||
| 8e608bd623 | |||
| 60a1707d43 | |||
| 1848ed85d0 | |||
| 197673de11 | |||
| 19e1d4e760 | |||
| abb1509314 | |||
| b9e4d9b01f | |||
| fcb541175a | |||
| 99e0b9967e | |||
| b88caa12ab | |||
| 40912bb7b7 | |||
| 7d6903d181 | |||
| 43cf75d400 | |||
| 2fa3ea24a5 | |||
| c82a27ebae | |||
| a7df54d8d2 | |||
| e8d11f150e | |||
| 6d8bd01266 | |||
| 65a256ba7b | |||
| d403f9cfcf | |||
| 30cc274c2e | |||
| 6564bdc74f | |||
| 6cdf1583c0 | |||
| 5441ff7b50 | |||
| d03ed02b2c | |||
| 8c4000a74c | |||
| 4c48085e4f | |||
| 37265932e9 |
+54
-6
@@ -101,6 +101,21 @@ local function WriteTimeToLogFile( dTime)
|
|||||||
hFile:close()
|
hFile:close()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Funzioni per riportare stato lavorazione o pezzo in nge
|
||||||
|
local function WriteErrToNge( nProcId, sErr, sMsg, sRot, sCutId, sTaskId)
|
||||||
|
EgtSetInfo( nProcId, 'STATUS.ERR', sErr)
|
||||||
|
EgtSetInfo( nProcId, 'STATUS.MSG', sMsg)
|
||||||
|
EgtSetInfo( nProcId, 'STATUS.ROT', sRot)
|
||||||
|
EgtSetInfo( nProcId, 'CUTID', sCutId)
|
||||||
|
EgtSetInfo( nProcId, 'TASKID', sTaskId)
|
||||||
|
end
|
||||||
|
local function WriteFallToNge( nPartId, sErr, sMsg, sCutId, sFall)
|
||||||
|
EgtSetInfo( nPartId, 'STATUS.ERR', sErr)
|
||||||
|
EgtSetInfo( nPartId, 'STATUS.MSG', sMsg)
|
||||||
|
EgtSetInfo( nPartId, 'CUTID', sCutId)
|
||||||
|
EgtSetInfo( nPartId, 'STATUS.FALL', sFall)
|
||||||
|
end
|
||||||
|
|
||||||
-- Funzione per gestire visualizzazione dopo errore
|
-- Funzione per gestire visualizzazione dopo errore
|
||||||
local function PostErrView( nErr, sMsg)
|
local function PostErrView( nErr, sMsg)
|
||||||
if nErr ~= 0 and ( BEAM.FLAG == 1 or BEAM.FLAG == 2) then
|
if nErr ~= 0 and ( BEAM.FLAG == 1 or BEAM.FLAG == 2) then
|
||||||
@@ -132,7 +147,7 @@ local function UpdateAuxData( sAuxFile)
|
|||||||
-- Se definito PROJID, aggiorno
|
-- Se definito PROJID, aggiorno
|
||||||
local sProjId = EgtGetStringFromIni( 'AuxData', 'PROJID', '', sAuxFile)
|
local sProjId = EgtGetStringFromIni( 'AuxData', 'PROJID', '', sAuxFile)
|
||||||
if sProjId ~= '' then
|
if sProjId ~= '' then
|
||||||
EgtSetInfo( BtlInfoId, 'PROJECT', sProjId)
|
EgtSetInfo( BtlInfoId, 'PROJECTNUMBER', sProjId)
|
||||||
bModif = true
|
bModif = true
|
||||||
end
|
end
|
||||||
-- Se definito PRODID, aggiorno
|
-- Se definito PRODID, aggiorno
|
||||||
@@ -413,6 +428,9 @@ if bToProcess then
|
|||||||
BEAM.CUTID = Stats[i].CutId
|
BEAM.CUTID = Stats[i].CutId
|
||||||
BEAM.TASKID = Stats[i].TaskId
|
BEAM.TASKID = Stats[i].TaskId
|
||||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||||
|
if Stats[i].ProcId then
|
||||||
|
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||||
|
end
|
||||||
elseif Stats[i].Err > 0 then
|
elseif Stats[i].Err > 0 then
|
||||||
nErrCnt = nErrCnt + 1
|
nErrCnt = nErrCnt + 1
|
||||||
sOutput = sOutput .. string.format( '[%d,%d] %s\n', Stats[i].CutId, Stats[i].TaskId, sMsg)
|
sOutput = sOutput .. string.format( '[%d,%d] %s\n', Stats[i].CutId, Stats[i].TaskId, sMsg)
|
||||||
@@ -422,6 +440,9 @@ if bToProcess then
|
|||||||
BEAM.CUTID = Stats[i].CutId
|
BEAM.CUTID = Stats[i].CutId
|
||||||
BEAM.TASKID = Stats[i].TaskId
|
BEAM.TASKID = Stats[i].TaskId
|
||||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||||
|
if Stats[i].ProcId then
|
||||||
|
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||||
|
end
|
||||||
elseif Stats[i].Err < 0 then
|
elseif Stats[i].Err < 0 then
|
||||||
-- se segnalazione scarico pezzo standard, incompleto o a caduta
|
-- se segnalazione scarico pezzo standard, incompleto o a caduta
|
||||||
if Stats[i].Err == -100 or Stats[i].Err == -101 or Stats[i].Err == -102 then
|
if Stats[i].Err == -100 or Stats[i].Err == -101 or Stats[i].Err == -102 then
|
||||||
@@ -430,6 +451,9 @@ if bToProcess then
|
|||||||
BEAM.CUTID = Stats[i].CutId
|
BEAM.CUTID = Stats[i].CutId
|
||||||
BEAM.FALL = abs( Stats[i].Err + 100)
|
BEAM.FALL = abs( Stats[i].Err + 100)
|
||||||
WriteFallToLogFile( BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
|
WriteFallToLogFile( BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
|
||||||
|
if Stats[i].ProcId then
|
||||||
|
WriteFallToNge( Stats[i].PartId, BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
|
||||||
|
end
|
||||||
-- altri avvertimenti
|
-- altri avvertimenti
|
||||||
else
|
else
|
||||||
nWarnCnt = nWarnCnt + 1
|
nWarnCnt = nWarnCnt + 1
|
||||||
@@ -440,6 +464,9 @@ if bToProcess then
|
|||||||
BEAM.CUTID = Stats[i].CutId
|
BEAM.CUTID = Stats[i].CutId
|
||||||
BEAM.TASKID = Stats[i].TaskId
|
BEAM.TASKID = Stats[i].TaskId
|
||||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||||
|
if Stats[i].ProcId then
|
||||||
|
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -455,35 +482,56 @@ if bToProcess then
|
|||||||
PostWarnView( 19, sOutput)
|
PostWarnView( 19, sOutput)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Altrimenti carico il progetto salvato e dichiaro nessun errore
|
-- Altrimenti carico il progetto salvato, rileggo gli errori da nge e riscrivo il log txt con gli stati precedenti
|
||||||
else
|
else
|
||||||
EgtOutLog( ' +++ Loading Project already processed >>>')
|
EgtOutLog( ' +++ Loading Project already processed >>>')
|
||||||
-- Carico il progetto già fatto
|
-- Carico il progetto già fatto
|
||||||
EgtOpenFile( sNgeFile)
|
EgtOpenFile( sNgeFile)
|
||||||
-- Dichiaro nessun errore
|
-- Riscrivo il log txt
|
||||||
local nPartId = EgtGetFirstPart()
|
local nPartId = EgtGetFirstPart()
|
||||||
while nPartId do
|
while nPartId do
|
||||||
local nCutId = EgtGetInfo( nPartId, 'CUTID')
|
local nCutId = EgtGetInfo( nPartId, 'CUTID')
|
||||||
if nCutId then
|
if nCutId then
|
||||||
|
-- stato a livello di singola feature
|
||||||
local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nPartId, 'Processings') or GDB_ID.NULL)
|
local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nPartId, 'Processings') or GDB_ID.NULL)
|
||||||
while nProcId do
|
while nProcId do
|
||||||
local bIsFea = EgtExistsInfo( nProcId, 'GRP') and EgtExistsInfo( nProcId, 'PRC')
|
local bIsFea = EgtExistsInfo( nProcId, 'GRP') and EgtExistsInfo( nProcId, 'PRC')
|
||||||
local nTaskId = EgtGetInfo( nProcId, 'TASKID')
|
local nTaskId = EgtGetInfo( nProcId, 'TASKID')
|
||||||
|
local sErr = EgtGetInfo( nProcId, 'STATUS.ERR') or 0
|
||||||
|
local sMsg = EgtGetInfo( nProcId, 'STATUS.MSG') or '---'
|
||||||
|
local sRot = EgtGetInfo( nProcId, 'STATUS.ROT') or 0
|
||||||
if bIsFea and nTaskId then
|
if bIsFea and nTaskId then
|
||||||
BEAM.ERR = 0
|
BEAM.ERR = sErr
|
||||||
BEAM.MSG = '---'
|
BEAM.MSG = sMsg
|
||||||
BEAM.ROT = 0
|
BEAM.ROT = sRot
|
||||||
BEAM.CUTID = nCutId
|
BEAM.CUTID = nCutId
|
||||||
BEAM.TASKID = nTaskId
|
BEAM.TASKID = nTaskId
|
||||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||||
end
|
end
|
||||||
nProcId = EgtGetNext( nProcId)
|
nProcId = EgtGetNext( nProcId)
|
||||||
end
|
end
|
||||||
|
-- stato a livello di pezzo
|
||||||
|
local sErr = EgtGetInfo( nPartId, 'STATUS.ERR') or 0
|
||||||
|
if sErr == -100 or sErr == -101 or sErr == -102 then
|
||||||
|
local sMsg = EgtGetInfo( nPartId, 'STATUS.MSG') or '---'
|
||||||
|
local sFall = EgtGetInfo( nPartId, 'STATUS.FALL') or 0
|
||||||
|
BEAM.ERR = sErr
|
||||||
|
BEAM.MSG = sMsg
|
||||||
|
BEAM.CUTID = nCutId
|
||||||
|
BEAM.FALL = sFall
|
||||||
|
WriteFallToLogFile( BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
nPartId = EgtGetNextPart( nPartId)
|
nPartId = EgtGetNextPart( nPartId)
|
||||||
end
|
end
|
||||||
-- Aggiorno eventuali dati ausiliari
|
-- Aggiorno eventuali dati ausiliari
|
||||||
UpdateAuxData( sBtmFile)
|
UpdateAuxData( sBtmFile)
|
||||||
|
|
||||||
|
-- Anche se non è da riprocessare, imposto nome file CN.
|
||||||
|
-- Se file TS7 importato da altro PC, 'BEAM.FILE' è cambiato da un PC all'altro. Di conseguenza si deve aggiornare nome file che si andrà a generare.
|
||||||
|
local _, sName, _ = EgtSplitPath( BEAM.FILE)
|
||||||
|
EgtSetInfo( EgtGetLastMachGroup(), 'NcName', sName .. '.cnc')
|
||||||
|
|
||||||
-- Passo in modalità lavora
|
-- Passo in modalità lavora
|
||||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||||
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ REM Compilazione 32 e 64 bit
|
|||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua -s LuaLibs\ProcessText.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua -s LuaLibs\ProcessText.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua -s LuaLibs\ProcessTyroleanDovetail.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua -s LuaLibs\ProcessTyroleanDovetail.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua -s LuaLibs\ProcessVariant.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua -s LuaLibs\ProcessVariant.lua
|
||||||
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProbing.lua -s LuaLibs\ProcessProbing.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua
|
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua
|
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\GetBeamData.lua -s GetBeamData.lua
|
\EgtProg\Dll32\luac54 -o bin\GetBeamData.lua -s GetBeamData.lua
|
||||||
|
|||||||
+50
-22
@@ -108,6 +108,7 @@ _G.package.loaded.ProcessScarfJoint = nil
|
|||||||
_G.package.loaded.ProcessSimpleScarf = nil
|
_G.package.loaded.ProcessSimpleScarf = nil
|
||||||
_G.package.loaded.ProcessStepJoint = nil
|
_G.package.loaded.ProcessStepJoint = nil
|
||||||
_G.package.loaded.ProcessStepJointNotch = nil
|
_G.package.loaded.ProcessStepJointNotch = nil
|
||||||
|
_G.package.loaded.ProcessProbing = nil
|
||||||
_G.package.loaded.ProcessProfFront = nil
|
_G.package.loaded.ProcessProfFront = nil
|
||||||
_G.package.loaded.ProcessProfConcave = nil
|
_G.package.loaded.ProcessProfConcave = nil
|
||||||
_G.package.loaded.ProcessProfConvex = nil
|
_G.package.loaded.ProcessProfConvex = nil
|
||||||
@@ -1238,7 +1239,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
|||||||
Proc.Flg = 0
|
Proc.Flg = 0
|
||||||
Proc.Down = true
|
Proc.Down = true
|
||||||
bAllOk = false
|
bAllOk = false
|
||||||
table.insert( Stats, {Err = 1, Msg='Error : impossible to machine by orientation', CutId=Proc.CutId, TaskId=Proc.TaskId})
|
table.insert( Stats, {Err = 1, Msg='Error : impossible to machine by orientation', CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id})
|
||||||
-- gestione feature di coda da lavorare ribaltata
|
-- gestione feature di coda da lavorare ribaltata
|
||||||
elseif Proc.Tail and bDown then
|
elseif Proc.Tail and bDown then
|
||||||
Proc.Down = true
|
Proc.Down = true
|
||||||
@@ -1259,12 +1260,12 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
|||||||
elseif Proc.Flg == 0 then
|
elseif Proc.Flg == 0 then
|
||||||
bAllOk = false
|
bAllOk = false
|
||||||
Proc.ErrMsg = 'Error : out of the part'
|
Proc.ErrMsg = 'Error : out of the part'
|
||||||
table.insert( Stats, {Err = 1, Msg=Proc.ErrMsg, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
table.insert( Stats, {Err = 1, Msg=Proc.ErrMsg, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id})
|
||||||
else
|
else
|
||||||
Proc.Flg = 0
|
Proc.Flg = 0
|
||||||
bAllOk = false
|
bAllOk = false
|
||||||
if not Proc.ErrMsg then Proc.ErrMsg = 'Error : impossible to machine' end
|
if not Proc.ErrMsg then Proc.ErrMsg = 'Error : impossible to machine' end
|
||||||
table.insert( Stats, {Err = 1, Msg=Proc.ErrMsg, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
table.insert( Stats, {Err = 1, Msg=Proc.ErrMsg, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se necessario ribaltamento, assegno intestatura alla fase ribaltata
|
-- se necessario ribaltamento, assegno intestatura alla fase ribaltata
|
||||||
@@ -1826,7 +1827,10 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
|
|||||||
sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true)
|
sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true)
|
||||||
dMachiningDepth = dMaxDepth or dMachiningDepth
|
dMachiningDepth = dMaxDepth or dMachiningDepth
|
||||||
end
|
end
|
||||||
if not sDrilling or ( sType ~= 'Drill' and sType ~= 'Pocket') or not EgtMdbSetCurrMachining( sDrilling) then
|
if not sDrilling
|
||||||
|
or ( sType ~= 'Drill' and ( sType ~= 'Pocket'or ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)))
|
||||||
|
or not EgtMdbSetCurrMachining( sDrilling) then
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP)
|
local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP)
|
||||||
@@ -1860,10 +1864,16 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
|
|||||||
( BD.DOWN_HEAD and AreOppositeVectorApprox( vtExtr, Y_AX())) then
|
( BD.DOWN_HEAD and AreOppositeVectorApprox( vtExtr, Y_AX())) then
|
||||||
Proc.Double = 2
|
Proc.Double = 2
|
||||||
Proc.MachDepthDouble = dMachiningDepth
|
Proc.MachDepthDouble = dMachiningDepth
|
||||||
|
Proc.MirrorId = ProcToDisable.Id
|
||||||
|
Proc.MirrorCutId = ProcToDisable.CutId
|
||||||
|
Proc.MirrorTaskId = ProcToDisable.TaskId
|
||||||
DisableOtherDrilling( ProcToDisable, vProc)
|
DisableOtherDrilling( ProcToDisable, vProc)
|
||||||
elseif BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Z_AX()) then
|
elseif BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||||
Proc.Double = 3
|
Proc.Double = 3
|
||||||
Proc.MachDepthDouble = dMachiningDepth
|
Proc.MachDepthDouble = dMachiningDepth
|
||||||
|
Proc.MirrorId = ProcToDisable.Id
|
||||||
|
Proc.MirrorCutId = ProcToDisable.CutId
|
||||||
|
Proc.MirrorTaskId = ProcToDisable.TaskId
|
||||||
DisableOtherDrilling( ProcToDisable, vProc)
|
DisableOtherDrilling( ProcToDisable, vProc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2169,13 +2179,19 @@ function BeamExec.ProcessFeatures()
|
|||||||
end
|
end
|
||||||
if not bOk then
|
if not bOk then
|
||||||
nTotErr = nTotErr + 1
|
nTotErr = nTotErr + 1
|
||||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
elseif sMsg and #sMsg > 0 then
|
|
||||||
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
|
||||||
else
|
|
||||||
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
|
||||||
if Proc.Double == 2 or Proc.Double == 3 then
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId})
|
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
|
end
|
||||||
|
elseif sMsg and #sMsg > 0 then
|
||||||
|
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
|
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-2, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
|
end
|
||||||
|
else
|
||||||
|
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
|
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se è taglio di separazione, verifico se ha già aggiunto una nuova fase oppure se è da creare
|
-- se è taglio di separazione, verifico se ha già aggiunto una nuova fase oppure se è da creare
|
||||||
@@ -2259,13 +2275,19 @@ function BeamExec.ProcessFeatures()
|
|||||||
end
|
end
|
||||||
if not bOk then
|
if not bOk then
|
||||||
nTotErr = nTotErr + 1
|
nTotErr = nTotErr + 1
|
||||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
elseif sMsg and #sMsg > 0 then
|
|
||||||
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
|
||||||
else
|
|
||||||
table.insert( Stats, {Err=0, Msg='', Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
|
||||||
if Proc.Double == 2 or Proc.Double == 3 then
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
table.insert( Stats, {Err=0, Msg='', Rot=-1, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId})
|
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
|
end
|
||||||
|
elseif sMsg and #sMsg > 0 then
|
||||||
|
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
|
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-1, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
|
end
|
||||||
|
else
|
||||||
|
table.insert( Stats, {Err=0, Msg='', Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
|
table.insert( Stats, {Err=0, Msg='', Rot=-1, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if bOk then nSideMchOk = nSideMchOk + 1 end
|
if bOk then nSideMchOk = nSideMchOk + 1 end
|
||||||
@@ -2337,13 +2359,19 @@ function BeamExec.ProcessFeatures()
|
|||||||
end
|
end
|
||||||
if not bOk then
|
if not bOk then
|
||||||
nTotErr = nTotErr + 1
|
nTotErr = nTotErr + 1
|
||||||
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
elseif sMsg and #sMsg > 0 then
|
|
||||||
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
|
||||||
else
|
|
||||||
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
|
|
||||||
if Proc.Double == 2 or Proc.Double == 3 then
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId})
|
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
|
end
|
||||||
|
elseif sMsg and #sMsg > 0 then
|
||||||
|
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
|
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
|
end
|
||||||
|
else
|
||||||
|
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
|
||||||
|
if Proc.Double == 2 or Proc.Double == 3 then
|
||||||
|
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se era taglio di separazione, aggiungo nuova fase
|
-- se era taglio di separazione, aggiungo nuova fase
|
||||||
|
|||||||
+7
-1
@@ -642,7 +642,7 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
|
|||||||
-- premio quella che non è sottosquadra e che ha la X minore
|
-- premio quella che non è sottosquadra e che ha la X minore
|
||||||
local bDiffSmall = true
|
local bDiffSmall = true
|
||||||
for i = 1, #dtElev do
|
for i = 1, #dtElev do
|
||||||
if dtElev[i] > dMinElev + 5 or dtElev[i] > 80 then
|
if ( dtElev[i] > dMinElev + 5 or dtElev[i] > 80) and dMinElev < 0.85 * dtElev[i] then
|
||||||
bDiffSmall = false
|
bDiffSmall = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1345,6 +1345,12 @@ function BeamLib.GetToolFromMachining( sMachiningName)
|
|||||||
Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
|
Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
|
||||||
Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||||
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
||||||
|
Tool.HeadType = {}
|
||||||
|
Tool.PreferredSide = {}
|
||||||
|
if BD.GetSetupInfo then
|
||||||
|
Tool.HeadType = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).HeadType
|
||||||
|
Tool.PreferredSide = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).PreferredSide
|
||||||
|
end
|
||||||
-- lama
|
-- lama
|
||||||
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
|
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
|
||||||
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
|
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
|
||||||
|
|||||||
+2
-2
@@ -407,7 +407,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
|||||||
local dNzLimDwnUp = BL.GetNzLimDownUp( BBoxRawPart)
|
local dNzLimDwnUp = BL.GetNzLimDownUp( BBoxRawPart)
|
||||||
|
|
||||||
-- se non c'è testa da sotto e normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda
|
-- se non c'è testa da sotto e normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda
|
||||||
if not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then
|
if not BD.TURN and not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then
|
||||||
OffsetO = dOrthoMaxDim or BD.MAX_DIM_HTCUT
|
OffsetO = dOrthoMaxDim or BD.MAX_DIM_HTCUT
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -566,7 +566,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return UltimateTable
|
return UltimateTable, OffsetP, OffsetO
|
||||||
end
|
end
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
+91
-16
@@ -46,7 +46,7 @@ local BD = require( 'BeamData')
|
|||||||
local ML = require( 'MachiningLib')
|
local ML = require( 'MachiningLib')
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
|
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, sLeadInOutType, dActualElevation)
|
||||||
EgtOutLog( 'FacesBySaw.MakeParallelOne', 3)
|
EgtOutLog( 'FacesBySaw.MakeParallelOne', 3)
|
||||||
-- dati della faccia
|
-- dati della faccia
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||||
@@ -68,16 +68,28 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
|
|||||||
local dLiPerp = dDistX + dCutExtra + dCutSic
|
local dLiPerp = dDistX + dCutExtra + dCutSic
|
||||||
local dLoTang = dLiTang
|
local dLoTang = dLiTang
|
||||||
local dLoPerp = dLiPerp
|
local dLoPerp = dLiPerp
|
||||||
|
local dLiCompLength = 0
|
||||||
|
local dLoCompLength = 0
|
||||||
-- lunghezza attacco/uscita tangenti
|
-- lunghezza attacco/uscita tangenti
|
||||||
local dLi2Tang = dSawDiam / 2 + dCutSic
|
local dLi2Tang = dSawDiam / 2 + dCutSic
|
||||||
local dLi2Perp = 0
|
local dLi2Perp = 0
|
||||||
local dLo2Tang = dLi2Tang
|
local dLo2Tang = dLi2Tang
|
||||||
local dLo2Perp = dLi2Perp
|
local dLo2Perp = dLi2Perp
|
||||||
|
local dLi2CompLength = 0
|
||||||
|
local dLo2CompLength = 0
|
||||||
-- scelgo l'attacco più conveniente
|
-- scelgo l'attacco più conveniente
|
||||||
local bLioTang
|
local bLioTang
|
||||||
local Ktp = 1.1
|
local Ktp = 1.1
|
||||||
if BD.KIOTP then Ktp = BD.KIOTP end
|
if BD.KIOTP then Ktp = BD.KIOTP end
|
||||||
if bForceTangentLeadInOut or ( Ktp * dLi2Tang < dLiPerp) then
|
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||||
|
bLioTang = false
|
||||||
|
dLiCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
|
||||||
|
dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
|
||||||
|
dLiTang = 1
|
||||||
|
dLoTang = 1
|
||||||
|
dLiPerp = 0
|
||||||
|
dLoPerp = 0
|
||||||
|
elseif ( sLeadInOutType ~= 'Perpendicular') and ( ( sLeadInOutType == 'Tangent') or ( Ktp * dLi2Tang < dLiPerp)) then
|
||||||
bLioTang = true
|
bLioTang = true
|
||||||
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
|
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
|
||||||
if BD.TURN then
|
if BD.TURN then
|
||||||
@@ -136,9 +148,11 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
|
|||||||
-- imposto attacco/uscita
|
-- imposto attacco/uscita
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
|
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LICOMPLEN, dLiCompLength)
|
||||||
if BD.TURN and bLioTang then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
|
if BD.TURN and bLioTang then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
|
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOCOMPLEN, dLoCompLength)
|
||||||
-- imposto allungamenti iniziale e finale
|
-- imposto allungamenti iniziale e finale
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dAccStart)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dAccStart)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dAccEnd)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dAccEnd)
|
||||||
@@ -157,6 +171,9 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
|
|||||||
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
|
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
|
||||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtTool, vtOut))
|
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtTool, vtOut))
|
||||||
-- eventuali note
|
-- eventuali note
|
||||||
|
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||||
|
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
|
||||||
|
end
|
||||||
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
|
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
@@ -193,7 +210,28 @@ local function GetNameSolidFaceIncludingLine( b3Solid, ptP1Comp, ptP2Comp)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut, Par5Alternative)
|
local function AreSameOrOppositeDirApprox( vDir1, vDir2)
|
||||||
|
if abs( abs( vDir1) - abs( vDir2)) < 10 * GEO.EPS_SMALL then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
|
||||||
|
local _, EdgesEgt = EgtSurfTmGetFacetOutlineInfo( nSurfId, nFacet, GDB_ID.ROOT)
|
||||||
|
|
||||||
|
for i = 1, #EdgesEgt do
|
||||||
|
if AreOppositeVectorApprox( EdgesEgt[i].Norm, vtOrthO) then
|
||||||
|
return ( i - 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation)
|
||||||
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
|
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
|
||||||
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
|
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
|
||||||
Par5 == MCH_MILL_FU.PARAL_TOP or
|
Par5 == MCH_MILL_FU.PARAL_TOP or
|
||||||
@@ -201,7 +239,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
Par5 == MCH_MILL_FU.PARAL_BACK or
|
Par5 == MCH_MILL_FU.PARAL_BACK or
|
||||||
Par5 == MCH_MILL_FU.PARAL_LEFT or
|
Par5 == MCH_MILL_FU.PARAL_LEFT or
|
||||||
Par5 == MCH_MILL_FU.PARAL_RIGHT) then
|
Par5 == MCH_MILL_FU.PARAL_RIGHT) then
|
||||||
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
|
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, sLeadInOutType, dActualElevation)
|
||||||
end
|
end
|
||||||
-- la lama ha asse perpendicolare alla faccia
|
-- la lama ha asse perpendicolare alla faccia
|
||||||
EgtOutLog( 'FacesBySaw.MakeOne', 3)
|
EgtOutLog( 'FacesBySaw.MakeOne', 3)
|
||||||
@@ -233,8 +271,9 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
|
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
|
||||||
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
|
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
|
||||||
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
|
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
|
||||||
-- linea o bilinea di lavorazione
|
|
||||||
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, vtOrthO, GDB_ID.ROOT)
|
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, vtOrthO, GDB_ID.ROOT)
|
||||||
|
|
||||||
|
|
||||||
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
|
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
|
||||||
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
|
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
|
||||||
EgtOutLog( sWarn, 1)
|
EgtOutLog( sWarn, 1)
|
||||||
@@ -373,6 +412,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
|
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
|
||||||
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
||||||
local dLiCompLength = 0
|
local dLiCompLength = 0
|
||||||
|
local dLoCompLength = 0
|
||||||
-- attacco tangente
|
-- attacco tangente
|
||||||
local dLi2Tang = 0
|
local dLi2Tang = 0
|
||||||
local dLi2Perp = 0
|
local dLi2Perp = 0
|
||||||
@@ -394,6 +434,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
end
|
end
|
||||||
local dLenLi2 = abs( dLi2Tang)
|
local dLenLi2 = abs( dLi2Tang)
|
||||||
local dLenLo2 = abs( dLo2Tang)
|
local dLenLo2 = abs( dLo2Tang)
|
||||||
|
local dBiLineaAddLength = 0
|
||||||
|
|
||||||
-- se il lato non lavorato della bilinea è aperto, setto entrata/uscita con la stessa direzione
|
-- se il lato non lavorato della bilinea è aperto, setto entrata/uscita con la stessa direzione
|
||||||
if bIsBiLinea then
|
if bIsBiLinea then
|
||||||
@@ -422,6 +463,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
local dDistPointToCenter = sqrt( dDistPtTang * dDistPtTang + dDistToCenter * dDistToCenter)
|
local dDistPointToCenter = sqrt( dDistPtTang * dDistPtTang + dDistToCenter * dDistToCenter)
|
||||||
-- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo uscita opportunamente
|
-- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo uscita opportunamente
|
||||||
if dDistPointToCenter > 0.5 * dSawDiam then
|
if dDistPointToCenter > 0.5 * dSawDiam then
|
||||||
|
dBiLineaAddLength = dDistPointToCenter - ( 0.5 * dSawDiam)
|
||||||
dLoTang = -dAllEnd * dCosAlpha
|
dLoTang = -dAllEnd * dCosAlpha
|
||||||
dLoPerp = dDist2 * dSinAlpha
|
dLoPerp = dDist2 * dSinAlpha
|
||||||
end
|
end
|
||||||
@@ -432,7 +474,17 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
local bLioTang
|
local bLioTang
|
||||||
local Ktp = 1.1
|
local Ktp = 1.1
|
||||||
if BD.KIOTP then Ktp = BD.KIOTP end
|
if BD.KIOTP then Ktp = BD.KIOTP end
|
||||||
if ( bForceTangentLeadInOut or ( not bDownUp or abs( vtTg:getY()) > 0.5) and
|
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||||
|
bLioTang = false
|
||||||
|
dLiCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
|
||||||
|
dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
|
||||||
|
dLiTang = 1
|
||||||
|
dLoTang = 1
|
||||||
|
dLiPerp = 0
|
||||||
|
dLoPerp = 0
|
||||||
|
dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
|
||||||
|
dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
||||||
|
elseif ( sLeadInOutType ~= 'Perpendicular') and ( ( sLeadInOutType == 'Tangent') or ( not bDownUp or abs( vtTg:getY()) > 0.5) and
|
||||||
( not bDownHead or abs( vtTg:getZ()) < 0.51) and
|
( not bDownHead or abs( vtTg:getZ()) < 0.51) and
|
||||||
abs( vtTg:getX()) < 0.9848 and
|
abs( vtTg:getX()) < 0.9848 and
|
||||||
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5) and not bDownHead) or
|
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5) and not bDownHead) or
|
||||||
@@ -455,11 +507,23 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
-- dLoPerp rimane invariato
|
-- dLoPerp rimane invariato
|
||||||
end
|
end
|
||||||
elseif BD.TURN then
|
elseif BD.TURN then
|
||||||
bLioTang = 2
|
|
||||||
local dMove = dist( ptP1, ptP2)
|
|
||||||
dLiTang, dLiPerp = dLi2Tang, dLi2Perp
|
dLiTang, dLiPerp = dLi2Tang, dLi2Perp
|
||||||
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
|
-- se angolo bilinea ottuso si segue bilinea per un tratto per tagliare completamente cubetto a forma di rombo
|
||||||
dLoPerp = BD.COLL_SIC
|
if dCosAngleL1L2 > 0.707 and bIsBiLinea then
|
||||||
|
-- calcolo uscita per prolungare solo della parte mancante per completare il taglio
|
||||||
|
if dBiLineaAddLength > 0 then
|
||||||
|
dLoTang = dLoTang * ( dBiLineaAddLength + BD.COLL_SIC) / 100
|
||||||
|
dLoPerp = dLoPerp * ( dBiLineaAddLength + BD.COLL_SIC) / 100
|
||||||
|
end
|
||||||
|
-- aggiungo componente perpendicolare a percorso per ritornare dal punto di ingresso, altrimenti l'uscita viene allungata fino dall'altra parte del grezzo
|
||||||
|
dLoCompLength = 100
|
||||||
|
-- se angolo bilinea oltre 45°, faccio movimento in retrazione
|
||||||
|
else
|
||||||
|
bLioTang = 2
|
||||||
|
local dMove = dist( ptP1, ptP2)
|
||||||
|
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
|
||||||
|
dLoPerp = BD.COLL_SIC
|
||||||
|
end
|
||||||
else
|
else
|
||||||
bLioTang = true
|
bLioTang = true
|
||||||
dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength
|
dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength
|
||||||
@@ -532,8 +596,18 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
|
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
|
||||||
-- imposto uso faccia
|
-- imposto uso faccia
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||||
local sNoteVtFaceUse = 'VtFaceUse=' .. EgtNumToString( vtOrthO:getX(),3) .. ',' .. EgtNumToString( vtOrthO:getY(),3) .. ',' .. EgtNumToString( vtOrthO:getZ(),3) .. ';'
|
-- 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
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteVtFaceUse)
|
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)
|
||||||
|
else
|
||||||
|
local sNoteVtFaceUse = 'VtFaceUse=' .. EgtNumToString( vtOrthO:getX(),3) .. ',' .. EgtNumToString( vtOrthO:getY(),3) .. ',' .. EgtNumToString( vtOrthO:getZ(),3) .. ';'
|
||||||
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteVtFaceUse)
|
||||||
|
-- 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)
|
||||||
|
end
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- imposto inversione e lato correzione
|
-- imposto inversione e lato correzione
|
||||||
@@ -551,13 +625,14 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
|
if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
|
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
|
||||||
-- imposto allungamenti iniziale e finale
|
EgtSetMachiningParam( MCH_MP.LOCOMPLEN, dLoCompLength)
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
|
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
|
|
||||||
-- imposto angolo 3° asse rot
|
-- imposto angolo 3° asse rot
|
||||||
local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular')
|
local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular')
|
||||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO))
|
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO))
|
||||||
-- eventuali note
|
-- eventuali note
|
||||||
|
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||||
|
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
|
||||||
|
end
|
||||||
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
|
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
@@ -627,7 +702,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
|||||||
local bFaceOk = {}
|
local bFaceOk = {}
|
||||||
bFaceOk[1] = ( vtN[1]:getZ() >= ( BD.CUT_VZ_MIN or BD.NZ_MINB) or abs( vtN[1]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[1].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
bFaceOk[1] = ( vtN[1]:getZ() >= ( BD.CUT_VZ_MIN or BD.NZ_MINB) or abs( vtN[1]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[1].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
||||||
bFaceOk[2] = ( vtN[2]:getZ() >= ( BD.CUT_VZ_MIN or BD.NZ_MINB) or abs( vtN[2]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[2].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
bFaceOk[2] = ( vtN[2]:getZ() >= ( BD.CUT_VZ_MIN or BD.NZ_MINB) or abs( vtN[2]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[2].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
|
||||||
if not bDownHead and ( not bFaceOk[1] or not bFaceOk[2]) then
|
if not bDownHead and not bFaceOk[1] and not bFaceOk[2] then
|
||||||
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
|
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
|||||||
+63
-42
@@ -25,11 +25,14 @@ EgtOutLog( ' MachiningLib started', 1)
|
|||||||
|
|
||||||
-- Dati
|
-- Dati
|
||||||
local BD = require( 'BeamData')
|
local BD = require( 'BeamData')
|
||||||
local Cuttings = require( 'CutData')
|
-- librerie lavorazioni caricate con pcall perchè potrebbero non esserci
|
||||||
local Millings = require( 'MillingData')
|
local Cuttings, Millings, Pocketings, Sawings, Drillings, Probing
|
||||||
local Pocketings = require( 'PocketingData')
|
if pcall( require, 'CutData') then Cuttings = require( 'CutData') end
|
||||||
local Sawings = require( 'SawingData')
|
if pcall( require, 'MillingData') then Millings = require( 'MillingData') end
|
||||||
local Drillings = require( 'DrillData')
|
if pcall( require, 'PocketingData') then Pocketings = require( 'PocketingData') end
|
||||||
|
if pcall( require, 'SawingData') then Sawings = require( 'SawingData') end
|
||||||
|
if pcall( require, 'DrillData') then Drillings = require( 'DrillData') end
|
||||||
|
if pcall( require, 'ProbingData') then Probing = require( 'ProbingData') end
|
||||||
|
|
||||||
-- tipo di teste macchina
|
-- tipo di teste macchina
|
||||||
local ONE_HEAD = 1 -- una testa (Fast, One, Turn1T)
|
local ONE_HEAD = 1 -- una testa (Fast, One, Turn1T)
|
||||||
@@ -184,18 +187,32 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function GetMachinings( MachiningType, sType)
|
function GetMachinings( MachiningType, sType)
|
||||||
local Machinings
|
local Machinings = {}
|
||||||
-- leggo le lavorazioni disponibili
|
-- leggo le lavorazioni disponibili
|
||||||
if MachiningType == MCH_MY.DRILLING then
|
if MachiningType == MCH_MY.DRILLING then
|
||||||
Machinings = Drillings
|
if Drillings and type( Drillings) == "table" then
|
||||||
|
Machinings = Drillings
|
||||||
|
end
|
||||||
elseif MachiningType == MCH_MY.SAWING then
|
elseif MachiningType == MCH_MY.SAWING then
|
||||||
Machinings = Cuttings
|
if Cuttings and type( Cuttings) == "table" then
|
||||||
|
Machinings = Cuttings
|
||||||
|
end
|
||||||
elseif MachiningType == MCH_MY.MILLING then
|
elseif MachiningType == MCH_MY.MILLING then
|
||||||
Machinings = Millings
|
if Millings and type( Millings) == "table" then
|
||||||
|
Machinings = Millings
|
||||||
|
end
|
||||||
elseif MachiningType == MCH_MY.POCKETING then
|
elseif MachiningType == MCH_MY.POCKETING then
|
||||||
Machinings = Pocketings
|
if Pocketings and type( Pocketings) == "table" then
|
||||||
|
Machinings = Pocketings
|
||||||
|
end
|
||||||
elseif MachiningType == MCH_MY.MORTISING then
|
elseif MachiningType == MCH_MY.MORTISING then
|
||||||
Machinings = Sawings
|
if Sawings and type( Sawings) == "table" then
|
||||||
|
Machinings = Sawings
|
||||||
|
end
|
||||||
|
elseif MachiningType == MCH_MY.PROBING then
|
||||||
|
if Probing and type( Probing) == "table" then
|
||||||
|
Machinings = Probing
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- scrivo i parametri utensile nella lavorazione
|
-- scrivo i parametri utensile nella lavorazione
|
||||||
local validMachinings = {}
|
local validMachinings = {}
|
||||||
@@ -208,27 +225,30 @@ function GetMachinings( MachiningType, sType)
|
|||||||
if Machining.Tool.Name then
|
if Machining.Tool.Name then
|
||||||
if EgtTdbSetCurrTool( Machining.Tool.Name) then
|
if EgtTdbSetCurrTool( Machining.Tool.Name) then
|
||||||
table.insert( validMachinings, Machining)
|
table.insert( validMachinings, Machining)
|
||||||
if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
|
-- se non è tastatura, recupero dati utensile
|
||||||
Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth()
|
if MachiningType ~= MCH_MY.PROBING then
|
||||||
else
|
if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
|
||||||
Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth()
|
||||||
end
|
else
|
||||||
if MachiningType == MCH_MY.DRILLING then
|
Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||||
if EgtStartsWith( Machining.Type, 'Drill') then
|
|
||||||
Machining.SubType = 'Drill'
|
|
||||||
elseif EgtStartsWith( Machining.Type, 'AngleDrill') then
|
|
||||||
Machining.SubType = 'AngleDrill'
|
|
||||||
elseif EgtStartsWith( Machining.Type, 'Pocket') then
|
|
||||||
Machining.SubType = 'DrillPocket'
|
|
||||||
elseif EgtStartsWith( Machining.Type, 'Predrill') then
|
|
||||||
Machining.SubType = 'Predrill'
|
|
||||||
end
|
end
|
||||||
|
if MachiningType == MCH_MY.DRILLING then
|
||||||
|
if EgtStartsWith( Machining.Type, 'Drill') then
|
||||||
|
Machining.SubType = 'Drill'
|
||||||
|
elseif EgtStartsWith( Machining.Type, 'AngleDrill') then
|
||||||
|
Machining.SubType = 'AngleDrill'
|
||||||
|
elseif EgtStartsWith( Machining.Type, 'Pocket') then
|
||||||
|
Machining.SubType = 'DrillPocket'
|
||||||
|
elseif EgtStartsWith( Machining.Type, 'Predrill') then
|
||||||
|
Machining.SubType = 'Predrill'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||||
|
Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||||
|
Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||||
|
Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam()
|
||||||
|
Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72
|
||||||
end
|
end
|
||||||
Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
|
||||||
Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
|
||||||
Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
|
||||||
Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam()
|
|
||||||
Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -311,6 +331,7 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||||
|
local bOptimizeHeads = BEAM and BEAM.BW and ( not sSortingCriterion or sSortingCriterion == '')
|
||||||
if bTopHead == nil and bDownHead == nil then
|
if bTopHead == nil and bDownHead == nil then
|
||||||
bTopHead = true
|
bTopHead = true
|
||||||
bDownHead = false
|
bDownHead = false
|
||||||
@@ -342,21 +363,21 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
|||||||
local ForStart = 1
|
local ForStart = 1
|
||||||
local ForEnd = #Machinings
|
local ForEnd = #Machinings
|
||||||
local ForStep = 1
|
local ForStep = 1
|
||||||
-- le forature vanno scorse dal diametro maggiore al minore
|
-- le forature vanno scorse dal diametro maggiore al minore, a meno che non sia stato passato un ordinamento specifico
|
||||||
if MachiningType == MCH_MY.DRILLING then
|
if MachiningType == MCH_MY.DRILLING and ( not sSortingCriterion or sSortingCriterion == '') then
|
||||||
ForStart = #Machinings
|
ForStart = #Machinings
|
||||||
ForEnd = 1
|
ForEnd = 1
|
||||||
ForStep = -1
|
ForStep = -1
|
||||||
end
|
end
|
||||||
if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
|
if bOptimizeHeads or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
|
||||||
_, sType = EgtEndsWith( sType, '_H2')
|
_, sType = EgtEndsWith( sType, '_H2')
|
||||||
elseif not ( BEAM and BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
|
elseif not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
|
||||||
if not EgtEndsWith( sType, '_H2') then
|
if not EgtEndsWith( sType, '_H2') then
|
||||||
sType = sType .. '_H2'
|
sType = sType .. '_H2'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local MachineHeadUse = MachineHeadType
|
local MachineHeadUse = MachineHeadType
|
||||||
if not ( BEAM and BEAM.BW) and MachineHeadUse == TWO_EQUAL_HEADS then
|
if not bOptimizeHeads and MachineHeadUse == TWO_EQUAL_HEADS then
|
||||||
MachineHeadUse = ONE_HEAD
|
MachineHeadUse = ONE_HEAD
|
||||||
end
|
end
|
||||||
if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
||||||
@@ -368,7 +389,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
|||||||
for i = ForStart, ForEnd, ForStep do
|
for i = ForStart, ForEnd, ForStep do
|
||||||
local Machining = Machinings[i]
|
local Machining = Machinings[i]
|
||||||
local sMachiningType = Machining.Type
|
local sMachiningType = Machining.Type
|
||||||
if ( BEAM and BEAM.BW) or MachineHeadUse == TWO_EQUAL_HEADS then
|
if bOptimizeHeads or MachineHeadUse == TWO_EQUAL_HEADS then
|
||||||
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
||||||
end
|
end
|
||||||
-- recupero dati utensile
|
-- recupero dati utensile
|
||||||
@@ -444,7 +465,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local bH2, sOrigType = EgtEndsWith( sType, '_H2')
|
local bH2, sOrigType = EgtEndsWith( sType, '_H2')
|
||||||
if ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then
|
if not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then
|
||||||
return FindMachining( MachiningType, sOrigType, Params, true, false)
|
return FindMachining( MachiningType, sOrigType, Params, true, false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -455,7 +476,7 @@ function MachiningLib.FindCutting( sType, bTopHead, bDownHead, dDepth, sSortingC
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission, bIsPredrill)
|
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission, bIsPredrill, bExcludeH3, sSortingCriterion)
|
||||||
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5, sTypeMach
|
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5, sTypeMach
|
||||||
-- se il foro è un predrill, cerco solo punte abilitate al Predrill
|
-- se il foro è un predrill, cerco solo punte abilitate al Predrill
|
||||||
if bIsPredrill then
|
if bIsPredrill then
|
||||||
@@ -463,9 +484,9 @@ function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExclude
|
|||||||
else
|
else
|
||||||
sTypeMach = EgtIf( bAngleTransmission, 'Drill_AT', 'Drill')
|
sTypeMach = EgtIf( bAngleTransmission, 'Drill_AT', 'Drill')
|
||||||
end
|
end
|
||||||
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, sTypeMach, { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2)
|
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, sTypeMach, { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||||
if ( not MachiningName or MachiningName == '') then
|
if ( not MachiningName or MachiningName == '') then
|
||||||
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead)
|
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||||
end
|
end
|
||||||
if MachiningName and MachiningName ~= '' then
|
if MachiningName and MachiningName ~= '' then
|
||||||
return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5
|
return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5
|
||||||
@@ -481,8 +502,8 @@ function MachiningLib.FindAngleDrilling( dDiam, dDepth, bTopHead, bDownHead)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||||
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|||||||
+44
-15
@@ -92,7 +92,7 @@ function ProcessCut.Classify( Proc, b3Raw)
|
|||||||
-- calcolo l'ingombro orizzontale della faccia
|
-- calcolo l'ingombro orizzontale della faccia
|
||||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||||
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
|
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
|
||||||
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and abs( vtN:getY()) > 0.1 and dMaxMat < DimH + BD.CUT_EXTRA) then
|
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then
|
||||||
return true, true
|
return true, true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -261,7 +261,8 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione con testa da sopra
|
-- Applicazione della lavorazione con testa da sopra
|
||||||
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, bForceTangentLeadInOut)
|
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, sLeadInOutType)
|
||||||
|
local sWarn
|
||||||
-- ingombro del grezzo
|
-- ingombro del grezzo
|
||||||
b3Raw = b3Raw or EgtGetRawPartBBox( nRawId)
|
b3Raw = b3Raw or EgtGetRawPartBBox( nRawId)
|
||||||
-- ingombro del pezzo
|
-- ingombro del pezzo
|
||||||
@@ -373,10 +374,19 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
end
|
end
|
||||||
-- verifico se necessari tagli supplementari o se presente superficie limitante
|
-- verifico se necessari tagli supplementari o se presente superficie limitante
|
||||||
EgtOutLog( string.format( 'MaxDepth=%.1f MaxVertDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dMaxVertDepth, dCutH, dCutV), 3)
|
EgtOutLog( string.format( 'MaxDepth=%.1f MaxVertDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dMaxVertDepth, dCutH, dCutV), 3)
|
||||||
|
-- se lungo, una faccia e rivolto sul retro verso l'alto si forzano i cubetti per evitare di rovinare il pezzo successivo
|
||||||
|
local bForceDicing = ( Proc.Fct == 1 and Proc.AffectedFaces.Left and bLongCut and vtN:getZ() > 10 * GEO.EPS_SMALL and vtN:getY() < 10 * GEO.EPS_SMALL)
|
||||||
local vCuts = {}
|
local vCuts = {}
|
||||||
if not Proc.AdvTail and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
|
local dDicingOffsetP
|
||||||
|
local dDicingOffsetO
|
||||||
|
if ( ( not Proc.AdvTail) or bForceDicing) and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
|
||||||
local ptExtra, vtExtra
|
local ptExtra, vtExtra
|
||||||
local bAutoCalcSurf = true
|
local bAutoCalcSurf = true
|
||||||
|
if Proc.AdvTail then
|
||||||
|
-- do avviso che la lama può sbordare nel pezzo successivo
|
||||||
|
sWarn = 'Warning : Cut machining can damage next piece'
|
||||||
|
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
|
||||||
|
end
|
||||||
if bFillAreaPiece or bFillTail then
|
if bFillAreaPiece or bFillTail then
|
||||||
local ptMiddle = ( b3Solid:getMin() + b3Solid:getMax()) / 2
|
local ptMiddle = ( b3Solid:getMin() + b3Solid:getMax()) / 2
|
||||||
ptExtra = Point3d( b3Solid:getMin():getX() + 5*GEO.EPS_SMALL, ptMiddle:getY(), ptMiddle:getZ())
|
ptExtra = Point3d( b3Solid:getMin():getX() + 5*GEO.EPS_SMALL, ptMiddle:getY(), ptMiddle:getZ())
|
||||||
@@ -415,11 +425,11 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se il taglio è più spesso della lama abilito il dicing, altrimenti no
|
-- se il taglio è più spesso della lama abilito il dicing, altrimenti no
|
||||||
if dMaxElev > dSawThick then
|
if ( dMaxElev > dSawThick) or bForceDicing then
|
||||||
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, dNewDiceDim)
|
vCuts, dDicingOffsetP = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, dNewDiceDim)
|
||||||
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
|
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
|
||||||
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
|
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
|
||||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
|
vCuts, dDicingOffsetP = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -588,8 +598,17 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
if ( i % 2 == 0) and ( Proc.Fct == 1) and bNoPerpCuts then
|
if ( i % 2 == 0) and ( Proc.Fct == 1) and bNoPerpCuts then
|
||||||
vtOrthoOAlternative = - vtOrthoO
|
vtOrthoOAlternative = - vtOrthoO
|
||||||
end
|
end
|
||||||
bForceTangentLeadInOut = bForceTangentLeadInOut and ( ( i % 2) ~= 0)
|
local sLeadInOutTypeFbs = 'Calculated'
|
||||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut, bForceTangentLeadInOut, vtOrthoOAlternative)
|
if ( ( i % 2) ~= 0) then
|
||||||
|
if ( sLeadInOutType == 'Tangent') then
|
||||||
|
sLeadInOutTypeFbs = 'Tangent'
|
||||||
|
elseif ( sLeadInOutType == 'Perpendicular') then
|
||||||
|
sLeadInOutTypeFbs = 'Perpendicular'
|
||||||
|
elseif ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||||
|
sLeadInOutTypeFbs = 'PerpendicularOutraw'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut, sLeadInOutTypeFbs, vtOrthoOAlternative, dDicingOffsetP)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -608,7 +627,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
local vtOrthoO
|
local vtOrthoO
|
||||||
if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
|
if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
|
||||||
vtOrthoO = -Z_AX()
|
vtOrthoO = -Z_AX()
|
||||||
elseif bHorizCut and ( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
|
elseif ( bHorizCut or ( dCutV < dMaxDepth - BD.CUT_EXTRA and not bVertCutOk)) and
|
||||||
|
( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
|
||||||
vtOrthoO = Z_AX()
|
vtOrthoO = Z_AX()
|
||||||
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
|
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
|
||||||
vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
|
vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||||
@@ -641,7 +661,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
return true
|
return true, sWarn
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
@@ -829,7 +849,7 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf, bForceTangentLeadInOut)
|
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf, sLeadInOutType)
|
||||||
-- sovramateriale di coda
|
-- sovramateriale di coda
|
||||||
dOvmTail = dOvmTail or BD.OVM_MID
|
dOvmTail = dOvmTail or BD.OVM_MID
|
||||||
-- ingombro del grezzo
|
-- ingombro del grezzo
|
||||||
@@ -866,22 +886,31 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local bNoDicing = false
|
local bNoDicing = false
|
||||||
|
local sWarn
|
||||||
-- se taglio con testa da sopra
|
-- se taglio con testa da sopra
|
||||||
if not bDownHead and not bDownTurn then
|
if not bDownHead and not bDownTurn then
|
||||||
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, bForceTangentLeadInOut)
|
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, sLeadInOutType)
|
||||||
bNoDicing = bNoDicing2
|
bNoDicing = bNoDicing2
|
||||||
if not bOk then return false, sErr end
|
if not bOk then
|
||||||
|
return false, sErr
|
||||||
|
else
|
||||||
|
sWarn = sErr
|
||||||
|
end
|
||||||
-- altrimenti taglio con testa da sotto
|
-- altrimenti taglio con testa da sotto
|
||||||
else
|
else
|
||||||
local bOk, sErr = MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
local bOk, sErr = MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
if not bOk then return false, sErr end
|
if not bOk then
|
||||||
|
return false, sErr
|
||||||
|
else
|
||||||
|
sWarn = sErr
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- Aggiornamento ingombro (se vero taglio o richiesto)
|
-- Aggiornamento ingombro (se vero taglio o richiesto)
|
||||||
-- Se lascio il cordolo (bNoDicing) non aggiorno il grezzo perchè lo scarto rimane attaccato
|
-- Se lascio il cordolo (bNoDicing) non aggiorno il grezzo perchè lo scarto rimane attaccato
|
||||||
if ( ProcessCut.Identify( Proc) or bUpdateIng) and not bNoDicing then
|
if ( ProcessCut.Identify( Proc) or bUpdateIng) and not bNoDicing then
|
||||||
UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
||||||
end
|
end
|
||||||
return true
|
return true, sWarn
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|||||||
@@ -209,7 +209,8 @@ function ProcessDrill.AddPredrillFromDrillProc( Proc)
|
|||||||
PredrillProc.MainId = Proc.MainId
|
PredrillProc.MainId = Proc.MainId
|
||||||
PredrillProc.IsPredrill = true
|
PredrillProc.IsPredrill = true
|
||||||
PredrillProc.IsPredrillOf = Proc.Id
|
PredrillProc.IsPredrillOf = Proc.Id
|
||||||
|
-- recupero l'elenco delle facce della parte interessate dalla feature
|
||||||
|
PredrillProc.AffectedFaces = BL.GetProcessAffectedFaces( PredrillProc)
|
||||||
return true, PredrillProc
|
return true, PredrillProc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -388,6 +389,25 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
||||||
|
|
||||||
|
if sDrilling then
|
||||||
|
-- Determino la faccia di inizio del foro e dati correlati
|
||||||
|
local 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
|
||||||
|
-- Per fori molto inclinati ( < 30 gradi) si usa la testa della macchina per l'accorciamento. Fast esclusa
|
||||||
|
if BD.C_SIMM and CosB > 0.866 then
|
||||||
|
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
|
||||||
|
end
|
||||||
|
local 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
|
||||||
|
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill, nil, 'Longest')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not sDrilling and dCheckDepth then
|
if not sDrilling and dCheckDepth then
|
||||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
||||||
if sDrilling then dCheckDepth = nil end
|
if sDrilling then dCheckDepth = nil end
|
||||||
@@ -482,16 +502,28 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
-- eventuale inversione foro in base al lato di lavoro e al lato testa dell'utensile scelto
|
||||||
|
-- se non già richiesta inversione e foro quasi orizzontale (15deg) passante
|
||||||
|
if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then
|
||||||
|
local Tool = BL.GetToolFromMachining( sDrilling)
|
||||||
|
-- lato testa e lato di lavoro devono corrispondere
|
||||||
|
if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
|
||||||
|
or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
|
||||||
|
ptCen = ptCen - vtExtr * dLen
|
||||||
|
vtExtr = - vtExtr
|
||||||
|
bToInvert = true
|
||||||
|
end
|
||||||
|
end
|
||||||
-- Determino la faccia di inizio del foro e dati correlati
|
-- 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
|
-- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia
|
||||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||||
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
|
dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
|
||||||
-- Per fori molto inclinati ( < 30 gradi) si usa la testa della macchina per l'accorciamento. Fast esclusa
|
-- Per fori molto inclinati ( < 30 gradi) si usa la testa della macchina per l'accorciamento. Fast esclusa
|
||||||
if BD.C_SIMM and CosB > 0.866 then
|
if BD.C_SIMM and CosB > 0.866 then
|
||||||
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
|
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
|
||||||
end
|
end
|
||||||
local dMaxDepthOri = dMaxDepth
|
dMaxDepthOri = dMaxDepth
|
||||||
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
||||||
-- Verifico inclinazione foro nei limiti
|
-- Verifico inclinazione foro nei limiti
|
||||||
local bTryDrill = EgtIf( dMaxDepth > 0, ( CosB < BD.DRILL_VX_MAX), false)
|
local bTryDrill = EgtIf( dMaxDepth > 0, ( CosB < BD.DRILL_VX_MAX), false)
|
||||||
@@ -514,7 +546,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
if bIntersectionOk then
|
if bIntersectionOk then
|
||||||
local dHoleToCutDistance = vDistance[1]
|
local dHoleToCutDistance = vDistance[1]
|
||||||
-- se il taglio accorcia realmente il foro
|
-- se il taglio accorcia realmente il foro
|
||||||
if dHoleToCutDistance > 10 * GEO.EPS_SMALL and dHoleToCutDistance < dLen then
|
if ( dHoleToCutDistance > 10 * GEO.EPS_SMALL or Proc.AffectedFaces.Right) and dHoleToCutDistance < dLen then
|
||||||
dMaxDepth = dMaxDepthOri
|
dMaxDepth = dMaxDepthOri
|
||||||
dMaxElev = dLen - dHoleToCutDistance
|
dMaxElev = dLen - dHoleToCutDistance
|
||||||
bTryDrill = true
|
bTryDrill = true
|
||||||
@@ -565,6 +597,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if bDrillAngTrasm then
|
if bDrillAngTrasm then
|
||||||
nSCC = MCH_SCC.ADIR_NEAR
|
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
|
elseif not BD.C_SIMM and not BD.TURN then
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ local ProcessDtMortise = {}
|
|||||||
require( 'EgtBase')
|
require( 'EgtBase')
|
||||||
local BL = require( 'BeamLib')
|
local BL = require( 'BeamLib')
|
||||||
local Cut = require( 'ProcessCut')
|
local Cut = require( 'ProcessCut')
|
||||||
|
local Probe = require( 'ProcessProbing')
|
||||||
|
|
||||||
EgtOutLog( ' ProcessDtMortise started', 1)
|
EgtOutLog( ' ProcessDtMortise started', 1)
|
||||||
|
|
||||||
@@ -111,9 +112,6 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
|
|||||||
EgtAddCurveCompoLineTg( NewAuxId, 100, false)
|
EgtAddCurveCompoLineTg( NewAuxId, 100, false)
|
||||||
EgtAddCurveCompoLineTg( NewAuxId, 100, true)
|
EgtAddCurveCompoLineTg( NewAuxId, 100, true)
|
||||||
EgtMergeCurvesInCurveCompo( NewAuxId)
|
EgtMergeCurvesInCurveCompo( NewAuxId)
|
||||||
-- eseguo traslazione e offset per portarla sul top
|
|
||||||
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dAltMort - 10 * GEO.EPS_SMALL)
|
|
||||||
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
|
|
||||||
local dOffset = dAltMort * tan( dSideAng)
|
local dOffset = dAltMort * tan( dSideAng)
|
||||||
if not EgtOffsetCurve( NewAuxId, dOffset) then return end
|
if not EgtOffsetCurve( NewAuxId, dOffset) then return end
|
||||||
-- la limito entro la trave
|
-- la limito entro la trave
|
||||||
@@ -121,6 +119,9 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
|
|||||||
local vtBoxDiag = b3Solid:getMax() - b3Solid:getMin()
|
local vtBoxDiag = b3Solid:getMax() - b3Solid:getMin()
|
||||||
local nCount
|
local nCount
|
||||||
NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB)
|
NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB)
|
||||||
|
-- eseguo traslazione e offset per portarla sul top
|
||||||
|
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dAltMort - 10 * GEO.EPS_SMALL)
|
||||||
|
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
|
||||||
-- se divisa in più parti, le unisco congiungendole con segmenti
|
-- se divisa in più parti, le unisco congiungendole con segmenti
|
||||||
if nCount > 1 then
|
if nCount > 1 then
|
||||||
if EgtGetType( NewAuxId) ~= GDB_TY.CRV_COMPO then
|
if EgtGetType( NewAuxId) ~= GDB_TY.CRV_COMPO then
|
||||||
@@ -273,7 +274,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
local dToolDiam = 100
|
local dToolDiam = 100
|
||||||
local dMaxMat = 30
|
local dMaxMat = 30
|
||||||
local dSideAng = 0
|
local dSideAng = 0
|
||||||
|
local sHeadTool = 'H1'
|
||||||
local bCW = true
|
local bCW = true
|
||||||
|
local bMillOnAggregate = sMchExt == '_AT'
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
@@ -281,6 +284,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
dToolDiam = max( dToolDiam, 10)
|
dToolDiam = max( dToolDiam, 10)
|
||||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||||
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
|
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
|
||||||
|
sHeadTool = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||||
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
||||||
bCW = ( dSpeed >= 0)
|
bCW = ( dSpeed >= 0)
|
||||||
end
|
end
|
||||||
@@ -291,6 +295,11 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- tastatura se richiesta
|
||||||
|
local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sHeadTool}
|
||||||
|
local bProbeExecuted, sErr = Probe.Make( Proc, nPartId, Info)
|
||||||
|
|
||||||
-- se con tasca, la lavoro (mai in doppio)
|
-- se con tasca, la lavoro (mai in doppio)
|
||||||
if bPocket then
|
if bPocket then
|
||||||
-- recupero il contorno della tasca (seconda curva ausiliaria)
|
-- recupero il contorno della tasca (seconda curva ausiliaria)
|
||||||
@@ -345,11 +354,20 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- eventuale calcolo SCC
|
-- eventuale calcolo SCC
|
||||||
local nSCC
|
local nSCC
|
||||||
if BD.TURN and not bPocket then
|
if BD.TURN then
|
||||||
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
|
if not bPocket then
|
||||||
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
|
||||||
else
|
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
else
|
||||||
|
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se aggregato e rivolto verso Z-, si accede da lato aperto
|
||||||
|
elseif bMillOnAggregate and AreSameVectorApprox( vtExtr, -Z_AX()) then
|
||||||
|
if Proc.AffectedFaces.Back then
|
||||||
|
nSCC = MCH_SCC.ADIR_YP
|
||||||
|
elseif Proc.AffectedFaces.Front then
|
||||||
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- flag di mirror precedente aggiornabile localmente
|
-- flag di mirror precedente aggiornabile localmente
|
||||||
@@ -529,6 +547,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- se c'è stata tastatura, si disattiva sull'ultima lavorazione
|
||||||
|
if bProbeExecuted and i == 1 then
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'END-PROBE', true)
|
||||||
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
|
|||||||
-- se macchina Fast, pezzo stretto e inclinazione laterale non eccessiva, accetto fino a -27deg
|
-- se macchina Fast, pezzo stretto e inclinazione laterale non eccessiva, accetto fino a -27deg
|
||||||
elseif ( not BD.C_SIMM) and abs( vtN:getY()) < 0.5 and b3Raw:getDimY() < 150.1 then
|
elseif ( not BD.C_SIMM) and abs( vtN:getY()) < 0.5 and b3Raw:getDimY() < 150.1 then
|
||||||
return ( vtN:getZ() >= -0.454)
|
return ( vtN:getZ() >= -0.454)
|
||||||
-- altrimenti accetto fino a -21deg
|
-- altrimenti accetto fino a -23.5deg
|
||||||
else
|
else
|
||||||
return ( vtN:getZ() >= -0.359)
|
return ( vtN:getZ() >= -0.399)
|
||||||
end
|
end
|
||||||
-- se trave medio-bassa
|
-- se trave medio-bassa
|
||||||
elseif b3Raw:getDimZ() < 281 then
|
elseif b3Raw:getDimZ() < 281 then
|
||||||
@@ -70,8 +70,8 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
|
|||||||
end
|
end
|
||||||
-- altrimenti
|
-- altrimenti
|
||||||
else
|
else
|
||||||
-- accetto fino a -5deg
|
-- accetto fino a -7deg
|
||||||
return ( vtN:getZ() >= -0.088)
|
return ( vtN:getZ() >= -0.122)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -471,7 +471,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if not BD.C_SIMM then
|
if BD.TURN == 2 then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
elseif not BD.C_SIMM then
|
||||||
if Proc.Head then
|
if Proc.Head then
|
||||||
nSCC = MCH_SCC.ADIR_XP
|
nSCC = MCH_SCC.ADIR_XP
|
||||||
elseif Proc.Tail then
|
elseif Proc.Tail then
|
||||||
@@ -539,7 +541,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if not BD.C_SIMM then
|
if BD.TURN == 2 then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
elseif not BD.C_SIMM then
|
||||||
if Proc.Head then
|
if Proc.Head then
|
||||||
nSCC = MCH_SCC.ADIR_XP
|
nSCC = MCH_SCC.ADIR_XP
|
||||||
elseif Proc.Tail then
|
elseif Proc.Tail then
|
||||||
@@ -695,7 +699,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
|
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if not BD.C_SIMM then
|
if BD.TURN == 2 then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
elseif not BD.C_SIMM then
|
||||||
if Proc.Head then
|
if Proc.Head then
|
||||||
nSCC = MCH_SCC.ADIR_XP
|
nSCC = MCH_SCC.ADIR_XP
|
||||||
elseif Proc.Tail then
|
elseif Proc.Tail then
|
||||||
@@ -826,7 +832,9 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if not BD.C_SIMM then
|
if BD.TURN == 2 then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
elseif not BD.C_SIMM then
|
||||||
if Proc.Head then
|
if Proc.Head then
|
||||||
nSCC = MCH_SCC.ADIR_XP
|
nSCC = MCH_SCC.ADIR_XP
|
||||||
elseif Proc.Tail then
|
elseif Proc.Tail then
|
||||||
|
|||||||
+30
-21
@@ -161,7 +161,7 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- tagli verticali aggiuntivi
|
-- tagli verticali aggiuntivi
|
||||||
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw)
|
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, dOffsetBetweenCuts)
|
||||||
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
|
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
|
||||||
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
|
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
|
||||||
-- recupero il diametro dell'utensile
|
-- recupero il diametro dell'utensile
|
||||||
@@ -177,8 +177,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw)
|
|||||||
for j = nVerticalCuts, 1, -1 do
|
for j = nVerticalCuts, 1, -1 do
|
||||||
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
||||||
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
||||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER and not BD.DOWN_HEAD
|
local sLeadInOutType = 'PerpendicularOutraw'
|
||||||
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
|
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -240,8 +240,8 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCut
|
|||||||
for j = nHorizontalCuts, 1, -1 do
|
for j = nHorizontalCuts, 1, -1 do
|
||||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||||
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
||||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER
|
local sLeadInOutType = 'PerpendicularOutraw'
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||||
@@ -284,7 +284,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCut
|
|||||||
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
|
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
|
||||||
-- se trave larga effettuo tagli verticali aggiuntivi
|
-- se trave larga effettuo tagli verticali aggiuntivi
|
||||||
if HeadCutType.bNeedVerticalAddedCuts then
|
if HeadCutType.bNeedVerticalAddedCuts then
|
||||||
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw)
|
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, dOffsetBetweenCuts)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
if i == 1 and HeadCutType.sType =='Precut' then
|
if i == 1 and HeadCutType.sType =='Precut' then
|
||||||
@@ -340,7 +340,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCut
|
|||||||
end
|
end
|
||||||
-- se trave larga effettuo tagli verticali aggiuntivi
|
-- se trave larga effettuo tagli verticali aggiuntivi
|
||||||
if HeadCutType.bNeedVerticalAddedCuts then
|
if HeadCutType.bNeedVerticalAddedCuts then
|
||||||
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw)
|
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, dOffsetBetweenCuts)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||||
@@ -365,7 +365,15 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
-- eventuali informazioni sul tipo di finitura
|
-- eventuali informazioni sul tipo di finitura
|
||||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sCutting = ML.FindCutting( 'HeadSide', nil, nil, nil, 'Longest')
|
-- TODO questa parte andrà cambiata quando si gestiranno i volumi liberi in cui girare da mlse
|
||||||
|
local dMinWidthForBigBlade = 300
|
||||||
|
local dMaxHeightForBigBlade = 300
|
||||||
|
local sCutting
|
||||||
|
if b3Raw:getDimY() > dMinWidthForBigBlade and b3Raw:getDimZ() < dMaxHeightForBigBlade then
|
||||||
|
sCutting = ML.FindCutting( 'HeadSide', nil, nil, nil, 'Longest')
|
||||||
|
else
|
||||||
|
sCutting = ML.FindCutting( 'HeadSide')
|
||||||
|
end
|
||||||
if not sCutting then
|
if not sCutting then
|
||||||
local sErr = 'Error : cutting not found in library'
|
local sErr = 'Error : cutting not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -398,17 +406,23 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
dSawThick2 = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick2
|
dSawThick2 = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset
|
||||||
|
local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1)
|
||||||
|
local dOffsL = dOvmHead / nCuts
|
||||||
-- caratteristiche taglio
|
-- caratteristiche taglio
|
||||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||||
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||||
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
|
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
|
||||||
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||||
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) and
|
||||||
|
( b3Raw:getDimY() < 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||||
-- verifico necessità di tagli aggiuntivi orizzontali o verticali
|
-- verifico necessità di tagli aggiuntivi orizzontali o verticali
|
||||||
local dMinOvmHeadForAddeddCuts = 10.123
|
local dMinOvmHeadForAddeddCuts = 10.123
|
||||||
local bNeedVerticalAddedCuts = ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
|
local bNeedVerticalAddedCuts = ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
|
||||||
local bNeedHorizontalAddedCuts = ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
|
local bNeedHorizontalAddedCuts = ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and
|
||||||
|
not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) and
|
||||||
|
dOffsL < BD.MAX_DIM_DICE
|
||||||
-- dati lavorazioni sopra e sotto
|
-- dati lavorazioni sopra e sotto
|
||||||
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
|
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
|
||||||
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dMaxDepth2, dSawThick = dSawThick2}
|
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dMaxDepth2, dSawThick = dSawThick2}
|
||||||
@@ -420,9 +434,6 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then
|
if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
-- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset
|
|
||||||
local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1)
|
|
||||||
local dOffsL = dOvmHead / nCuts
|
|
||||||
-- se taglio per sezioni alte e larghe
|
-- se taglio per sezioni alte e larghe
|
||||||
if bBigSectionCut then
|
if bBigSectionCut then
|
||||||
if dOvmHead > 0 then
|
if dOvmHead > 0 then
|
||||||
@@ -487,18 +498,16 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
if AreSameVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
|
if AreSameVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
|
||||||
end
|
end
|
||||||
-- tagli verticali
|
-- tagli verticali
|
||||||
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw)
|
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, dOffsL)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
-- tagli a cubetti con eventuale superficie limitante
|
-- tagli a cubetti con eventuale superficie limitante
|
||||||
bOk, sErr = Cut.Make( AddProc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nLimitingSurf)
|
local sLeadInOutType = 'PerpendicularOutraw'
|
||||||
|
bOk, sErr = Cut.Make( AddProc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nLimitingSurf, sLeadInOutType)
|
||||||
end
|
end
|
||||||
-- tagli aggiuntivi non necessari
|
-- tagli aggiuntivi non necessari
|
||||||
else
|
else
|
||||||
local bForceTangentLeadInOut = false
|
local sLeadInOutType = 'PerpendicularOutraw'
|
||||||
if BD.PRESS_ROLLER then
|
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nil, sLeadInOutType)
|
||||||
bForceTangentLeadInOut = true
|
|
||||||
end
|
|
||||||
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nil, bForceTangentLeadInOut)
|
|
||||||
end
|
end
|
||||||
return bOk, sErr
|
return bOk, sErr
|
||||||
end
|
end
|
||||||
|
|||||||
+166
-41
@@ -192,6 +192,7 @@ local function AssignQIdent( Proc)
|
|||||||
Q_STAIRCASE = ''
|
Q_STAIRCASE = ''
|
||||||
Q_SAW_PLUS_CHAIN = 'Q11'
|
Q_SAW_PLUS_CHAIN = 'Q11'
|
||||||
Q_FORCE_CHAINSAW = 'Q12'
|
Q_FORCE_CHAINSAW = 'Q12'
|
||||||
|
Q_NO_ROTATION = 'Q13'
|
||||||
|
|
||||||
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
||||||
Q_FORCE_BLADE = 'Q01' -- i
|
Q_FORCE_BLADE = 'Q01' -- i
|
||||||
@@ -200,6 +201,7 @@ local function AssignQIdent( Proc)
|
|||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17 then
|
||||||
Q_DEPTH_CHAMFER = 'Q01' -- d
|
Q_DEPTH_CHAMFER = 'Q01' -- d
|
||||||
Q_ONLY_CHAMFER = 'Q02' -- i
|
Q_ONLY_CHAMFER = 'Q02' -- i
|
||||||
|
Q_USE_MILL = 'Q03' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20 then
|
||||||
Q_DEPTH_CHAMFER = 'Q01' -- d
|
Q_DEPTH_CHAMFER = 'Q01' -- d
|
||||||
Q_USE_MILL = 'Q02' -- i
|
Q_USE_MILL = 'Q02' -- i
|
||||||
@@ -414,7 +416,7 @@ local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bP
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
|
local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill, b3Raw)
|
||||||
|
|
||||||
-- se non feature BlockHausHalfLap e non abilitato parametro Q per lavorarlo di fianco e non macchina BH esco
|
-- se non feature BlockHausHalfLap e non abilitato parametro Q per lavorarlo di fianco e non macchina BH esco
|
||||||
local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
|
local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
|
||||||
@@ -444,9 +446,13 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
|
|||||||
|
|
||||||
-- le facce devono contenere X e quelle di chiusura devono essere perpendicolari a X
|
-- le facce devono contenere X e quelle di chiusura devono essere perpendicolari a X
|
||||||
local bStopY, bStopZ
|
local bStopY, bStopZ
|
||||||
|
if not Proc.TopologyLongName then
|
||||||
|
Topology.Classify( Proc, b3Raw)
|
||||||
|
end
|
||||||
for i = 1, Proc.Fct do
|
for i = 1, Proc.Fct do
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
|
||||||
if abs( vtN:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 then
|
-- permessa U passante non parallela agli assi principali
|
||||||
|
if abs( vtN:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 and Proc.TopologyLongName ~= "Groove-Through-RightAngles-NotParallel-3" then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if abs( vtN:getY()) > 0.866 then bStopY = true end
|
if abs( vtN:getY()) > 0.866 then bStopY = true end
|
||||||
@@ -776,7 +782,7 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
|||||||
-- in base al tipo di feature attribuisco il significato dei parametri Q
|
-- in base al tipo di feature attribuisco il significato dei parametri Q
|
||||||
AssignQIdent( Proc)
|
AssignQIdent( Proc)
|
||||||
-- se può essere fatto con utensile tipo lama
|
-- se può essere fatto con utensile tipo lama
|
||||||
local bUseBHSideMill, bHead, bHeadDir = VerifyBHSideMill( Proc)
|
local bUseBHSideMill, bHead, bHeadDir = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
|
||||||
if bUseBHSideMill then
|
if bUseBHSideMill then
|
||||||
Proc.HeadDir = bHeadDir
|
Proc.HeadDir = bHeadDir
|
||||||
end
|
end
|
||||||
@@ -784,7 +790,6 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
|||||||
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
||||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
-- verifico se è in coda
|
-- verifico se è in coda
|
||||||
|
|
||||||
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
|
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
|
||||||
if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then
|
if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then
|
||||||
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
|
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
|
||||||
@@ -799,6 +804,12 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
|||||||
( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.8 * b3Solid:getDimX())) then
|
( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.8 * b3Solid:getDimX())) then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- se interessa la coda, e pezzo lungo, si sposta dopo separazione
|
||||||
|
if b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.AffectedFaces.Left and Proc.Fct >= 2 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
-- se una o due facce e interessa veramente la coda, allora di coda
|
-- se una o due facce e interessa veramente la coda, allora di coda
|
||||||
if Proc.Fct <= 2 then
|
if Proc.Fct <= 2 then
|
||||||
if Proc.Box:getMin():getX() < b3Solid:getMin():getX() + 1. then
|
if Proc.Box:getMin():getX() < b3Solid:getMin():getX() + 1. then
|
||||||
@@ -836,7 +847,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|||||||
-- se 2 facce
|
-- se 2 facce
|
||||||
elseif Proc.Fct == 2 then
|
elseif Proc.Fct == 2 then
|
||||||
-- se può essere fatto con utensile tipo lama
|
-- se può essere fatto con utensile tipo lama
|
||||||
local bUseBHSideMill = VerifyBHSideMill( Proc)
|
local bUseBHSideMill = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
|
||||||
if bUseBHSideMill then
|
if bUseBHSideMill then
|
||||||
return true, false
|
return true, false
|
||||||
end
|
end
|
||||||
@@ -916,7 +927,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|||||||
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
-- se può essere fatto con utensile tipo lama
|
-- se può essere fatto con utensile tipo lama
|
||||||
local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc)
|
local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
|
||||||
if bUseBHSideMill then
|
if bUseBHSideMill then
|
||||||
if vtN:getZ() > -0.5 or b3Raw:getDimZ() - Proc.Box:getDimZ() < ( BD.MAX_DIST_BH_FROM_BOTTOM or 395) - dTDiam / 2 then
|
if vtN:getZ() > -0.5 or b3Raw:getDimZ() - Proc.Box:getDimZ() < ( BD.MAX_DIST_BH_FROM_BOTTOM or 395) - dTDiam / 2 then
|
||||||
return true, false
|
return true, false
|
||||||
@@ -955,6 +966,12 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|||||||
bDown = ( vtN2:getZ() < BD.NZ_MINB)
|
bDown = ( vtN2:getZ() < BD.NZ_MINB)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local bNoRotation = ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1
|
||||||
|
if bDown and bNoRotation then
|
||||||
|
bDown = false
|
||||||
|
end
|
||||||
|
|
||||||
return true, bDown
|
return true, bDown
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -3077,10 +3094,20 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local bGoFromHead = true
|
local bGoFromHead = true
|
||||||
-- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di fianco (se possibile)
|
local bAttackFromSide = ( ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1)
|
||||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
and ( Proc.Fct == 4) and ( Proc.Topology == 'Groove')
|
||||||
|
-- se normale lungo Z è da sopra: si tenta attacco laterale se richiesto
|
||||||
|
if AreSameOrOppositeVectorApprox( Proc.Face[ nFacInd + 1].VtN, Z_AX()) then
|
||||||
|
if bAttackFromSide then
|
||||||
|
bGoFromHead = false
|
||||||
|
end
|
||||||
|
elseif dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||||
|
if bAttackFromSide then
|
||||||
|
bGoFromHead = false
|
||||||
-- continuo di testa se fessura con tre facce o non è tunnel
|
-- continuo di testa se fessura con tre facce o non è tunnel
|
||||||
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
|
else
|
||||||
|
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- se continuo a lavorare di testa
|
-- se continuo a lavorare di testa
|
||||||
if bGoFromHead then
|
if bGoFromHead then
|
||||||
@@ -3178,15 +3205,33 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- altrimenti sega a catena di fianco
|
-- altrimenti sega a catena di fianco
|
||||||
|
-- si arriva qui anche per groove 4 lati con rotazione esclusa
|
||||||
else
|
else
|
||||||
-- verifico se posso farlo con la sega-catena
|
local vtRef = Vector3d( vtOrtho)
|
||||||
|
if vtRef and ( vtRef:getY() > 0.5 or vtRef:getZ() < -0.1) then
|
||||||
|
vtRef = -vtRef
|
||||||
|
end
|
||||||
|
if not ( Proc.Topology == 'Tunnel') then
|
||||||
|
dDimMin = min( Proc.Face[ nFacInd + 1].Width, Proc.Face[ nFacInd + 1].Height)
|
||||||
|
dDimMax = min( Proc.Face[ nFacAdj + 1].Width, Proc.Face[ nFacAdj + 1].Height)
|
||||||
|
nLundIdFace = nFacAdj
|
||||||
|
local nFaceZ
|
||||||
|
if not vtRef then
|
||||||
|
if Proc.AffectedFaces.Top then
|
||||||
|
vtRef = Z_AX()
|
||||||
|
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, Z_AX())
|
||||||
|
else
|
||||||
|
vtRef = -Z_AX()
|
||||||
|
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, -Z_AX())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
dDepth = Proc.Face[ nFaceZ + 1].Elevation
|
||||||
|
end
|
||||||
local bMakeChainSaw, sSawing2, dMaxMat2, dSawCornerRad2, dSawThick2 = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
|
local bMakeChainSaw, sSawing2, dMaxMat2, dSawCornerRad2, dSawThick2 = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
|
||||||
if bMakeChainSaw then
|
if bMakeChainSaw then
|
||||||
-- Calcolo normale faccia da lavorare
|
-- Calcolo normale faccia da lavorare
|
||||||
local vtNL = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT)
|
local vtNL = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT)
|
||||||
-- Calcolo uso faccia
|
-- Calcolo uso faccia
|
||||||
local vtRef = Vector3d( vtOrtho)
|
|
||||||
if vtRef:getY() > 0.5 or vtRef:getZ() < -0.1 then vtRef = -vtRef end
|
|
||||||
local nFaceUse = BL.GetNearestParalOpposite( vtRef, vtNL)
|
local nFaceUse = BL.GetNearestParalOpposite( vtRef, vtNL)
|
||||||
-- Verifico se necessarie più passate
|
-- Verifico se necessarie più passate
|
||||||
local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick2)
|
local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick2)
|
||||||
@@ -3213,21 +3258,67 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
-- imposto offset radiale
|
-- imposto offset radiale
|
||||||
local dOffs = ( i - 1) * dStep
|
local dOffs = ( i - 1) * dStep
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||||
-- se possibile aumento l'affondamento pari al raggio corner + 1
|
local dMachiningDepth = dDepth
|
||||||
if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then
|
if Proc.Topology == 'Tunnel' then
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, (dDepth + dSawCornerRad2 + 1))
|
-- se possibile aumento l'affondamento pari al raggio corner + 1
|
||||||
-- se massimo affondamento supera altezza fessura, uso massimo affondamento
|
if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then
|
||||||
elseif dMaxMat2 > (dDepth + 1) then
|
dMachiningDepth = ( dDepth + dSawCornerRad2 + 1)
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, (dMaxMat2 - 1))
|
-- se massimo affondamento supera altezza fessura, uso massimo affondamento
|
||||||
-- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning
|
elseif dMaxMat2 > ( dDepth + 1) then
|
||||||
elseif dMaxMat2 < dDepth then
|
dMachiningDepth = (dMaxMat2 - 1)
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat2)
|
-- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning
|
||||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
elseif dMaxMat2 < dDepth then
|
||||||
EgtOutLog( sWarn)
|
dMachiningDepth = dMaxMat2
|
||||||
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth)
|
||||||
|
else
|
||||||
|
-- se possibile si lavora tutta la profondità
|
||||||
|
if dMaxMat2 > (dDepth - 100 * GEO.EPS_SMALL) then
|
||||||
|
dMachiningDepth = dDepth
|
||||||
|
-- in alternativa si arriva al massimo materiale
|
||||||
|
else
|
||||||
|
dMachiningDepth = dMaxMat2
|
||||||
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth)
|
||||||
|
local dStartAddLen = dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ)
|
||||||
|
local dEndAddLen = - dSawWidth / 2
|
||||||
|
if vtRef:getZ() > 10 * GEO.EPS_SMALL then
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.LEFT)
|
||||||
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||||
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||||
|
end
|
||||||
|
-- in caso di attacco esterno si setta in modo da fare un primo step adeguato per evitare finecorsa
|
||||||
|
-- si riduce la feed opportunamente
|
||||||
|
if not ( Proc.Topology == 'Tunnel') then
|
||||||
|
local dMachiningStep = EgtGetMachiningParam( MCH_MP.STEP) or 0
|
||||||
|
-- TODO qui sostituire con valore preciso da GetSetupInfo
|
||||||
|
if BD.C_SIMM then
|
||||||
|
dMachiningStep = 165
|
||||||
|
if vtRef:getZ() < - 10 * GEO.EPS_SMALL then
|
||||||
|
dMachiningStep = 250
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local dActualStep = ( dMachiningDepth - dMachiningStep) / ( 2 + 1)
|
||||||
|
dElev = dMachiningDepth - dMachiningStep + dActualStep - 0.1
|
||||||
|
if dActualStep < 0 then
|
||||||
|
dActualStep = 1
|
||||||
|
dElev = 2
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.STEP, dActualStep)
|
||||||
|
|
||||||
|
local dFeed = EgtGetMachiningParam( MCH_MP.FEED) / 2
|
||||||
|
EgtSetMachiningParam( MCH_MP.FEED, dFeed)
|
||||||
end
|
end
|
||||||
-- considero estremi inizio/fine chiusi
|
|
||||||
-- imposto massima elevazione
|
|
||||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||||
|
if not ( Proc.Topology == 'Tunnel') then
|
||||||
|
sNotes = EgtSetValInNotes( sNotes, 'Plunge', 10)
|
||||||
|
end
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
@@ -3468,7 +3559,7 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
|||||||
sWarn = 'Warning on pocketing ' .. sName .. ': machining can damage next piece. Minimum distance needed : ' .. ( 1 + dDiamTool / 2) .. ' mm'
|
sWarn = 'Warning on pocketing ' .. sName .. ': machining can damage next piece. Minimum distance needed : ' .. ( 1 + dDiamTool / 2) .. ' mm'
|
||||||
EgtOutLog( sWarn)
|
EgtOutLog( sWarn)
|
||||||
end
|
end
|
||||||
if BD.TURN then
|
if BD.TURN and BD.TURN ~= 2 then
|
||||||
-- centro del pezzo
|
-- centro del pezzo
|
||||||
local ptCen = ORIG()
|
local ptCen = ORIG()
|
||||||
if b3Solid then ptCen = b3Solid:getCenter() end
|
if b3Solid then ptCen = b3Solid:getCenter() end
|
||||||
@@ -5279,7 +5370,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
|||||||
EgtOutLog( Cutting.Message)
|
EgtOutLog( Cutting.Message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA then
|
if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA and BD.C_SIMM then
|
||||||
Cutting.CanApply = false
|
Cutting.CanApply = false
|
||||||
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : skipped sawblade from bottom'
|
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : skipped sawblade from bottom'
|
||||||
EgtOutLog( Cutting.Message)
|
EgtOutLog( Cutting.Message)
|
||||||
@@ -5838,10 +5929,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local sMyMchFind = 'Pocket'
|
local sMyMchFind = 'Pocket'
|
||||||
local nOk, sErr
|
local nOk, sErr
|
||||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
|
||||||
nLundIdFace = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
|
nLundIdFace, sErr = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
|
||||||
if nOk < 0 then
|
if nOk < 0 then
|
||||||
return false, sErr
|
return false, sErr
|
||||||
elseif nOk > 0 then
|
elseif nOk > 0 then
|
||||||
|
sWarn = sErr
|
||||||
bTryWithBlades = false
|
bTryWithBlades = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -5946,7 +6038,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local bIsRabbetAlongXTowardsBottom = ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)
|
local bIsRabbetAlongXTowardsBottom = ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)
|
||||||
local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2)))
|
local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2)))
|
||||||
-- se fattibile con fresa BH di fianco e spessore utensile inferiore alla larghezza faccia
|
-- se fattibile con fresa BH di fianco e spessore utensile inferiore alla larghezza faccia
|
||||||
local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
|
local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill, b3Raw)
|
||||||
if bPrevBhSideMill == nil then
|
if bPrevBhSideMill == nil then
|
||||||
bPrevBhSideMill = bMakeBySideMill
|
bPrevBhSideMill = bMakeBySideMill
|
||||||
end
|
end
|
||||||
@@ -6001,6 +6093,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||||
|
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, EgtIf( nFacInd == 0, 1, 0), GDB_ID.ROOT)
|
||||||
|
if vtN2 then
|
||||||
|
local AddLen = sqrt( dV^2 * ( ( 1 / abs( vtN2:getX())^2) - 1)) + BD.CUT_SIC
|
||||||
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, AddLen)
|
||||||
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, AddLen)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + BD.CUT_SIC)
|
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + BD.CUT_SIC)
|
||||||
@@ -6137,9 +6235,20 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
vtN, vtN2 = vtN2, vtN
|
vtN, vtN2 = vtN2, vtN
|
||||||
sPocketing = ML.FindPocketing( sMchFind, dDiam2, dFacElev2 + dCollSic2)
|
sPocketing = ML.FindPocketing( sMchFind, dDiam2, dFacElev2 + dCollSic2)
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
local sErr = 'Error : '..sMchFind..' not found in library'
|
dDiam, dDiam2 = dDiam2, dDiam
|
||||||
EgtOutLog( sErr)
|
dCollSic, dCollSic2 = dCollSic2, dCollSic
|
||||||
return false, sErr
|
nFacInd, nFacInd2 = nFacInd2, nFacInd
|
||||||
|
dH, dH2 = dH2, dH
|
||||||
|
dV, dV2 = dV2, dV
|
||||||
|
dFacElev, dFacElev2 = dFacElev2, dFacElev
|
||||||
|
rfFac, rfFac2 = rfFac2, rfFac
|
||||||
|
vtN, vtN2 = vtN2, vtN
|
||||||
|
sPocketing = ML.FindPocketing( sMchFind, dDiam2, nil, nil, nil, nil, nil, nil, 'Longest')
|
||||||
|
if not sPocketing then
|
||||||
|
local sErr = 'Error : '..sMchFind..' not found in library'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- provo con contornatura
|
-- provo con contornatura
|
||||||
@@ -6938,8 +7047,10 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- superficie di fondo
|
-- superficie di fondo
|
||||||
nSurfBottomId = EgtSurfTmPlaneInBBox( nAddGrpId, ptMaxBox, vtOrtho, b3SolidExtended, GDB_ID.ROOT)
|
nSurfBottomId = EgtSurfTmPlaneInBBox( nAddGrpId, ptMaxBox, vtOrtho, b3SolidExtended, GDB_ID.ROOT)
|
||||||
-- calcolo di quanto allargare le superfici
|
-- calcolo di quanto allargare le superfici
|
||||||
local dWidth = EgtIf( Proc.AffectedFaces.Front, Proc.Box:getDimZ(), Proc.Box:getDimY())
|
if dAddLen == 0 then
|
||||||
dAddLen = min( dWidth, 100) / 2
|
local dWidth = EgtIf( Proc.AffectedFaces.Front, Proc.Box:getDimZ(), Proc.Box:getDimY())
|
||||||
|
dAddLen = min( dWidth, 100) / 2
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- la divido in parti lungo X
|
-- la divido in parti lungo X
|
||||||
local vAddId = {}
|
local vAddId = {}
|
||||||
@@ -7073,11 +7184,9 @@ local function TestTwoFacesDownHead( Proc)
|
|||||||
if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then
|
if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then
|
||||||
bDownHeadBlade = false
|
bDownHeadBlade = false
|
||||||
else
|
else
|
||||||
for i = 1, Proc.Fct do
|
if ( Proc.Face[1].IsTooDownwardForTopBlade and Proc.Face[2].IsTooWideForTopBlade) or
|
||||||
if Proc.Face[i].IsTooDownwardForTopBlade and ( not Proc.IsTopDownRabbet or Proc.Face[i].IsTooWideForTopBlade) then
|
( Proc.Face[2].IsTooDownwardForTopBlade and Proc.Face[1].IsTooWideForTopBlade) then
|
||||||
bDownHeadBlade = true
|
bDownHeadBlade = true
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -7335,7 +7444,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- se lunghezza richiede spezzatura
|
-- se lunghezza richiede spezzatura
|
||||||
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
|
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
|
||||||
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) or
|
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) or
|
||||||
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > BD.LEN_SHORT_PART or 1000)) then
|
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
|
||||||
-- una faccia
|
-- una faccia
|
||||||
if Proc.Fct == 1 then
|
if Proc.Fct == 1 then
|
||||||
if bUseBlade then
|
if bUseBlade then
|
||||||
@@ -7483,10 +7592,26 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- determino l'angolo tra le facce
|
-- determino l'angolo tra le facce
|
||||||
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||||
-- se con BH
|
-- se con BH
|
||||||
if VerifyBHSideMill( Proc) then
|
if VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw) then
|
||||||
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true)
|
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true)
|
||||||
-- se ortogonali e non forzata lama, con fresa
|
-- se ortogonali e non forzata lama, con fresa
|
||||||
elseif not bUseBlade then
|
elseif not bUseBlade then
|
||||||
|
-- verifico se devo fare prima gli smussi
|
||||||
|
-- recupero gruppo per geometria addizionale
|
||||||
|
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||||
|
if not nAddGrpId then
|
||||||
|
local sErr = 'Error : missing AddGroup'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- verifiche per smusso
|
||||||
|
local nChamfer, dDepthCham, sErrCham = EvaluateQParam( Proc)
|
||||||
|
-- se smusso da fare
|
||||||
|
if nChamfer > 0 then
|
||||||
|
local _, _, _, vtOrtho, _, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
||||||
|
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||||
|
if nOk < 0 then return false, sErr end
|
||||||
|
end
|
||||||
-- se piccole
|
-- se piccole
|
||||||
if Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN) and bAdj and abs( dAng + 90) < 1 then
|
if Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN) and bAdj and abs( dAng + 90) < 1 then
|
||||||
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHeadMill)
|
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHeadMill)
|
||||||
|
|||||||
@@ -286,9 +286,11 @@ local function CalcBladeUse( bUseBlade, bDown_Head, nSide, vtN1, vtN2, bConvex,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if ( vtN1 and vtN1:getZ() >= EgtIf( dCustomAngle, dCustomAngle, -0.5)) and ( not vtN2 or vtN2:getZ() >= -0.5) then
|
--if ( vtN1 and vtN1:getZ() >= EgtIf( dCustomAngle, dCustomAngle, -0.5)) and ( not vtN2 or vtN2:getZ() >= -0.5) then
|
||||||
bCanUseBlade = true
|
-- bCanUseBlade = true
|
||||||
end
|
--end
|
||||||
|
-- viene abilitata sempre lama da sotto
|
||||||
|
bCanUseBlade = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -423,12 +425,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
-- analisi del taglio
|
-- analisi del taglio
|
||||||
local vOrd = {}
|
local vOrd = {}
|
||||||
local vFaceUse = {}
|
local vFaceUse = {}
|
||||||
|
local bIsMachDownUp = false
|
||||||
if nSide == 1 or ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN)) then
|
if nSide == 1 or ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN)) then
|
||||||
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
|
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
|
||||||
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
|
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
|
||||||
elseif nSide == -1 then
|
elseif nSide == -1 then
|
||||||
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
|
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
|
||||||
vFaceUse = { BL.GetNearestParalOpposite( ptC[1] - ptM), BL.GetNearestParalOpposite( ptC[2] - ptM)}
|
local vtFaceUse1, vtFaceUse2
|
||||||
|
if bCanUseBlade and not BD.DOWN_HEAD then
|
||||||
|
bIsMachDownUp = true
|
||||||
|
vtFaceUse1 = BL.GetOrtupOpposite( BL.GetNearestOrthoOpposite( ptC[1] - ptM))
|
||||||
|
vtFaceUse2 = BL.GetOrtupOpposite( BL.GetNearestOrthoOpposite( ptC[2] - ptM))
|
||||||
|
else
|
||||||
|
vtFaceUse1 = BL.GetNearestParalOpposite( ptC[1] - ptM)
|
||||||
|
vtFaceUse2 = BL.GetNearestParalOpposite( ptC[2] - ptM)
|
||||||
|
end
|
||||||
|
vFaceUse = { vtFaceUse1, vtFaceUse2}
|
||||||
else
|
else
|
||||||
local bFront = ( ( vtN[1]:getY() + vtN[2]:getY()) < 0)
|
local bFront = ( ( vtN[1]:getY() + vtN[2]:getY()) < 0)
|
||||||
if bFront then
|
if bFront then
|
||||||
@@ -442,6 +454,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
local vWidth = {}
|
local vWidth = {}
|
||||||
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1])
|
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1])
|
||||||
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2])
|
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2])
|
||||||
|
local vElevation = { vWidth[2], vWidth[1]}
|
||||||
|
|
||||||
-- Se da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima
|
-- Se da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima
|
||||||
if ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then
|
if ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then
|
||||||
@@ -850,7 +863,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
|
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
|
||||||
local nWorkSide, bInvert
|
local nWorkSide, bInvert
|
||||||
if ( not bIsTopBladeCurrent and abs( nSide) ~= 0) or ( bCanUseBlade and bCanUseUnderBlade and nSide == -1) then
|
if ( not bIsTopBladeCurrent and abs( nSide) ~= 0) or ( bCanUseBlade and bCanUseUnderBlade and nSide == -1) then
|
||||||
if bIsCurrentBladeCCW then
|
if bIsCurrentBladeCCW and not bIsMachDownUp then
|
||||||
nWorkSide = MCH_MILL_WS.LEFT
|
nWorkSide = MCH_MILL_WS.LEFT
|
||||||
bInvert = true
|
bInvert = true
|
||||||
dSal, dEal = dEal, dSal
|
dSal, dEal = dEal, dSal
|
||||||
@@ -859,7 +872,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
bInvert = false
|
bInvert = false
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if bIsCurrentBladeCCW then
|
if bIsCurrentBladeCCW and not bIsMachDownUp then
|
||||||
nWorkSide = MCH_MILL_WS.LEFT
|
nWorkSide = MCH_MILL_WS.LEFT
|
||||||
bInvert = false
|
bInvert = false
|
||||||
else
|
else
|
||||||
@@ -1066,6 +1079,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
if nSide == -1 and BD.DOWN_HEAD then
|
if nSide == -1 and BD.DOWN_HEAD then
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
|
||||||
|
elseif nSide == -1 and not BD.DOWN_HEAD and bIsMachDownUp then
|
||||||
|
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( EgtGetMachiningParam( MCH_MP.INVERT), false, true))
|
||||||
|
dOffset = 5
|
||||||
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
|
||||||
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||||
@@ -1288,6 +1306,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
end
|
end
|
||||||
-- ciclo sulle parti
|
-- ciclo sulle parti
|
||||||
local nM = 0
|
local nM = 0
|
||||||
|
local bInverted = false
|
||||||
for j = 1, nC do
|
for j = 1, nC do
|
||||||
-- su entrambe le facce
|
-- su entrambe le facce
|
||||||
for i = nIni, nFin do
|
for i = nIni, nFin do
|
||||||
@@ -1311,6 +1330,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
if nSide == 1 or nSide == -1 then
|
if nSide == 1 or nSide == -1 then
|
||||||
local bFromYM = (( vtN[vOrd[i]]:getY() < 0 and bConvex) or ( vtN[vOrd[i]]:getY() > 0 and not bConvex))
|
local bFromYM = (( vtN[vOrd[i]]:getY() < 0 and bConvex) or ( vtN[vOrd[i]]:getY() > 0 and not bConvex))
|
||||||
nSCC = EgtIf( bFromYM, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
nSCC = EgtIf( bFromYM, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||||
|
if BD.TURN == 2 and not bFromYM then
|
||||||
|
nSCC = EgtIf( nSide == -1, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
local bFromZM = (( vtN[vOrd[i]]:getZ() < 0 and bConvex) or ( vtN[vOrd[i]]:getZ() > 0 and not bConvex))
|
local bFromZM = (( vtN[vOrd[i]]:getZ() < 0 and bConvex) or ( vtN[vOrd[i]]:getZ() > 0 and not bConvex))
|
||||||
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||||
@@ -1325,6 +1347,23 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
local dStep = 0
|
local dStep = 0
|
||||||
local dAgg = EgtIf( bConvex, 2 * BD.CUT_EXTRA, BD.CUT_EXTRA)
|
local dAgg = EgtIf( bConvex, 2 * BD.CUT_EXTRA, BD.CUT_EXTRA)
|
||||||
local dLargh = vWidth[vOrd[i]]
|
local dLargh = vWidth[vOrd[i]]
|
||||||
|
-- controllo se lavorazione completa
|
||||||
|
local dMachDepth = vElevation[vOrd[i]]
|
||||||
|
if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then
|
||||||
|
-- verifico se posso lavorare la faccia 2
|
||||||
|
local nOtherFace = EgtIf( i == 1, 2, 1)
|
||||||
|
if j == 1 and vtN[vOrd[nOtherFace]]:getZ() > dLimitAngle and vWidth[vOrd[i]] < dMaxDepth then
|
||||||
|
vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
|
||||||
|
dLargh = vWidth[vOrd[i]]
|
||||||
|
dSal, dEal = dEal, dSal
|
||||||
|
bInverted = true
|
||||||
|
else
|
||||||
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
|
elseif bInverted then
|
||||||
|
dSal, dEal = dEal, dSal
|
||||||
|
end
|
||||||
if not bSide and dLargh > 0.8 * dToolDiam then
|
if not bSide and dLargh > 0.8 * dToolDiam then
|
||||||
nO = ceil( dLargh / ( 0.6 * dToolDiam))
|
nO = ceil( dLargh / ( 0.6 * dToolDiam))
|
||||||
if nO > 1 then
|
if nO > 1 then
|
||||||
@@ -1358,7 +1397,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
--EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, BL.GetParallelOpposite( vFaceUse[vOrd[i]]), vFaceUse[vOrd[i]]))
|
--EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, BL.GetParallelOpposite( vFaceUse[vOrd[i]]), vFaceUse[vOrd[i]]))
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, MCH_MILL_FU.PARAL_DOWN, vFaceUse[vOrd[i]]))
|
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, MCH_MILL_FU.PARAL_DOWN, vFaceUse[vOrd[i]]))
|
||||||
-- imposto lato di lavoro e inversione
|
-- imposto lato di lavoro e inversione
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bSide, true, false))
|
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bSide, true, false))
|
||||||
-- imposto offset radiale (nullo se concavo o di lato)
|
-- imposto offset radiale (nullo se concavo o di lato)
|
||||||
local dOffsR = EgtIf( k < nO, ( nO - k) * dStep, EgtIf( bConvex, - BD.CUT_EXTRA, 0))
|
local dOffsR = EgtIf( k < nO, ( nO - k) * dStep, EgtIf( bConvex, - BD.CUT_EXTRA, 0))
|
||||||
@@ -1402,7 +1441,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||||
local AddProc = { Id = AddId, Grp = 0, Prc = 12, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId, bMoveAfterSplit = true}
|
local AddProc = { Id = AddId, Grp = 0, Prc = 12, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||||
|
PartId = Proc.PartId, TaskId = Proc.TaskId, CutId = Proc.CutId, bMoveAfterSplit = true}
|
||||||
Topology.Classify( AddProc, b3Raw)
|
Topology.Classify( AddProc, b3Raw)
|
||||||
table.insert( AddedIds, AddProc)
|
table.insert( AddedIds, AddProc)
|
||||||
end
|
end
|
||||||
@@ -1793,7 +1833,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- imposto lato di lavoro e inversione
|
-- imposto lato di lavoro e inversione
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
-- calcolo la componente dNz non in base alla classificazione della feature (sopra, sotto, fianchi) ma alla componente maggiore
|
-- 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( nSide == 0, vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
-- ProcessSplit.lua by Egaltech s.r.l. 2025/06/20
|
||||||
|
-- Gestione tastatura
|
||||||
|
|
||||||
|
-- Tabella per definizione modulo
|
||||||
|
local ProcessProbing = {}
|
||||||
|
|
||||||
|
-- Include
|
||||||
|
require( 'EgtBase')
|
||||||
|
local BL = require( 'BeamLib')
|
||||||
|
|
||||||
|
-- Dati
|
||||||
|
local ML = require( 'MachiningLib')
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function GetProbingMachining( Machinings, sHead)
|
||||||
|
local sProbeMachining, sHeadTool
|
||||||
|
|
||||||
|
-- TODO questa associazione "testa utensile"-"testa tastatore" dovrebbe essere spostata nella macchina.
|
||||||
|
-- Non è detto che se testa utensile inizia con "H2" allora bisogna prendere lavorazione con "_H2"
|
||||||
|
|
||||||
|
-- se la testa utilizzata dalla lavorazione inizia con H2, dovrebbe essere la seconda testa
|
||||||
|
if EgtStartsWith( sHead, 'H2') then
|
||||||
|
sHeadTool = '_H2'
|
||||||
|
else
|
||||||
|
sHeadTool = '_H1'
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = 1, #Machinings do
|
||||||
|
if EgtEndsWith( Machinings[i].Name, sHeadTool) then
|
||||||
|
sProbeMachining = Machinings[i]
|
||||||
|
return sProbeMachining
|
||||||
|
end
|
||||||
|
end
|
||||||
|
sProbeMachining = Machinings[1]
|
||||||
|
return sProbeMachining
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function MoveProbePointToRawFaces( ptProbe, vtProbe, nPartId)
|
||||||
|
local b3BoxPart = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
|
-- si porta linea di tastatura su grezzo
|
||||||
|
if AreSameVectorApprox( vtProbe, Z_AX()) then
|
||||||
|
ptProbe[3] = b3BoxPart:getMax():getZ()
|
||||||
|
elseif AreSameVectorApprox( vtProbe, -Z_AX()) then
|
||||||
|
ptProbe[3] = b3BoxPart:getMin():getZ()
|
||||||
|
elseif AreSameVectorApprox( vtProbe, Y_AX()) then
|
||||||
|
ptProbe[2] = b3BoxPart:getMax():getY()
|
||||||
|
elseif AreSameVectorApprox( vtProbe, -Y_AX()) then
|
||||||
|
ptProbe[2] = b3BoxPart:getMin():getY()
|
||||||
|
end
|
||||||
|
return ptProbe
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- Applicazione della lavorazione
|
||||||
|
function ProcessProbing.Make( Proc, nPartId, Info)
|
||||||
|
local bOk, sErr
|
||||||
|
|
||||||
|
-- per eseguire tastatura servono tutti i dati, altriemnti impossibile
|
||||||
|
if Info.vtProbe and Info.ptProbe and Info.sType then
|
||||||
|
Info.ptProbe = MoveProbePointToRawFaces( Info.ptProbe, Info.vtProbe, nPartId)
|
||||||
|
-- recupero gruppo per geometria addizionale
|
||||||
|
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||||
|
local nIdLine = EgtLinePVL( nAddGrpId, Info.ptProbe, Info.vtProbe, 10, GDB_RT.GLOB) -- TODO lunghezza da portare fuori come parametro
|
||||||
|
local Machinings = GetMachinings( MCH_MY.PROBING, Info.sType)
|
||||||
|
-- se c'è almeno una lavorazione, allora devo fare tastatura
|
||||||
|
if Machinings and #Machinings > 0 then
|
||||||
|
local sProbing = GetProbingMachining( Machinings, Info.sHead)
|
||||||
|
-- se c'è la linea e la lavorazione, applico
|
||||||
|
if sProbing and nIdLine then
|
||||||
|
local sName = 'DtMtProbe_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
|
local nMchFId = EgtAddMachining( sName, sProbing.Name)
|
||||||
|
-- si inverte la direzione della linea, deve essere entrante, oppostaa vettore estrusione
|
||||||
|
EgtInvertCurve( nIdLine)
|
||||||
|
-- aggiungo geometria
|
||||||
|
EgtSetMachiningGeometry( {{ nIdLine, -1}})
|
||||||
|
|
||||||
|
-- eseguo
|
||||||
|
if not ML.ApplyMachining( true, false) then
|
||||||
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sErr
|
||||||
|
else
|
||||||
|
bOk = true
|
||||||
|
end
|
||||||
|
else
|
||||||
|
bOk = false
|
||||||
|
sErr = 'Error on probing'
|
||||||
|
end
|
||||||
|
-- altrimenti tastatura non richiesta, esco
|
||||||
|
else
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
else
|
||||||
|
bOk = false
|
||||||
|
sErr = 'Error on probing'
|
||||||
|
end
|
||||||
|
|
||||||
|
return bOk, sErr
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
return ProcessProbing
|
||||||
@@ -33,6 +33,7 @@ local sEnableExtraBladeUpperFace = 'Q02' -- i
|
|||||||
local sDepthChamferMill = 'Q03' -- d
|
local sDepthChamferMill = 'Q03' -- d
|
||||||
local sOverMaterialForFinish = 'Q04' -- d
|
local sOverMaterialForFinish = 'Q04' -- d
|
||||||
local sPreemptiveChamfer = 'Q05' -- i
|
local sPreemptiveChamfer = 'Q05' -- i
|
||||||
|
local bUseSmallMill = 'Q06' -- i
|
||||||
|
|
||||||
-- abilitazioni extra
|
-- abilitazioni extra
|
||||||
local dMakeAntiSplintOnHead = 1 -- valore impronta antischeggia, per disattivare settare = nil o = 0
|
local dMakeAntiSplintOnHead = 1 -- valore impronta antischeggia, per disattivare settare = nil o = 0
|
||||||
@@ -206,6 +207,41 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
|||||||
return nChamfer, dDepth, sMilling, sMilling2
|
return nChamfer, dDepth, sMilling, sMilling2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
function VerifySmallMillCanFinish( dDiamCurrentTool, dDepthProfile, nSide)
|
||||||
|
local dToolMaxDepthSmall, dToolDiamSmall
|
||||||
|
-- abilitazione lavorazione da sotto
|
||||||
|
local sMillType = 'Prof'
|
||||||
|
local sMillingSmall, _, _, bH2Small = ML.FindMilling( sMillType, nil, nil, nil, nil, true, nil, nil, nil, 'Smallest')
|
||||||
|
if not sMillingSmall then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
-- Recupero i dati dell'utensile
|
||||||
|
if EgtMdbSetCurrMachining( sMillingSmall) then
|
||||||
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid)) then
|
||||||
|
dToolMaxDepthSmall = EgtTdbGetCurrToolMaxDepth()
|
||||||
|
dToolDiamSmall = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||||
|
-- se non ci sono almeno 5mm di differenza si fa con utensile standard
|
||||||
|
if dDiamCurrentTool - 5 < dToolDiamSmall then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local bDouble = ( dDepthProfile + BD.CUT_EXTRA > dToolMaxDepthSmall)
|
||||||
|
-- se lavorazione in doppio richiesta, si verifica se richiesta testa sotto
|
||||||
|
if bDouble and nSide == 0 then
|
||||||
|
return false -- TODO macchine con BD.DOWN_HEAD potrebbero lavorare in doppio in questo caso!
|
||||||
|
end
|
||||||
|
|
||||||
|
if not bDouble or ( dDepthProfile + BD.MILL_OVERLAP < dToolMaxDepthSmall * 2) then
|
||||||
|
return true, sMillingSmall, bDouble
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||||
@@ -468,6 +504,15 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local bUseSmallMillOnFinish = EgtGetInfo( Proc.Id, bUseSmallMill, 'i') == 1
|
||||||
|
local sMillingSmall, bDoubleSmall
|
||||||
|
-- se serve fresa più piccola per finitura
|
||||||
|
if bUseSmallMillOnFinish then
|
||||||
|
bUseSmallMillOnFinish, sMillingSmall, bDoubleSmall = VerifySmallMillCanFinish( dMillDiam, dProfDepth, nSide)
|
||||||
|
end
|
||||||
|
|
||||||
-- se il chamfer non è esclusivo continuo con le altre lavorazioni
|
-- se il chamfer non è esclusivo continuo con le altre lavorazioni
|
||||||
if nChamfer < 2 then
|
if nChamfer < 2 then
|
||||||
-- verifico se necessario lavorare in doppio
|
-- verifico se necessario lavorare in doppio
|
||||||
@@ -537,10 +582,6 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtSetMachiningParam( MCH_MP.OFFSR, ( dOriOffset + dOffsetPar))
|
EgtSetMachiningParam( MCH_MP.OFFSR, ( dOriOffset + dOffsetPar))
|
||||||
bFinish = true
|
bFinish = true
|
||||||
end
|
end
|
||||||
-- se parametro sovramateriale è maggiore di 0 lo aggiungo al sovramateriale precedente
|
|
||||||
if dOffsetPar > 0 then
|
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, ( dOriOffset + dOffsetPar))
|
|
||||||
end
|
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
@@ -567,7 +608,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
nMchId = nMch2Id
|
nMchId = nMch2Id
|
||||||
end
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
if bFinish then
|
if bFinish and not bUseSmallMillOnFinish then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sNewName = 'ProfB_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sNewName = 'ProfB_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||||
@@ -639,7 +680,13 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
local nSCC = MCH_SCC.ADIR_NONE
|
||||||
|
if BD.TURN == 2 then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
else
|
||||||
|
nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||||
local ptSP, ptEp
|
local ptSP, ptEp
|
||||||
local bFinish
|
local bFinish
|
||||||
@@ -676,7 +723,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
nMchId = nMch2Id
|
nMchId = nMch2Id
|
||||||
end
|
end
|
||||||
-- se abilitata, aggiungo lavorazione di finitura
|
-- se abilitata, aggiungo lavorazione di finitura
|
||||||
if bFinish then
|
if bFinish and not bUseSmallMillOnFinish then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||||
@@ -732,6 +779,44 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- se finitura con fresa piccola
|
||||||
|
if bFinish and bUseSmallMillOnFinish then
|
||||||
|
local sDepthSmall = EgtIf( bDoubleSmall, ( dProfDepth+ BD.MILL_OVERLAP ) / 2, dProfDepth + BD.CUT_EXTRA)
|
||||||
|
local sMachName = 'Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
|
nMchId = EgtAddMachining( sMachName, sMillingSmall)
|
||||||
|
if not nMchId then
|
||||||
|
local sErr = 'Error adding machining ' .. sMachName .. '-' .. sMillingSmall
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- aggiungo geometria
|
||||||
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
|
|
||||||
|
-- imposto l'affondamento
|
||||||
|
EgtSetMachiningParam( MCH_MP.DEPTH, sDepthSmall)
|
||||||
|
-- posizione braccio porta testa
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||||
|
-- eseguo
|
||||||
|
if not ML.ApplyMachining( true, false) then
|
||||||
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( nMchId, false)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
|
||||||
|
if bDoubleSmall then
|
||||||
|
local sNewName = 'FinB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
|
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||||
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
|
|
||||||
|
-- eseguo
|
||||||
|
if not ML.ApplyMachining( true, false) then
|
||||||
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( nMchId, false)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- aggiorno ingombro testa o coda per presa
|
-- aggiorno ingombro testa o coda per presa
|
||||||
if nSide ~= 1 then -- se feature di fianco o da sotto
|
if nSide ~= 1 then -- se feature di fianco o da sotto
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
-- calcolo riferimenti per facce inclinate
|
-- calcolo riferimenti per facce inclinate
|
||||||
local vtRef = Vector3d( vtN[vFaceOrd[3]])
|
local vtRef = Vector3d( vtN[vFaceOrd[3]])
|
||||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
local vtRef2 = Vector3d( vtN[vFaceOrd[2]])
|
||||||
-- eseguo
|
-- eseguo
|
||||||
for i = 1, #vCuts do
|
for i = 1, #vCuts do
|
||||||
local nOrthoOpposite
|
local nOrthoOpposite
|
||||||
|
|||||||
@@ -239,6 +239,8 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||||
nSCC = MCH_SCC.ADIR_YP
|
nSCC = MCH_SCC.ADIR_YP
|
||||||
end
|
end
|
||||||
|
elseif BD.TURN == 2 then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
elseif BD.TURN then
|
elseif BD.TURN then
|
||||||
if vtN:getZ() > 0.707 then
|
if vtN:getZ() > 0.707 then
|
||||||
nSCC = MCH_SCC.ADIR_ZP
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
|||||||
@@ -196,27 +196,33 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- controllo per eseguire solo un taglio ottimizzato
|
-- se non ho intersezione con la faccia tappo posso fare il taglio sul fianco
|
||||||
local bExecJustOneCut = false
|
if not nGoodFace1 or nGoodFace1 == 0 then
|
||||||
local dDiceFaceDim = GEO.INFINITO
|
-- controllo per eseguire solo un taglio ottimizzato
|
||||||
if ( i % 2) == 0 then
|
local bExecJustOneCut = false
|
||||||
for cont = 1, #vCuts[i] do
|
local dDiceFaceDim = GEO.INFINITO
|
||||||
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][cont], 0)
|
if ( i % 2) == 0 then
|
||||||
-- se feature verso Z, si ammette anche lavorazione in doppio
|
for cont = 1, #vCuts[i] do
|
||||||
if AreSameVectorApprox( vtRef, Z_AX()) then
|
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][cont], 0)
|
||||||
if dMaxDepth * 2 > dDiceFaceH + BD.CUT_EXTRA then
|
-- se feature verso Z, si ammette anche lavorazione in doppio
|
||||||
bExecJustOneCut = true
|
if AreSameVectorApprox( vtRef, Z_AX()) then
|
||||||
dDiceFaceDim = dDiceFaceH
|
if dMaxDepth * 2 > dDiceFaceH + BD.CUT_EXTRA then
|
||||||
break
|
bExecJustOneCut = true
|
||||||
end
|
dDiceFaceDim = dDiceFaceH
|
||||||
elseif AreSameVectorApprox( vtRef, Y_AX()) or AreSameVectorApprox( vtRef, -Y_AX()) then
|
break
|
||||||
if dMaxDepth > dDiceFaceV + BD.CUT_EXTRA then
|
end
|
||||||
bExecJustOneCut = true
|
elseif AreSameVectorApprox( vtRef, Y_AX()) or AreSameVectorApprox( vtRef, -Y_AX()) then
|
||||||
dDiceFaceDim = dDiceFaceV
|
if dMaxDepth > dDiceFaceV + BD.CUT_EXTRA then
|
||||||
break
|
bExecJustOneCut = true
|
||||||
|
dDiceFaceDim = dDiceFaceV
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- se c'è intersezione non ci deve essere ExtraCut
|
||||||
|
else
|
||||||
|
dExtraCut = 0
|
||||||
end
|
end
|
||||||
-- se si può fare, faccio unico taglio parallelo
|
-- se si può fare, faccio unico taglio parallelo
|
||||||
if bExecJustOneCut then
|
if bExecJustOneCut then
|
||||||
@@ -522,10 +528,20 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
else
|
else
|
||||||
dDiamMax = EgtIf( abs( frMor:getVersX():getY()) < abs( frMor:getVersY():getY()), dL, dW)
|
dDiamMax = EgtIf( abs( frMor:getVersX():getY()) < abs( frMor:getVersY():getY()), dL, dW)
|
||||||
end
|
end
|
||||||
-- determino la distanza tra le due facce inclinate
|
-- determino la distanza tra le due facce inclinate per determinare elevazione
|
||||||
local dDistFaces
|
local dDistFaces
|
||||||
if vFaceOrd[4] ~= 0 then
|
if vFaceOrd[4] ~= 0 then
|
||||||
dDistFaces = abs((ptC[vFaceOrd[2]]-ptC[vFaceOrd[4]])*vtN[vFaceOrd[2]])
|
local nElevationFace1 = 0
|
||||||
|
-- controllo estensione faccia 1
|
||||||
|
if vFaceOrd[1] ~= 0 then
|
||||||
|
frMor, dL, dW = EgtSurfTmFacetMinAreaRectangle( Proc.Id, vFaceOrd[1]-1, GDB_ID.ROOT)
|
||||||
|
if abs(vtRef:getY()) > 0.866 then
|
||||||
|
nElevationFace1 = EgtIf( abs( frMor:getVersX():getZ()) < abs( frMor:getVersY():getY()), dL, dW)
|
||||||
|
else
|
||||||
|
nElevationFace1 = EgtIf( abs( frMor:getVersX():getY()) < abs( frMor:getVersY():getY()), dL, dW)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
dDistFaces = max( abs((ptC[vFaceOrd[2]]-ptC[vFaceOrd[4]])*vtN[vFaceOrd[2]]), nElevationFace1)
|
||||||
end
|
end
|
||||||
-- recupero la lavorazione. considerando l dimensione del lato e l'affondamento
|
-- recupero la lavorazione. considerando l dimensione del lato e l'affondamento
|
||||||
local sPocketing
|
local sPocketing
|
||||||
|
|||||||
+29
-19
@@ -336,7 +336,7 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- tagli verticali aggiuntivi
|
-- tagli verticali aggiuntivi
|
||||||
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes)
|
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes, dOffsetBetweenCuts)
|
||||||
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
|
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
|
||||||
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
|
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
|
||||||
-- recupero il diametro dell'utensile
|
-- recupero il diametro dell'utensile
|
||||||
@@ -352,8 +352,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes)
|
|||||||
for j = nVerticalCuts, 1, -1 do
|
for j = nVerticalCuts, 1, -1 do
|
||||||
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
||||||
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
||||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER and not BD.DOWN_HEAD
|
local sLeadInOutType = 'PerpendicularOutraw'
|
||||||
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw, nil, nil, nil, bForceTangentLeadInOut)
|
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
|
|||||||
local dCutExtra = 0
|
local dCutExtra = 0
|
||||||
local dAccStart = 0
|
local dAccStart = 0
|
||||||
local dAccEnd = 0
|
local dAccEnd = 0
|
||||||
if TailCutType.bBigSectionCut and BD.C_SIMM then
|
if TailCutType.bBigSectionCut and BD.C_SIMM and b3Raw:getDimZ() > BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL then
|
||||||
-- qui arrivano sezioni molto grandi su macchine tipo PF con materiale da asportare inferiore allo spessore lama
|
-- qui arrivano sezioni molto grandi su macchine tipo PF con materiale da asportare inferiore allo spessore lama
|
||||||
local dSawRad = Cutting1Data.dSawDiam / 2
|
local dSawRad = Cutting1Data.dSawDiam / 2
|
||||||
dCutExtra = - ( b3Raw:getDimY() - dSawRad)
|
dCutExtra = - ( b3Raw:getDimY() - dSawRad)
|
||||||
@@ -422,8 +422,8 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
|
|||||||
for j = nHorizontalCuts, 1, -1 do
|
for j = nHorizontalCuts, 1, -1 do
|
||||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||||
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
|
||||||
local bForceTangentLeadInOut = BD.PRESS_ROLLER
|
local sLeadInOutType = 'PerpendicularOutraw'
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
|
||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||||
@@ -472,7 +472,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
|
|||||||
-- se trave larga effettuo tagli verticali aggiuntivi
|
-- se trave larga effettuo tagli verticali aggiuntivi
|
||||||
if TailCutType.bNeedVerticalAddedCuts then
|
if TailCutType.bNeedVerticalAddedCuts then
|
||||||
local sSpecNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
|
local sSpecNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
|
||||||
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes)
|
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes, dOffsetBetweenCuts)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
if i == 1 and TailCutType.sType =='Precut' then
|
if i == 1 and TailCutType.sType =='Precut' then
|
||||||
@@ -541,7 +541,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
|
|||||||
-- se trave larga effettuo tagli verticali aggiuntivi
|
-- se trave larga effettuo tagli verticali aggiuntivi
|
||||||
if TailCutType.bNeedVerticalAddedCuts then
|
if TailCutType.bNeedVerticalAddedCuts then
|
||||||
local sSpecNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
|
local sSpecNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
|
||||||
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes)
|
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes, dOffsetBetweenCuts)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
local sNotes
|
local sNotes
|
||||||
@@ -573,7 +573,15 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
if not bOkc then return bOkc, sErrC end
|
if not bOkc then return bOkc, sErrC end
|
||||||
end
|
end
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sCutting = ML.FindCutting( 'TailSide', nil, nil, nil, 'Longest')
|
-- TODO questa parte andrà cambiata quando si gestiranno i volumi liberi in cui girare da mlse
|
||||||
|
local dMinWidthForBigBlade = 300
|
||||||
|
local dMaxHeightForBigBlade = 300
|
||||||
|
local sCutting
|
||||||
|
if b3Raw:getDimY() > dMinWidthForBigBlade and b3Raw:getDimZ() < dMaxHeightForBigBlade then
|
||||||
|
sCutting = ML.FindCutting( 'TailSide', nil, nil, nil, 'Longest')
|
||||||
|
else
|
||||||
|
sCutting = ML.FindCutting( 'TailSide')
|
||||||
|
end
|
||||||
if not sCutting then
|
if not sCutting then
|
||||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library'
|
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -623,10 +631,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- caratteristiche taglio
|
-- caratteristiche taglio
|
||||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dSawMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dSawMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||||
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dSawMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dSawMaxDepth2) - 2 * BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||||
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
|
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
|
||||||
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||||
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) and
|
||||||
|
( b3Raw:getDimY() < 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||||
-- dati geometrici del taglio
|
-- dati geometrici del taglio
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||||
-- separazione solo se esiste grezzo successivo con pezzi o scaricabile
|
-- separazione solo se esiste grezzo successivo con pezzi o scaricabile
|
||||||
@@ -652,7 +661,10 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- determino la necessità di tagli aggiuntivi
|
-- determino la necessità di tagli aggiuntivi
|
||||||
local dMinTailScrapForAdditionalCuts = 10.123
|
local dMinTailScrapForAdditionalCuts = 10.123
|
||||||
local bNeedVerticalAddedCuts = not bSplit and ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
|
local bNeedVerticalAddedCuts = not bSplit and ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
|
||||||
local bNeedHorizontalAddedCuts = not bSplit and ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
|
local bNeedHorizontalAddedCuts = not bSplit and not bBigSectionCut and
|
||||||
|
( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and
|
||||||
|
( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) and
|
||||||
|
dOffsL < BD.MAX_DIM_DICE
|
||||||
-- dati lavorazioni sopra e sotto
|
-- dati lavorazioni sopra e sotto
|
||||||
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dSawMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
|
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dSawMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
|
||||||
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dSawMaxDepth2, dSawThick = dSawThick2}
|
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dSawMaxDepth2, dSawThick = dSawThick2}
|
||||||
@@ -759,18 +771,16 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
if AreOppositeVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
|
if AreOppositeVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
|
||||||
end
|
end
|
||||||
-- tagli verticali
|
-- tagli verticali
|
||||||
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, sNotes)
|
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, sNotes, dOffsL)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
-- tagli a cubetti con eventuale superficie limitante
|
-- tagli a cubetti con eventuale superficie limitante
|
||||||
bOk, sErr = Cut.Make( AddProc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nLimitingSurf)
|
local sLeadInOutType = 'PerpendicularOutraw'
|
||||||
|
bOk, sErr = Cut.Make( AddProc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nLimitingSurf, sLeadInOutType)
|
||||||
end
|
end
|
||||||
-- tagli aggiuntivi non necessari
|
-- tagli aggiuntivi non necessari
|
||||||
else
|
else
|
||||||
local bForceTangentLeadInOut = false
|
local sLeadInOutType = 'PerpendicularOutraw'
|
||||||
if BD.PRESS_ROLLER then
|
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nil, sLeadInOutType)
|
||||||
bForceTangentLeadInOut = true
|
|
||||||
end
|
|
||||||
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nil, bForceTangentLeadInOut)
|
|
||||||
end
|
end
|
||||||
if sNotesFinal then
|
if sNotesFinal then
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||||
|
|||||||
@@ -132,7 +132,12 @@ local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchF
|
|||||||
-- calcolo il diametro utensile
|
-- calcolo il diametro utensile
|
||||||
local dDiamTool
|
local dDiamTool
|
||||||
if nUseRoughTool == 1 then
|
if nUseRoughTool == 1 then
|
||||||
dDiamTool = max( 80, min( tBHx[nFaceRef][1], tBHx[nFaceRef][2]))
|
-- se feature passante prendo utensile più grande possibile
|
||||||
|
if ( Proc.AffectedFaces.Top and Proc.AffectedFaces.Bottom) or ( Proc.AffectedFaces.Front and Proc.AffectedFaces.Back) then
|
||||||
|
dDiamTool = nil
|
||||||
|
else
|
||||||
|
dDiamTool = max( 80, min( tBHx[nFaceRef][1], tBHx[nFaceRef][2]))
|
||||||
|
end
|
||||||
else
|
else
|
||||||
-- se non uso truciolatore prendo il valore dalle dimensioni minime delle facce
|
-- se non uso truciolatore prendo il valore dalle dimensioni minime delle facce
|
||||||
dDiamTool = min( tBHx[nFaceRef][1], tBHx[nFaceRef][2])
|
dDiamTool = min( tBHx[nFaceRef][1], tBHx[nFaceRef][2])
|
||||||
@@ -283,8 +288,8 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN,
|
|||||||
-- setto a 0 eventuali offset
|
-- setto a 0 eventuali offset
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||||
-- applico gli allungamenti o accorciamenti considerando che la lavorazione è invertita
|
-- applico gli allungamenti o accorciamenti considerando che la lavorazione è invertita
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, dTDiam / 2, - dTDiam / 2))
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, dTDiam / 2 + 10, - dTDiam / 2))
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, dTDiam / 2, - dTDiam / 2))
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, dTDiam / 2 + 10, - dTDiam / 2))
|
||||||
-- attacchi e uscite lineari con parte tg nulla
|
-- attacchi e uscite lineari con parte tg nulla
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
|
|||||||
@@ -1,5 +1,71 @@
|
|||||||
==== Beam Update Log ====
|
==== Beam Update Log ====
|
||||||
|
|
||||||
|
Versione 2.7f3 (19/06/2025)
|
||||||
|
- Modifx : in StepJointNotch corretta distanza attacco in/out
|
||||||
|
|
||||||
|
Versione 2.7f2 (18/06/2025)
|
||||||
|
- Modif : in LongDoubleCut aggiunto messaggio feature non completa se utensile non arriva sul fondo
|
||||||
|
- Modif : in StepJointNotch, se si forza truciolatore, si prende utensile più grande
|
||||||
|
- Fixed : in LapJoint, piccola correzione calcolo sovrapposizione trimesh per smuotatura
|
||||||
|
- Fixed : in LapJoint, per sovrapposizione in spezzatura, corretto caso tipo Tunnel
|
||||||
|
|
||||||
|
Versione 2.7f1 (03/06/2025)
|
||||||
|
- Modif : in tenone coda di rondine modificato angolo limite tenone per lavorazione in sottosquadro
|
||||||
|
- Modif : migliorie per lavorazioni su aggregato
|
||||||
|
|
||||||
|
Versione 2.7e2 (23/05/2025)
|
||||||
|
- Modif : in tagli di lama migliorie alla scelta del lato da lavorare
|
||||||
|
- Modif : in mortasa coda di rondine migliorati i percorsi
|
||||||
|
- Modif : in tenone coda di rondine migliorate le lavorazioni da sotto
|
||||||
|
- Fixed : in Scarf Joint correzione alla scelta faccia da lavorare
|
||||||
|
|
||||||
|
Versione 2.7e1 (05/05/2025)
|
||||||
|
- Fixed : in taglio di separazione si riduce percorso di taglio solo se il pezzo è effettivamente alto
|
||||||
|
- Fixed : in foratura corretto caso in cui non si sceglieva l'utensile più lungo disponibile
|
||||||
|
- Fixed : In BatchProcess (Ts7) corretta generazione in caso di progetto senza ricalcolo
|
||||||
|
- Modif : in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning
|
||||||
|
|
||||||
|
Versione 2.7d3 (22/04/2025)
|
||||||
|
- Fixed : in LapJoint corretta gestione errata Q04
|
||||||
|
|
||||||
|
Versione 2.7d2 (17/04/2025)
|
||||||
|
- Added : in scanalatura aggiunta Q03 per forzare fresa
|
||||||
|
- Modif : in slot con lama + sega a catena abilitata lavorazione da sotto per macchine con testa sopra
|
||||||
|
- Modif : nei tagli modifche in caso di tagli di coda anticipati
|
||||||
|
- Modif : in lavorazioni tipo tacca ma 3 facce migliorata la scelta faccia
|
||||||
|
|
||||||
|
Versione 2.7d1 (04/04/2025)
|
||||||
|
- Fixed : in PreDrill piccola correzione
|
||||||
|
- Fixed : nei tagli varie correzioni
|
||||||
|
- Fixed : in HeadCut e Split corretto calcolo lunghezza extra di taglio
|
||||||
|
|
||||||
|
Versione 2.7c2 (24/03/2025)
|
||||||
|
- Fixed : in BatchProcess (Ts7) riabilitata modifica barra erroneamente rimossa
|
||||||
|
|
||||||
|
Versione 2.7c1 (17/03/2025)
|
||||||
|
- Modif : in HeadCut e Split, per decidere se fare doppio taglio verticale, si controlla anche il massimo possibile e non solo il minimo
|
||||||
|
- Modif : in LapJoint migliorato controllo per decidere se feature di coda
|
||||||
|
- Modif : nei tagli, se taglio rivolto verso il basso e non possibile tagliare di fianco, si fa in fase ribaltata
|
||||||
|
- Fixed : in BatchProcess (Ts7) corretta restituzione stato feature erroneamente segnalata verde
|
||||||
|
- Fixed : corretta restituzione stato feature lavorata in doppio
|
||||||
|
|
||||||
|
Versione 2.7b3 (03/03/2025)
|
||||||
|
- Modif : in forature passanti orizzontali fatte da un solo lato, si inverte il lato di lavoro in base all'utensile scelto
|
||||||
|
- Modif : in LapJoint in lavorazione tipo BH permessa U passante non parallela agli assi principali; attacchi migliorati
|
||||||
|
- Modif : in LapJoint le feature di coda con pezzo lungo vengono spostate sempre dopo separazione
|
||||||
|
- Fixed : in macchine tipo Turn piccoli miglioramenti ai tagli di lama
|
||||||
|
|
||||||
|
Versione 2.7b2 (05/02/2025)
|
||||||
|
- Modif : si consentono DrillPocket in doppio solo se foro non passante
|
||||||
|
|
||||||
|
Versione 2.7b1 (04/02/2025)
|
||||||
|
- Modif : in tagli di testa e coda l'utilizzo delle lame grandi (es: 1000 su 15003TMAX) è limitato ai pezzi più bassi di 300 mm e più larghi di 300 mm
|
||||||
|
|
||||||
|
Versione 2.7a2 (23/01/2025)
|
||||||
|
- Added : in RidgeLap aggiunta Q05 per usare la fresa tipo LapJoint
|
||||||
|
- Fixed : in BatchProcess (Ts7) piccola correzione
|
||||||
|
- Fixed : in ScarfJoint, in caso di taglio dal lato, aggiunta estensione oltre il bordo
|
||||||
|
|
||||||
Versione 2.7a1 (21/01/2025)
|
Versione 2.7a1 (21/01/2025)
|
||||||
- Added : in FreeContour aggiunta Q09 per inversione ultima lavorazione
|
- Added : in FreeContour aggiunta Q09 per inversione ultima lavorazione
|
||||||
- Modif : in Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra
|
- Modif : in Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra
|
||||||
|
|||||||
+2
-2
@@ -2,5 +2,5 @@
|
|||||||
-- Gestione della versione di Beam
|
-- Gestione della versione di Beam
|
||||||
|
|
||||||
NAME = 'Beam'
|
NAME = 'Beam'
|
||||||
VERSION = '2.7a1'
|
VERSION = '2.7f3'
|
||||||
MIN_EXE = '2.6e5'
|
MIN_EXE = '2.7f2'
|
||||||
|
|||||||
Reference in New Issue
Block a user