Compare commits
22 Commits
BigSection
...
FixLongCut
| Author | SHA1 | Date | |
|---|---|---|---|
| 58ea436132 | |||
| c8b5f9ca27 | |||
| 33d70bdbf4 | |||
| 6ffb0da24d | |||
| 04abd401f6 | |||
| 5b1fb41c43 | |||
| 8baf4ad2d6 | |||
| 3e27651e4c | |||
| 2c5de2516d | |||
| 07dad8f8c2 | |||
| b48fe0da34 | |||
| 640f77b5f5 | |||
| 14afb25783 | |||
| 5bc4e6f24f | |||
| ea40658bd3 | |||
| ec1a8e711d | |||
| a0b55b8628 | |||
| 6e0d6c7ea7 | |||
| c3786e0a96 | |||
| 07a66eb132 | |||
| b3fcdcdd6b | |||
| 0c5c1dcfe5 |
+109
-1
@@ -35,8 +35,9 @@
|
|||||||
-- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
|
-- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
|
||||||
-- 2022/08/08 Modifica per macchine senza BD.MAX_WIDTH2 e BD.MAX_HEIGHT2.
|
-- 2022/08/08 Modifica per macchine senza BD.MAX_WIDTH2 e BD.MAX_HEIGHT2.
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||||
-- 2022/09/21 Nella funzione di ordinamento il foro del birdsmouth viene sempre fatto prima della lavorazione stessa
|
|
||||||
-- 2022/09/28 I fori vengono sempre fatti prima delle tacche.
|
-- 2022/09/28 I fori vengono sempre fatti prima delle tacche.
|
||||||
|
-- 2022/09/29 Aggiunta la ricerca di feature specchiate, al momento solo per DtMortise, con le relative funzioni.
|
||||||
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamExec = {}
|
local BeamExec = {}
|
||||||
@@ -1368,6 +1369,108 @@ local function MoveDrillsOnTenon( vProc)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- Estrazione parametri P da lavorazioni di tipo DtMortise
|
||||||
|
local function GetPParametersDtMortise( Proc)
|
||||||
|
local vPParameters = {
|
||||||
|
{ 'P01', 'd'},
|
||||||
|
{ 'P02', 'd'},
|
||||||
|
{ 'P03', 'd'},
|
||||||
|
{ 'P04', 'i'},
|
||||||
|
{ 'P05', 'i'},
|
||||||
|
{ 'P06', 'd'},
|
||||||
|
{ 'P07', 'd'},
|
||||||
|
{ 'P09', 'd'},
|
||||||
|
{ 'P10', 'd'},
|
||||||
|
{ 'P11', 'd'},
|
||||||
|
{ 'P12', 'd'},
|
||||||
|
{ 'P13', 'd'},
|
||||||
|
{ 'P14', 'd'},
|
||||||
|
{ 'P15', 'd'}
|
||||||
|
}
|
||||||
|
for i = 1, #vPParameters do
|
||||||
|
vPParameter = vPParameters[i]
|
||||||
|
vPParameter[3] = EgtGetInfo( Proc.Id, vPParameter[1], vPParameter[2])
|
||||||
|
end
|
||||||
|
return vPParameters
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- Controlla se la feature ProcMirror è la specchiata di Proc, per feature di tipo DtMortise
|
||||||
|
local function CheckMirrorDtMortise( Proc, ProcMirror, dHBeam)
|
||||||
|
local bIsMirror = true
|
||||||
|
local vPParametersProc = GetPParametersDtMortise( Proc)
|
||||||
|
local vPParametersMirror = GetPParametersDtMortise( ProcMirror)
|
||||||
|
local nP02, nP06 = 2, 6
|
||||||
|
-- controllo che i parametri P delle due feature, tranne P02 e P06, siano uguali
|
||||||
|
for i = 1, #vPParametersProc do
|
||||||
|
local vPParameterProc = vPParametersProc[i]
|
||||||
|
local vPParameterMirror = vPParametersMirror[i]
|
||||||
|
if vPParameterProc[1] ~= 'P02' and vPParameterProc[1] ~= 'P06'then
|
||||||
|
bIsMirror = ( abs( vPParameterProc[3] - vPParameterMirror[3]) < 100 * GEO.EPS_SMALL)
|
||||||
|
if bIsMirror == false then break end
|
||||||
|
elseif vPParameterProc[1] == 'P02' then
|
||||||
|
nP02 = i
|
||||||
|
elseif vPParameterProc[1] == 'P06' then
|
||||||
|
nP06 = i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se gli altri parametri P sono uguali, verifico che P02 e P06 siano compatibili con feature specchiate
|
||||||
|
if bIsMirror == true then
|
||||||
|
bIsMirror = ( ( vPParametersProc[nP02][3] == 0 and abs( vPParametersMirror[nP02][3] - dHBeam) < 100 * GEO.EPS_SMALL) and
|
||||||
|
( vPParametersProc[nP06][3] == 90 and vPParametersMirror[nP06][3] == -90)) or
|
||||||
|
( ( vPParametersMirror[nP02][3] == 0 and abs( vPParametersProc[nP02][3] - dHBeam) < 100 * GEO.EPS_SMALL) and
|
||||||
|
( vPParametersMirror[nP06][3] == 90 and vPParametersProc[nP06][3] == -90))
|
||||||
|
end
|
||||||
|
return bIsMirror
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- Cerca se esiste una feature specchiata di Proc e nel caso ne restituisce la posizione in vProc
|
||||||
|
local function FindMirrorFeature( vProc, Proc, sFeatureType, dHBeam)
|
||||||
|
local nProcMirror
|
||||||
|
-- se mortasa a coda di rondine
|
||||||
|
if sFeatureType == 'DtMortise' then
|
||||||
|
Proc.Side = EgtGetInfo( Proc.Id, 'SIDE', 'i')
|
||||||
|
for i = 1, #vProc do
|
||||||
|
local ProcMirror = vProc[i]
|
||||||
|
if DtMortise.SideIdentify(ProcMirror) then
|
||||||
|
ProcMirror.Side = EgtGetInfo( ProcMirror.Id, 'SIDE', 'i')
|
||||||
|
if ( Proc.Side == 1 and ProcMirror.Side == 3) or ( Proc.Side == 3 and ProcMirror.Side == 1) or
|
||||||
|
( Proc.Side == 2 and ProcMirror.Side == 4) or ( Proc.Side == 4 and ProcMirror.Side == 2) then
|
||||||
|
local bIsMirror = CheckMirrorDtMortise( Proc, ProcMirror, dHBeam)
|
||||||
|
if bIsMirror then nProcMirror = i end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se foratura (da implementare)
|
||||||
|
return nProcMirror
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- Cerca in vProc la presenza di feature specchiate. Se le trova scrive in Proc e nelle info l'Id della specchiata.
|
||||||
|
local function SetMirroredFeatures( vProc, dHBeam)
|
||||||
|
for i = 1, #vProc do
|
||||||
|
local Proc = vProc[i]
|
||||||
|
local sFeatureType
|
||||||
|
if DtMortise.SideIdentify(Proc) then
|
||||||
|
sFeatureType = 'DtMortise'
|
||||||
|
elseif Drill.Identify(Proc) then
|
||||||
|
sFeatureType = 'Drill'
|
||||||
|
end
|
||||||
|
if ( sFeatureType == 'DtMortise' or sFeatureType == 'Drill') and not Proc.MirrorId then
|
||||||
|
local nProcMirror = FindMirrorFeature( vProc, Proc, sFeatureType, dHBeam)
|
||||||
|
if nProcMirror then
|
||||||
|
Proc.MirrorId = vProc[nProcMirror].Id
|
||||||
|
vProc[nProcMirror].MirrorId = Proc.Id
|
||||||
|
EgtSetInfo( Proc.Id, 'MIRRORID', vProc[nProcMirror].Id)
|
||||||
|
EgtSetInfo( vProc[nProcMirror].Id, 'MIRRORID', Proc.Id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
-- verifica se ci sono forature da lavorare dopo tagli di testa o coda e nel caso le classifica come Head o Tail e gli assegna l'Id della rispettiva feature di taglio
|
-- verifica se ci sono forature da lavorare dopo tagli di testa o coda e nel caso le classifica come Head o Tail e gli assegna l'Id della rispettiva feature di taglio
|
||||||
local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
|
local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
|
||||||
@@ -1462,6 +1565,11 @@ function BeamExec.ProcessFeatures()
|
|||||||
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
|
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
|
||||||
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
|
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
|
||||||
end
|
end
|
||||||
|
-- verifica presenza di feature specchiate per eventuali lavorazioni simultanee
|
||||||
|
local bConcurrentDoubleHead = BD.DOUBLE_HEAD_MIRRORED_FEATURES and ( BD.TWO_EQUAL_HEADS or BD.TWO_UP_DOWN_HEADS)
|
||||||
|
if bConcurrentDoubleHead then
|
||||||
|
SetMirroredFeatures( vProc, EgtGetRawPartBBox( nRawId):getDimZ())
|
||||||
|
end
|
||||||
-- le ordino lungo X
|
-- le ordino lungo X
|
||||||
OrderFeatures( vProc, b3Raw)
|
OrderFeatures( vProc, b3Raw)
|
||||||
-- le classifico
|
-- le classifico
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
-- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste.
|
-- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste.
|
||||||
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
||||||
-- 2022/11/02 Modificata scelta utensile ottimizzata. Ora se c'è un utensile più grande disponibile si dà preferenza a quello.
|
-- 2022/11/02 Modificata scelta utensile ottimizzata. Ora se c'è un utensile più grande disponibile si dà preferenza a quello.
|
||||||
|
-- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local MachiningLib = {}
|
local MachiningLib = {}
|
||||||
@@ -108,8 +109,9 @@ local function SetCurrMachiningAndTool( sMachName)
|
|||||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||||
local nHead = tonumber( sHead:sub( 2, #sHead))
|
local nHead = tonumber( sHead:sub( 2, #sHead))
|
||||||
local bH2 = ( nHead >= 21 and nHead <= 29)
|
local bH2 = ( nHead >= 21 and nHead <= 29)
|
||||||
|
local bH3 = ( nHead >= 31 and nHead <= 39)
|
||||||
local bFixed = ( vFixedHeads[nHead])
|
local bFixed = ( vFixedHeads[nHead])
|
||||||
return bActive, sTool, bH2, bFixed
|
return bActive, sTool, bH2, bFixed, bH3
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
@@ -222,7 +224,7 @@ function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH3)
|
||||||
if bTopHead == nil and bDownHead == nil then
|
if bTopHead == nil and bDownHead == nil then
|
||||||
bTopHead = true
|
bTopHead = true
|
||||||
bDownHead = false
|
bDownHead = false
|
||||||
@@ -273,8 +275,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
|||||||
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
||||||
end
|
end
|
||||||
-- recupero dati utensile
|
-- recupero dati utensile
|
||||||
local bToolActive, sToolName, bH2, bFixed = SetCurrMachiningAndTool( Machining.Name)
|
local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining.Name)
|
||||||
if Machining.On and sMachiningType == sType and bToolActive then
|
if Machining.On and sMachiningType == sType and bToolActive and ( not bH3 or bH3 == not bExcludeH3) then
|
||||||
local bOk, ToolParams = VerifyTool( MachiningType, sType, Params, bH2)
|
local bOk, ToolParams = VerifyTool( MachiningType, sType, Params, bH2)
|
||||||
if bOk then
|
if bOk then
|
||||||
if MachineHeadUse == ONE_HEAD then
|
if MachineHeadUse == ONE_HEAD then
|
||||||
@@ -384,8 +386,8 @@ function MachiningLib.FindAngleDrilling( dDiam, dDepth, bTopHead, bDownHead)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead)
|
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH3)
|
||||||
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead)
|
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH3)
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto e punta disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto e punta disabilitata.
|
||||||
-- 2022/10/25 Nella funzione Split aggiunto il controllo che le facce di ingresso e uscita siano differenti (potrebbe succedere per fori molto corti). Modifica importatore in futuro.
|
-- 2022/10/25 Nella funzione Split aggiunto il controllo che le facce di ingresso e uscita siano differenti (potrebbe succedere per fori molto corti). Modifica importatore in futuro.
|
||||||
|
-- 2022/11/23 Aggiunta la gestione dei fori con angolo < 30 gradi, per i quali si usa la testa della macchina per accorciare l'utile di lavoro.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDrill = {}
|
local ProcessDrill = {}
|
||||||
@@ -267,7 +268,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
local nErrorCode = 0
|
local nErrorCode = 0
|
||||||
-- abilitazione foratura da sotto
|
-- abilitazione foratura da sotto
|
||||||
local bDrillDown = ( bDownDrill and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259))
|
local bDrillDown = ( bDownDrill and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259))
|
||||||
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.5)
|
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.421)
|
||||||
-- 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)
|
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown)
|
||||||
@@ -370,10 +371,14 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
-- 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)
|
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||||
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 2) * TgA
|
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 2) * 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 + 2) * TgA - 96
|
||||||
|
end
|
||||||
local dMaxDepthOri = dMaxDepth
|
local dMaxDepthOri = dMaxDepth
|
||||||
dMaxDepth = min( dMaxDepth, dToolFreeLen - dSubL)
|
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
||||||
-- Verifico inclinazione foro nei limiti
|
-- Verifico inclinazione foro nei limiti
|
||||||
local bTryDrill = ( CosB < BD.DRILL_VX_MAX)
|
local bTryDrill = EgtIf( dMaxDepth > 0, ( CosB < BD.DRILL_VX_MAX), false)
|
||||||
if ( CosB > 0.8 * BD.DRILL_VX_MAX and CosB < BD.DRILL_VX_MAX_ANGLEDRILL) then
|
if ( CosB > 0.8 * BD.DRILL_VX_MAX and CosB < BD.DRILL_VX_MAX_ANGLEDRILL) then
|
||||||
-- cerco le forature speciali AngleDrill
|
-- cerco le forature speciali AngleDrill
|
||||||
local sDrilling3, sType3, dMaxDepth3 = ML.FindAngleDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown)
|
local sDrilling3, sType3, dMaxDepth3 = ML.FindAngleDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
|
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
|
||||||
-- 2022/06/01 Modifiche per evitare di entrare nel legno con mortase parziali.
|
-- 2022/06/01 Modifiche per evitare di entrare nel legno con mortase parziali.
|
||||||
-- 2022/08/18 Migliorato calcolo dello step.
|
-- 2022/08/18 Migliorato calcolo dello step.
|
||||||
|
-- 2022/09/29 Aggiunto riconoscimento della sola feature laterale.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDtMortise = {}
|
local ProcessDtMortise = {}
|
||||||
@@ -39,6 +40,12 @@ function ProcessDtMortise.FrontIdentify( Proc)
|
|||||||
return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 56)
|
return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 56)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- Riconoscimento della sola feature laterale
|
||||||
|
function ProcessDtMortise.SideIdentify( Proc)
|
||||||
|
return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 55)
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Verifica se feature di coda
|
-- Verifica se feature di coda
|
||||||
function ProcessDtMortise.IsTailFeature( Proc, b3Raw)
|
function ProcessDtMortise.IsTailFeature( Proc, b3Raw)
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
-- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta.
|
-- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta.
|
||||||
-- 2022/11/03 In MakeByMill migliorata gestione lavorazione con fresa su testa da sotto.
|
-- 2022/11/03 In MakeByMill migliorata gestione lavorazione con fresa su testa da sotto.
|
||||||
-- 2022/11/09 Aggiunta la gestione della chiamata della FreeContour da parte della SimpleScarf.
|
-- 2022/11/09 Aggiunta la gestione della chiamata della FreeContour da parte della SimpleScarf.
|
||||||
|
-- 2022/11/24 In MakeByMill aggiunta la lavorazione sopra/sotto nel caso di testa sotto
|
||||||
|
-- In MakeByMill se BeamData forza lettura codolo da Q questo viene sempre fatto indipendentemente dalle dimensioni della feature
|
||||||
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
@@ -121,7 +123,7 @@ function ProcessFreeContour.Classify( Proc, b3Raw)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham)
|
local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham, bDownHead)
|
||||||
local nChamfer = 0
|
local nChamfer = 0
|
||||||
-- ingombro del grezzo
|
-- ingombro del grezzo
|
||||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||||
@@ -161,7 +163,11 @@ local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham)
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMilling
|
local sMilling
|
||||||
if nChamfer > 0 then
|
if nChamfer > 0 then
|
||||||
sMilling = ML.FindMilling( 'Mark')
|
if bDownHead then
|
||||||
|
sMilling = ML.FindMilling( 'Mark_H2', nil, nil, nil, nil, false, true)
|
||||||
|
else
|
||||||
|
sMilling = ML.FindMilling( 'Mark')
|
||||||
|
end
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : Mark not found in library'
|
local sErr = 'Error : Mark not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -302,15 +308,15 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
local dOriDepth = dDepth
|
local dOriDepth = dDepth
|
||||||
local nDouble = 1
|
local nDouble = 1
|
||||||
local bCanDouble = ( abs( vtExtr:getY()) > abs( vtExtr:getZ()) and bCross)
|
local bCanDouble = ( abs( vtExtr:getY()) > abs( vtExtr:getZ()) and bCross) or ( BD.DOWN_HEAD and bCross)
|
||||||
local dDimStrip = BD.DIM_STRIP
|
local dDimStrip = BD.DIM_STRIP
|
||||||
if dDimStrip < 0 then
|
if dDimStrip < 0 then
|
||||||
dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0
|
dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0
|
||||||
end
|
end
|
||||||
local bStripOnSide = false
|
local bStripOnSide = false
|
||||||
if bCross then
|
if bCross then
|
||||||
-- se chiamata da SimpleScarf il codolo è sempre attivo
|
-- se forzata da parametro Q il codolo è sempre attivo
|
||||||
if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX()) or Proc.Prc == 70) then
|
if dDimStrip > 10 * GEO.EPS_SMALL and ( BD.DIM_STRIP < 0 or nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then
|
||||||
-- devo lasciare un codolo
|
-- devo lasciare un codolo
|
||||||
local dExtraCham = EgtIf( nChamfer > 0, 2, 0)
|
local dExtraCham = EgtIf( nChamfer > 0, 2, 0)
|
||||||
dDepth = EgtIf( Proc.Prc == 70, dDepth - dDimStrip - dDepthCham - dExtraCham, dDepth - dDimStrip)
|
dDepth = EgtIf( Proc.Prc == 70, dDepth - dDimStrip - dDepthCham - dExtraCham, dDepth - dDimStrip)
|
||||||
@@ -322,8 +328,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
local bIsDepthReduced = false
|
local bIsDepthReduced = false
|
||||||
-- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga
|
-- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga
|
||||||
-- se chiamata da SimpleScarf il codolo è sempre attivo
|
-- se forzata da parametro Q il codolo è sempre attivo
|
||||||
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and ( nStep > 1 or Proc.Prc == 70) and
|
local dDepthWork = dDepth
|
||||||
|
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and ( BD.DIM_STRIP < 0 or nStep > 1) and
|
||||||
bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then
|
bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then
|
||||||
nDouble = 2
|
nDouble = 2
|
||||||
dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth)
|
dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth)
|
||||||
@@ -332,8 +339,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
if dDepth > dMaxDepth then
|
if dDepth > dMaxDepth then
|
||||||
if bCanDouble then
|
if bCanDouble then
|
||||||
nDouble = 2
|
nDouble = 2
|
||||||
dDepth = min( 0.5 * dDepth, dMaxDepth)
|
dDepthWork = 0.5 * dDepth
|
||||||
if dDepth < 0.5 * dDepth - 10 * GEO.EPS_SMALL then
|
dDepth = min( dDepthWork, dMaxDepth)
|
||||||
|
if dDepth < dDepthWork - 10 * GEO.EPS_SMALL then
|
||||||
bIsDepthReduced = true
|
bIsDepthReduced = true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -345,7 +353,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local sWarn = ''
|
local sWarn = ''
|
||||||
-- se ho ridotto l'altezza emetto warning
|
-- se ho ridotto l'altezza emetto warning
|
||||||
if bIsDepthReduced then
|
if bIsDepthReduced then
|
||||||
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' (Free Contour) : elevation bigger than max tool depth'
|
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' (Free Contour) : depth (' .. EgtNumToString( dDepthWork, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||||
EgtOutLog( sWarn)
|
EgtOutLog( sWarn)
|
||||||
end
|
end
|
||||||
-- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-
|
-- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-
|
||||||
@@ -361,11 +369,34 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then
|
if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then
|
||||||
local bDoubleCham = false
|
local bDoubleCham = false
|
||||||
local dExtra = 2
|
local dExtra = 2
|
||||||
|
local sChamferDown, sChamferUp
|
||||||
|
if nDouble > 1 and bCanDouble then
|
||||||
|
if nSide == 0 then
|
||||||
|
if BD.DOWN_HEAD then
|
||||||
|
-- recupero la lavorazione
|
||||||
|
local nChamferDown
|
||||||
|
nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true)
|
||||||
|
if nChamferDown < 0 then
|
||||||
|
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||||
|
sChamferDown = nil
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local nChamferUp
|
||||||
|
nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false)
|
||||||
|
if nChamferUp < 0 then
|
||||||
|
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||||
|
sChamferUp = nil
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
-- eseguo
|
-- eseguo
|
||||||
for i = 1, nStep do
|
for i = 1, nStep do
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchId = EgtAddMachining( sNameCh, sChamfer)
|
local sChamferSide1 = EgtIf( bDownHead, sChamferDown, sChamfer)
|
||||||
|
local nMchId = EgtAddMachining( sNameCh, sChamferSide1)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer
|
local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -374,9 +405,6 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- se lavorazione da sopra o da sotto
|
-- se lavorazione da sopra o da sotto
|
||||||
if nSide ~= 0 then
|
|
||||||
bDoubleCham = true
|
|
||||||
end
|
|
||||||
if Proc.Grp == 3 then
|
if Proc.Grp == 3 then
|
||||||
if not bToolInv then
|
if not bToolInv then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
@@ -406,6 +434,11 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if nSide == 0 then
|
||||||
|
bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false)
|
||||||
|
else
|
||||||
|
bDoubleCham = true
|
||||||
|
end
|
||||||
-- assegno affondamento e offset radiale
|
-- assegno affondamento e offset radiale
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||||
@@ -445,12 +478,19 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMchId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se lavorazione da due parti, aggiungo la seconda
|
-- se lavorazione da due parti, aggiungo la seconda
|
||||||
if bDoubleCham then
|
if bDoubleCham then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = 'ChamB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'ChamB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchId = EgtAddMachining( sName, sChamfer)
|
local sChamferSide2
|
||||||
|
if EgtEndsWith( sChamferSide1, 'H2') then
|
||||||
|
sChamferSide2 = sChamferUp
|
||||||
|
elseif nSide == 0 then
|
||||||
|
sChamferSide2 = sChamferDown
|
||||||
|
else
|
||||||
|
sChamferSide2 = sChamfer
|
||||||
|
end
|
||||||
|
nMchId = EgtAddMachining( sName, sChamferSide2)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sChamfer
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sChamfer
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -511,6 +551,31 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
-- verifico se devo fare sgrossatura più finitura
|
-- verifico se devo fare sgrossatura più finitura
|
||||||
local dOffsetPar = EgtGetInfo( Proc.Id, Q_OVERMAT_FOR_FINISH, 'i') or 0
|
local dOffsetPar = EgtGetInfo( Proc.Id, Q_OVERMAT_FOR_FINISH, 'i') or 0
|
||||||
|
-- nel caso di lavorazioni sopra/sotto cerco lavorazioni specifiche
|
||||||
|
local sMillingDown, sMillingUp
|
||||||
|
if nDouble > 1 and bCanDouble then
|
||||||
|
if nSide == 0 then
|
||||||
|
if BD.DOWN_HEAD then
|
||||||
|
-- recupero la lavorazione
|
||||||
|
sMillingDown = ML.FindMilling( 'FreeContour_H2', nil, nil, nil, nil, false, true)
|
||||||
|
if not sMillingDown then
|
||||||
|
nDouble = 1
|
||||||
|
dDepth = min( dOriDepth, dMaxDepth)
|
||||||
|
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' (Free Contour) : milling from bottom not found in library' .. '\n' ..
|
||||||
|
'; depth (' .. EgtNumToString( dOriDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
elseif sMillingDown and not bDownHead then
|
||||||
|
bToolInv = true
|
||||||
|
sMilling = sMillingDown
|
||||||
|
end
|
||||||
|
end
|
||||||
|
sMillingUp = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, true, false)
|
||||||
|
if not sMillingUp then
|
||||||
|
sWarn = 'Warning : milling not found in library'
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
-- eseguo
|
-- eseguo
|
||||||
for i = 1, nStep do
|
for i = 1, nStep do
|
||||||
for j = 1, nDouble do
|
for j = 1, nDouble do
|
||||||
@@ -535,7 +600,13 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
else
|
else
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
nMchId = EgtAddMachining( sName, sMilling)
|
if EgtEndsWith( sMilling, '_H2') then
|
||||||
|
nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingUp, sMilling))
|
||||||
|
elseif sMillingDown then
|
||||||
|
nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingDown, sMilling))
|
||||||
|
else
|
||||||
|
nMchId = EgtAddMachining( sName, sMilling)
|
||||||
|
end
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
||||||
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
||||||
|
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessHeadCut = {}
|
local ProcessHeadCut = {}
|
||||||
@@ -168,11 +169,13 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
local dMaxDepth = 50
|
local dMaxDepth = 50
|
||||||
|
local dSawThick = 2
|
||||||
if EgtMdbSetCurrMachining( sCutting) then
|
if EgtMdbSetCurrMachining( sCutting) 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
|
||||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
|
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||||
@@ -181,20 +184,22 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
-- recupero i dati della eventuale seconda lama
|
-- recupero i dati della eventuale seconda lama
|
||||||
local dSawDiam2 = 0
|
local dSawDiam2 = 0
|
||||||
local dMaxDepth2 = 0
|
local dMaxDepth2 = 0
|
||||||
|
local dSawThick2 = 0
|
||||||
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
||||||
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
||||||
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
||||||
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
||||||
|
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- 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_MIN + 10 * GEO.EPS_SMALL)
|
||||||
local bHorizCut = ( not bBigSectionCut and ( 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 bBigSectionCut 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 bBigSectionCut and 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)
|
||||||
-- 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)
|
||||||
-- se non obbligatorio e coincide con inizio grezzo, non va fatto
|
-- se non obbligatorio e coincide con inizio grezzo, non va fatto
|
||||||
@@ -210,8 +215,21 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
||||||
-- se finitura con lama
|
-- se finitura con lama
|
||||||
if nQ05 == 1 or nQ05 == 0 then
|
if nQ05 == 1 or nQ05 == 0 then
|
||||||
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
|
local dSawThickCheck = dSawThick
|
||||||
if not bOk then return bOk, sErr end
|
if dSawThick2 > 0 and bDoubleHorizCut then
|
||||||
|
dSawThickCheck = min( dSawThick, dSawThick2)
|
||||||
|
end
|
||||||
|
local dMaxElev = 0
|
||||||
|
if vtN:getX() > 0 then
|
||||||
|
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
|
||||||
|
else
|
||||||
|
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
|
||||||
|
end
|
||||||
|
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
|
||||||
|
if dMaxElev > dSawThickCheck then
|
||||||
|
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
|
||||||
|
return bOk, sErr
|
||||||
|
end
|
||||||
-- se finitura con truciolatore
|
-- se finitura con truciolatore
|
||||||
elseif nQ05 == 2 then
|
elseif nQ05 == 2 then
|
||||||
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)
|
||||||
@@ -227,11 +245,12 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
||||||
if not bOk then return bOk, sErr end
|
return bOk, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
-- se tagli standard
|
-- se tagli standard
|
||||||
elseif not bDoubleHorizCut then
|
if not bDoubleHorizCut then
|
||||||
-- flag di lavorazione faccia
|
-- flag di lavorazione faccia
|
||||||
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
|
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
|
||||||
-- calcolo extra taglio ed accorciamento
|
-- calcolo extra taglio ed accorciamento
|
||||||
@@ -277,7 +296,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
-- verifico che le due lame riescano a lavorare la sezione
|
-- verifico che le due lame riescano a lavorare la sezione
|
||||||
local dDimZ = b3Raw:getDimZ()
|
local dDimZ = b3Raw:getDimZ()
|
||||||
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
||||||
if dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0 then
|
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
|
||||||
local sErr = 'Error : section too big for head cut'
|
local sErr = 'Error : section too big for head cut'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ local function AssignQIdent( Proc)
|
|||||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
|
||||||
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
||||||
|
Q_USE_MILL = 'Q02' -- i
|
||||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||||
elseif ( Proc.Grp == 4) and Proc.Prc == 37 then
|
elseif ( Proc.Grp == 4) and Proc.Prc == 37 then
|
||||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
|
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
|
||||||
-- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali.
|
-- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali.
|
||||||
-- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace.
|
-- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace.
|
||||||
|
-- 2022/11/28 Correzioni varie per attacco, pulizia spigoli, utilizzo H3
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLongCut = {}
|
local ProcessLongCut = {}
|
||||||
@@ -860,7 +861,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local bDownHead = ( nSide == - 1)
|
local bDownHead = ( nSide == - 1)
|
||||||
sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut')
|
sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut')
|
||||||
local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead)
|
local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1
|
||||||
|
local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead, bExcludeH3)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : milling '..sMchType..' not found in library'
|
local sErr = 'Error : milling '..sMchType..' not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -885,11 +887,22 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
if bLimXmin and bLimXmax and Proc.Box:getDimX() < 2 * dToolDiam then
|
if bLimXmin and bLimXmax and Proc.Box:getDimX() < 2 * dToolDiam then
|
||||||
return MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
return MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
||||||
end
|
end
|
||||||
|
-- determino l'utilizzo della faccia
|
||||||
|
local nFaceUse = EgtIf( abs( vtN:getY()) > 0.01, MCH_MILL_FU.ORTHO_DOWN, EgtIf( bFront, MCH_MILL_FU.ORTHO_FRONT, MCH_MILL_FU.ORTHO_BACK))
|
||||||
|
-- determino il lato di attacco (0:xMin, 1:xMax)
|
||||||
|
local nStartSide = 0
|
||||||
|
if nFaceUse == MCH_MILL_FU.ORTHO_DOWN and not bFront then
|
||||||
|
nStartSide = 1
|
||||||
|
elseif nFaceUse ~= MCH_MILL_FU.ORTHO_DOWN then
|
||||||
|
if ( bFront and nSide == -1) or ( not bFront and nSide == 1) then
|
||||||
|
nStartSide = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
-- determino gli estremi
|
-- determino gli estremi
|
||||||
local dStartDist = 0
|
local dStartDist = 0
|
||||||
local dStartAccDist = BD.LONGCUT_ENDLEN
|
local dStartAccDist = BD.LONGCUT_ENDLEN
|
||||||
local bStartFixed = true
|
local bStartFixed = true
|
||||||
if ( bLimXmin and bFront) or ( bLimXmax and not bFront) then
|
if ( bLimXmin and nStartSide == 0) or ( bLimXmax and nStartSide == 1) then
|
||||||
dStartDist = dToolDiam / 2
|
dStartDist = dToolDiam / 2
|
||||||
dStartAccDist = BD.LONGCUT_MAXLEN
|
dStartAccDist = BD.LONGCUT_MAXLEN
|
||||||
bStartFixed = false
|
bStartFixed = false
|
||||||
@@ -897,7 +910,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
local dEndDist = 0
|
local dEndDist = 0
|
||||||
local dEndAccDist = BD.LONGCUT_ENDLEN
|
local dEndAccDist = BD.LONGCUT_ENDLEN
|
||||||
local bEndFixed = true
|
local bEndFixed = true
|
||||||
if ( bLimXmin and not bFront) or ( bLimXmax and bFront) then
|
if ( bLimXmin and nStartSide == 1) or ( bLimXmax and nStartSide == 0) then
|
||||||
dEndDist = dToolDiam / 2
|
dEndDist = dToolDiam / 2
|
||||||
dEndAccDist = BD.LONGCUT_MAXLEN
|
dEndAccDist = BD.LONGCUT_MAXLEN
|
||||||
bEndFixed = false
|
bEndFixed = false
|
||||||
@@ -962,8 +975,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
dEndAccDist = 0
|
dEndAccDist = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- determino l'utilizzo della faccia
|
|
||||||
local nFaceUse = EgtIf( abs( vtN:getY()) > 0.01, MCH_MILL_FU.ORTHO_DOWN, EgtIf( bFront, MCH_MILL_FU.ORTHO_FRONT, MCH_MILL_FU.ORTHO_BACK))
|
|
||||||
-- si percorre il lato basso della faccia
|
-- si percorre il lato basso della faccia
|
||||||
local nM = 0
|
local nM = 0
|
||||||
local nCountMilHead = 0
|
local nCountMilHead = 0
|
||||||
@@ -994,6 +1005,22 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
-- correggo l'attacco se necessario
|
||||||
|
if i == 1 and not bStartFixed then
|
||||||
|
if nO == 1 or EgtGetMachiningParam( MCH_MP.LITANG) ~= 0 then
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20)
|
||||||
|
end
|
||||||
|
elseif i == nC and not bEndFixed then
|
||||||
|
if nO == 1 or EgtGetMachiningParam( MCH_MP.LOTANG) ~= 0 then
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LOPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20)
|
||||||
|
end
|
||||||
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
||||||
-- limito opportunamente la lavorazione
|
-- limito opportunamente la lavorazione
|
||||||
@@ -1022,7 +1049,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
end
|
end
|
||||||
-- eventuale lavorazione della faccia limitante l'inizio
|
-- eventuale lavorazione della faccia limitante l'inizio
|
||||||
if i == 1 and not bStartFixed then
|
if i == 1 and not bStartFixed then
|
||||||
local vtIni = EgtIf( bFront, X_AX(), -X_AX())
|
-- per il lato sotto il vettore è opposto
|
||||||
|
local vtIni = EgtIf( bFront, X_AX(), -X_AX())
|
||||||
|
if nSide == -1 then
|
||||||
|
vtIni = -1 * vtIni
|
||||||
|
end
|
||||||
for j = 1, Proc.Fct - 1 do
|
for j = 1, Proc.Fct - 1 do
|
||||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||||
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
||||||
@@ -1039,7 +1070,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
|
|
||||||
-- eventuale lavorazione della faccia limitante la fine
|
-- eventuale lavorazione della faccia limitante la fine
|
||||||
if not bEndFixed then
|
if not bEndFixed then
|
||||||
local vtFin = EgtIf( bFront, -X_AX(), X_AX())
|
-- per il lato sotto il vettore è opposto
|
||||||
|
local vtFin = EgtIf( bFront, -X_AX(), X_AX())
|
||||||
|
if nSide == -1 then
|
||||||
|
vtFin = -1 * vtFin
|
||||||
|
end
|
||||||
for j = 1, Proc.Fct - 1 do
|
for j = 1, Proc.Fct - 1 do
|
||||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||||
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
||||||
|
|||||||
+110
-109
@@ -198,119 +198,120 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
|
|||||||
( EgtGetInfo( Proc.Id, 'Q04', 'd') == 3 and abs( vtN[vFaceOrd[3]]:getY()) < 0.1 and vtN[vFaceOrd[3]]:getZ() < 0.1)
|
( EgtGetInfo( Proc.Id, 'Q04', 'd') == 3 and abs( vtN[vFaceOrd[3]]:getY()) < 0.1 and vtN[vFaceOrd[3]]:getZ() < 0.1)
|
||||||
if bForceSideMill then
|
if bForceSideMill then
|
||||||
bOk, sErr = FreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
bOk, sErr = FreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
return bOk, sErr
|
if not bOk then return bOk, sErr end
|
||||||
end
|
|
||||||
-- recupero la lavorazione
|
|
||||||
local sCutting = ML.FindCutting( 'HeadSide')
|
|
||||||
if not sCutting then
|
|
||||||
local sErr = 'Error : cutting not found in library'
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return false, sErr
|
|
||||||
end
|
|
||||||
-- recupero i dati dell'utensile
|
|
||||||
local dSawDiam = 400
|
|
||||||
if EgtMdbSetCurrMachining( sCutting) then
|
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
|
||||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- taglio sulla faccia esterna
|
|
||||||
if vFaceOrd[1] ~= 0 then
|
|
||||||
-- in generale va fatto
|
|
||||||
local bCut = true
|
|
||||||
-- se di testa e coincide con inizio grezzo, non va fatto
|
|
||||||
if bHead and AreSameVectorApprox( vtN[vFaceOrd[1]], X_AX()) and abs( ptC[vFaceOrd[1]]:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
|
||||||
bCut = false
|
|
||||||
end
|
|
||||||
-- se di coda e coincide con taglio di separazione, non va fatto
|
|
||||||
if not bHead and AreSameVectorApprox( vtN[vFaceOrd[1]], - X_AX()) and abs( ptC[vFaceOrd[1]]:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
|
||||||
bCut = false
|
|
||||||
end
|
|
||||||
-- se va fatto, inserisco la lavorazione
|
|
||||||
if bCut then
|
|
||||||
local vtOrthoO = Vector3d( vtRef)
|
|
||||||
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
||||||
if not bOk then return bOk, sNameOrErr end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- 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
|
|
||||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
|
||||||
local vCuts = {}
|
|
||||||
if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then
|
|
||||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], false, ptC[vFaceOrd[2]], vtN[vFaceOrd[2]])
|
|
||||||
elseif vFaceOrd[3] ~= 0 then
|
|
||||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], true)
|
|
||||||
end
|
|
||||||
if #vCuts > 0 then
|
|
||||||
-- sistemo posizione nel DB e nome
|
|
||||||
for i = 1, #vCuts do
|
|
||||||
for j = 1, #vCuts[i] do
|
|
||||||
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
|
|
||||||
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- calcolo secondo riferimento per testa o coda
|
|
||||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
|
||||||
-- eseguo
|
|
||||||
for i = 1, #vCuts do
|
|
||||||
local vtOrthoO
|
|
||||||
if i % 2 == 1 then
|
|
||||||
vtOrthoO = Vector3d( vtRef)
|
|
||||||
else
|
|
||||||
if #vCuts[i-1] > 0 then
|
|
||||||
vtOrthoO = Vector3d( EgtIf( vtRef2, vtRef2, vtRef))
|
|
||||||
else
|
|
||||||
local vtO
|
|
||||||
for j = 1, #vCuts[i-1] do
|
|
||||||
_, vtO = EgtSurfTmFacetCenter( vCuts[i-1][j], 0, GDB_ID.ROOT)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
if vtO then
|
|
||||||
vtOrthoO = Vector3d( vtO)
|
|
||||||
else
|
|
||||||
vtOrthoO = Y_AX()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- lavoro la faccia
|
|
||||||
for j = 1, #vCuts[i] do
|
|
||||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
||||||
if not bOk then
|
|
||||||
return bOk, sErr
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
-- taglio sulla faccia interna
|
-- recupero la lavorazione
|
||||||
local bIntCut = false
|
local sCutting = ML.FindCutting( 'HeadSide')
|
||||||
if vFaceOrd[2] ~= 0 then
|
if not sCutting then
|
||||||
-- inserisco la lavorazione
|
local sErr = 'Error : cutting not found in library'
|
||||||
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
|
EgtOutLog( sErr)
|
||||||
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
return false, sErr
|
||||||
if not bOk then return bOk, sNameOrErr end
|
|
||||||
if #sNameOrErr > 0 then bIntCut = true end
|
|
||||||
end
|
end
|
||||||
-- taglio sulla faccia intermedia
|
-- recupero i dati dell'utensile
|
||||||
if vFaceOrd[3] ~= 0 then
|
local dSawDiam = 400
|
||||||
-- calcolo secondo testa o coda
|
if EgtMdbSetCurrMachining( sCutting) then
|
||||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
-- se non ho il taglio sulla faccia interna
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
if not bIntCut then
|
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||||
local frHV, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, vFaceOrd[3] - 1)
|
end
|
||||||
if DimV > DimH then
|
end
|
||||||
vtRef2 = Vector3d( frHV:getVersX())
|
-- taglio sulla faccia esterna
|
||||||
|
if vFaceOrd[1] ~= 0 then
|
||||||
|
-- in generale va fatto
|
||||||
|
local bCut = true
|
||||||
|
-- se di testa e coincide con inizio grezzo, non va fatto
|
||||||
|
if bHead and AreSameVectorApprox( vtN[vFaceOrd[1]], X_AX()) and abs( ptC[vFaceOrd[1]]:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||||
|
bCut = false
|
||||||
|
end
|
||||||
|
-- se di coda e coincide con taglio di separazione, non va fatto
|
||||||
|
if not bHead and AreSameVectorApprox( vtN[vFaceOrd[1]], - X_AX()) and abs( ptC[vFaceOrd[1]]:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||||
|
bCut = false
|
||||||
|
end
|
||||||
|
-- se va fatto, inserisco la lavorazione
|
||||||
|
if bCut then
|
||||||
|
local vtOrthoO = Vector3d( vtRef)
|
||||||
|
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOk then return bOk, sNameOrErr end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- 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
|
||||||
|
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||||
|
local vCuts = {}
|
||||||
|
if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then
|
||||||
|
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], false, ptC[vFaceOrd[2]], vtN[vFaceOrd[2]])
|
||||||
|
elseif vFaceOrd[3] ~= 0 then
|
||||||
|
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], true)
|
||||||
|
end
|
||||||
|
if #vCuts > 0 then
|
||||||
|
-- sistemo posizione nel DB e nome
|
||||||
|
for i = 1, #vCuts do
|
||||||
|
for j = 1, #vCuts[i] do
|
||||||
|
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
|
||||||
|
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- calcolo secondo riferimento per testa o coda
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||||
if not bOk then return bOk, sErr end
|
-- eseguo
|
||||||
|
for i = 1, #vCuts do
|
||||||
|
local vtOrthoO
|
||||||
|
if i % 2 == 1 then
|
||||||
|
vtOrthoO = Vector3d( vtRef)
|
||||||
|
else
|
||||||
|
if #vCuts[i-1] > 0 then
|
||||||
|
vtOrthoO = Vector3d( EgtIf( vtRef2, vtRef2, vtRef))
|
||||||
|
else
|
||||||
|
local vtO
|
||||||
|
for j = 1, #vCuts[i-1] do
|
||||||
|
_, vtO = EgtSurfTmFacetCenter( vCuts[i-1][j], 0, GDB_ID.ROOT)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
if vtO then
|
||||||
|
vtOrthoO = Vector3d( vtO)
|
||||||
|
else
|
||||||
|
vtOrthoO = Y_AX()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- lavoro la faccia
|
||||||
|
for j = 1, #vCuts[i] do
|
||||||
|
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOk then
|
||||||
|
return bOk, sErr
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- taglio sulla faccia interna
|
||||||
|
local bIntCut = false
|
||||||
|
if vFaceOrd[2] ~= 0 then
|
||||||
|
-- inserisco la lavorazione
|
||||||
|
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
|
||||||
|
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOk then return bOk, sNameOrErr end
|
||||||
|
if #sNameOrErr > 0 then bIntCut = true end
|
||||||
|
end
|
||||||
|
-- taglio sulla faccia intermedia
|
||||||
|
if vFaceOrd[3] ~= 0 then
|
||||||
|
-- calcolo secondo testa o coda
|
||||||
|
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||||
|
-- se non ho il taglio sulla faccia interna
|
||||||
|
if not bIntCut then
|
||||||
|
local frHV, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, vFaceOrd[3] - 1)
|
||||||
|
if DimV > DimH then
|
||||||
|
vtRef2 = Vector3d( frHV:getVersX())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- inserisco la lavorazione
|
||||||
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOk then return bOk, sErr end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- aggiornamento ingombro di testa o coda
|
-- aggiornamento ingombro di testa o coda
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
||||||
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
||||||
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
||||||
|
-- 2022/11/16 Correzioni per travi larghe
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessSplit = {}
|
local ProcessSplit = {}
|
||||||
@@ -346,6 +347,12 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- altrimenti tagli dai due fianchi (dietro e davanti)
|
-- altrimenti tagli dai due fianchi (dietro e davanti)
|
||||||
else
|
else
|
||||||
local cutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
|
local cutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
|
||||||
|
-- se la sega a catena non può completare lo split esco
|
||||||
|
if cutDepth >= min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
|
||||||
|
sErr = 'Error : section too big for splitting'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr, -1
|
||||||
|
end
|
||||||
local sNotesSplit = 'Presplit;'
|
local sNotesSplit = 'Presplit;'
|
||||||
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_BACK, cutDepth, sNotesSplit, dOffs)
|
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_BACK, cutDepth, sNotesSplit, dOffs)
|
||||||
if not bOk then return bOk, sErr, nNewPhase end
|
if not bOk then return bOk, sErr, nNewPhase end
|
||||||
@@ -482,7 +489,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- verifico che le due lame riescano a lavorare la sezione
|
-- verifico che le due lame riescano a lavorare la sezione
|
||||||
local dDimZ = b3Raw:getDimZ()
|
local dDimZ = b3Raw:getDimZ()
|
||||||
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
||||||
if dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0 then
|
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
|
||||||
local sErr = 'Error : section too big for tail cut'
|
local sErr = 'Error : section too big for tail cut'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local OVERLAP_COEFF = 0.7
|
local OVERLAP_COEFF = 0.7
|
||||||
-- porto inizio curva il più possibile sul bordo in alto o in basso
|
-- porto inizio curva il più possibile sul bordo in alto o in basso
|
||||||
local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS
|
local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS
|
||||||
local bMyShortPart = ( bShortPart and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
local bMyShortPart = ( bShortPart and vtN:getX() < 0 and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
||||||
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, ( bH2 and bMillDown) ~= bMyShortPart)
|
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, ( bH2 and bMillDown) ~= bMyShortPart)
|
||||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||||
local sWarn
|
local sWarn
|
||||||
|
|||||||
Reference in New Issue
Block a user