Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 58ea436132 | |||
| c8b5f9ca27 | |||
| 33d70bdbf4 | |||
| 6ffb0da24d | |||
| 04abd401f6 | |||
| 5b1fb41c43 | |||
| 8baf4ad2d6 | |||
| 3e27651e4c | |||
| 640f77b5f5 |
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -313,8 +315,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
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)
|
||||||
@@ -326,9 +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
|
||||||
local dDepthWork = dDepth
|
local dDepthWork = dDepth
|
||||||
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and ( nStep > 1 or Proc.Prc == 70) and
|
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)
|
||||||
@@ -372,15 +374,19 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
if nSide == 0 then
|
if nSide == 0 then
|
||||||
if BD.DOWN_HEAD then
|
if BD.DOWN_HEAD then
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
_, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true)
|
local nChamferDown
|
||||||
if not sChamferDown then
|
nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true)
|
||||||
|
if nChamferDown < 0 then
|
||||||
sWarn = 'Warning : chamfer from bottom not found in library'
|
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||||
|
sChamferDown = nil
|
||||||
EgtOutLog( sWarn)
|
EgtOutLog( sWarn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
_, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false)
|
local nChamferUp
|
||||||
if not sChamferUp then
|
nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false)
|
||||||
sWarn = 'Warning : milling not found in library'
|
if nChamferUp < 0 then
|
||||||
|
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||||
|
sChamferUp = nil
|
||||||
EgtOutLog( sWarn)
|
EgtOutLog( sWarn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -429,7 +435,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if nSide == 0 then
|
if nSide == 0 then
|
||||||
bDoubleCham = BD.DOWN_HEAD
|
bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false)
|
||||||
else
|
else
|
||||||
bDoubleCham = true
|
bDoubleCham = true
|
||||||
end
|
end
|
||||||
@@ -545,6 +551,7 @@ 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
|
local sMillingDown, sMillingUp
|
||||||
if nDouble > 1 and bCanDouble then
|
if nDouble > 1 and bCanDouble then
|
||||||
if nSide == 0 then
|
if nSide == 0 then
|
||||||
@@ -552,16 +559,20 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
sMillingDown = ML.FindMilling( 'FreeContour_H2', nil, nil, nil, nil, false, true)
|
sMillingDown = ML.FindMilling( 'FreeContour_H2', nil, nil, nil, nil, false, true)
|
||||||
if not sMillingDown then
|
if not sMillingDown then
|
||||||
sWarn = 'Warning : milling from bottom not found in library'
|
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)
|
EgtOutLog( sWarn)
|
||||||
|
elseif sMillingDown and not bDownHead then
|
||||||
|
bToolInv = true
|
||||||
|
sMilling = sMillingDown
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if EgtEndsWith( sMilling, '_H2') then
|
sMillingUp = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, true, false)
|
||||||
sMillingUp = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, true, false)
|
if not sMillingUp then
|
||||||
if not sMillingUp then
|
sWarn = 'Warning : milling not found in library'
|
||||||
sWarn = 'Warning : milling not found in library'
|
EgtOutLog( sWarn)
|
||||||
EgtOutLog( sWarn)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -591,8 +602,10 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
if EgtEndsWith( sMilling, '_H2') then
|
if EgtEndsWith( sMilling, '_H2') then
|
||||||
nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingUp, sMilling))
|
nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingUp, sMilling))
|
||||||
else
|
elseif sMillingDown then
|
||||||
nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingDown, sMilling))
|
nMchId = EgtAddMachining( sName, EgtIf( j == 2 and nSide == 0, sMillingDown, sMilling))
|
||||||
|
else
|
||||||
|
nMchId = EgtAddMachining( sName, sMilling)
|
||||||
end
|
end
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||||
|
|||||||
@@ -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
|
||||||
|
-- per il lato sotto il vettore è opposto
|
||||||
local vtIni = EgtIf( bFront, X_AX(), -X_AX())
|
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
|
||||||
|
-- per il lato sotto il vettore è opposto
|
||||||
local vtFin = EgtIf( bFront, -X_AX(), X_AX())
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user