Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd0a52ad6b | |||
| 3e2ae92adc | |||
| c746a11e45 | |||
| d337e4cc18 | |||
| 5fcaf823a0 | |||
| 6b76dd2f4f | |||
| cc7f5abf40 | |||
| 389e722f7c | |||
| 946f5e8bf6 | |||
| a5cd84172e | |||
| 895740feff | |||
| 7e243bb9ea | |||
| ca21098226 | |||
| 32052e3016 | |||
| 4138f89f69 | |||
| 66013f5e07 | |||
| a9ec6744e3 | |||
| 5c82ab27c8 | |||
| 723f1a0d10 | |||
| 6c18d3fa95 | |||
| e910d6e6ba | |||
| 1f3906ab35 | |||
| 183a4a564a | |||
| be4575e984 | |||
| 1af37a5589 | |||
| 7c9b20ae2e | |||
| 5dd839dace | |||
| 6ae1e94cd5 | |||
| bbffd69e1e | |||
| 30028fecf0 | |||
| cf96d7bc90 | |||
| 89fefbcbad | |||
| 6892759956 | |||
| 78a3e907ce | |||
| 63133c8813 | |||
| 58e32bdfd0 | |||
| 6528e6e77c | |||
| 48f1ac5e4d | |||
| fbca8d3abd | |||
| 6c61edc338 | |||
| 6643673196 | |||
| 7d33ea6799 | |||
| 7dd0c14f5f | |||
| 232adff332 | |||
| d55caac3c9 | |||
| bd8a551005 | |||
| 1729e57dbf |
@@ -443,7 +443,7 @@ local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
|
|||||||
for i = 1, #vProc do
|
for i = 1, #vProc do
|
||||||
local Proc = vProc[i]
|
local Proc = vProc[i]
|
||||||
if Proc.Box and not Proc.Box:isEmpty() then
|
if Proc.Box and not Proc.Box:isEmpty() then
|
||||||
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
|
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 350 then
|
||||||
if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
|
if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
|
||||||
dHeadX = Proc.Box:getCenter():getX()
|
dHeadX = Proc.Box:getCenter():getX()
|
||||||
nHeadId = Proc.Id
|
nHeadId = Proc.Id
|
||||||
@@ -1991,6 +1991,9 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
|
|||||||
end
|
end
|
||||||
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
||||||
local dToolDoubleMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
local dToolDoubleMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||||
|
if ( sType == 'Pocket_AT' or sType == 'Pocket') then
|
||||||
|
dToolDoubleMaxDepth = EgtTdbGetCurrToolMaxDepth()
|
||||||
|
end
|
||||||
dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth)
|
dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth)
|
||||||
-- recupero la lunghezza della parte inclinata della punta
|
-- recupero la lunghezza della parte inclinata della punta
|
||||||
local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||||
@@ -2211,14 +2214,14 @@ function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
|
|||||||
Proc.PassedByHole = true
|
Proc.PassedByHole = true
|
||||||
end
|
end
|
||||||
-- se taglio attraversato da foro, si definisce precedenza in base ad angolo
|
-- se taglio attraversato da foro, si definisce precedenza in base ad angolo
|
||||||
if Drill.Identify( Proc) and Cut.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
if Drill.Identify( Proc) and ( Cut.Identify( ProcB) or ProcB.Prc == 340 or ProcB.Proc == 350) and Overlaps( Proc.Box, ProcB.Box) then
|
||||||
-- recupero e verifico l'entità foro
|
-- recupero e verifico l'entità foro
|
||||||
local DrillAuxId = ( EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0) + Proc.Id
|
local DrillAuxId = ( EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0) + Proc.Id
|
||||||
local vtDrillExtr = EgtCurveExtrusion( DrillAuxId, GDB_RT.GLOB)
|
local vtDrillExtr = EgtCurveExtrusion( DrillAuxId, GDB_RT.GLOB)
|
||||||
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
|
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
|
||||||
local ptCut, vtCutN = EgtSurfTmFacetCenter( ProcB.Id, 0, GDB_ID.ROOT)
|
local ptCut, vtCutN = EgtSurfTmFacetCenter( ProcB.Id, 0, GDB_ID.ROOT)
|
||||||
local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10
|
local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10
|
||||||
if GetAngle( vtDrillExtr, vtCutN) > dMaxAngleDrillOnCut then
|
if ( GetAngle( vtDrillExtr, vtCutN) > dMaxAngleDrillOnCut) and not ( ProcB.Prc == 340 or ProcB.Proc == 350) then
|
||||||
if bOpen and GetAngle( -vtDrillExtr, vtCutN) < dMaxAngleDrillOnCut then
|
if bOpen and GetAngle( -vtDrillExtr, vtCutN) < dMaxAngleDrillOnCut then
|
||||||
ProcB.Dependency = {}
|
ProcB.Dependency = {}
|
||||||
ProcB.Dependency.ExecBefore = Proc
|
ProcB.Dependency.ExecBefore = Proc
|
||||||
|
|||||||
@@ -883,6 +883,25 @@ function BeamLib.GetBlockedAxis( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
|
|||||||
return ''
|
return ''
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
function BeamLib.GetAuxDir( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
|
||||||
|
-- informazioni sull'utensile della lavorazione
|
||||||
|
local nToolType, sHead
|
||||||
|
if EgtMdbSetCurrMachining( sMachining) then
|
||||||
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
|
nToolType = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||||
|
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se presente funzione specifica nella macchina, la richiamo
|
||||||
|
if BD.GetAuxDir then
|
||||||
|
return BD.GetAuxDir( sHead, nToolType, sBlockedAxis, b3Raw, vtTool, vtOut)
|
||||||
|
end
|
||||||
|
-- niente
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca.
|
-- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca.
|
||||||
function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
|
function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
|
||||||
@@ -1158,6 +1177,31 @@ function BeamLib.Is3EdgesApprox( Proc, nFacet, nAddGrpId)
|
|||||||
return bResult
|
return bResult
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
function BeamLib.IsPointOnBoxLimits( ptPoint, b3Solid)
|
||||||
|
local dTol = 500 * GEO.EPS_SMALL
|
||||||
|
|
||||||
|
local dMinX = b3Solid:getMin():getX()
|
||||||
|
local dMinY = b3Solid:getMin():getY()
|
||||||
|
local dMinZ = b3Solid:getMin():getZ()
|
||||||
|
|
||||||
|
local dMaxX = b3Solid:getMax():getX()
|
||||||
|
local dMaxY = b3Solid:getMax():getY()
|
||||||
|
local dMaxZ = b3Solid:getMax():getZ()
|
||||||
|
|
||||||
|
-- Check di ogni piano limite
|
||||||
|
if abs( ptPoint:getX() - dMinX) < dTol then return true, "Left" end
|
||||||
|
if abs( ptPoint:getX() - dMaxX) < dTol then return true, "Right" end
|
||||||
|
|
||||||
|
if abs( ptPoint:getY() - dMinY) < dTol then return true, "Front" end
|
||||||
|
if abs( ptPoint:getY() - dMaxY) < dTol then return true, "Back" end
|
||||||
|
|
||||||
|
if abs( ptPoint:getZ() - dMinZ) < dTol then return true, "Bottom" end
|
||||||
|
if abs( ptPoint:getZ() - dMaxZ) < dTol then return true, "Top" end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
-- restituisce le facce della parte interessate dalla feature Proc
|
-- restituisce le facce della parte interessate dalla feature Proc
|
||||||
function BeamLib.GetProcessAffectedFaces( Proc)
|
function BeamLib.GetProcessAffectedFaces( Proc)
|
||||||
@@ -1393,6 +1437,11 @@ function BeamLib.GetToolFromMachining( sMachiningName)
|
|||||||
else
|
else
|
||||||
Tool.IsOnAggregate = false
|
Tool.IsOnAggregate = false
|
||||||
end
|
end
|
||||||
|
Tool.StemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or 0
|
||||||
|
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
|
||||||
|
if Tool.StemDiameter > Tool.Diameter + GEO.EPS_SMALL then
|
||||||
|
Tool.MaxDepth = Tool.MaxDepth - BD.COLL_SIC
|
||||||
|
end
|
||||||
-- altri utensili al momento non previsti
|
-- altri utensili al momento non previsti
|
||||||
else
|
else
|
||||||
error( 'Wrong tool type')
|
error( 'Wrong tool type')
|
||||||
|
|||||||
+14
-2
@@ -170,6 +170,12 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
|
|||||||
end
|
end
|
||||||
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))
|
||||||
|
local sAuxDir, sInitAngs = BL.GetAuxDir( sCutting, 'perpendicular', b3Raw, vtTool, vtOut)
|
||||||
|
if sAuxDir then
|
||||||
|
sNotes = EgtSetValInNotes( sNotes, 'VtAuxDir', sAuxDir)
|
||||||
|
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
|
||||||
|
end
|
||||||
-- eventuali note
|
-- eventuali note
|
||||||
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||||
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
|
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
|
||||||
@@ -231,7 +237,7 @@ local function GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation)
|
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation, bForceClimbCut)
|
||||||
-- 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
|
||||||
@@ -298,7 +304,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
|
if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
|
||||||
local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||||
local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL)
|
local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL)
|
||||||
if ( bIsSawCCW ~= bDownUp) and ( bIsMachiningDownwards or not ( bIsMachiningDownwards or bIsMachiningUpwards)) then
|
if ( bIsSawCCW ~= bDownUp) and ( bIsMachiningDownwards or not ( bIsMachiningDownwards or bIsMachiningUpwards) or bForceClimbCut) then
|
||||||
bInvert = true
|
bInvert = true
|
||||||
elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then
|
elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then
|
||||||
if Par5Alternative then
|
if Par5Alternative then
|
||||||
@@ -631,6 +637,12 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
-- 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))
|
||||||
|
local sAuxDir, sInitAngs = BL.GetAuxDir( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO)
|
||||||
|
if sAuxDir then
|
||||||
|
sNotes = EgtSetValInNotes( sNotes, 'VtAuxDir', sAuxDir)
|
||||||
|
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
|
||||||
|
end
|
||||||
-- eventuali note
|
-- eventuali note
|
||||||
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||||
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
|
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
|
||||||
|
|||||||
+46
-23
@@ -37,6 +37,7 @@ EgtOutLog( ' ProcessDrill started', 1)
|
|||||||
-- Dati
|
-- Dati
|
||||||
local BD = require( 'BeamData')
|
local BD = require( 'BeamData')
|
||||||
local ML = require( 'MachiningLib')
|
local ML = require( 'MachiningLib')
|
||||||
|
local FreeContour = require( 'ProcessFreeContour')
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Riconoscimento della feature
|
-- Riconoscimento della feature
|
||||||
@@ -345,8 +346,6 @@ end
|
|||||||
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||||
-- Se forzato contorno foro forzo richiamo a FreeContour e uscita dalla funzione
|
-- Se forzato contorno foro forzo richiamo a FreeContour e uscita dalla funzione
|
||||||
if EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then
|
if EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then
|
||||||
_G.package.loaded.ProcessFreeContour = nil
|
|
||||||
local FreeContour = require( 'ProcessFreeContour')
|
|
||||||
return FreeContour.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
return FreeContour.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||||
end
|
end
|
||||||
-- default per costanti
|
-- default per costanti
|
||||||
@@ -542,11 +541,13 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then
|
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)
|
local Tool = BL.GetToolFromMachining( sDrilling)
|
||||||
-- lato testa e lato di lavoro devono corrispondere
|
-- lato testa e lato di lavoro devono corrispondere
|
||||||
if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
|
if Tool.PreferredSide then
|
||||||
or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
|
if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
|
||||||
ptCen = ptCen - vtExtr * dLen
|
or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
|
||||||
vtExtr = - vtExtr
|
ptCen = ptCen - vtExtr * dLen
|
||||||
bToInvert = true
|
vtExtr = - vtExtr
|
||||||
|
bToInvert = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Determino la faccia di inizio del foro e dati correlati
|
-- Determino la faccia di inizio del foro e dati correlati
|
||||||
@@ -612,6 +613,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local dDepthOri = dDepth
|
||||||
-- se foro da saltare per eccessiva inclinazione
|
-- se foro da saltare per eccessiva inclinazione
|
||||||
if not bTryDrill then
|
if not bTryDrill then
|
||||||
sMyWarn = 'Warning in drill : too slant hole'
|
sMyWarn = 'Warning in drill : too slant hole'
|
||||||
@@ -653,6 +655,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
local dReduceDepth = MIRROR_POCKETS_MIN_DISTANCE / 2 + 10
|
local dReduceDepth = MIRROR_POCKETS_MIN_DISTANCE / 2 + 10
|
||||||
dLastStepDepth = dDepth + dReduceDepth
|
dLastStepDepth = dDepth + dReduceDepth
|
||||||
dDepth = dDepth - dReduceDepth
|
dDepth = dDepth - dReduceDepth
|
||||||
|
if ( dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL) and ( dMaxDepth <= ( dLen / 2) - dReduceDepth) and ( dDepthOri ~= dDepth) then
|
||||||
|
dDepth = dMaxDepth
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'LastStep', MIRROR_DRILLINGS_MIN_DISTANCE / 2 + 15)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'LastStep', MIRROR_DRILLINGS_MIN_DISTANCE / 2 + 15)
|
||||||
@@ -717,23 +722,41 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
else
|
else
|
||||||
-- se DrillPocket passante in doppio si fa lavorazione aggiuntiva dell'ultimo step
|
-- se DrillPocket passante in doppio si fa lavorazione aggiuntiva dell'ultimo step
|
||||||
if Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then
|
if Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then
|
||||||
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
|
if dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||||
local idProcLastStep = EgtCopyGlob( Proc.Id, nAddGrpId)
|
sMyWarn = 'Warning in drill pocket last step: depth (' .. EgtNumToString( dLastStepDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||||
local idAuxIdLastStep = EgtCopyGlob( AuxId, nAddGrpId)
|
return false, sMyWarn
|
||||||
EgtModifyCurveThickness( idAuxIdLastStep, -dLastStepDepth)
|
|
||||||
local ProcLastStep = BL.TableCopyDeep( Proc)
|
|
||||||
ProcLastStep.Id = idProcLastStep
|
|
||||||
ProcLastStep.Flg = 1
|
|
||||||
ProcLastStep.Double = 0
|
|
||||||
ProcLastStep.dCustomMaxElev = dLastStepDepth - dDepth
|
|
||||||
local bOkLastStep, sWarnLastStep = ProcessDrill.Make( ProcLastStep, nPhase, nRawId, nPartId)
|
|
||||||
if not bOkLastStep then
|
|
||||||
sWarnLastStep = 'Drillpocket double : incomplete, last step missing'
|
|
||||||
end
|
end
|
||||||
local sPreviousWarn = sMyWarn or sWarn
|
local idMachiningLastStep = EgtCopyMachining( EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)), sName)
|
||||||
if sWarnLastStep then
|
EgtSetCurrMachining( idMachiningLastStep)
|
||||||
if not sPreviousWarn then sPreviousWarn = '' end
|
local dMaxElevLastStep = dLastStepDepth - dDepth
|
||||||
sMyWarn = EgtIf( #sPreviousWarn > 0, sPreviousWarn .. '\n' .. sWarnLastStep, sWarnLastStep)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElevLastStep, 1))
|
||||||
|
EgtSetMachiningParam( MCH_MP.DEPTH, dLastStepDepth)
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', '')
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', '')
|
||||||
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
|
local bOkLastStep = ML.ApplyMachining( true, false)
|
||||||
|
if not bOkLastStep and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
|
||||||
|
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||||
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
|
else
|
||||||
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
|
end
|
||||||
|
bOkLastStep = ML.ApplyMachining( true, false)
|
||||||
|
end
|
||||||
|
if not bOkLastStep then
|
||||||
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( nMchId, false)
|
||||||
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarnLastStep = EgtGetMachMgrWarning( 0)
|
||||||
|
if not bOkLastStep then
|
||||||
|
sWarnLastStep = 'Drillpocket double : incomplete, last step missing'
|
||||||
|
end
|
||||||
|
local sPreviousWarn = sMyWarn or sWarn
|
||||||
|
if sWarnLastStep then
|
||||||
|
if not sPreviousWarn then sPreviousWarn = '' end
|
||||||
|
sMyWarn = EgtIf( #sPreviousWarn > 0, sPreviousWarn .. '\n' .. sWarnLastStep, sWarnLastStep)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true, ( sMyWarn or sWarn)
|
return true, ( sMyWarn or sWarn)
|
||||||
|
|||||||
@@ -136,9 +136,11 @@ local function CalcPathAtHeight( nProcId, AuxId, nAddGrpId, dHeight, dSideAng, b
|
|||||||
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
|
-- per ogni curva creata, eseguo traslazione e offset per portarla sul top
|
||||||
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dHeight - 10 * GEO.EPS_SMALL)
|
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dHeight - 10 * GEO.EPS_SMALL)
|
||||||
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
|
for i = 1, nCount do
|
||||||
|
EgtMove( NewAuxId + i - 1, vtMove, GDB_RT.GLOB)
|
||||||
|
end
|
||||||
-- 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
|
||||||
@@ -147,7 +149,7 @@ local function CalcPathAtHeight( nProcId, AuxId, nAddGrpId, dHeight, dSideAng, b
|
|||||||
for i = 2, nCount do
|
for i = 2, nCount do
|
||||||
local CrvId = NewAuxId + i - 1
|
local CrvId = NewAuxId + i - 1
|
||||||
local ptStart = EgtSP( CrvId)
|
local ptStart = EgtSP( CrvId)
|
||||||
EgtAddCurveCompoLine( NewAuxId, ptStart)
|
EgtAddCurveCompoLine( NewAuxId, ptStart)
|
||||||
EgtAddCurveCompoCurve( NewAuxId, CrvId)
|
EgtAddCurveCompoCurve( NewAuxId, CrvId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -227,9 +229,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
|
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
|
||||||
local dAltMort = b3DtMrt:getDimZ()
|
local dAltMort = b3DtMrt:getDimZ()
|
||||||
-- verifico se di tipo pocket
|
-- verifico se di tipo pocket o se antischeggia disabilitato
|
||||||
local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1)
|
local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1)
|
||||||
if bPocket then bMakeAntiSplitPath = false end
|
local bDisableAntiSplint = ( EgtGetInfo( Proc.Id, 'Q01', 'i') or 0) == 1
|
||||||
|
if bPocket or bDisableAntiSplint then bMakeAntiSplitPath = false end
|
||||||
-- verifico se frontale
|
-- verifico se frontale
|
||||||
local bFront = ( Proc.Prc == 56)
|
local bFront = ( Proc.Prc == 56)
|
||||||
-- se mortasa di fronte, eseguo il taglio della faccia
|
-- se mortasa di fronte, eseguo il taglio della faccia
|
||||||
|
|||||||
+511
-81
@@ -153,6 +153,7 @@ local Q_CHAINSAW_FROM_SIDE = '' -- i
|
|||||||
local Q_CONVENTIONAL_MILLING = '' -- i
|
local Q_CONVENTIONAL_MILLING = '' -- i
|
||||||
local Q_CLEAN_CORNER = '' -- 1
|
local Q_CLEAN_CORNER = '' -- 1
|
||||||
local Q_FLOATING_AGGREGATE = '' -- i
|
local Q_FLOATING_AGGREGATE = '' -- i
|
||||||
|
local Q_DIM_STRIP = '' -- d
|
||||||
|
|
||||||
-- variabile smussi
|
-- variabile smussi
|
||||||
local bMadeChamfer
|
local bMadeChamfer
|
||||||
@@ -233,6 +234,7 @@ local function AssignQIdent( Proc)
|
|||||||
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
Q_CONVENTIONAL_MILLING = 'Q14' -- i
|
||||||
Q_CLEAN_CORNER = 'Q15' -- i
|
Q_CLEAN_CORNER = 'Q15' -- i
|
||||||
Q_FLOATING_AGGREGATE = 'Q16' -- i
|
Q_FLOATING_AGGREGATE = 'Q16' -- i
|
||||||
|
Q_DIM_STRIP = 'Q17' -- d
|
||||||
elseif ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 30 then
|
elseif ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 30 then
|
||||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
||||||
@@ -1064,6 +1066,12 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- eventuale segnalazione ingombro di testa o coda
|
-- eventuale segnalazione ingombro di testa o coda
|
||||||
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
||||||
@@ -1201,6 +1209,12 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1236,6 +1250,12 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- eventuale segnalazione ingombro di testa o coda
|
-- eventuale segnalazione ingombro di testa o coda
|
||||||
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
||||||
@@ -1405,6 +1425,12 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV
|
|||||||
_, sErr = EgtGetLastMachMgrError()
|
_, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return true, '', dTDiam
|
return true, '', dTDiam
|
||||||
end
|
end
|
||||||
@@ -2414,6 +2440,229 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
|
|||||||
return true, sMyWarn
|
return true, sMyWarn
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunnelDepth, dDimStrip, nPhase)
|
||||||
|
|
||||||
|
local dCollSic = BL.CalcCollisionSafety( vtTunnelDirection)
|
||||||
|
local bMultipleHeadsAvailble = BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS
|
||||||
|
local bMillFromBottom = vtTunnelDirection:getZ() < BD.NZ_MINA
|
||||||
|
local bMillFromBottomOpposite = -vtTunnelDirection:getZ() < BD.NZ_MINA
|
||||||
|
local sApplyWarning = ''
|
||||||
|
local bIncomplete = false
|
||||||
|
|
||||||
|
-- ricerca lavorazione lato principale
|
||||||
|
local sMilling = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not bMillFromBottom, bMillFromBottom)
|
||||||
|
if not sMilling then
|
||||||
|
local sErr = 'Warning : SmallToolContour not found in library'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- dati utensile
|
||||||
|
local Tool = BL.GetToolFromMachining( sMilling)
|
||||||
|
|
||||||
|
-- verifica necessità lavorazione opposta
|
||||||
|
local bOppositeMillingNeeded
|
||||||
|
local bMainMillingReachesFullDepth = Tool.MaxDepth > dTunnelDepth + dCollSic - dDimStrip
|
||||||
|
local bMainMillingReachesHalfDepth = bMainMillingReachesFullDepth or ( Tool.MaxDepth > dTunnelDepth / 2 + dCollSic - dDimStrip / 2)
|
||||||
|
if bMainMillingReachesFullDepth and not bMultipleHeadsAvailble then
|
||||||
|
bOppositeMillingNeeded = false
|
||||||
|
else
|
||||||
|
bOppositeMillingNeeded = true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- ricera lavorazione lato opposto
|
||||||
|
local sMillingOpposite = ML.FindMilling( 'SmallToolContour', nil, nil, nil, nil, not bMillFromBottomOpposite, bMillFromBottomOpposite)
|
||||||
|
if bOppositeMillingNeeded and not sMillingOpposite then
|
||||||
|
local sErr = 'Warning : Opposite SmallToolContour not found in library'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- dati utensile
|
||||||
|
local ToolOpposite = BL.GetToolFromMachining( sMillingOpposite)
|
||||||
|
|
||||||
|
local bOppositMillingReachesHalfDepth = ToolOpposite.MaxDepth > dTunnelDepth / 2 + dCollSic - dDimStrip / 2
|
||||||
|
|
||||||
|
-- eventuale lavorazione opposta
|
||||||
|
local bMillingOppositeOk
|
||||||
|
if bOppositeMillingNeeded then
|
||||||
|
local sName = 'ContourOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
|
local idMachining = EgtAddMachining( sName, sMillingOpposite)
|
||||||
|
if not idMachining then
|
||||||
|
local sErr = 'Error : impossible add machining ' .. sName .. '-' .. sMilling
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- geometria
|
||||||
|
EgtSetMachiningGeometry( {{ idContourPath, -1}})
|
||||||
|
-- lato di lavoro sinistro
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
|
-- inversione direzione utensile
|
||||||
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
|
-- SCC
|
||||||
|
local nSCC = MCH_SCC.NONE
|
||||||
|
if not BD.C_SIMM then
|
||||||
|
if AreSameOrOppositeVectorApprox( vtTunnelDirection, Z_AX()) then
|
||||||
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
|
elseif abs( vtTunnelDirection:getX()) < 0.1 then
|
||||||
|
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||||
|
elseif vtTunnelDirection:getY() < GEO.EPS_SMALL then
|
||||||
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
|
else
|
||||||
|
nSCC = MCH_SCC.ADIR_YP
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
|
-- gestione attacco e uscita
|
||||||
|
if EgtCurveIsClosed( idContourPath) then
|
||||||
|
-- attacco e uscita a quarto di cerchio senza allungamenti a inizio e fine
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIPERP, 0.5 * Tool.Diameter)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||||
|
else
|
||||||
|
-- nessun attacco e uscita, allungo inizio e fine di raggio utensile + 5mm (per evitare controllo collisioni)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.NONE)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||||
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Tool.Diameter / 2 + 5)
|
||||||
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Tool.Diameter / 2 + 5)
|
||||||
|
end
|
||||||
|
-- affondamento - la curva è a metà tasca quindi affondamento 0 significa che la lavorazione arriva a metà tasca
|
||||||
|
local dDepth
|
||||||
|
-- si arriva a metà tasca
|
||||||
|
if bOppositMillingReachesHalfDepth then
|
||||||
|
dDepth = -dDimStrip / 2
|
||||||
|
-- si arriva al massimo raggiungibile
|
||||||
|
else
|
||||||
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
||||||
|
bIncomplete = true
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
|
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||||
|
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTunnelDepth / 2 + dDepth, 1))
|
||||||
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
|
-- eseguo
|
||||||
|
if ML.ApplyMachining( true, false) then
|
||||||
|
_, sApplyWarning = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( idMachining, false)
|
||||||
|
end
|
||||||
|
bMillingOppositeOk = true
|
||||||
|
-- altrimenti lavorazione non applicata
|
||||||
|
else
|
||||||
|
_, sApplyWarning = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( idMachining, false)
|
||||||
|
bMillingOppositeOk = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- applicazione lavorazione lato principale
|
||||||
|
local sName = 'Contour_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
|
local idMachining = EgtAddMachining( sName, sMilling)
|
||||||
|
if not idMachining then
|
||||||
|
local sErr = 'Error : impossible add machining ' .. sName .. '-' .. sMilling
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- geometria
|
||||||
|
EgtSetMachiningGeometry( {{ idContourPath, -1}})
|
||||||
|
-- lato di lavoro sinistro
|
||||||
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
|
-- inversione direzione utensile
|
||||||
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
|
||||||
|
-- SCC
|
||||||
|
local nSCC = MCH_SCC.NONE
|
||||||
|
if not BD.C_SIMM then
|
||||||
|
if AreSameOrOppositeVectorApprox( vtTunnelDirection, Z_AX()) then
|
||||||
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
|
elseif abs( vtTunnelDirection:getX()) < 0.1 then
|
||||||
|
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||||
|
elseif vtTunnelDirection:getY() < GEO.EPS_SMALL then
|
||||||
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
|
else
|
||||||
|
nSCC = MCH_SCC.ADIR_YP
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
|
-- gestione attacco e uscita
|
||||||
|
if EgtCurveIsClosed( idContourPath) then
|
||||||
|
-- attacco e uscita a quarto di cerchio senza allungamenti a inizio e fine
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIPERP, 0.5 * Tool.Diameter)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||||
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||||
|
else
|
||||||
|
-- nessun attacco e uscita, allungo inizio e fine di raggio utensile + 5mm (per evitare controllo collisioni)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.NONE)
|
||||||
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||||
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, Tool.Diameter / 2 + 5)
|
||||||
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, Tool.Diameter / 2 + 5)
|
||||||
|
end
|
||||||
|
-- affondamento - la curva è a metà tasca quindi affondamento 0 significa che la lavorazione arriva a metà tasca
|
||||||
|
local dDepth
|
||||||
|
-- c'è la lavorazione opposta
|
||||||
|
if bOppositeMillingNeeded then
|
||||||
|
-- si arriva a metà tasca
|
||||||
|
if bMainMillingReachesHalfDepth then
|
||||||
|
dDepth = -dDimStrip / 2
|
||||||
|
-- si arriva al massimo raggiungibile
|
||||||
|
else
|
||||||
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
||||||
|
bIncomplete = true
|
||||||
|
end
|
||||||
|
-- non c'è lavorazione opposta
|
||||||
|
else
|
||||||
|
-- si arriva fino in fondo
|
||||||
|
if bMainMillingReachesFullDepth then
|
||||||
|
dDepth = dTunnelDepth / 2 - dDimStrip
|
||||||
|
-- si arriva al massimo raggiungibile
|
||||||
|
else
|
||||||
|
dDepth = Tool.MaxDepth - dTunnelDepth / 2 - dCollSic
|
||||||
|
bIncomplete = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||||
|
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill e massima elevazione
|
||||||
|
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTunnelDepth / 2 + dDepth, 1))
|
||||||
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
|
-- eseguo
|
||||||
|
local bMillingOk
|
||||||
|
if ML.ApplyMachining( true, false) then
|
||||||
|
_, sApplyWarning = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( idMachining, false)
|
||||||
|
end
|
||||||
|
bMillingOk = true
|
||||||
|
-- altrimenti lavorazione non applicata
|
||||||
|
else
|
||||||
|
_, sApplyWarning = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( idMachining, false)
|
||||||
|
bMillingOk = false
|
||||||
|
end
|
||||||
|
|
||||||
|
if bMillingOk or ( bOppositeMillingNeeded and bMillingOppositeOk) then
|
||||||
|
local sWarning = ''
|
||||||
|
if bIncomplete then
|
||||||
|
sWarning = 'Warning : machining incomplete'
|
||||||
|
end
|
||||||
|
if #sApplyWarning > 0 then
|
||||||
|
sWarning = sApplyWarning .. '\n' .. sWarning
|
||||||
|
end
|
||||||
|
return true, sWarning
|
||||||
|
else
|
||||||
|
local sErr = 'Error : Not applicable'
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function ExtractExternalPaths( nPathInt, nNumIdAux, vtOrtho, b3Solid, nAddGrpId)
|
local function ExtractExternalPaths( nPathInt, nNumIdAux, vtOrtho, b3Solid, nAddGrpId)
|
||||||
local nAuxId1, nAuxId2
|
local nAuxId1, nAuxId2
|
||||||
@@ -2752,6 +3001,12 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMchId, false)
|
||||||
return -1, sErr
|
return -1, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- se non perpendicolare emetto un warning
|
-- se non perpendicolare emetto un warning
|
||||||
-- else
|
-- else
|
||||||
@@ -2905,6 +3160,12 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMchId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- in base all'elevazione calcolo l'impronta della lama
|
-- in base all'elevazione calcolo l'impronta della lama
|
||||||
@@ -3091,7 +3352,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
end
|
end
|
||||||
for i = 1, nStep do
|
for i = 1, nStep do
|
||||||
local dOffs = ( i - 1) * dStep
|
local dOffs = ( i - 1) * dStep
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, 0, 0, nil, b3Raw)
|
local bForceClimbCut = true
|
||||||
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, 0, 0, nil, b3Raw, nil, nil, nil, nil, nil, nil, bForceClimbCut)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
-- in base all'elevazione calcolo l'impronta della lama
|
-- in base all'elevazione calcolo l'impronta della lama
|
||||||
@@ -3146,7 +3408,9 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
bGoFromHead = false
|
bGoFromHead = false
|
||||||
-- continuo di testa se fessura con tre facce o non è tunnel
|
-- continuo di testa se fessura con tre facce o non è tunnel
|
||||||
else
|
else
|
||||||
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
|
bGoFromHead = (( bIs3Faces and ( dMaxElev
|
||||||
|
or ( Proc.Topology == 'Groove' and Proc.IsThrough and (Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and not Proc.IsParallel)))
|
||||||
|
or not bOrthoFaces)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se continuo a lavorare di testa
|
-- se continuo a lavorare di testa
|
||||||
@@ -3211,17 +3475,35 @@ 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)
|
||||||
|
local bElevAdj
|
||||||
|
local dToolEntryAngle, _, _, dTanToolEntryAngle = GetToolEntryAngle( Proc, rfFac:getVersZ())
|
||||||
-- se necessario, avverto limitazione dell'affondamento
|
-- se necessario, avverto limitazione dell'affondamento
|
||||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth)
|
if Proc.Fct == 3 and Proc.Topology == 'Groove' and Proc.IsThrough and (Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and not Proc.IsParallel then
|
||||||
sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
local Edges = BL.GetEdgesInfo( Proc, Proc.Face[nFacAdj+1])
|
||||||
EgtOutLog( sWarn)
|
local dWorkEdgeWidth
|
||||||
|
for i = 1, #Edges do
|
||||||
|
if Edges[i].AdjacentFaceId == nFacInd then
|
||||||
|
dWorkEdgeWidth = Edges[i].Length
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local dDeltaDepth = dWorkEdgeWidth * cos( dToolEntryAngle)
|
||||||
|
bElevAdj = true
|
||||||
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dDeltaDepth)
|
||||||
|
else
|
||||||
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth)
|
||||||
|
sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
|
|
||||||
--local dDepth = dMaxDepth - dElev
|
--local dDepth = dMaxDepth - dElev
|
||||||
--EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1))
|
--EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1))
|
||||||
end
|
end
|
||||||
-- imposto massima elevazione
|
-- imposto massima elevazione
|
||||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 2))
|
local dElevAdj = EgtIf( bElevAdj, dElev / sin( dToolEntryAngle), dElev)
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElevAdj, 2))
|
||||||
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
|
||||||
@@ -3626,6 +3908,12 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
|||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- se la lavorazione rovina il pezzo successivo emetto warning
|
-- se la lavorazione rovina il pezzo successivo emetto warning
|
||||||
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and dDistToNextPiece < dDiamTool / 2 then
|
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and dDistToNextPiece < dDiamTool / 2 then
|
||||||
@@ -3743,6 +4031,12 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchId, false)
|
EgtSetOperationMode( nMchId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return false, sWarn
|
return false, sWarn
|
||||||
@@ -3870,6 +4164,12 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -4313,6 +4613,12 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return -1, sErr
|
return -1, sErr
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
||||||
@@ -4384,6 +4690,12 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return -1, sErr
|
return -1, sErr
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -4496,6 +4808,12 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtN, nFacInd,
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nIdMach, false)
|
EgtSetOperationMode( nIdMach, false)
|
||||||
return false, false, sErr
|
return false, false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nIdMach, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -4505,7 +4823,7 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtN, nFacInd,
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakePathsOnExtremPoints( nAddGrpId, nIdPath, pPaths, dTDiam)
|
local function MakePathsOnExtremePoints( nAddGrpId, nIdPath, pPaths, dTDiam, b3Solid)
|
||||||
|
|
||||||
local dLength = 2
|
local dLength = 2
|
||||||
if not nIdPath then return pPaths end
|
if not nIdPath then return pPaths end
|
||||||
@@ -4521,15 +4839,20 @@ local function MakePathsOnExtremPoints( nAddGrpId, nIdPath, pPaths, dTDiam)
|
|||||||
local vtIni = EgtSV( nIdPath, GDB_RT.GLOB)
|
local vtIni = EgtSV( nIdPath, GDB_RT.GLOB)
|
||||||
local vtEnd = EgtEV( nIdPath, GDB_RT.GLOB)
|
local vtEnd = EgtEV( nIdPath, GDB_RT.GLOB)
|
||||||
|
|
||||||
local ptIniP = ptIni
|
-- si costruisce il percorso solo per i punti sui bordi del grezzo
|
||||||
local ptEndP = ptIniP + (vtIni * dLength)
|
if BL.IsPointOnBoxLimits( ptIni, b3Solid) then
|
||||||
local nAuxId = EgtLine( nAddGrpId, ptIniP, ptEndP, GDB_RT.GLOB)
|
local ptIniP = ptIni
|
||||||
table.insert( pPaths, { nAuxId, 1, ptIniP})
|
local ptEndP = ptIniP + (vtIni * dLength)
|
||||||
|
local nAuxId = EgtLine( nAddGrpId, ptIniP, ptEndP, GDB_RT.GLOB)
|
||||||
|
table.insert( pPaths, { nAuxId, 1, ptIniP})
|
||||||
|
end
|
||||||
|
|
||||||
ptIniP = ptEnd
|
if BL.IsPointOnBoxLimits( ptEnd, b3Solid) then
|
||||||
ptEndP = ptEnd - ( vtEnd * dLength)
|
local ptIniP = ptEnd
|
||||||
nAuxId = EgtLine( nAddGrpId, ptIniP, ptEndP, GDB_RT.GLOB)
|
local ptEndP = ptEnd - ( vtEnd * dLength)
|
||||||
table.insert( pPaths, { nAuxId, 2, ptIniP})
|
local nAuxId = EgtLine( nAddGrpId, ptIniP, ptEndP, GDB_RT.GLOB)
|
||||||
|
table.insert( pPaths, { nAuxId, 2, ptIniP})
|
||||||
|
end
|
||||||
|
|
||||||
return pPaths
|
return pPaths
|
||||||
end
|
end
|
||||||
@@ -4783,7 +5106,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
-- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati
|
-- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati
|
||||||
for i = 1, nNumId do
|
for i = 1, nNumId do
|
||||||
local nIdPath = nFirstId + i - 1
|
local nIdPath = nFirstId + i - 1
|
||||||
pPaths = MakePathsOnExtremPoints( nAddGrpId, nIdPath, pPaths, dTDiam)
|
pPaths = MakePathsOnExtremePoints( nAddGrpId, nIdPath, pPaths, dTDiam, b3Solid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- alrimenti ho la faccia aggiunta
|
-- alrimenti ho la faccia aggiunta
|
||||||
@@ -4818,7 +5141,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
-- se non ho un percorso chiuso estraggo i percorsi
|
-- se non ho un percorso chiuso estraggo i percorsi
|
||||||
if bOpenPath then
|
if bOpenPath then
|
||||||
-- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati
|
-- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati
|
||||||
pPaths = MakePathsOnExtremPoints( nAddGrpId, nFirstId, pPaths, dTDiam)
|
pPaths = MakePathsOnExtremePoints( nAddGrpId, nFirstId, pPaths, dTDiam, b3Solid)
|
||||||
end
|
end
|
||||||
EgtErase(nFirstId)
|
EgtErase(nFirstId)
|
||||||
end
|
end
|
||||||
@@ -6672,17 +6995,50 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
if bForceChainsaw then
|
if bForceChainsaw then
|
||||||
-- ottengo le dimensioni del tunnel
|
-- ottengo le dimensioni del tunnel
|
||||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = BL.GetTunnelDimension( Proc, nPartId)
|
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = BL.GetTunnelDimension( Proc, nPartId)
|
||||||
-- lavoro fessura con svuotature (singola o doppia contrapposta)
|
-- se non richiesto solo contorno, lavoro fessura con svuotature (singola o doppia contrapposta)
|
||||||
else
|
else
|
||||||
local sMyMchFind = 'Pocket'
|
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
||||||
local nOk, sErr
|
if bOnlyContour then
|
||||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
|
if Proc.TopologyLongName == 'Tunnel-Through-RightAngles-Parallel-4' then
|
||||||
nLundIdFace, sErr = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
|
-- direzione e faccia aggiunta del tunnel (la groove-3 passante è uno pseudotunnel)
|
||||||
if nOk < 0 then
|
local _, _, dTunnelDepth, vtTunnelDirection, _, idAddedTunnelTmFace = BL.GetTunnelDimension( Proc, nPartId)
|
||||||
return false, sErr
|
-- si tiene il verso del tunnel dal lato Z positiva
|
||||||
elseif nOk > 0 then
|
if vtTunnelDirection:getZ() < GEO.EPS_SMALL then
|
||||||
sWarn = sErr
|
vtTunnelDirection = -vtTunnelDirection
|
||||||
bTryWithBlades = false
|
EgtInvertSurf( idAddedTunnelTmFace)
|
||||||
|
end
|
||||||
|
-- estrazione del contorno da lavorare
|
||||||
|
local idContourPath = EgtExtractSurfTmLoops( idAddedTunnelTmFace, nAddGrpId)
|
||||||
|
EgtModifyCurveExtrusion( idContourPath, vtTunnelDirection, GDB_RT.GLOB)
|
||||||
|
-- spessore codolo da lasciare
|
||||||
|
local dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0
|
||||||
|
-- lavorazione
|
||||||
|
local bOkContour, sWarn2 = MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunnelDepth, dDimStrip, nPhase)
|
||||||
|
if bOkContour then
|
||||||
|
return true, sWarn2
|
||||||
|
else
|
||||||
|
return false, sWarn2
|
||||||
|
end
|
||||||
|
if sWarn2 then
|
||||||
|
if not sWarn then sWarn = '' end
|
||||||
|
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local sErr2 = 'Error : Cannot use ' .. Q_ONLY_CONTOUR .. ' on this feature'
|
||||||
|
return false, sErr2
|
||||||
|
end
|
||||||
|
-- svuotatura
|
||||||
|
else
|
||||||
|
local sMyMchFind = 'Pocket'
|
||||||
|
local nOk, sErr
|
||||||
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
|
||||||
|
nLundIdFace, sErr = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
|
||||||
|
if nOk < 0 then
|
||||||
|
return false, sErr
|
||||||
|
elseif nOk > 0 then
|
||||||
|
sWarn = sErr
|
||||||
|
bTryWithBlades = false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Se la svuotatura precedente non è stata fatta e chamfer non è mutuamente esclusivo provo con la sega-catena
|
-- Se la svuotatura precedente non è stata fatta e chamfer non è mutuamente esclusivo provo con la sega-catena
|
||||||
@@ -6904,6 +7260,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- se divisa in due metà
|
-- se divisa in due metà
|
||||||
if bDouble then
|
if bDouble then
|
||||||
@@ -6924,6 +7286,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFNId, false)
|
EgtSetOperationMode( nMchFNId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFNId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -7004,6 +7372,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- CASO SPECIALE 3 FACCE (se rimane esclusa molta sezione trasversale complessiva della feature, solo per feature 20)
|
-- CASO SPECIALE 3 FACCE (se rimane esclusa molta sezione trasversale complessiva della feature, solo per feature 20)
|
||||||
@@ -7119,6 +7493,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- se abilitato dal parametro Q inserisco foro sullo spigolo
|
-- se abilitato dal parametro Q inserisco foro sullo spigolo
|
||||||
if EgtGetInfo( Proc.Id, Q_BORE_ON_CORNER, 'i') == 1 then
|
if EgtGetInfo( Proc.Id, Q_BORE_ON_CORNER, 'i') == 1 then
|
||||||
@@ -7472,7 +7852,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
if nChamfer < 2 and ( nQAntisplintResult == 1 or nQAntisplintResult == 3) and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
||||||
local bOk
|
local bOk
|
||||||
local bSawDown = ( bMillDown and not bMillUp)
|
local bSawDown = ( bMillDown and not bMillUp)
|
||||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
||||||
@@ -7486,6 +7866,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
if ( bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU) or bForceSideMill then
|
if ( bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU) or bForceSideMill then
|
||||||
-- lavoro con svuotature (singola o doppia contrapposta)
|
-- lavoro con svuotature (singola o doppia contrapposta)
|
||||||
local sMyMchFind = EgtIf( bForceSideMill, 'OpenPocket', 'Pocket')
|
local sMyMchFind = EgtIf( bForceSideMill, 'OpenPocket', 'Pocket')
|
||||||
|
if Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3'
|
||||||
|
or Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' then
|
||||||
|
sMyMchFind = 'OpenPocket'
|
||||||
|
end
|
||||||
local dDiamTool = 100
|
local dDiamTool = 100
|
||||||
local nPathInt, nSurfInt, bOneShot, nFirstMachId
|
local nPathInt, nSurfInt, bOneShot, nFirstMachId
|
||||||
local bIs3Faces = true
|
local bIs3Faces = true
|
||||||
@@ -7553,8 +7937,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
end
|
end
|
||||||
bTryWithBlades = false
|
bTryWithBlades = false
|
||||||
-- se ho antischeggia con fresa le inserisco
|
-- se ho antischeggia con fresa le inserisco
|
||||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
if nChamfer < 2 and ( nQAntisplintResult == 2 or ( nQAntisplintResult == 3 and not bMadeASbyBld)) then
|
||||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
||||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||||
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||||
nil, nil, nil, b3Solid, dDepth,
|
nil, nil, nil, b3Solid, dDepth,
|
||||||
@@ -7578,59 +7961,95 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- in tutti gli altri casi, a meno che non sia forzata sega a catena, lancio la MakeByPockets
|
-- in tutti gli altri casi, a meno che non sia forzata sega a catena, lancio la MakeByPockets
|
||||||
-- lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo
|
-- se non richiesto solo contorno, lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo
|
||||||
elseif not bForceChainsaw then
|
elseif not bForceChainsaw then
|
||||||
-- se 2 facce setto i parametri corretti per la MakeByPockets
|
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
||||||
if bForceSideMill and Proc.Fct == 2 then
|
-- richiesto solo contorno
|
||||||
bIs3Faces = false
|
if bOnlyContour then
|
||||||
bOrthoFacesMaster = true
|
if Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' then
|
||||||
bSetOpenBorders = true
|
-- direzione e faccia aggiunta del tunnel (la groove-3 passante è uno pseudotunnel)
|
||||||
end
|
local _, _, dTunnelDepth, vtTunnelDirection, _, idAddedTunnelTmFace = BL.GetTunnelDimension( Proc, nPartId)
|
||||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
-- si tiene il verso del tunnel dal lato Z positiva
|
||||||
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
if vtTunnelDirection:getZ() < GEO.EPS_SMALL then
|
||||||
if nOk == -3 then
|
vtTunnelDirection = -vtTunnelDirection
|
||||||
bTryWithBlades = true
|
EgtInvertSurf( idAddedTunnelTmFace)
|
||||||
elseif nOk == -2 then
|
end
|
||||||
if not sMchFind then
|
-- estrazione del contorno da lavorare
|
||||||
sMchFind = sMchFindBackUp
|
local idContourPath = EgtExtractSurfTmLoops( idAddedTunnelTmFace, nAddGrpId)
|
||||||
end
|
EgtModifyCurveExtrusion( idContourPath, vtTunnelDirection, GDB_RT.GLOB)
|
||||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, nil, nil, not bMillDown, bMillDown)
|
-- si eliminano i lati aperti
|
||||||
if not sPocketing then
|
BL.SetOpenSide( idContourPath, b3Solid)
|
||||||
local sErr2 = 'Error : '..sMchFind..' not found in library'
|
BL.ChangeOrOpenStart( idContourPath, 2)
|
||||||
EgtOutLog( sErr2)
|
-- spessore codolo da lasciare
|
||||||
return false, sErr2
|
local dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0
|
||||||
end
|
-- lavorazione
|
||||||
bTryWithBlades = false
|
local bOkContour, sWarn2 = MakeContourByMill( Proc, idContourPath, vtTunnelDirection, dTunnelDepth, dDimStrip, nPhase)
|
||||||
sWarn = sErr
|
if bOkContour then
|
||||||
elseif nOk < 0 then
|
return true, sWarn2
|
||||||
return false, sErr
|
else
|
||||||
elseif nOk > 0 then
|
return false, sWarn2
|
||||||
bTryWithBlades = false
|
end
|
||||||
sWarn = sErr
|
|
||||||
-- se ho antischeggia con fresa le inserisco
|
|
||||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
|
||||||
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
|
||||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
|
||||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
||||||
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
|
||||||
nil, nil, nil, b3Solid, dFacElevOri,
|
|
||||||
bOneShot, nFirstMachId)
|
|
||||||
if sWarn2 then
|
if sWarn2 then
|
||||||
if not sWarn then sWarn = '' end
|
if not sWarn then sWarn = '' end
|
||||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
local sErr2 = 'Error : Cannot use ' .. Q_ONLY_CONTOUR .. ' on this feature'
|
||||||
|
return false, sErr2
|
||||||
end
|
end
|
||||||
-- se abilitato dal parametro Q inserisco pulitura spigoli o contorno con fresa più piccola
|
-- svuotatura
|
||||||
local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0
|
else
|
||||||
if nContourSmallTool > 0 then
|
-- se 2 facce setto i parametri corretti per la MakeByPockets
|
||||||
local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
if bForceSideMill and Proc.Fct == 2 then
|
||||||
nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown,
|
bIs3Faces = false
|
||||||
bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid,
|
bOrthoFacesMaster = true
|
||||||
dDepth, bOneShotm)
|
bSetOpenBorders = true
|
||||||
if not bOk then return false, sWarn2 end
|
end
|
||||||
if sWarn2 then
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
||||||
if not sWarn then sWarn = '' end
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
||||||
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
if nOk == -3 then
|
||||||
|
bTryWithBlades = true
|
||||||
|
elseif nOk == -2 then
|
||||||
|
if not sMchFind then
|
||||||
|
sMchFind = sMchFindBackUp
|
||||||
|
end
|
||||||
|
sPocketing = ML.FindPocketing( sMchFind, dDiam, nil, nil, not bMillDown, bMillDown)
|
||||||
|
if not sPocketing then
|
||||||
|
local sErr2 = 'Error : '..sMchFind..' not found in library'
|
||||||
|
EgtOutLog( sErr2)
|
||||||
|
return false, sErr2
|
||||||
|
end
|
||||||
|
bTryWithBlades = false
|
||||||
|
sWarn = sErr
|
||||||
|
elseif nOk < 0 then
|
||||||
|
return false, sErr
|
||||||
|
elseif nOk > 0 then
|
||||||
|
bTryWithBlades = false
|
||||||
|
sWarn = sErr
|
||||||
|
-- se ho antischeggia con fresa le inserisco
|
||||||
|
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
|
if nChamfer < 2 and ( nQAntisplintResult == 2 or ( nQAntisplintResult == 3 and not bMadeASbyBld)) then
|
||||||
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||||
|
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||||
|
nil, nil, nil, b3Solid, dFacElevOri,
|
||||||
|
bOneShot, nFirstMachId)
|
||||||
|
if sWarn2 then
|
||||||
|
if not sWarn then sWarn = '' end
|
||||||
|
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se abilitato dal parametro Q inserisco pulitura spigoli o contorno con fresa più piccola
|
||||||
|
local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0
|
||||||
|
if nContourSmallTool > 0 then
|
||||||
|
local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||||
|
nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown,
|
||||||
|
bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid,
|
||||||
|
dDepth, bOneShotm)
|
||||||
|
if not bOk then return false, sWarn2 end
|
||||||
|
if sWarn2 then
|
||||||
|
if not sWarn then sWarn = '' end
|
||||||
|
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -7714,14 +8133,14 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
if nChamfer < 2 and ( nQAntisplintResult == 1 or nQAntisplintResult == 3) and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
||||||
local bOk
|
local bOk
|
||||||
local bSawDown = ( bMillDown and not bMillUp)
|
local bSawDown = ( bMillDown and not bMillUp)
|
||||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
||||||
if not bOk then return false, sWarn end
|
if not bOk then return false, sWarn end
|
||||||
end
|
end
|
||||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
if nChamfer < 2 and ( nQAntisplintResult == 2 or ( nQAntisplintResult == 3 and not bMadeASbyBld)) then
|
||||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||||
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||||
nil, nil, nil, b3Solid)
|
nil, nil, nil, b3Solid)
|
||||||
if not bOk then return false, sWarn2 end
|
if not bOk then return false, sWarn2 end
|
||||||
@@ -8261,6 +8680,12 @@ local function MakeStaircaseStep( Proc, nRawId, b3Raw, nPartId)
|
|||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
EgtSetOperationMode( nMchFId, false)
|
EgtSetOperationMode( nMchFId, false)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
|
else
|
||||||
|
local _, sWarn = EgtGetMachMgrWarning( 0)
|
||||||
|
if EgtIsMachiningEmpty() then
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sWarn
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- eventuale segnalazione ingombro di testa o coda
|
-- eventuale segnalazione ingombro di testa o coda
|
||||||
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
||||||
@@ -8352,6 +8777,11 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
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.DistanceToNextPart > 1000 or Proc.Box:getDimX() > BD.LONGCUT_ENDLEN)) or
|
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( Proc.DistanceToNextPart > 1000 or Proc.Box:getDimX() > BD.LONGCUT_ENDLEN)) or
|
||||||
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
|
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
|
||||||
|
local bOnlyContour = ( EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') or 0) > 0
|
||||||
|
if bOnlyContour then
|
||||||
|
local sErr2 = 'Error : Cannot use ' .. Q_ONLY_CONTOUR .. ' on long features'
|
||||||
|
return false, sErr2
|
||||||
|
end
|
||||||
-- una faccia
|
-- una faccia
|
||||||
if Proc.Fct == 1 then
|
if Proc.Fct == 1 then
|
||||||
if bUseBlade then
|
if bUseBlade then
|
||||||
|
|||||||
@@ -1151,7 +1151,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
end
|
end
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMilling
|
local sMilling
|
||||||
local bDownHead = ( nSide == -1 and BD.DOWN_HEAD)
|
local bDownHead = ( BD.DOWN_HEAD and ( nSide == -1 or AreSameVectorApprox( vtN[vOrd[1]], -Z_AX())))
|
||||||
sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead)
|
sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead)
|
||||||
|
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
@@ -1277,31 +1277,35 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
local dLimitAngle = -0.5 - 20 * GEO.EPS_SMALL
|
local dLimitAngle = -0.5 - 20 * GEO.EPS_SMALL
|
||||||
-- se facce ortogonali (concave), mantengo la lavorazione di testa sulla faccia più grande purchè non superi di 30 gradi il sottosquadra
|
-- se facce ortogonali (concave), mantengo la lavorazione di testa sulla faccia più grande purchè non superi di 30 gradi il sottosquadra
|
||||||
if bOrtho then
|
if bOrtho then
|
||||||
local vtN1 = vtN[vOrd[1]]
|
if bDownHead and AreSameVectorApprox( vtN[vOrd[1]], -Z_AX()) then
|
||||||
local vtN2 = vtN[vOrd[2]]
|
nFin = 1
|
||||||
if vtN1:getZ() > 0.001 and vtN2:getZ() > 0.001 then
|
|
||||||
if vtN1:getZ() >= vtN2:getZ() then
|
|
||||||
nFin = 1
|
|
||||||
else
|
|
||||||
nIni = 2
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if vtN1:getZ() < dLimitAngle then
|
local vtN1 = vtN[vOrd[1]]
|
||||||
nIni = 2
|
local vtN2 = vtN[vOrd[2]]
|
||||||
elseif vtN2:getZ() < dLimitAngle then
|
if vtN1:getZ() > 0.001 and vtN2:getZ() > 0.001 then
|
||||||
nFin = 1
|
|
||||||
else
|
|
||||||
if vtN1:getZ() >= vtN2:getZ() then
|
if vtN1:getZ() >= vtN2:getZ() then
|
||||||
if vtN1:getZ() < dLimitAngle then
|
nFin = 1
|
||||||
nIni = 2
|
|
||||||
else
|
|
||||||
nFin = 1
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if vtN1:getZ() < dLimitAngle then
|
nIni = 2
|
||||||
nIni = 2
|
end
|
||||||
|
else
|
||||||
|
if vtN1:getZ() < dLimitAngle then
|
||||||
|
nIni = 2
|
||||||
|
elseif vtN2:getZ() < dLimitAngle then
|
||||||
|
nFin = 1
|
||||||
|
else
|
||||||
|
if vtN1:getZ() >= vtN2:getZ() then
|
||||||
|
if vtN1:getZ() < dLimitAngle then
|
||||||
|
nIni = 2
|
||||||
|
else
|
||||||
|
nFin = 1
|
||||||
|
end
|
||||||
else
|
else
|
||||||
nFin = 1
|
if vtN1:getZ() < dLimitAngle then
|
||||||
|
nIni = 2
|
||||||
|
else
|
||||||
|
nFin = 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1325,7 +1329,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
-- valore sovrapposizione tra passate con fresa di fianco
|
-- valore sovrapposizione tra passate con fresa di fianco
|
||||||
local dOverLapExtend = 2
|
local dOverLapExtend = 2
|
||||||
-- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg)
|
-- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg)
|
||||||
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN)))
|
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( bDownHead or ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN))))
|
||||||
-- Limitazioni della lavorazione
|
-- Limitazioni della lavorazione
|
||||||
local nPos = EgtIf( i == 1, j, nC - j + 1)
|
local nPos = EgtIf( i == 1, j, nC - j + 1)
|
||||||
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0))
|
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0))
|
||||||
@@ -1470,7 +1474,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left then
|
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left and Proc.DistanceToNextPart < ( dToolDiam / 2 + 5) then
|
||||||
-- recupero gruppo per geometria addizionale
|
-- recupero gruppo per geometria addizionale
|
||||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||||
if not nAddGrpId then
|
if not nAddGrpId then
|
||||||
@@ -1503,8 +1507,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
sMilling = ML.FindMilling( sMchType)
|
sMilling = ML.FindMilling( sMchType)
|
||||||
sPrefix = 'L2CS_'
|
sPrefix = 'L2CS_'
|
||||||
nExtendMach = nUseMillOnSide
|
nExtendMach = nUseMillOnSide
|
||||||
if nUseMillOnSide == 2 then
|
if nUseMillOnSide == 2 then
|
||||||
bRemoveToolRadius = true
|
bRemoveToolRadius = true
|
||||||
end
|
end
|
||||||
-- se testa da sotto
|
-- se testa da sotto
|
||||||
if nSide ~= 1 and BD.DOWN_HEAD then
|
if nSide ~= 1 and BD.DOWN_HEAD then
|
||||||
|
|||||||
@@ -834,7 +834,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- determinazione materiale da asportare
|
-- determinazione materiale da asportare
|
||||||
local dSawThickCheck = dSawThick
|
local dSawThickCheck = dSawThick
|
||||||
if dSawThick2 > 0 and bDoubleHorizCut then
|
if dSawThick2 > 0 and bDoubleHorizCut then
|
||||||
dSawThickCheck = min( dSawThick, dSawThick2)
|
dSawThickCheck = max( min( dSawThick, dSawThick2), dOvmTail)
|
||||||
end
|
end
|
||||||
local dMaxElev = 0
|
local dMaxElev = 0
|
||||||
if vtN:getX() > 0 then
|
if vtN:getX() > 0 then
|
||||||
|
|||||||
+154
-34
@@ -140,6 +140,112 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchFind, nUseRoughTool, tBHx)
|
||||||
|
|
||||||
|
-- calcolo il elevazione dal punto medio
|
||||||
|
local dElev
|
||||||
|
local dLenIn, dLedOut = BL.GetPointDirDepth( nPartId, ptPs, vtN[nFaceRef])
|
||||||
|
if dLenIn > 0 then
|
||||||
|
dElev = dLenIn
|
||||||
|
elseif dLedOut then
|
||||||
|
dElev = dLedOut
|
||||||
|
end
|
||||||
|
local dCollSic = 2 * BD.COLL_SIC
|
||||||
|
local sTuuidMstr
|
||||||
|
-- calcolo il diametro utensile
|
||||||
|
local dDiamTool
|
||||||
|
if nUseRoughTool == 1 then
|
||||||
|
-- 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
|
||||||
|
-- se non uso truciolatore prendo il valore dalle dimensioni minime delle facce
|
||||||
|
dDiamTool = min( tBHx[nFaceRef][1], tBHx[nFaceRef][2])
|
||||||
|
end
|
||||||
|
-- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -30deg)
|
||||||
|
local bTopHead = ( BD.DOWN_HEAD and vtN[nFaceRef]:getZ() > -0.1)
|
||||||
|
local bDownHead = ( BD.DOWN_HEAD and vtN[nFaceRef]:getZ() < 0.1)
|
||||||
|
-- recupero la lavorazione
|
||||||
|
local sPocketing, _, _, bDownHead = ML.FindPocketing( sMchFind.. EgtIf( bDownHead, '_H2', ''), dDiamTool, dElev + dCollSic, nil, bTopHead, bDownHead)
|
||||||
|
if not sPocketing then
|
||||||
|
local sErr = 'Error : pocketing not found in library'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- recupero il diametro dell'utensile
|
||||||
|
if EgtMdbSetCurrMachining( sPocketing) then
|
||||||
|
sTuuidMstr = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidMstr) or '') then
|
||||||
|
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dDiamTool
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- inserisco la lavorazione di svuotatura
|
||||||
|
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. 'F' .. tostring( nFaceRef - 1)
|
||||||
|
local nMchFId = EgtAddMachining( sName, sPocketing)
|
||||||
|
if not nMchFId then
|
||||||
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
-- aggiungo geometria
|
||||||
|
EgtSetMachiningGeometry( {{ Proc.Id, (nFaceRef-1)}})
|
||||||
|
-- imposto uso faccia
|
||||||
|
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||||
|
-- imposto posizione braccio porta testa
|
||||||
|
if vtN[nFaceRef]:getY() < GEO.EPS_SMALL then
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
|
||||||
|
else
|
||||||
|
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||||
|
end
|
||||||
|
-- La tasca ha sempre almeno un lato aperto, imposto opportuno attacco
|
||||||
|
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||||
|
-- imposto elevazione
|
||||||
|
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||||
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
|
||||||
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
|
if not ML.ApplyMachining( true, false) then
|
||||||
|
-- provo ad allargare leggermente la tasca
|
||||||
|
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
|
||||||
|
if not ML.ApplyMachining( true, false) then
|
||||||
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
EgtSetOperationMode( nMchFId, false)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true, '', sTuuidMstr
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, nBigInd, nSmaInd, ptPs, tBHx, b3Raw, nDiffWidth, nUseRoughTool, dAng)
|
||||||
|
|
||||||
|
local sMchFind = 'Pocket'
|
||||||
|
-- se feature é larga come trave imposto openpocket
|
||||||
|
if nDiffWidth == 0 then
|
||||||
|
sMchFind = 'OpenPocket'
|
||||||
|
-- altrimenti se non è passante disabilito il truciolatore
|
||||||
|
else
|
||||||
|
nUseRoughTool = 0
|
||||||
|
end
|
||||||
|
-- applico la svuotatura
|
||||||
|
local bOk, sErr, sTuuidMstr = MakePocket( Proc, nPartId, ptPs, vtN, nBigInd, nDiffWidth, sMchFind, nUseRoughTool, tBHx)
|
||||||
|
if not bOk then
|
||||||
|
return bOk, sErr
|
||||||
|
end
|
||||||
|
-- se angolo tra le facce maggiore di 90, inserisco la contornatura o svuotatura del lato più corto
|
||||||
|
if dAng > -90 then
|
||||||
|
-- applico la svuotatura
|
||||||
|
local bOk, sErr = MakePocket( Proc, nPartId, ptPs, vtN, nSmaInd, nDiffWidth, sMchFind, nUseRoughTool, tBHx)
|
||||||
|
if not bOk then
|
||||||
|
return bOk, sErr
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione al caso due facce
|
-- Applicazione della lavorazione al caso due facce
|
||||||
local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
@@ -156,6 +262,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- dati delle facce
|
-- dati delle facce
|
||||||
|
local tBHx = {}
|
||||||
local ptC = {}
|
local ptC = {}
|
||||||
local vtN = {}
|
local vtN = {}
|
||||||
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||||
@@ -183,11 +290,13 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
|
local dSawThick = 2
|
||||||
local dMaxDepth = 0
|
local dMaxDepth = 0
|
||||||
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
|
||||||
|
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -239,47 +348,58 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
vtRef[2] = vtN[2] ^ vtTg
|
vtRef[2] = vtN[2] ^ vtTg
|
||||||
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
|
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
|
||||||
-- determino quale faccia è più grande
|
-- determino quale faccia è più grande
|
||||||
local _, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0)
|
local rfFac1, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0)
|
||||||
local _, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 1)
|
local rfFac2, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 1)
|
||||||
local nBigInd = EgtIf( dB1 * dH1 >= dB2 * dH2, 1, 2)
|
local nBigInd = EgtIf( dB1 * dH1 >= dB2 * dH2, 1, 2)
|
||||||
local nSmaInd = 3 - nBigInd
|
local nSmaInd = 3 - nBigInd
|
||||||
-- calcolo extra taglio
|
tBHx[1] = {dH1, dV1, rfFac1}
|
||||||
local dCutExtra = dExtraUp
|
tBHx[2] = {dH2, dV2, rfFac2}
|
||||||
if dAng < -90.5 and dAng > -179.5 then
|
local nUseRoughTool = EgtGetInfo( Proc.Id, 'Q02', 'i')
|
||||||
dCutExtra = - dSawThick / tan( 180 + dAng) + dExtraUp
|
if nUseRoughTool == 1 and dAng < -0.1 and dAng > -90 then
|
||||||
end
|
local bOk, sErr = MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, nBigInd, nSmaInd, ptPs, tBHx, b3Raw, 0, nUseRoughTool, dAng)
|
||||||
-- verifico se necessari tagli supplementari
|
|
||||||
local vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd])
|
|
||||||
--DC.PrintOrderCut( vCuts)
|
|
||||||
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
|
|
||||||
-- eseguo
|
|
||||||
for i = 1, #vCuts do
|
|
||||||
-- assegno il modo di tagliare
|
|
||||||
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nSmaInd], vtRef[nBigInd])
|
|
||||||
-- lavoro la faccia
|
|
||||||
for j = 1, #vCuts[i] do
|
|
||||||
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
|
|
||||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
||||||
if not bOk then
|
|
||||||
return bOk, sErr
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- altrimenti, tagli diretti delle facce
|
|
||||||
else
|
|
||||||
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, EgtIf( bHead, 'HeadSide', 'TailSide'))
|
|
||||||
if not bOk then
|
if not bOk then
|
||||||
return bOk, sErr
|
return bOk, sErr
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
-- calcolo extra taglio
|
||||||
|
local dCutExtra = dExtraUp
|
||||||
|
if dAng < -90.5 and dAng > -179.5 then
|
||||||
|
dCutExtra = - dSawThick / tan( 180 + dAng) + dExtraUp
|
||||||
|
end
|
||||||
|
-- verifico se necessari tagli supplementari
|
||||||
|
local vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd])
|
||||||
|
--DC.PrintOrderCut( vCuts)
|
||||||
|
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
|
||||||
|
-- eseguo
|
||||||
|
for i = 1, #vCuts do
|
||||||
|
-- assegno il modo di tagliare
|
||||||
|
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nSmaInd], vtRef[nBigInd])
|
||||||
|
-- lavoro la faccia
|
||||||
|
for j = 1, #vCuts[i] do
|
||||||
|
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
|
||||||
|
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOk then
|
||||||
|
return bOk, sErr
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- altrimenti, tagli diretti delle facce
|
||||||
|
else
|
||||||
|
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, EgtIf( bHead, 'HeadSide', 'TailSide'))
|
||||||
|
if not bOk then
|
||||||
|
return bOk, sErr
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- eventuale segnalazione ingombro di testa o coda
|
-- eventuale segnalazione ingombro di testa o coda
|
||||||
if Proc.Head then
|
if Proc.Head then
|
||||||
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||||
|
|||||||
@@ -1,4 +1,29 @@
|
|||||||
==== Beam Update Log ====
|
==== Beam Update Log ====
|
||||||
|
|
||||||
|
Versione 3.1e1 (05/05/2026)
|
||||||
|
- Modif : in LapJoint migliorate slot con sega a catena
|
||||||
|
- Fixed : in DrillPocket in doppio eliminata lavorazione aggiuntiva in caso di utensile non abbastanza lungo
|
||||||
|
|
||||||
|
Versione 3.1d2 (10/04/2026)
|
||||||
|
- Added : in StepJoint aggiunto Q02=1 per forzare fresa
|
||||||
|
- Added : in DtMortise aggiunto Q01=1 per disabilitare antischeggia
|
||||||
|
- Fixed : in LapJoint correzione a antischeggia con fresa in caso di feature spezzata
|
||||||
|
|
||||||
|
Versione 3.1d1 (08/04/2026)
|
||||||
|
- Added : le forature vengono accorciate con massima elevazione anche in presenza di tagli di testa
|
||||||
|
- Modif : nelle slot con lama verticali si lavora sempre in concordanza
|
||||||
|
- Fixed : in DtMortise correzione a lavorazione antischeggia
|
||||||
|
- Fixed : in LapJoint, se lavorazione vuota, si disattiva sempre; in Q02 si lavora sempre prima il lato sotto.
|
||||||
|
|
||||||
|
Versione 3.1c2 (18/03/2026)
|
||||||
|
- Added : in LapJoint (solo L030) aggiunto Q02 per fare solo contorno per forme a "C" e tunnel; Q17 spessore di eventuale codolo
|
||||||
|
- Modif : per LapJoint e simili il Q06 per antischeggia ora contempla il valore 3 per scegliere la strategia in automatico (lama o fresa)
|
||||||
|
- Modif : in LapJoint migliorie nella lavorazione delle tasche aperte
|
||||||
|
- Modif : in LongDoubleCut e LapJoint lunghe migliorata scelta fresa in caso di tasca che guarda verso il basso
|
||||||
|
- Fixed : in forature in doppio con svuotatura corretto ultimo step
|
||||||
|
- Fixed : in split correzione in caso di materiale di coda molto sottile e testa sotto
|
||||||
|
- Fixed : in LongDoubleCut e LapJoint lunghe eliminata passate finale dopo taglio di coda se non è presente un grezzo successivo
|
||||||
|
|
||||||
Versione 3.1c1 (04/03/2026)
|
Versione 3.1c1 (04/03/2026)
|
||||||
- Fixed : correzione in ordinamento (fori vs tagli)
|
- Fixed : correzione in ordinamento (fori vs tagli)
|
||||||
- Fixed : in drilling rimosso preforo duplicato
|
- Fixed : in drilling rimosso preforo duplicato
|
||||||
|
|||||||
+1
-1
@@ -2,5 +2,5 @@
|
|||||||
-- Gestione della versione di Beam
|
-- Gestione della versione di Beam
|
||||||
|
|
||||||
NAME = 'Beam'
|
NAME = 'Beam'
|
||||||
VERSION = '3.1c1'
|
VERSION = '3.1e1'
|
||||||
MIN_EXE = '3.1b1'
|
MIN_EXE = '3.1b1'
|
||||||
|
|||||||
Reference in New Issue
Block a user