Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
        public static void LCComputeRepeatedPatternSameOrigin(List <MyGroupingSurface> listOfInitialGroupingSurface, ref List <MyPatternOfComponents> listOfPattern,
                                                              ref List <MyPatternOfComponents> listPattern2, ModelDoc2 SwModel, SldWorks swApplication)
        {
            StringBuilder fileOutput = new StringBuilder();

            fileOutput.AppendLine("RICERCA PATH");

            var listOfMyGroupingSurface = new List <MyGroupingSurface>();

            GeometryAnalysis.MainPatternSearch_Part(false, ref listOfMyGroupingSurface, listOfInitialGroupingSurface,
                                                    ref fileOutput, swApplication);

            // Create a file to write to.
            string mydocpath = @"C:\Users\Katia Lupinetti\Desktop\Debug";

            //System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);

            using (StreamWriter outfile = new StreamWriter(mydocpath + @"\PathCreation.txt", true))
            {
                outfile.Write(fileOutput.ToString());
                outfile.Close();
            }
        }