public static void BuildNewComposedPatternOfComponentsOfLength2(StringBuilder fileOutput, string typeOfNewComposedPattern, ref List <MyComposedPatternOfComponents> listOfComposedPattern, ref List <MyComposedPatternOfComponents> listOfComposedPatternTwo, List <MyPatternOfComponents> listOfPatternsToConsider) { var listOfPathOfCentroids = new List <MyPathOfPoints>(); var listOfMyMatrAdj = new List <MyMatrAdj>(); var newListOfPatterns = new List <MyPatternOfComponents>(); newListOfPatterns.Add(listOfPatternsToConsider[0]); newListOfPatterns.Add(listOfPatternsToConsider[1]); var newComposedPatternGeomObject = FunctionsLC.LinePassingThrough( listOfPatternsToConsider[0].patternCentroid, listOfPatternsToConsider[1].patternCentroid); var newComposedPatternType = typeOfNewComposedPattern; var newComposedPattern = new MyComposedPatternOfComponents(newListOfPatterns, newComposedPatternGeomObject, newComposedPatternType); GeometryAnalysis.CheckAndUpdate_Assembly_ComposedPatterns(newComposedPattern, ref listOfPathOfCentroids, listOfPatternsToConsider, ref listOfMyMatrAdj, ref listOfComposedPattern, ref listOfComposedPatternTwo); }
public static bool GetComposedPatternsFromPathCircum_Assembly(MyPathOfPoints currentPathOfCentroids, List <MyPatternOfComponents> listOfCoherentPatterns, ref List <MyPathOfPoints> listOfPathsOfCentroids, ref List <MyMatrAdj> listOfMyMatrAdj, ref List <MyComposedPatternOfComponents> listOfOutputComposedPattern, ref List <MyComposedPatternOfComponents> listOfOutputComposedPatternTwo, SldWorks SwApplication, ref StringBuilder fileOutput) { var numOfPatterns = currentPathOfCentroids.path.Count; var noStop = true; var listOfPatternOnThePath = currentPathOfCentroids.path.Select(ind => listOfCoherentPatterns[ind]).ToList(); var pathCircumference = (MyCircumForPath)currentPathOfCentroids.pathGeometricObject; var i = 0; while (i < (numOfPatterns - 1)) { var newComposedPattern = new MyComposedPatternOfComponents(); var foundNewComposedPattern = GetMaximumRotation_Assembly_ComposedPatterns(listOfPatternOnThePath, pathCircumference, ref i, ref numOfPatterns, ref noStop, ref newComposedPattern, SwApplication, ref fileOutput); if (foundNewComposedPattern) { if (newComposedPattern.ListOfMyPatternOfComponents.Count == numOfPatterns || newComposedPattern.ListOfMyPatternOfComponents.Count == numOfPatterns - 1) { noStop = true; } GeometryAnalysis.CheckAndUpdate_Assembly_ComposedPatterns(newComposedPattern, ref listOfPathsOfCentroids, listOfCoherentPatterns, ref listOfMyMatrAdj, ref listOfOutputComposedPattern, ref listOfOutputComposedPatternTwo); } } if (noStop) { return(true); } return(false); }
public static bool GetComposedPatternsFromPathLine_Assembly(MyPathOfPoints currentPathOfCentroids, List <MyPatternOfComponents> listOfParallelPatterns, ref List <MyPathOfPoints> listOfPathsOfCentroids, ref List <MyMatrAdj> listOfMyMatrAdj, ref List <MyComposedPatternOfComponents> listOfOutputComposedPattern, ref List <MyComposedPatternOfComponents> listOfOutputComposedPatternTwo) { var numOfPatterns = currentPathOfCentroids.path.Count; var noStop = true; var listOfPatternOnThePath = currentPathOfCentroids.path.Select(ind => listOfParallelPatterns[ind]).ToList(); var i = 0; while (i < (numOfPatterns - 1)) { var newComposedPattern = new MyComposedPatternOfComponents(); var foundNewComposedPattern = GetMaximumTranslation_Assembly_ComposedPatterns(listOfPatternOnThePath, currentPathOfCentroids.pathGeometricObject, ref i, ref numOfPatterns, ref noStop, ref newComposedPattern); if (foundNewComposedPattern) { if (newComposedPattern.ListOfMyPatternOfComponents.Count == numOfPatterns || newComposedPattern.ListOfMyPatternOfComponents.Count == numOfPatterns - 1) { noStop = true; } GeometryAnalysis.CheckAndUpdate_Assembly_ComposedPatterns(newComposedPattern, ref listOfPathsOfCentroids, listOfParallelPatterns, ref listOfMyMatrAdj, ref listOfOutputComposedPattern, ref listOfOutputComposedPatternTwo); } } if (noStop) { return(true); } return(false); }