Пример #1
0
            private void ProcessFaceLine(SpanInfo[] slashSplit, SpanInfo[] pieces, int count, ReadOnlySpan <char> currentLineText)
            {
                ReadOnlySpan <char> first = pieces[1].Get(currentLineText);

                ObjFile.FaceVertex faceVertex0 = ParseFaceVertex(slashSplit, first, currentLineText);

                for (int i = 0; i < count - 3; i++)
                {
                    ReadOnlySpan <char> second      = pieces[i + 2].Get(currentLineText);
                    ObjFile.FaceVertex  faceVertex1 = ParseFaceVertex(slashSplit, second, currentLineText);
                    ReadOnlySpan <char> third       = pieces[i + 3].Get(currentLineText);
                    ObjFile.FaceVertex  faceVertex2 = ParseFaceVertex(slashSplit, third, currentLineText);

                    DiscoverFace(new ObjFile.Face(faceVertex0, faceVertex1, faceVertex2, _currentSmoothingGroup));
                }
            }
Пример #2
0
            private void ProcessFaceLine(string[] pieces)
            {
                string first = pieces[1];

                ObjFile.FaceVertex faceVertex0 = ParseFaceVertex(first);

                for (int i = 0; i < pieces.Length - 3; i++)
                {
                    string             second      = pieces[i + 2];
                    ObjFile.FaceVertex faceVertex1 = ParseFaceVertex(second);
                    string             third       = pieces[i + 3];
                    ObjFile.FaceVertex faceVertex2 = ParseFaceVertex(third);

                    DiscoverFace(new ObjFile.Face(faceVertex0, faceVertex1, faceVertex2, _currentSmoothingGroup));
                }
            }