diff --git a/LuaLibs/BasicCustomerStrategies.lua b/LuaLibs/BasicCustomerStrategies.lua index 85e2473..03e2193 100644 --- a/LuaLibs/BasicCustomerStrategies.lua +++ b/LuaLibs/BasicCustomerStrategies.lua @@ -57,7 +57,7 @@ local function GetStrategies_Egalware( Proc) --------------------------------------------------------------------- -- Feature : Longitudinal Cut (0-10) elseif ID.IsLongitudinalCut( Proc) then - Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}, { sStrategyId = 'STR0010'}} + Strategies = { { sStrategyId = 'STR0005'}, { sStrategyId = 'STR0010'}} --------------------------------------------------------------------- -- Feature : Double Cut (1-11) elseif ID.IsDoubleCut( Proc) then @@ -108,6 +108,7 @@ local function GetStrategies_Egalware( Proc) --------------------------------------------------------------------- -- Feature : Birds Mouth (0-20) elseif ID.IsBirdsMouth( Proc) then + Strategies = { { sStrategyId = 'STR0002'}} --------------------------------------------------------------------- -- Feature : Hip or Valley Rafter Notch (0-25) elseif ID.IsHipValleyRafterNotch( Proc) then @@ -168,6 +169,9 @@ local function GetStrategies_Egalware( Proc) --------------------------------------------------------------------- -- Feature : Block Haus (0-33) elseif ID.IsBlockHaus( Proc) then + if Proc.Topology.sName == 'Groove-3-Through' then + Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}, { sStrategyId = 'STR0004'}} + end --------------------------------------------------------------------- -- Feature : Notch (0-34) elseif ID.IsNotch( Proc) then @@ -377,7 +381,7 @@ local function GetStrategies_Essetre( Proc) --------------------------------------------------------------------- -- Feature : Longitudinal Cut (0-10) elseif ID.IsLongitudinalCut( Proc) then - Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0005'}, { sStrategyId = 'STR0010'}} + Strategies = { { sStrategyId = 'STR0005'}, { sStrategyId = 'STR0010'}} --------------------------------------------------------------------- -- Feature : Double Cut (1-11) elseif ID.IsDoubleCut( Proc) then @@ -428,6 +432,7 @@ local function GetStrategies_Essetre( Proc) --------------------------------------------------------------------- -- Feature : Birds Mouth (0-20) elseif ID.IsBirdsMouth( Proc) then + Strategies = { { sStrategyId = 'STR0002'}} --------------------------------------------------------------------- -- Feature : Hip or Valley Rafter Notch (0-25) elseif ID.IsHipValleyRafterNotch( Proc) then @@ -488,6 +493,9 @@ local function GetStrategies_Essetre( Proc) --------------------------------------------------------------------- -- Feature : Block Haus (0-33) elseif ID.IsBlockHaus( Proc) then + if Proc.Topology.sName == 'Groove-3-Through' then + Strategies = { { sStrategyId = 'STR0002'}, { sStrategyId = 'STR0003'}, { sStrategyId = 'STR0004'}} + end --------------------------------------------------------------------- -- Feature : Notch (0-32) elseif ID.IsNotch( Proc) then @@ -689,7 +697,7 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet) -- Feature : Cut (1-340) if ID.IsHeadCut( Proc) then - -- Per Essetre nion esiste il taglio di testa, quindi si leggono le variabili Q sul processing che coincide con il taglio di testa + -- Per Essetre non esiste il taglio di testa, quindi si leggono le variabili Q sul processing che coincide con il taglio di testa if sStrategyIdToGet == 'HEADCUT' then local dDepthChamfer = 0 -- eventuali informazioni da recuperare sulla feature sostituita diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 0b1967c..cc8b00c 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -533,6 +533,8 @@ function BeamExec.CalcMinUnloadableRaw( dRawW, dRawH) else BeamData.dMinRaw = BeamData.MINRAW_L end + -- lettura minimo pezzo pinzabile + BeamData.dMinClampRaw = BeamData.LEN_VERY_SHORT_PART or 400 end end diff --git a/LuaLibs/FeatureLib.lua b/LuaLibs/FeatureLib.lua index 5036ef8..19c4e96 100644 --- a/LuaLibs/FeatureLib.lua +++ b/LuaLibs/FeatureLib.lua @@ -62,6 +62,8 @@ function FeatureLib.NeedTopologyFeature( Proc) return true elseif ID.IsFrontSlot( Proc) then return true + elseif ID.IsBirdsMouth( Proc) then + return true elseif ID.IsRidgeLap( Proc) then return true elseif ID.IsLapJoint( Proc) then @@ -78,6 +80,8 @@ function FeatureLib.NeedTopologyFeature( Proc) -- calcolo topologia da geometria SOLO se non raggiata elseif ID.IsFrontMortise( Proc) and Proc.nFct < 6 then return true + elseif ID.IsBlockHaus( Proc) then + return true end -- se feature non tra quelle sopra, riconoscimento topologico non necessario diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 77338c8..dbb99f9 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -74,8 +74,9 @@ end ------------------------------------------------------------------------------------------------------------- -- TODO valutare se c'è un modo più preciso di prevedere i casi in cui le lavorazioni dopo separazione sono da saltare function MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part) + -- TODO controllare. Serve passare anche la posizione per capire il restante. Considerare anche HCING e TCING local bCanMoveAfterSplitcut = ( Part.dLength > BeamData.dMinRaw + 10 * GEO.EPS_SMALL) - and ( dLengthOnX < 0.7 * Part.dLength - 10 * GEO.EPS_SMALL) + or ( dLengthOnX < 0.7 * Part.dLength - 10 * GEO.EPS_SMALL and Part.dLength - dLengthOnX > BeamData.dMinClampRaw) return bCanMoveAfterSplitcut end @@ -1015,8 +1016,14 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part) local idPocketingPath = EgtPocketing( idFaceContour, TOOLS[Machining.nToolIndex].dDiameter / 2, TOOLS[Machining.nToolIndex].dSideStep, 0, Machining.nSubType, true, nAddGroupId) local dPocketingPathLength = EgtCurveLength( idPocketingPath) -- calcolo lunghezze e tempi totali - dLengthToMachineAllStepsWithLeadInOut = dPocketingPathLength * nSteps - dTimeToMachineTotal = dLengthToMachineAllStepsWithLeadInOut / dToolFeed + if dPocketingPathLength then + dLengthToMachineAllStepsWithLeadInOut = dPocketingPathLength * nSteps + dTimeToMachineTotal = dLengthToMachineAllStepsWithLeadInOut / dToolFeed + -- se percorso non calcolato, si settano dati molto alti + else + dLengthToMachineAllStepsWithLeadInOut = 99999 * nSteps + dTimeToMachineTotal = dLengthToMachineAllStepsWithLeadInOut / dToolFeed + end -- le geometrie create si settano da cancellare EgtSetLevel( idFaceContour, GDB_LV.TEMP) EgtSetLevel( idPocketingPath, GDB_LV.TEMP) diff --git a/Strategies/Standard/STR0002/STR0002.lua b/Strategies/Standard/STR0002/STR0002.lua index 453037f..3bb536c 100644 --- a/Strategies/Standard/STR0002/STR0002.lua +++ b/Strategies/Standard/STR0002/STR0002.lua @@ -34,6 +34,7 @@ local function IsTopologyOk( Proc) Proc.Topology.sName == 'Bevel-3-Blind' or Proc.Topology.sName == 'Rabbet-2-Through' or Proc.Topology.sName == 'DoubleBevel-2-Through' or + Proc.Topology.sName == 'VGroove-2-Through' or Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'Bevel-1-Through' then @@ -120,6 +121,7 @@ local function GetBestPocketingStrategy( Proc) ToolSearchParameters.dMaxToolDiameter = Strategy.Parameters.dMaxCornerRadius * 2 elseif Proc.Topology.sName == 'Rabbet-2-Through' or Proc.Topology.sName == 'DoubleBevel-2-Through' + or Proc.Topology.sName == 'VGroove-2-Through' or Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'Bevel-1-Through' then @@ -157,7 +159,7 @@ local function GetBestPocketingStrategy( Proc) -- caso speciale 'Rabbet-2-Through' seconda faccia principale Milling = {} Milling.bIsApplicable = false - if Proc.Topology.sName == 'Rabbet-2-Through' or Proc.Topology.sName == 'DoubleBevel-2-Through' then + if Proc.Topology.sName == 'Rabbet-2-Through' or Proc.Topology.sName == 'DoubleBevel-2-Through' or Proc.Topology.sName == 'VGroove-2-Through' then ToolSearchParameters.dElevation = Proc.MainFaces.BottomFaces[2].dElevation ToolSearchParameters.vtToolDirection = Proc.MainFaces.BottomFaces[2].vtN Milling.vtFaceNormal = Proc.MainFaces.BottomFaces[2].vtN @@ -193,7 +195,7 @@ local function GetBestPocketingStrategy( Proc) Milling.idFaceToMachine = Proc.MainFaces.LongFaces[1].id Milling.idProc = Proc.id Milling.dElevation = Proc.MainFaces.LongFaces[1].dElevation - else -- 'Tunnel-4-Through', 'Groove-3-Through', 'Rabbet-2-Through' + else -- 'Tunnel-4-Through', 'Groove-3-Through', 'Rabbet-2-Through', 'VGroove-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 @@ -219,7 +221,7 @@ local function GetBestPocketingStrategy( Proc) Milling = {} Milling.bIsApplicable = false 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 + if Proc.MainFaces.TunnelAddedFaces then -- Tunnel-4-Through, Groove-3-Through, Rabbet-2-Through, VGroove-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 @@ -271,7 +273,8 @@ local function GetBestPocketingStrategy( Proc) 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 + elseif ( Proc.Topology.sName == 'Rabbet-2-Through' or Proc.Topology.sName == 'VGroove-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) diff --git a/Strategies/Standard/STR0006/STR0006.lua b/Strategies/Standard/STR0006/STR0006.lua index d047d13..c762144 100644 --- a/Strategies/Standard/STR0006/STR0006.lua +++ b/Strategies/Standard/STR0006/STR0006.lua @@ -80,7 +80,11 @@ function GetTenonStrategy( Proc, Part) if bMachIsOk then Machining.Milling.bIsApplicable = true -- calcolo passate necessarie - Machining.nMillingPathsNeeded = ceil( Proc.FeatureInfo.dTenonMaxDist / TOOLS[Machining.Milling.ToolInfo.nToolIndex].dSideStep) + if Proc.FeatureInfo.dTenonMaxDist > TOOLS[Machining.Milling.ToolInfo.nToolIndex].dDiameter then + Machining.nMillingPathsNeeded = ceil( Proc.FeatureInfo.dTenonMaxDist / TOOLS[Machining.Milling.ToolInfo.nToolIndex].dSideStep) + else + Machining.nMillingPathsNeeded = 1 + end local ParametersMRR = {} ParametersMRR.nToolIndex = Machining.Milling.ToolInfo.nToolIndex Result.Milling.dMRR = MachiningLib.GetToolMRR( ParametersMRR) @@ -243,6 +247,9 @@ function STR0006.Make( bAddMachining, Proc, Part, CustomParameters) Strategy.Machining.Milling.nType = MCH_MY.MILLING Strategy.Machining.Milling.vtToolDirection = Proc.FeatureInfo.vtTenonN Strategy.Machining.Milling.sDepth = min( -Strategy.Machining.Milling.ToolInfo.dResidualDepth, 0) + Strategy.Machining.Milling.Steps = {} + Strategy.Machining.Milling.Steps.dStep = TOOLS[Strategy.Machining.Milling.ToolInfo.nToolIndex].dStep + Strategy.Machining.Milling.Steps.nStepType = MCH_MILL_ST.ONEWAY local nNearSide -- +3 = Z+, -3 = Z- local bShortPart = ( Part.b3Part:getDimX() < BeamData.LEN_SHORT_PART) @@ -281,7 +288,12 @@ function STR0006.Make( bAddMachining, Proc, Part, CustomParameters) Strategy.Machining.Milling.sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( Proc.FeatureInfo.dTenonLength, 1)) .. ';' - -- TODO calcolare SCC + -- SCC : si tiene il motore sempre più verso l'esterno + if Proc.AffectedFaces.bLeft then + Strategy.Machining.Milling.nSCC = MCH_SCC.ADIR_XM + else + Strategy.Machining.Milling.nSCC = MCH_SCC.ADIR_XP + end -- passate con sovramateriale AuxiliaryData.Clones = {}