- per T010, L010 e T11 abilitata STR0002 (svuotatura)
- in FaceData.GetMainFaces gestita DoubleBevel - in STR0002 gestita topologia DoubleBevel-2-Through e topologie 1 faccia (Bevel, Cut) - TEMPI NON OK DA SISTEMARE - in STR0005 si restituisce anche TimeToMachine - in FABYBLADE e FACEBYMILL piccola correzione in calcolo LeadIn/Out
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( false)
|
||||
EgtEnableDebug( true)
|
||||
|
||||
-- Imposto direttorio libreria specializzata per Travi
|
||||
EgtAddToPackagePath( BEAM.BASEDIR .. '\\LuaLibs\\?.lua')
|
||||
|
||||
@@ -53,15 +53,15 @@ local function GetStrategies_Egalware( Proc)
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut (1-10)
|
||||
elseif ID.IsCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'STR0005'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Longitudinal Cut (0-10)
|
||||
elseif ID.IsLongitudinalCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'STR0005'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Double Cut (1-11)
|
||||
elseif ID.IsDoubleCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'STR0005'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Ridge or Valley Cut (0-12)
|
||||
elseif ID.IsDoubleLongitudinalCut( Proc) then
|
||||
@@ -372,15 +372,15 @@ local function GetStrategies_Essetre( Proc)
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Cut (1-10)
|
||||
elseif ID.IsCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'STR0005'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Longitudinal Cut (0-10)
|
||||
elseif ID.IsLongitudinalCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'STR0005'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Double Cut (1-11)
|
||||
elseif ID.IsDoubleCut( Proc) then
|
||||
Strategies = { { sStrategyId = 'STR0005'}}
|
||||
Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}}
|
||||
---------------------------------------------------------------------
|
||||
-- Feature : Ridge or Valley Cut (0-12)
|
||||
elseif ID.IsDoubleLongitudinalCut( Proc) then
|
||||
|
||||
+35
-19
@@ -260,10 +260,17 @@ local function GetBottomFaces( Proc)
|
||||
|
||||
if Proc.Topology.sFamily == 'Tunnel' then
|
||||
return nil
|
||||
elseif not ( Proc.Topology.sFamily == 'Rabbet' or Proc.Topology.sFamily == 'VGroove' or Proc.Topology.sFamily == 'Groove' or
|
||||
Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Bevel') then
|
||||
elseif not ( Proc.Topology.sFamily == 'Rabbet'
|
||||
or Proc.Topology.sFamily == 'VGroove'
|
||||
or Proc.Topology.sFamily == 'Groove'
|
||||
or Proc.Topology.sFamily == 'Pocket'
|
||||
or Proc.Topology.sFamily == 'Bevel'
|
||||
or Proc.Topology.sFamily == 'DoubleBevel'
|
||||
or Proc.Topology.sFamily == 'Cut') then
|
||||
error( 'GetBottomFace : Topology not implemented')
|
||||
elseif Proc.nFct == 1 then
|
||||
end
|
||||
|
||||
if Proc.nFct == 1 then
|
||||
return { Proc.Faces[1]}
|
||||
end
|
||||
|
||||
@@ -303,7 +310,10 @@ local function GetBottomFaces( Proc)
|
||||
end
|
||||
end
|
||||
table.sort( ClosedEdgesSortedByGreatestLength, function (a, b) return a.dLength > b.dLength end)
|
||||
local nFirstLongEdgeIndex = ClosedEdgesSortedByGreatestLength[1].nIndex
|
||||
local nFirstLongEdgeIndex
|
||||
if #ClosedEdgesSortedByGreatestLength > 0 then
|
||||
nFirstLongEdgeIndex = ClosedEdgesSortedByGreatestLength[1].nIndex
|
||||
end
|
||||
|
||||
for i = 1, #BottomFaces[1].Edges do
|
||||
local nPreviousEdgeIndex = i - 1
|
||||
@@ -324,18 +334,21 @@ local function GetBottomFaces( Proc)
|
||||
CurrentEdge.bIsStartOpen = BottomFaces[1].Edges[i].bIsStartOpen
|
||||
CurrentEdge.bIsEndOpen = BottomFaces[1].Edges[i].bIsEndOpen
|
||||
|
||||
if i == nFirstLongEdgeIndex then
|
||||
BottomFaces[1].MainEdges.LongEdges[1] = CurrentEdge
|
||||
BottomFaces[1].MainEdges.LongEdges[1].sType = 'Long'
|
||||
elseif nNextEdgeIndex == nFirstLongEdgeIndex then
|
||||
BottomFaces[1].MainEdges.SideEdges[1] = CurrentEdge
|
||||
BottomFaces[1].MainEdges.SideEdges[1].sType = 'Side'
|
||||
elseif nPreviousEdgeIndex == nFirstLongEdgeIndex then
|
||||
BottomFaces[1].MainEdges.SideEdges[2] = CurrentEdge
|
||||
BottomFaces[1].MainEdges.SideEdges[2].sType = 'Side'
|
||||
else
|
||||
BottomFaces[1].MainEdges.LongEdges[2] = CurrentEdge
|
||||
BottomFaces[1].MainEdges.LongEdges[2].sType = 'Long'
|
||||
-- se non c'è un LongEdge significa che non ci sono lati chiusi (facce convesse)
|
||||
if nFirstLongEdgeIndex then
|
||||
if i == nFirstLongEdgeIndex then
|
||||
BottomFaces[1].MainEdges.LongEdges[1] = CurrentEdge
|
||||
BottomFaces[1].MainEdges.LongEdges[1].sType = 'Long'
|
||||
elseif nNextEdgeIndex == nFirstLongEdgeIndex then
|
||||
BottomFaces[1].MainEdges.SideEdges[1] = CurrentEdge
|
||||
BottomFaces[1].MainEdges.SideEdges[1].sType = 'Side'
|
||||
elseif nPreviousEdgeIndex == nFirstLongEdgeIndex then
|
||||
BottomFaces[1].MainEdges.SideEdges[2] = CurrentEdge
|
||||
BottomFaces[1].MainEdges.SideEdges[2].sType = 'Side'
|
||||
else
|
||||
BottomFaces[1].MainEdges.LongEdges[2] = CurrentEdge
|
||||
BottomFaces[1].MainEdges.LongEdges[2].sType = 'Long'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -348,7 +361,8 @@ local function GetLongFaces( Proc, MainFaces)
|
||||
|
||||
if Proc.nFct > 5 then
|
||||
error( 'GetLongFaces : Topology not implemented')
|
||||
elseif Proc.nFct == 1 then
|
||||
elseif Proc.nFct == 1
|
||||
or Proc.Topology.sFamily == 'DoubleBevel' then
|
||||
return {}
|
||||
end
|
||||
|
||||
@@ -446,7 +460,8 @@ local function GetSideFaces( Proc, MainFaces)
|
||||
|
||||
if Proc.nFct > 5 then
|
||||
error( 'GetSideFaces : Topology not implemented')
|
||||
elseif Proc.nFct == 1 then
|
||||
elseif Proc.nFct == 1
|
||||
or Proc.Topology.sFamily == 'DoubleBevel' then
|
||||
return {}
|
||||
end
|
||||
|
||||
@@ -535,7 +550,8 @@ function FaceData.GetMainFaces( Proc, Part)
|
||||
|
||||
-- CASO 1 : Feature tipo LapJoint
|
||||
if Proc.Topology.sFamily == 'Rabbet' or Proc.Topology.sFamily == 'VGroove' or Proc.Topology.sFamily == 'Groove' or
|
||||
Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Bevel' then
|
||||
Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Bevel' or
|
||||
Proc.Topology.sFamily == 'DoubleBevel' or Proc.Topology.sFamily == 'Cut' then
|
||||
|
||||
if Proc.Topology.bIsThrough and Proc.Topology.bAllRightAngles and Proc.nFct < 5 then
|
||||
MainFaces.TunnelAddedFaces = GetTunnelFaces( Proc, Part)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"nGrp": "1",
|
||||
"TopologyList" : [
|
||||
{ "sName": "Feature",
|
||||
"StrategyList" : [ { "sStrategyID": "STR0005" } ]
|
||||
"StrategyList" : [ { "sStrategyID": "STR0002" }, { "sStrategyID": "STR0005" } ]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -16,7 +16,7 @@
|
||||
"nGrp": "0",
|
||||
"TopologyList" : [
|
||||
{ "sName": "Feature",
|
||||
"StrategyList" : [ { "sStrategyID": "STR0005" } ]
|
||||
"StrategyList" : [ { "sStrategyID": "STR0002" }, { "sStrategyID": "STR0005" } ]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -26,7 +26,7 @@
|
||||
"nGrp": "1",
|
||||
"TopologyList" : [
|
||||
{ "sName": "Feature",
|
||||
"StrategyList" : [ { "sStrategyID": "STR0005" } ]
|
||||
"StrategyList" : [ { "sStrategyID": "STR0002" }, { "sStrategyID": "STR0005" } ]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -32,7 +32,10 @@ local function IsTopologyOk( Proc)
|
||||
Proc.Topology.sName == 'Groove-3-Through' or
|
||||
Proc.Topology.sName == 'Groove-3-Blind' or
|
||||
Proc.Topology.sName == 'Bevel-3-Blind' or
|
||||
Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
Proc.Topology.sName == 'Rabbet-2-Through' or
|
||||
Proc.Topology.sName == 'DoubleBevel-2-Through' or
|
||||
Proc.Topology.sName == 'Cut-1-Through' or
|
||||
Proc.Topology.sName == 'Bevel-1-Through' then
|
||||
|
||||
return true
|
||||
else
|
||||
@@ -115,7 +118,11 @@ local function GetBestPocketingStrategy( Proc)
|
||||
elseif Proc.Topology.sName == 'Groove-3-Blind' then
|
||||
ToolSearchParameters.sType = 'MILL_NOTIP'
|
||||
ToolSearchParameters.dMaxToolDiameter = Strategy.Parameters.dMaxCornerRadius * 2
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through'
|
||||
or Proc.Topology.sName == 'DoubleBevel-2-Through'
|
||||
or Proc.Topology.sName == 'Cut-1-Through'
|
||||
or Proc.Topology.sName == 'Bevel-1-Through' then
|
||||
|
||||
ToolSearchParameters.sType = 'MILL_NOTIP'
|
||||
ToolSearchParameters.dMaxToolDiameter = 9999
|
||||
else
|
||||
@@ -150,13 +157,13 @@ local function GetBestPocketingStrategy( Proc)
|
||||
-- caso speciale 'Rabbet-2-Through' seconda faccia principale
|
||||
Milling = {}
|
||||
Milling.bIsApplicable = false
|
||||
if Proc.Topology.sName == 'Rabbet-2-Through' then
|
||||
ToolSearchParameters.dElevation = Proc.MainFaces.LongFaces[1].dElevation
|
||||
ToolSearchParameters.vtToolDirection = Proc.MainFaces.LongFaces[1].vtN
|
||||
Milling.vtFaceNormal = Proc.MainFaces.LongFaces[1].vtN
|
||||
Milling.idFaceToMachine = Proc.MainFaces.LongFaces[1].id
|
||||
if Proc.Topology.sName == 'Rabbet-2-Through' or Proc.Topology.sName == 'DoubleBevel-2-Through' then
|
||||
ToolSearchParameters.dElevation = Proc.MainFaces.BottomFaces[2].dElevation
|
||||
ToolSearchParameters.vtToolDirection = Proc.MainFaces.BottomFaces[2].vtN
|
||||
Milling.vtFaceNormal = Proc.MainFaces.BottomFaces[2].vtN
|
||||
Milling.idFaceToMachine = Proc.MainFaces.BottomFaces[2].id
|
||||
Milling.idProc = Proc.id
|
||||
Milling.dElevation = Proc.MainFaces.LongFaces[1].dElevation
|
||||
Milling.dElevation = Proc.MainFaces.BottomFaces[2].dElevation
|
||||
Milling.ToolInfo = {}
|
||||
Milling.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
if Milling.ToolInfo.nToolIndex then
|
||||
@@ -171,7 +178,7 @@ local function GetBestPocketingStrategy( Proc)
|
||||
-- cerco utensile per lavorare di fianco 1
|
||||
Milling = {}
|
||||
Milling.bIsApplicable = false
|
||||
if Proc.Topology.sName ~= 'Pocket-5-Blind' then
|
||||
if ( #Proc.MainFaces.LongFaces > 0) and Proc.Topology.sName ~= 'Pocket-5-Blind' then
|
||||
if Proc.Topology.sName == 'Groove-4-Blind' then
|
||||
ToolSearchParameters.dElevation = Proc.MainFaces.BottomFaces[2].dElevation
|
||||
ToolSearchParameters.vtToolDirection = Proc.MainFaces.BottomFaces[2].vtN
|
||||
@@ -211,7 +218,7 @@ local function GetBestPocketingStrategy( Proc)
|
||||
-- cerco utensile per lavorare di fianco 2
|
||||
Milling = {}
|
||||
Milling.bIsApplicable = false
|
||||
if Proc.Topology.sName ~= 'Pocket-5-Blind' and Proc.Topology.sName ~= 'Groove-4-Blind' and Proc.Topology.sName ~= 'Bevel-3-Blind' then
|
||||
if ( #Proc.MainFaces.LongFaces > 0) and Proc.Topology.sName ~= 'Pocket-5-Blind' and Proc.Topology.sName ~= 'Groove-4-Blind' and Proc.Topology.sName ~= 'Bevel-3-Blind' then
|
||||
if Proc.MainFaces.TunnelAddedFaces then -- 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)
|
||||
@@ -250,9 +257,18 @@ local function GetBestPocketingStrategy( Proc)
|
||||
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
|
||||
Strategy.Result.dMRR = Machining[1].dMRR
|
||||
Machining[1].ToolInfo.dResidualDepth = 0
|
||||
Machining[2].bIsApplicable = false
|
||||
Machining[3].bIsApplicable = false
|
||||
Machining[4].bIsApplicable = false
|
||||
-- caso speciale 'DoubleBevel-2-Through' che deve lavorare due facce
|
||||
if Proc.Topology.sName == 'DoubleBevel-2-Through' and Machining[2].bIsApplicable and Machining[2].ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then
|
||||
Machining.sTypeMachining = 'Bottom2'
|
||||
Strategy.Result.sStatus = 'Completed'
|
||||
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
|
||||
Strategy.Result.dMRR = Machining[2].dMRR
|
||||
Machining[2].ToolInfo.dResidualDepth = 0
|
||||
else
|
||||
Machining[2].bIsApplicable = false
|
||||
end
|
||||
return Machining
|
||||
-- caso speciale 'Rabbet-2-Through' che ha la seconda faccia come se fosse una seconda bottom
|
||||
elseif Proc.Topology.sName == 'Rabbet-2-Through' and Machining[2].bIsApplicable and Machining[2].ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then
|
||||
|
||||
@@ -28,6 +28,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
Strategy.Result = {}
|
||||
Strategy.Result.sInfo = ''
|
||||
Blade.Result = {}
|
||||
local dTimeToMachine = 0
|
||||
local dMRRBlade = 0
|
||||
local dCompletionPercentage = 0
|
||||
local nQuality = 0
|
||||
@@ -82,6 +83,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
local BladeKeepWasteResult
|
||||
local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dStripWidth = Strategy.Parameters.dStripWidth}
|
||||
Blade.Result, BladeKeepWasteResult = BladeKeepWaste.Make( Proc, Part, OptionalParameters)
|
||||
dTimeToMachine = BladeKeepWasteResult.dTimeToMachine
|
||||
dMRRBlade = BladeKeepWasteResult.dMRR
|
||||
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
|
||||
nQuality = BladeKeepWasteResult.nQuality
|
||||
@@ -106,6 +108,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
dExtendAfterTail = dExtendAfterTail
|
||||
}
|
||||
Blade.Result, BladeToWasteResult = BladeToWaste.Make( Proc, Part, OptionalParameters)
|
||||
dTimeToMachine = BladeToWasteResult.dTimeToMachine
|
||||
dMRRBlade = BladeToWasteResult.dMRR
|
||||
dCompletionPercentage = BladeToWasteResult.dCompletionPercentage
|
||||
nQuality = BladeToWasteResult.nQuality
|
||||
@@ -118,6 +121,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
dMillingOffsetFromSide = Strategy.Parameters.dMillingOffsetFromSide
|
||||
}
|
||||
Blade.Result, BladeKeepWasteResult = BladeKeepWaste.Make( Proc, Part, OptionalParameters)
|
||||
dTimeToMachine = BladeKeepWasteResult.dTimeToMachine
|
||||
dMRRBlade = BladeKeepWasteResult.dMRR
|
||||
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
|
||||
nQuality = BladeKeepWasteResult.nQuality
|
||||
@@ -150,6 +154,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
dCompletionPercentageAddedFace = BladeToWasteResult.dCompletionPercentage
|
||||
nQualityAddedFace = BladeToWasteResult.nQuality
|
||||
|
||||
dTimeToMachine = dTimeToMachine + BladeToWasteResult.dTimeToMachine
|
||||
-- la faccia aggiuntiva conta per 1/3
|
||||
dMRRBlade = 2/3 * dMRRBlade + 1/3 * dMRRBladeAddedFace
|
||||
dCompletionPercentage = 2/3 * dCompletionPercentage + 1/3 * dCompletionPercentageAddedFace
|
||||
@@ -184,6 +189,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
end
|
||||
Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dCompletionPercentage)
|
||||
Strategy.Result.nQuality = nQuality
|
||||
Strategy.Result.dTimeToMachine = dTimeToMachine
|
||||
Strategy.Result.dMRR = dMRRBlade
|
||||
|
||||
return bAreAllMachiningsAdded, Strategy.Result
|
||||
|
||||
@@ -621,6 +621,7 @@ function BLADETOWASTE.Make( ProcOrId, Part, OptionalParameters)
|
||||
local dAngleBetweenFaces = Proc.AdjacencyMatrix[1][2]
|
||||
|
||||
-- feature convessa: lavorata come 2 facce singole con prolungamento
|
||||
-- TODO qui sostituire con check topologia DoubleBevel
|
||||
if dAngleBetweenFaces > 10 * GEO.EPS_SMALL then
|
||||
-- si creano superfici singole per le facce, estese fino al box della parte
|
||||
local nAddGrpId = BeamLib.GetAddGroup( Part.id)
|
||||
|
||||
@@ -80,7 +80,7 @@ local function CalculateLeadInOut( Machining, EdgeToMachine, Part)
|
||||
LeadOut.dTangentDistance = 0
|
||||
if Machining.bIsStartClosed
|
||||
or Machining.bIsEndClosed
|
||||
or Machining.Steps.nCount > 1 then
|
||||
or Machining.CloneStepsRadial.nCount > 1 then
|
||||
|
||||
Machining.sLeadInOutType = 'Perpendicular'
|
||||
if AreSameVectorApprox( Machining.vtToolDirection, EdgeToMachine.vtN) then
|
||||
|
||||
@@ -80,7 +80,7 @@ local function CalculateLeadInOut( Machining, EdgeToMachine, Part)
|
||||
LeadOut.dTangentDistance = 0
|
||||
if Machining.bIsStartClosed
|
||||
or Machining.bIsEndClosed
|
||||
or Machining.Steps.nCount > 1 then
|
||||
or Machining.CloneStepsRadial.nCount > 1 then
|
||||
|
||||
Machining.sLeadInOutType = 'Perpendicular'
|
||||
if AreSameVectorApprox( Machining.vtToolDirection, EdgeToMachine.vtN) then
|
||||
|
||||
Reference in New Issue
Block a user