- Gestione Tunnel-4-Through in STR0002
- Migliorie a scelta lavorazione - Migliorie spezzatura - Corretta condizione scelta utensile con minimo residuo
This commit is contained in:
@@ -52,7 +52,7 @@ local function GetStrategies_Egalware( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -68,7 +68,7 @@ local function GetStrategies_Egalware( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -90,7 +90,7 @@ local function GetStrategies_Egalware( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -106,7 +106,7 @@ local function GetStrategies_Egalware( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -122,7 +122,7 @@ local function GetStrategies_Egalware( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -141,7 +141,7 @@ local function GetStrategies_Egalware( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -169,7 +169,7 @@ local function GetStrategies_Egalware( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -320,7 +320,7 @@ local function GetStrategies_Essetre( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -336,7 +336,7 @@ local function GetStrategies_Essetre( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -358,7 +358,7 @@ local function GetStrategies_Essetre( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -374,7 +374,7 @@ local function GetStrategies_Essetre( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -390,7 +390,7 @@ local function GetStrategies_Essetre( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -409,7 +409,7 @@ local function GetStrategies_Essetre( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
@@ -437,7 +437,7 @@ local function GetStrategies_Essetre( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Tunnel-4-Through' then
|
||||
Strategies = { { sStrategyId = 'STR0003'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}}
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
Strategies = { { sStrategyId = 'STR0002'}}
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
|
||||
@@ -147,7 +147,7 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
-- se entrambi incompleti
|
||||
elseif dBestToolResidualDepth > 0 and dCurrentResidualDepth > 0 then
|
||||
--scelgo quello che lavora di più
|
||||
if dCurrentResidualDepth > dBestToolResidualDepth then
|
||||
if dCurrentResidualDepth < dBestToolResidualDepth then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
end
|
||||
@@ -323,10 +323,10 @@ function MachiningLib.AddNewMachining( ProcToAdd, MachiningToAdd)
|
||||
if not MachiningToAdd.sToolName then
|
||||
MachiningToAdd.sToolName = TOOLS[MachiningToAdd.nToolIndex].sName
|
||||
end
|
||||
local MachiningAppo = {}
|
||||
MachiningAppo.Proc = ProcToAdd
|
||||
MachiningAppo.Machining = MachiningToAdd
|
||||
table.insert( MACHININGS, MachiningAppo)
|
||||
local Machining = {}
|
||||
Machining.Proc = ProcToAdd
|
||||
Machining.Machining = MachiningToAdd
|
||||
table.insert( MACHININGS, Machining)
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ local Strategy = {}
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function IsTopologyOk( Proc)
|
||||
if Proc.Topology.sName == 'Pocket-5-Blind' or
|
||||
Proc.Topology.sName == 'Tunnel-4-Through' or
|
||||
Proc.Topology.sName == 'Groove-4-Blind' or
|
||||
Proc.Topology.sName == 'Groove-3-Through' or
|
||||
Proc.Topology.sName == 'Groove-3-Blind' or
|
||||
@@ -169,6 +170,8 @@ local function GetBestPocketingStrategy( Proc)
|
||||
Milling.idProc = Proc.id
|
||||
Milling.dElevation = Proc.MainFaces.LongFaces[1].dElevation
|
||||
else -- 'Tunnel-4-Through', 'Groove-3-Through', 'Rabbet-2-Through'
|
||||
-- se lavoro di fianco, devo comunque rispettare il raggio massimo
|
||||
ToolSearchParameters.dMaxToolDiameter = min( ToolSearchParameters.dMaxToolDiameter, Strategy.Parameters.dMaxCornerRadius * 2)
|
||||
ToolSearchParameters.dElevation = ( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation * 2) + BeamData.MILL_OVERLAP
|
||||
ToolSearchParameters.vtToolDirection = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].vtN
|
||||
Milling.vtFaceNormal = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].vtN
|
||||
@@ -192,13 +195,15 @@ local function GetBestPocketingStrategy( Proc)
|
||||
Milling.bIsApplicable = false
|
||||
if Proc.Topology.sName ~= 'Pocket-5-Blind' and Proc.Topology.sName ~= 'Groove-4-Blind' then
|
||||
if Proc.Topology.sName == 'Tunnel-4-Through' or Proc.Topology.sName == 'Groove-3-Through' or Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
-- se lavoro di fianco, devo comunque rispettare il raggio massimo
|
||||
ToolSearchParameters.dMaxToolDiameter = min( ToolSearchParameters.dMaxToolDiameter, Strategy.Parameters.dMaxCornerRadius * 2)
|
||||
ToolSearchParameters.dElevation = ( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation * 2) + BeamData.MILL_OVERLAP
|
||||
ToolSearchParameters.vtToolDirection = -Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].vtN
|
||||
Milling.vtFaceNormal = -Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].vtN
|
||||
Milling.idFaceToMachine = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].id
|
||||
Milling.idProc = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.id
|
||||
Milling.dElevation = ( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation * 2) + BeamData.MILL_OVERLAP
|
||||
Milling.bInvertTool = true
|
||||
Milling.bToolInvert = true
|
||||
else -- 'Groove-3-Blind'
|
||||
ToolSearchParameters.dElevation = Proc.MainFaces.SideFaces[1].dElevation
|
||||
ToolSearchParameters.vtToolDirection = Proc.MainFaces.SideFaces[1].vtN
|
||||
@@ -272,12 +277,12 @@ local function GetBestPocketingStrategy( Proc)
|
||||
Machining[3].bIsApplicable = false
|
||||
return Machining
|
||||
-- se tunnel 2+3 completa tutto
|
||||
elseif Proc.MainFaces.TunnelAddedFaces and Machining[2].bIsApplicable and Machining[3].bIsApplicable and
|
||||
elseif Proc.MainFaces.TunnelAddedFaces and Machining[3].bIsApplicable and Machining[4].bIsApplicable and
|
||||
Machining[3].ToolInfo.dResidualDepth + Machining[4].ToolInfo.dResidualDepth < (Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation * 2) + BeamData.MILL_OVERLAP then
|
||||
Machining.sTypeMachining = 'Side1-Side2'
|
||||
Strategy.Result.sStatus = 'Completed'
|
||||
Machining[3].ToolInfo.dResidualDepth = Machining[3].ToolInfo.dResidualDepth - Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation
|
||||
Machining[4].ToolInfo.dResidualDepth = -Machining[3].ToolInfo.dResidualDepth + BeamData.MILL_OVERLAP
|
||||
Machining[4].ToolInfo.dResidualDepth = -Machining[3].ToolInfo.dResidualDepth - BeamData.MILL_OVERLAP
|
||||
Strategy.Result.nCompletionIndex = FeatureData.GetFeatureCompletionIndex( 100)
|
||||
Strategy.Result.dMRR = ( Machining[3].dMRR + Machining[4].dMRR) / 2
|
||||
Machining[1].bIsApplicable = false
|
||||
@@ -296,14 +301,14 @@ local function GetBestPocketingStrategy( Proc)
|
||||
end
|
||||
if Machining[3].bIsApplicable then
|
||||
if Proc.MainFaces.TunnelAddedFaces then
|
||||
Machining[3].ToolInfo.dResidualDepth = Machining[3].ToolInfo.dResidualDepth - Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation
|
||||
Machining[3].ToolInfo.dResidualDepth = Machining[3].ToolInfo.dResidualDepth - Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation + BeamData.MILL_OVERLAP
|
||||
end
|
||||
Machining.sTypeMachining = EgtIf( Machining.sTypeMachining == 'None', 'Side1', Machining.sTypeMachining .. '-Side1')
|
||||
Strategy.Result.dMRR = Machining[1].dMRR
|
||||
end
|
||||
if Machining[4].bIsApplicable then
|
||||
if Proc.MainFaces.TunnelAddedFaces then
|
||||
Machining[4].ToolInfo.dResidualDepth = Machining[4].ToolInfo.dResidualDepth - Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation
|
||||
Machining[4].ToolInfo.dResidualDepth = Machining[4].ToolInfo.dResidualDepth - Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation + BeamData.MILL_OVERLAP
|
||||
end
|
||||
Machining.sTypeMachining = EgtIf( Machining.sTypeMachining == 'None', 'Side2', Machining.sTypeMachining .. '-Side2')
|
||||
Strategy.Result.dMRR = Machining[1].dMRR
|
||||
@@ -328,17 +333,26 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function VerifySplitMachiningNeeded( Proc, Part)
|
||||
local vAddId = {}
|
||||
local bSplit
|
||||
|
||||
-- la lunghezza richiede spezzatura
|
||||
if ( Proc.b3Box:getDimX() > BeamData.LONGCUT_MAXLEN) or ( Proc.b3Box:getDimX() > 0.7 * Part.b3Solid:getDimX() and Proc.b3Box:getDimX() > BeamData.LONGCUT_ENDLEN) then
|
||||
if Proc.b3Box:getDimX() > BeamData.LONGCUT_MAXLEN or Proc.b3Box:getDimX() > 0.7 * Part.b3Solid:getDimX() then
|
||||
bSplit = true
|
||||
else
|
||||
bSplit = false
|
||||
end
|
||||
|
||||
-- la lunghezza richiede spezzatura
|
||||
if ( bSplit) then
|
||||
-- recupero gruppo per geometria aggiuntiva
|
||||
local nAddGrpId = BeamLib.GetAddGroup( Part.idPart)
|
||||
local nAddGrpId = BeamLib.GetAddGroup( Part.id)
|
||||
local bStartLeft, bStartRight
|
||||
|
||||
-- se feature inizia al di sotto del limite sinistro
|
||||
-- se feature inizia al di sotto del limite sinistro (coda)
|
||||
if Proc.b3Box:getMin():getX() < Part.b3Solid:getMin():getX() + BeamData.LONGCUT_ENDLEN then
|
||||
bStartLeft = true
|
||||
end
|
||||
-- se feature inizia al di sotto del limite destro
|
||||
-- se feature inizia al di sotto del limite destro (testa)
|
||||
if Proc.b3Box:getMax():getX() > Part.b3Solid:getMax():getX() - BeamData.LONGCUT_ENDLEN then
|
||||
bStartRight = true
|
||||
end
|
||||
@@ -357,7 +371,18 @@ local function VerifySplitMachiningNeeded( Proc, Part)
|
||||
-- creo primo spezzone sulla sinistra
|
||||
if bStartLeft then
|
||||
local AddId = EgtCopyGlob( Proc.id, nAddGrpId) or GDB_ID.NULL
|
||||
dNewMinX = max( ( Proc.b3Box:getMin():getX() + dMaxDiam * 3), Part.b3Solid:getMin():getX() + BeamData.LONGCUT_ENDLEN)
|
||||
-- decido punto spezzatura verso la coda
|
||||
if Proc.b3Box:getDimX() > BeamData.LONGCUT_ENDLEN * 2 then
|
||||
dNewMinX = max( Part.b3Solid:getMin():getX() + BeamData.LONGCUT_ENDLEN, Proc.b3Box:getMin():getX() + dMaxDiam * 3)
|
||||
else
|
||||
-- se pezzo abbastanza piccolo, spezzo in mezzo al 'pezzo + grezzo restante'
|
||||
if Part.dRestLength + Part.b3Solid:getDimX() < BeamData.dMinRaw * 1.5 then
|
||||
dNewMinX = Part.b3Solid:getMax():getX() - ( ( Part.dRestLength + Part.b3Solid:getDimX()) / 2)
|
||||
else
|
||||
dNewMinX = max( Proc.b3Box:getMin():getX() + ( BeamData.dMinRaw)/2 + 150, Part.b3Solid:getMax():getX() - BeamData.LONGCUT_ENDLEN)
|
||||
end
|
||||
end
|
||||
|
||||
local ptOn = Point3d( dNewMinX, 0, 0)
|
||||
dNewRest = abs( dNewMaxX - dNewMinX)
|
||||
-- taglio della superficie lato sinistro
|
||||
@@ -369,38 +394,56 @@ local function VerifySplitMachiningNeeded( Proc, Part)
|
||||
if bStartRight then
|
||||
local AddId = EgtCopyGlob( Proc.id, nAddGrpId) or GDB_ID.NULL
|
||||
dNewMaxX = min( ( Proc.b3Box:getMax():getX() - dMaxDiam * 3), Part.b3Solid:getMax():getX() - BeamData.LONGCUT_ENDLEN)
|
||||
if dNewMaxX - dNewMinX < 500 * GEO.EPS_SMALL then
|
||||
dNewMaxX = dNewMinX - BeamData.MILL_OVERLAP
|
||||
dNewRest = 0
|
||||
else
|
||||
dNewRest = dNewMaxX - dNewMinX
|
||||
end
|
||||
local ptOn = Point3d( dNewMaxX, 0, 0)
|
||||
dNewRest = abs( dNewMaxX - dNewMinX)
|
||||
-- taglio della superficie lato destro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, -X_AX(), true, GDB_RT.GLOB)
|
||||
-- eseguo inserimento
|
||||
table.insert( vAddId, EgtIf( BeamData.RIGHT_LOAD, 2, 1),AddId)
|
||||
table.insert( vAddId, 1,AddId)
|
||||
end
|
||||
-- lavoro il restante
|
||||
local nSplitParts = max( ceil( dNewRest / BeamData.LONGCUT_MAXLEN + 10 * GEO.EPS_SMALL), 2)
|
||||
local dSplitPartsLen = dNewRest / nSplitParts
|
||||
for i = 1, nSplitParts do
|
||||
local AddId = EgtCopyGlob( Proc.id, nAddGrpId) or GDB_ID.NULL
|
||||
local ptOn
|
||||
-- eseguo trim sinistro
|
||||
if i ~= 1 or bStartLeft then
|
||||
ptOn = Point3d( dNewMinX, 0, 0)
|
||||
-- taglio della superficie lato sinistro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, -X_AX(), true, GDB_RT.GLOB)
|
||||
if dNewRest > 0 then
|
||||
local nSplitParts = max( ceil( dNewRest / BeamData.LONGCUT_MAXLEN + 10 * GEO.EPS_SMALL), 1)
|
||||
local dSplitPartsLen = dNewRest / nSplitParts
|
||||
for i = 1, nSplitParts do
|
||||
local AddId = EgtCopyGlob( Proc.id, nAddGrpId) or GDB_ID.NULL
|
||||
local ptOn
|
||||
-- se un solo spezzone, prendo punto massimo e minimo
|
||||
if nSplitParts == 1 then
|
||||
ptOn = Point3d( dNewMinX, 0, 0)
|
||||
-- taglio della superficie lato sinistro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, -X_AX(), true, GDB_RT.GLOB)
|
||||
ptOn = Point3d( dNewMaxX, 0, 0)
|
||||
-- taglio della superficie lato destro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, X_AX(), true, GDB_RT.GLOB)
|
||||
else
|
||||
-- eseguo trim sinistro
|
||||
if i ~= 1 or bStartLeft then
|
||||
ptOn = Point3d( dNewMinX, 0, 0)
|
||||
-- taglio della superficie lato sinistro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, -X_AX(), true, GDB_RT.GLOB)
|
||||
end
|
||||
-- eseguo trim destro
|
||||
dNewMaxX = dNewMinX + dSplitPartsLen
|
||||
if i ~= nSplitParts or bStartRight then
|
||||
ptOn = Point3d( dNewMaxX, 0, 0)
|
||||
-- taglio della superficie lato destro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, X_AX(), true, GDB_RT.GLOB)
|
||||
end
|
||||
-- il nuovo minimo è il punto massimo del precedente
|
||||
dNewMinX = dNewMaxX
|
||||
end
|
||||
-- eseguo inserimento in modo da ordinare da X- a X+
|
||||
table.insert( vAddId, EgtIf( #vAddId == 0, 1, 2), AddId)
|
||||
end
|
||||
-- eseguo trim destro
|
||||
dNewMaxX = dNewMinX + dSplitPartsLen
|
||||
if i ~= nSplitParts or bStartRight then
|
||||
ptOn = Point3d( dNewMaxX, 0, 0)
|
||||
-- taglio della superficie lato destro
|
||||
EgtCutSurfTmPlane( AddId, ptOn, X_AX(), true, GDB_RT.GLOB)
|
||||
end
|
||||
-- il nuovo minimo è il punto massimo del precedente
|
||||
dNewMinX = dNewMaxX
|
||||
-- eseguo inserimento in modo da ordinare da X- a X+
|
||||
table.insert( vAddId, EgtIf( BeamData.RIGHT_LOAD, 1+i, EgtIf( bStartLeft, 1, 2)), AddId)
|
||||
end
|
||||
else
|
||||
-- TODO se è sulla coda, messaggio che posso rovinare
|
||||
table.insert( vAddId, Proc.id)
|
||||
end
|
||||
|
||||
@@ -419,7 +462,7 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Strategy.Result = {}
|
||||
|
||||
if not IsTopologyOk( Proc) then
|
||||
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. Strategy.Config.sStrategyId .. ' not implemented'
|
||||
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not implemented'
|
||||
EgtOutLog( sErr)
|
||||
Strategy.Result.sStatus = 'Not-Applicable'
|
||||
Strategy.Result.nCompletionIndex = 0
|
||||
@@ -455,12 +498,13 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Pocketing.LeadIn.dTangentDistance = TOOLS[Strategy.Machining[j].ToolInfo.nToolIndex].dDiameter/2
|
||||
Pocketing.LeadIn.dElevation = TOOLS[Strategy.Machining[j].ToolInfo.nToolIndex].dDiameter/2
|
||||
Pocketing.sDepth = -Strategy.Machining[j].ToolInfo.dResidualDepth
|
||||
if j == 4 then
|
||||
-- il quarto ciclo è la lavorazione opposta sulla faccia Tunnel
|
||||
if Strategy.Machining[j].bToolInvert then
|
||||
Pocketing.bToolInvert = true
|
||||
end
|
||||
-- se ho una sola trimesh, sto lavorando la Proc direttamente e non ho spezzato. Applico direttamente alla geometria calcolata prima
|
||||
if #vAddId == 1 then
|
||||
Pocketing.Geometry = {{ Strategy.Machining[i].idProc, Strategy.Machining[i].idFaceToMachine}}
|
||||
Pocketing.Geometry = {{ Strategy.Machining[j].idProc, Strategy.Machining[j].idFaceToMachine}}
|
||||
bAreAllApplyOk = MachiningLib.AddNewMachining( Proc, Pocketing)
|
||||
else
|
||||
-- TODO settare parametro per indicare qual è lo spezzone che deve essere fatto dopo il taglio di separazione
|
||||
|
||||
Reference in New Issue
Block a user