diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index c3b9e11..0389546 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -427,8 +427,6 @@ 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 @@ -448,13 +446,6 @@ function DiceCut.GetDice( Part, Face1, Face2, OptionalParameters) dElevO = DistanzaMassima( idAddGroup, 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 - -- TODO eliminare i riferimenti a DOWN_HEAD e TWO_EQUAL_HEADS e sostituirli con check iniziale sulla disponibilità di teste? - -- 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 diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index b331789..4a5996c 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -1704,7 +1704,6 @@ end ------------------------------------------------------------------------------------------------------------- function MachiningLib.ShortestPathSorting() - local nStartIndex local i = 1 while i <= #DB_MACH_APPLIED do local nMachInDisp = 0 @@ -1714,11 +1713,12 @@ function MachiningLib.ShortestPathSorting() -- se è una lavorazione if DB_MACH_APPLIED[i].sType ~= 'DISP' then -- inizio - nStartIndex = i EgtOptMachInit() - -- leggere feed dalla macchina - EgtOptMachSetFeeds( 10000, 2000) + -- feed dalla macchina + -- TODO abbassare per considere accelerazioni?? + SetupInfo = BeamData.GetSetupInfo() + EgtOptMachSetFeeds( SetupInfo.dFeedLinearAxesAverage or 10000, SetupInfo.dFeedRotativeAxesAverage or 1000) -- tra gruppi (stage) non si può ottimizzare EgtOptMachSetAllGroupsDependencesAsMandatory( true) diff --git a/Strategies/GeneralParameters.json b/Strategies/GeneralParameters.json index 1ecab86..34f772b 100644 --- a/Strategies/GeneralParameters.json +++ b/Strategies/GeneralParameters.json @@ -106,7 +106,7 @@ "sName": "GEN_dMaxWasteLength", "sNameNge": "GEN_MAX_WASTE_LENGTH", "sValue": "300", - "sDescriptionShort": "Maximum Waste Length for Dice-cut", + "sDescriptionShort": "Maximum length for dropped waste", "sDescriptionLong": "", "sType": "d", "sMessageId": " ", @@ -117,7 +117,18 @@ "sName": "GEN_dMaxWasteVolume", "sNameNge": "GEN_MAX_WASTE_VOLUME", "sValue": "6000000", - "sDescriptionShort": "Maximum Waste Volume for Dice-cut", + "sDescriptionShort": "Maximum volume for dropped waste", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "5" + }, + { + "nGroup": "MACHINING STRATEGY", + "sName": "GEN_dMaxDimDice", + "sNameNge": "GEN_MAX_DIM_DICE", + "sValue": "150", + "sDescriptionShort": "Maximum dice dimension", "sDescriptionLong": "", "sType": "d", "sMessageId": " ", diff --git a/Strategies/Standard/STR0005/STR0005.json b/Strategies/Standard/STR0005/STR0005.json index 085d8d3..aa8f4ba 100644 --- a/Strategies/Standard/STR0005/STR0005.json +++ b/Strategies/Standard/STR0005/STR0005.json @@ -110,26 +110,6 @@ "sMessageId": " ", "sMinUserLevel": "1" }, - { - "sName": "dMinZAngleTopBlade", - "sNameNge": "MIN_Z_ANGLE_TOP_BLADE", - "sValue": "", - "sDescriptionShort": "Min Z angle top blade", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "sName": "dMaxYAngleTopBlade", - "sNameNge": "MAX_Y_ANGLE_TOP_BLADE", - "sValue": "", - "sDescriptionShort": "Max Y angle top blade", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, { "sName": "bFinishWithMill", "sNameNge": "ALLOW_FINISH_MILL", @@ -160,6 +140,11 @@ "sSource": "GEN_dMaxWasteVolume", "sMinUserLevel": "5" }, + { + "sName": "dMaxDimDice", + "sSource": "GEN_dMaxDimDice", + "sMinUserLevel": "5" + }, { "sName": "bReduceBladePath", "sSource": "GEN_bReduceBladePath", diff --git a/Strategies/Standard/STR0005/STR0005.lua b/Strategies/Standard/STR0005/STR0005.lua index 0258667..df2c704 100644 --- a/Strategies/Standard/STR0005/STR0005.lua +++ b/Strategies/Standard/STR0005/STR0005.lua @@ -129,20 +129,9 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) and not bIsTwoFacesCommonEdgeTooLong then AuxiliaryData.bIgnoreNotClampableLength = false - local dMinZTopBlade - local dMaxNyTopBlade local BladeToWasteResult - if Strategy.Parameters.dMinZAngleTopBlade then - dMinZTopBlade = sin( Strategy.Parameters.dMinZAngleTopBlade) - end - if Strategy.Parameters.dMaxYAngleTopBlade then - dMaxNyTopBlade = sin( Strategy.Parameters.dMaxYAngleTopBlade) - end - -- TODO rimuovere dMinNzTopBlade e dMaxNyTopBlade opzionali? non sono gestiti ovunque e probabilmente hanno utilizzo limitato local OptionalParameters = { dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume, dMaxWasteLength = Strategy.Parameters.dMaxWasteLength, - dMinNzTopBlade = dMinZTopBlade, - dMaxNyTopBlade = dMaxNyTopBlade, bSaveAddedGeometries = bAddMachining, dExtendAfterTail = dExtendAfterTail, bAllowFastCuts = Strategy.Parameters.bAllowFastCuts, @@ -174,19 +163,9 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) -- TODO da completare -- TODO va messa per prima???????? if idAddedTmFace then - local dMinZTopBlade - local dMaxNyTopBlade local BladeToWasteResult - if Strategy.Parameters.dMinZAngleTopBlade then - dMinZTopBlade = sin( Strategy.Parameters.dMinZAngleTopBlade) - end - if Strategy.Parameters.dMaxYAngleTopBlade then - dMaxNyTopBlade = sin( Strategy.Parameters.dMaxYAngleTopBlade) - end local OptionalParameters = { dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume, dMaxWasteLength = Strategy.Parameters.dMaxWasteLength, - dMinNzTopBlade = dMinZTopBlade, - dMaxNyTopBlade = dMaxNyTopBlade, bSaveAddedGeometries = bAddMachining, dExtendAfterTail = dExtendAfterTail } diff --git a/Strategies/Standard/STR0012/STR0012.json b/Strategies/Standard/STR0012/STR0012.json index 8c0d083..ff1983f 100644 --- a/Strategies/Standard/STR0012/STR0012.json +++ b/Strategies/Standard/STR0012/STR0012.json @@ -70,26 +70,6 @@ } ] }, - { - "sName": "dMinZAngleTopBlade", - "sNameNge": "MIN_Z_ANGLE_TOP_BLADE", - "sValue": "", - "sDescriptionShort": "Min Z angle top blade", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "sName": "dMaxYAngleTopBlade", - "sNameNge": "MAX_Y_ANGLE_TOP_BLADE", - "sValue": "", - "sDescriptionShort": "Max Y angle top blade", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, { "sName": "dMaxWasteLength", "sSource": "GEN_dMaxWasteLength", diff --git a/Strategies/Standard/STR0012/STR0012.lua b/Strategies/Standard/STR0012/STR0012.lua index 54e714e..9b5bcbc 100644 --- a/Strategies/Standard/STR0012/STR0012.lua +++ b/Strategies/Standard/STR0012/STR0012.lua @@ -105,19 +105,9 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters) -- lavorazione a cubetti facce concave else - local dMinZTopBlade - local dMaxNyTopBlade local BladeToWasteResult - if Strategy.Parameters.dMinZAngleTopBlade then - dMinZTopBlade = sin( Strategy.Parameters.dMinZAngleTopBlade) - end - if Strategy.Parameters.dMaxYAngleTopBlade then - dMaxNyTopBlade = sin( Strategy.Parameters.dMaxYAngleTopBlade) - end local OptionalParameters = { dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume, dMaxWasteLength = Strategy.Parameters.dMaxWasteLength, - dMinNzTopBlade = dMinZTopBlade, - dMaxNyTopBlade = dMaxNyTopBlade, bSaveAddedGeometries = bAddMachining, dExtendAfterTail = dExtendAfterTail, bReduceBladePath = Strategy.Parameters.bReduceBladePath @@ -134,19 +124,9 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters) -- TODO da completare -- TODO va messa per prima???????? if idAddedTmFace then - local dMinZTopBlade - local dMaxNyTopBlade local BladeToWasteResult - if Strategy.Parameters.dMinZAngleTopBlade then - dMinZTopBlade = sin( Strategy.Parameters.dMinZAngleTopBlade) - end - if Strategy.Parameters.dMaxYAngleTopBlade then - dMaxNyTopBlade = sin( Strategy.Parameters.dMaxYAngleTopBlade) - end local OptionalParameters = { dMaxWasteVolume = Strategy.Parameters.dMaxWasteVolume, dMaxWasteLength = Strategy.Parameters.dMaxWasteLength, - dMinNzTopBlade = dMinZTopBlade, - dMaxNyTopBlade = dMaxNyTopBlade, bSaveAddedGeometries = bAddMachining, dExtendAfterTail = dExtendAfterTail, bReduceBladePath = Strategy.Parameters.bReduceBladePath diff --git a/StrategyLibs/BLADETOWASTE.lua b/StrategyLibs/BLADETOWASTE.lua index fbd9dc7..aeae7b0 100644 --- a/StrategyLibs/BLADETOWASTE.lua +++ b/StrategyLibs/BLADETOWASTE.lua @@ -305,6 +305,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters) end -- lama sopra e sotto + -- TODO rivedere con Engagement, MinNzTopBlade e MaxNyTopBlade sono obsoleti!!!!!!!!!!!! if nToolIndexTop and nToolIndexBottom then -- angolo minimo che determina la preferenza tra lama sopra e sotto local dMinNzTopBlade @@ -917,17 +918,13 @@ local function CutWithDicing( Proc, Part, OptionalParameters) 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 - dDiceDimensionReduced = min( dDiceDimension, dDiceDimension - TOOLS[nToolIndex].SetupInfo.dMaxMatDecrease) + local dDiceDimension = min( TOOLS[nToolIndex].dMaxMaterial, Part.GeneralParameters.GEN_dMaxDimDice) dDiceDimension = dDiceDimension - BeamData.CUT_EXTRA - dDiceDimensionReduced = dDiceDimensionReduced - BeamData.CUT_EXTRA -- calcolo cubetti local OptionalParametersDiceCut = {} OptionalParametersDiceCut.dOffsetParallel = dDiceDimension OptionalParametersDiceCut.dOffsetOrthogonal = dDiceDimension - OptionalParametersDiceCut.dOffsetOrthogonalReduced = dDiceDimensionReduced OptionalParametersDiceCut.b3BoxDicing = b3BoxDicing OptionalParametersDiceCut.bSaveAddedGeometries = bSaveAddedGeometries local vCuts = DiceCut.GetDice( Part, Face1, Face2, OptionalParametersDiceCut) @@ -940,6 +937,8 @@ local function CutWithDicing( Proc, Part, OptionalParameters) end -- lavorazione cubetti + local bIsDicingOk + local bMoveAfterSplit local Parameters = { Proc = Proc, Part = Part, @@ -950,8 +949,6 @@ local function CutWithDicing( Proc, Part, OptionalParameters) bReduceBladePath = bReduceBladePath } - local bIsDicingOk - local bMoveAfterSplit bIsDicingOk, Machinings, bMoveAfterSplit = CalculateDiceMachinings( vCuts, Parameters) if not bIsDicingOk then