- alle StrategyLibs aggiunta ANTISPLINTONFACE per calcolare le lavorazioni antischeggia passando una faccia; STR0010 e BLADEKEEPWASTE modificate di conseguenza
- in BLADEKEEPWASTE migliorie e correzioni; manca ancora la pulitura con fresa - in FACEBYBLADE rimossa dimensione minima lato maggiore del diametro lama. Si può avere un accorciamento massimo pari alla lunghezza lato
This commit is contained in:
@@ -11,6 +11,7 @@ local FeatureLib = require( 'FeatureLib')
|
||||
-- strategie di base
|
||||
local FaceByMill = require( 'FACEBYMILL')
|
||||
local FaceByBlade = require( 'FACEBYBLADE')
|
||||
local AntiSplintOnFace = require( 'ANTISPLINTONFACE')
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local STR0010 = {}
|
||||
@@ -351,56 +352,23 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
end
|
||||
end
|
||||
|
||||
-- taglio eventuali facce di chiusura controvena, per ogni faccia bottom lavorata
|
||||
-- antischeggia sulle facce di chiusura delle facce lavorate
|
||||
if Strategy.Parameters.bAntiSplintWithBlade then
|
||||
|
||||
if Milling1 then
|
||||
local ClosingFacesAgainstGrain1 = {}
|
||||
for i = 1, #BottomFace1.Edges do
|
||||
local CurrentFace = Proc.Faces[BottomFace1.Edges[i].idAdjacentFace + 1]
|
||||
if ( not BottomFace1.Edges[i].bIsOpen) and abs( CurrentFace.vtN:getX()) > 0.707 then
|
||||
table.insert( ClosingFacesAgainstGrain1, CurrentFace)
|
||||
end
|
||||
end
|
||||
for i = 1, #ClosingFacesAgainstGrain1 do
|
||||
local EdgeToMachine = {}
|
||||
for j = 1, #ClosingFacesAgainstGrain1[i].Edges do
|
||||
if ClosingFacesAgainstGrain1[i].Edges[j].idAdjacentFace == BottomFace1.id then
|
||||
EdgeToMachine = ClosingFacesAgainstGrain1[i].Edges[j]
|
||||
break
|
||||
end
|
||||
end
|
||||
local Cutting = {}
|
||||
local OptionalParametersFaceByBlade = { bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail}
|
||||
Cutting = FaceByBlade.Make( Proc, Part, ClosingFacesAgainstGrain1[i], EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
Cutting.nInternalSortingPriority = 1
|
||||
Cutting.dResultWeight = 0.15
|
||||
table.insert( CalculatedMachinings, Cutting)
|
||||
end
|
||||
local OptionalParametersAntiSplint = {
|
||||
bIsSplitFeature = bIsSplitFeature,
|
||||
dExtendAfterTail = dExtendAfterTail,
|
||||
nInternalSortingPriority = 1,
|
||||
dResultWeight = 0.15
|
||||
}
|
||||
local AntiSplints1 = AntiSplintOnFace.Make( Proc, Part, BottomFace1, OptionalParametersAntiSplint)
|
||||
for i = 1, #AntiSplints1 do
|
||||
table.insert( CalculatedMachinings, AntiSplints1[i])
|
||||
end
|
||||
|
||||
if Milling2 then
|
||||
local ClosingFacesAgainstGrain2 = {}
|
||||
for i = 1, #BottomFace2.Edges do
|
||||
local CurrentFace = Proc.Faces[BottomFace2.Edges[i].idAdjacentFace + 1]
|
||||
if ( not BottomFace2.Edges[i].bIsOpen) and abs( CurrentFace.vtN:getX()) > 0.707 then
|
||||
table.insert( ClosingFacesAgainstGrain2, CurrentFace)
|
||||
end
|
||||
end
|
||||
for i = 1, #ClosingFacesAgainstGrain2 do
|
||||
local EdgeToMachine = {}
|
||||
for j = 1, #ClosingFacesAgainstGrain2[i].Edges do
|
||||
if ClosingFacesAgainstGrain2[i].Edges[j].idAdjacentFace == BottomFace2.id then
|
||||
EdgeToMachine = ClosingFacesAgainstGrain2[i].Edges[j]
|
||||
break
|
||||
end
|
||||
end
|
||||
local Cutting = {}
|
||||
local OptionalParametersFaceByBlade = { bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail}
|
||||
Cutting = FaceByBlade.Make( Proc, Part, ClosingFacesAgainstGrain2[i], EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
Cutting.nInternalSortingPriority = 1
|
||||
Cutting.dResultWeight = 0.15
|
||||
table.insert( CalculatedMachinings, Cutting)
|
||||
local AntiSplints2 = AntiSplintOnFace.Make( Proc, Part, BottomFace2, OptionalParametersAntiSplint)
|
||||
for i = 1, #AntiSplints2 do
|
||||
table.insert( CalculatedMachinings, AntiSplints2[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
-- Strategia: FACEBYBLADE
|
||||
-- Descrizione
|
||||
-- Strategia di base per la lavorazione delle facce con lama
|
||||
|
||||
-- carico librerie
|
||||
local FaceByBlade = require( 'FACEBYBLADE')
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ANTISPLINTONFACE = {}
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function ANTISPLINTONFACE.Make( Proc, Part, Face, OptionalParameters)
|
||||
local Machinings = {}
|
||||
|
||||
-- parametri opzionali
|
||||
if not OptionalParameters then
|
||||
OptionalParameters = {}
|
||||
end
|
||||
local bIsSplitFeature = OptionalParameters.bIsSplitFeature or false
|
||||
local dExtendAfterTail = OptionalParameters.dExtendAfterTail or 10000
|
||||
local nInternalSortingPriority = OptionalParameters.nInternalSortingPriority or 1
|
||||
local dResultWeight = OptionalParameters.dResultWeight or 0.15
|
||||
local bIgnoreGrainDirection = OptionalParameters.bIgnoreGrainDirection or false
|
||||
|
||||
local ClosingFacesAgainstGrain1 = {}
|
||||
for i = 1, #Face.Edges do
|
||||
local CurrentFace = Proc.Faces[Face.Edges[i].idAdjacentFace + 1]
|
||||
if ( not Face.Edges[i].bIsOpen) and ( ( abs( CurrentFace.vtN:getX()) > 0.707) or bIgnoreGrainDirection) then
|
||||
table.insert( ClosingFacesAgainstGrain1, CurrentFace)
|
||||
end
|
||||
end
|
||||
for i = 1, #ClosingFacesAgainstGrain1 do
|
||||
local EdgeToMachine = {}
|
||||
for j = 1, #ClosingFacesAgainstGrain1[i].Edges do
|
||||
if ClosingFacesAgainstGrain1[i].Edges[j].idAdjacentFace == Face.id then
|
||||
EdgeToMachine = ClosingFacesAgainstGrain1[i].Edges[j]
|
||||
break
|
||||
end
|
||||
end
|
||||
local Cutting = {}
|
||||
local OptionalParametersFaceByBlade = { bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail}
|
||||
Cutting = FaceByBlade.Make( Proc, Part, ClosingFacesAgainstGrain1[i], EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
Cutting.nInternalSortingPriority = nInternalSortingPriority
|
||||
Cutting.dResultWeight = dResultWeight
|
||||
table.insert( Machinings, Cutting)
|
||||
end
|
||||
|
||||
return Machinings
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
return ANTISPLINTONFACE
|
||||
@@ -14,7 +14,8 @@ local MachiningLib = require( 'MachiningLib')
|
||||
local BeamLib = require('BeamLib')
|
||||
-- strategie di base
|
||||
local FaceByBlade = require('FACEBYBLADE')
|
||||
local FaceByMill = require('FACEBYMILL')
|
||||
local FaceByMill = require( 'FACEBYMILL')
|
||||
local AntiSplintOnFace = require( 'ANTISPLINTONFACE')
|
||||
|
||||
-- tabelle per definizione modulo
|
||||
|
||||
@@ -270,6 +271,10 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
||||
Result = FeatureLib.GetStrategyResultNotApplicable()
|
||||
return Machinings, Result
|
||||
end
|
||||
local bConvexAngle
|
||||
if BottomFace2 then
|
||||
bConvexAngle = ( Proc.AdjacencyMatrix[BottomFace1.id + 1][BottomFace2.id + 1]) > 0
|
||||
end
|
||||
|
||||
-- eventuali punti di spezzatura
|
||||
local FeatureSplittingPoints = FeatureLib.GetFeatureSplittingPoints( Proc, Part)
|
||||
@@ -297,29 +302,39 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
||||
|
||||
-- calcolo lavorazioni faccia secondaria, solo se lato convesso; se concavo, sarà lavorato come antisplint
|
||||
local Cuttings2
|
||||
local bConvexAngle = ( Proc.AdjacencyMatrix[BottomFace1.id + 1][BottomFace2.id + 1]) > 0
|
||||
if BottomFace2 and bConvexAngle then
|
||||
-- ricerca lato da lavorare
|
||||
local BottomEdgeToMachine2 = GetLongEdgeToMachine( BottomFace2, { bTop = true})
|
||||
-- calcolo lavorazione
|
||||
local Parameters2 = BeamLib.TableCopyDeep( Parameters1)
|
||||
Parameters2.OtherBottomFace = BottomFace1
|
||||
Cuttings2 = MakeBottomFace( Proc, Part, BottomFace2, BottomEdgeToMachine2, Parameters2)
|
||||
for i = 1, #Cuttings2 do
|
||||
table.insert( CalculatedMachinings, Cuttings2[i])
|
||||
if BottomFace2 then
|
||||
if bConvexAngle then
|
||||
-- ricerca lato da lavorare
|
||||
local BottomEdgeToMachine2 = GetLongEdgeToMachine( BottomFace2, { bTop = true})
|
||||
-- calcolo lavorazione
|
||||
local Parameters2 = BeamLib.TableCopyDeep( Parameters1)
|
||||
Parameters2.OtherBottomFace = BottomFace1
|
||||
Cuttings2 = MakeBottomFace( Proc, Part, BottomFace2, BottomEdgeToMachine2, Parameters2)
|
||||
for i = 1, #Cuttings2 do
|
||||
table.insert( CalculatedMachinings, Cuttings2[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- -- taglio eventuali facce di chiusura o seconda faccia
|
||||
-- for i = 1, #LongFaces do
|
||||
-- local Cutting = {}
|
||||
-- local OptionalParametersFaceByBlade = { bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail, nToolIndex = nToolIndex}
|
||||
-- Cutting = FaceByBlade.Make( Proc, Part, LongFaces[i], LongFaces[i].MainEdges.BottomEdge, OptionalParametersFaceByBlade)
|
||||
-- Cutting.nInternalSortingPriority = 1
|
||||
-- Cutting.dResultWeight = 0.15
|
||||
-- table.insert( CalculatedMachinings, Cutting)
|
||||
-- end
|
||||
-- antischeggia sulle facce di chiusura delle facce lavorate
|
||||
local OptionalParametersAntiSplint = {
|
||||
bIsSplitFeature = bIsSplitFeature,
|
||||
dExtendAfterTail = dExtendAfterTail,
|
||||
nInternalSortingPriority = 1,
|
||||
dResultWeight = 0.15,
|
||||
bIgnoreGrainDirection = true
|
||||
}
|
||||
local AntiSplints1 = AntiSplintOnFace.Make( Proc, Part, BottomFace1, OptionalParametersAntiSplint)
|
||||
for i = 1, #AntiSplints1 do
|
||||
table.insert( CalculatedMachinings, AntiSplints1[i])
|
||||
end
|
||||
if BottomFace2 and bConvexAngle then
|
||||
OptionalParametersAntiSplint.bIgnoreGrainDirection = false
|
||||
local AntiSplints2 = AntiSplintOnFace.Make( Proc, Part, BottomFace2, OptionalParametersAntiSplint)
|
||||
for i = 1, #AntiSplints2 do
|
||||
table.insert( CalculatedMachinings, AntiSplints2[i])
|
||||
end
|
||||
end
|
||||
|
||||
-- -- fresatura eventuali facce di chiusura
|
||||
-- if bFinishWithMill then
|
||||
@@ -360,7 +375,7 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
||||
table.sort( Machinings, SortMachiningsBySegment)
|
||||
|
||||
-- calcolo risultati
|
||||
if Cuttings1[1].bIsApplicable or Cuttings1[2].bIsApplicable then
|
||||
if Cuttings1[1].bIsApplicable or Cuttings1[2].bIsApplicable or Cuttings2 and ( Cuttings2[1].bIsApplicable or Cuttings2[2].bIsApplicable) then
|
||||
Result.dQuality = FeatureLib.GetStrategyQuality( Machinings)
|
||||
Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings)
|
||||
Result.dMRR = ( dFeatureVolume / Result.dTimeToMachine) / pow( 10, 6)
|
||||
|
||||
@@ -72,6 +72,12 @@ local function GetLeadInOut( Machining, EdgeToMachine, bIsSplitFeature)
|
||||
LeadOut.dTotalLength = sqrt( LeadOut.dPerpDistance ^ 2 + LeadOut.dTangentDistance ^ 2)
|
||||
end
|
||||
|
||||
-- se accorciamenti maggiori della lunghezza lato, la lavorazione non è fattibile
|
||||
if LeadIn.dStartAddLength + LeadOut.dEndAddLength + EdgeToMachine.dLength < 1 then
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
-- se lavorazione con OppositeToolDirection o ridotta l'attacco va corretto
|
||||
if not AreSameVectorApprox( Machining.vtToolDirection, EdgeToMachine.vtN) then
|
||||
LeadIn.dPerpDistance = BeamData.CUT_SIC - Machining.dRadialOffset
|
||||
@@ -285,16 +291,18 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
|
||||
return Cutting, EdgeToMachine.dElevation
|
||||
end
|
||||
|
||||
-- TODO vedere se la rimozione di questo crea problemi
|
||||
-- se tasca chiusa da entrambi i lati e più stretta della lama la lavorazione non è applicabile
|
||||
if not ( EdgeToMachine.bIsStartOpen or EdgeToMachine.bIsEndOpen) then
|
||||
if TOOLS[Cutting.nToolIndex].dDiameter > EdgeToMachine.dLength + 10 * GEO.EPS_SMALL then
|
||||
Cutting.sMessage = 'Pocket too narrow for blade diameter'
|
||||
Cutting.bIsApplicable = false
|
||||
EgtOutLog( Cutting.sMessage)
|
||||
-- if not ( EdgeToMachine.bIsStartOpen or EdgeToMachine.bIsEndOpen) then
|
||||
-- if TOOLS[Cutting.nToolIndex].dDiameter > EdgeToMachine.dLength + 10 * GEO.EPS_SMALL then
|
||||
-- Cutting.sMessage = 'Pocket too narrow for blade diameter'
|
||||
-- Cutting.bIsApplicable = false
|
||||
-- EgtOutLog( Cutting.sMessage)
|
||||
|
||||
return Cutting, EdgeToMachine.dElevation
|
||||
end
|
||||
end
|
||||
-- return Cutting, EdgeToMachine.dElevation
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- parametri della lavorazione
|
||||
|
||||
@@ -320,7 +328,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
Cutting.bInvert = not Cutting.bInvert
|
||||
end
|
||||
|
||||
-- TODO al momento commentato per trovare i casi in cui nei riposizionamenti scende sul pezzo; poi valutare se lasciare o togliere
|
||||
-- se dicing, lato di lavoro e inversione per avere taglio sempre verso l'alto
|
||||
if bIsDicing
|
||||
and ( Cutting.bInvert and Cutting.vtEdgeDirection:getZ() > 100 * GEO.EPS_SMALL)
|
||||
|
||||
Reference in New Issue
Block a user