diff --git a/Strategies/Standard/STR0010/STR0010.lua b/Strategies/Standard/STR0010/STR0010.lua index 48efe24..78521dd 100644 --- a/Strategies/Standard/STR0010/STR0010.lua +++ b/Strategies/Standard/STR0010/STR0010.lua @@ -112,31 +112,31 @@ local function IsPositionOK( Proc, Part) end ------------------------------------------------------------------------------------------------------------- --- TODO da sistemare -local function GetBottomFaceEdge( Proc, nIndexFace) +-- contemplate max 2 facce +local function GetBottomFaceEdge( Proc, Face) local Edge = {} -- si lavora la bottom longitudinalmente if Proc.nFct == 1 or Proc.Topology.sFamily == 'DoubleBevel' then local BottomEdgesSorted = {} - for i = 1, #Proc.MainFaces.BottomFaces[nIndexFace].Edges do - table.insert( BottomEdgesSorted, Proc.MainFaces.BottomFaces[nIndexFace].Edges[i]) + for i = 1, #Face.Edges do + table.insert( BottomEdgesSorted, Face.Edges[i]) end table.sort( BottomEdgesSorted, CompareEdges) + Edge = BottomEdgesSorted[1] - -- edge in comune tra le due facce - elseif Proc.nFct == 2 then - if nIndexFace == 1 then - Edge = Proc.MainFaces.BottomFaces[nIndexFace].MainEdges.LongEdges[1] - elseif nIndexFace == 2 then - Edge = Proc.MainFaces.BottomFaces[nIndexFace].MainEdges.BottomEdge - end + + -- si lavora il lato in comune tra le due facce else - if nIndexFace == 1 then - Edge = Proc.MainFaces.BottomFaces[nIndexFace].MainEdges.LongEdges[1] - elseif nIndexFace == 2 then - Edge = Proc.MainFaces.BottomFaces[nIndexFace].MainEdges.BottomEdge + -- ricerca lato in comune + local nCommonEdge + for i = 1, #Face.Edges do + if Face.Edges[i].idAdjacentFace > -1 then + nCommonEdge = i + end end + + Edge = Face.Edges[nCommonEdge] end return Edge @@ -208,7 +208,7 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters) local bAreAllMachiningsAdded = true local Milling = {} local OptionalParametersFaceByMill = { nStepType = MCH_MILL_ST.ONEWAY, bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail} - local EdgeToMachine = GetBottomFaceEdge( Proc, 1) + local EdgeToMachine = GetBottomFaceEdge( Proc, Proc.MainFaces.BottomFaces[1]) if EdgeToMachine.bIsOpen then OptionalParametersFaceByMill.dDepthToMachine = EdgeToMachine.dElevation + BeamData.CUT_EXTRA end @@ -224,7 +224,7 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters) if dAngleBetweenFaces >= -91 then Milling = {} OptionalParametersFaceByMill = { nStepType = MCH_MILL_ST.ONEWAY, bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail} - EdgeToMachine = GetBottomFaceEdge( Proc, 2) + EdgeToMachine = GetBottomFaceEdge( Proc, Proc.MainFaces.BottomFaces[2]) if EdgeToMachine.bIsOpen then OptionalParametersFaceByMill.dDepthToMachine = EdgeToMachine.dElevation + BeamData.CUT_EXTRA end diff --git a/StrategyLibs/BLADEKEEPWASTE.lua b/StrategyLibs/BLADEKEEPWASTE.lua index 5324037..4997299 100644 --- a/StrategyLibs/BLADEKEEPWASTE.lua +++ b/StrategyLibs/BLADEKEEPWASTE.lua @@ -121,7 +121,6 @@ end function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters) -- TODO verificare funzionamento con lama da sotto -- TODO scelta utensile è corretto lasciarla a FaceByBlade? - -- attenzione perchè se l'inclinazione della faccia la fa finire oltre lo spigolo questo riduce il massimo (come calcolare????) local Result = {} local Machinings = {}