Merge branch 'STR0005_BladeToWaste' into develop
This commit is contained in:
@@ -153,6 +153,7 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDownU
|
||||
local dWidth = Box:getDimY()
|
||||
|
||||
-- se faccia non troppo lunga, con un lato piccolo e non diretta troppo verso il basso, non servono dice
|
||||
-- TODO si può eliminare questo test dato che vengono verificate già volume e dimensione del cubetto??
|
||||
local dMaxLen = BeamData.MAX_LEN_DICE or 600
|
||||
if dLen < dMaxLen and dWidth < dMaxLen and
|
||||
( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and vtN:getZ() > dNzLimDownUp then
|
||||
@@ -421,6 +422,8 @@ function DiceCut.GetDice( Part, Face1, Face2, OptionalParameters)
|
||||
local dOffsetParallel = OptionalParameters.dOffsetParallel or BeamData.MAX_DIM_DICE
|
||||
-- distanza tra piani ortogonali
|
||||
local dOffsetOrthogonal = OptionalParameters.dOffsetOrthogonal or BeamData.MAX_DIM_DICE
|
||||
-- distanza ridotta tra piani ortogonali - usato in tagli orizzontali con affondamento verticale
|
||||
local dOffsetOrthogonalReduced = OptionalParameters.dOffsetOrthogonalReduced or BeamData.MAX_DIM_HTCUT
|
||||
-- numero massimo piani paralleli
|
||||
local nStepParallel = OptionalParameters.nStepParallel or 100
|
||||
-- numero massimo piani perpendicolari
|
||||
@@ -442,6 +445,12 @@ function DiceCut.GetDice( Part, Face1, Face2, OptionalParameters)
|
||||
dElevO = DistanzaMassima( nAddGrpId, ptCSubordinateFace, vtNSubordinateFace, ptCMainFace, vtNMainFace, b3BoxDicing, TBoxPoint)
|
||||
end
|
||||
|
||||
-- TODO parte sotto da aggiungere???? se sì va passata anche la dimensione cubetto ridotta dOffsetOrthogonalReduced
|
||||
-- se non c'è testa da sotto e normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda
|
||||
-- if not BD.TURN and not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then
|
||||
-- dOffsetOrthogonal = dOffsetOrthogonalReduced
|
||||
-- end
|
||||
|
||||
-- aggiungo piccolo extra agli offset
|
||||
dOffsetParallel = dOffsetParallel + 10 * GEO.EPS_SMALL
|
||||
dOffsetOrthogonal = dOffsetOrthogonal + 10 * GEO.EPS_SMALL
|
||||
|
||||
@@ -180,6 +180,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
table.sort( Blade.Result.Sorted, SortMachiningsBySegment)
|
||||
|
||||
-- calcolo parametri per la stima della velocità di asportazione
|
||||
-- TODO non è corretto: come si stima la velocità di asportazione con il codolo? è come se avesse rimosso tutto il volume feature nel tempo di percorrenza
|
||||
if Cutting1.bIsApplicable and Cutting2.bIsApplicable then
|
||||
MRRParameters1 = {
|
||||
dStep = TOOLS[Cutting1.nToolIndex].dThickness,
|
||||
@@ -207,6 +208,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
local bDropWholeWaste = ( Strategy.Parameters.sCuttingStrategy == 'DROP_WHOLE_WASTE')
|
||||
local dMinZTopBlade
|
||||
local dMaxNyTopBlade
|
||||
local BladeToWasteResult
|
||||
if Strategy.Parameters.dMinZAngleTopBlade then
|
||||
dMinZTopBlade = sin( Strategy.Parameters.dMinZAngleTopBlade)
|
||||
end
|
||||
@@ -219,7 +221,9 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
dMinNzTopBlade = dMinZTopBlade,
|
||||
dMaxNyTopBlade = dMaxNyTopBlade
|
||||
}
|
||||
Blade.Result.Sorted, dCompletionPercentage = BladeToWaste.Make( Proc, Part, OptionalParameters)
|
||||
Blade.Result.Sorted, BladeToWasteResult = BladeToWaste.Make( Proc, Part, OptionalParameters)
|
||||
dMRRBlade = BladeToWasteResult.dMRR
|
||||
dCompletionPercentage = BladeToWasteResult.dCompletionPercentage
|
||||
end
|
||||
|
||||
-- aggiunta lavorazioni
|
||||
|
||||
@@ -86,6 +86,7 @@ end
|
||||
|
||||
|
||||
function BLADETOWASTE.Make( ProcOrId, Part, OptionalParameters)
|
||||
local Machinings = {}
|
||||
local Result = {}
|
||||
local dCompletionPercentage = 0
|
||||
|
||||
@@ -159,11 +160,28 @@ function BLADETOWASTE.Make( ProcOrId, Part, OptionalParameters)
|
||||
Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[1], EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
end
|
||||
if Cutting.bIsApplicable or bDropWholeWaste then
|
||||
table.insert( Result, Cutting)
|
||||
table.insert( Machinings, Cutting)
|
||||
dCompletionPercentage = Cutting.dCompletionPercentage or dCompletionPercentage
|
||||
end
|
||||
|
||||
return Result, dCompletionPercentage
|
||||
-- risultati del calcolo
|
||||
-- TODO funzione?
|
||||
if Cutting.bIsApplicable then
|
||||
if dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
||||
Result.sStatus = 'Completed'
|
||||
else
|
||||
Result.sStatus = 'Not-Completed'
|
||||
end
|
||||
else
|
||||
Result.sStatus = 'Not-Applicable'
|
||||
end
|
||||
Result.dCompletionPercentage = dCompletionPercentage
|
||||
Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dCompletionPercentage)
|
||||
Result.nQuality = FeatureLib.GetFeatureQuality( 'Blade')
|
||||
local dMRR = dFeatureVolume / ( EdgeToMachine.dLength / TOOLS[nToolIndex].Feeds.dFeed)
|
||||
Result.dMRR = dMRR / pow( 10, 6)
|
||||
|
||||
return Machinings, Result
|
||||
end
|
||||
|
||||
-- lavorazione con cubetti
|
||||
@@ -179,33 +197,32 @@ function BLADETOWASTE.Make( ProcOrId, Part, OptionalParameters)
|
||||
nToolIndex = GetBestBladeForDicing( Proc, Part, Face1, OptionalParameters)
|
||||
end
|
||||
|
||||
-- se non trovata lama la lavorazione non è fattibile
|
||||
if not nToolIndex then
|
||||
return Machinings, Result
|
||||
end
|
||||
|
||||
-- calcolo dimensione cubetto e eventuale cubetto ridotto (tagli orizzontali con affondamento verticale)
|
||||
local dDiceDimension = min( TOOLS[nToolIndex].dMaxMaterial, BeamData.MAX_DIM_DICE)
|
||||
local dDiceDimensionReduced = dDiceDimension
|
||||
if TOOLS[nToolIndex].SetupInfo.dMaxMatDecrease then
|
||||
dDiceDimensionReduced = min( dDiceDimension, dDiceDimension - TOOLS[nToolIndex].SetupInfo.dMaxMatDecrease)
|
||||
end
|
||||
|
||||
-- calcolo cubetti
|
||||
local OptionalParametersDiceCut = {}
|
||||
OptionalParametersDiceCut.dOffsetParallel = dDiceDimension
|
||||
OptionalParametersDiceCut.dOffsetOrthogonal = dDiceDimension
|
||||
OptionalParameters.dOffsetOrthogonalReduced = dDiceDimensionReduced
|
||||
local vCuts = DiceCut.GetDice( Part, Face1, Face2, OptionalParametersDiceCut)
|
||||
|
||||
-- lavorazione cubetti
|
||||
-- calcolo vtToolDirection
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- risultati del calcolo
|
||||
|
||||
-- restituire tabella contenente lavorazioni, già con cloni se necessari
|
||||
return Result, dCompletionPercentage
|
||||
return Machinings, Result
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user