Пример #1
0
        public static TurtleMesh ExportFaceAt(ITurtleMesh m, int index)
        {
            var nm = new TurtleMesh();

            var f  = m.FaceAt(index);
            var nf = new TurtleFace(f.EdgesVerticesCount);

            for (int i = 0; i < f.EdgesVerticesCount; i++)
            {
                nm.AddVertex(new TurtleVertex(m.VertexAt(f[i])));
                nf.Add(i);
            }

            nm.AddFace(nf);

            return(nm);
        }
Пример #2
0
        public static TurtleMesh ExportFaceAt(ITurtleMesh m, int index)
        {
            var nm = new TurtleMesh();

            var f = m.FaceAt(index);
            var nf = new TurtleFace(f.EdgesVerticesCount);

            for (int i = 0; i < f.EdgesVerticesCount; i++)
            {
                nm.AddVertex(new TurtleVertex(m.VertexAt(f[i])));
                nf.Add(i);
            }

            nm.AddFace(nf);

            return nm;
        }
Пример #3
0
        public void AppendOther(ITurtleMesh other)
        {
            int s = _vertices.Count;

            for (int i = 0; i < other.VertexCount; i++)
            {
                _vertices.Add(new TurtleVertex(other.VertexAt(i)));
            }

            for (int i = 0; i < other.FaceCount; i++)
            {
                var of = other.FaceAt(i);
                var nf = new TurtleFace(of.EdgesVerticesCount);
                for (int j = 0; j < of.EdgesVerticesCount; j++)
                {
                    nf.Add(of[j] + s);
                }

                _faces.Add(nf);
            }
        }
Пример #4
0
        public void AppendOther(ITurtleMesh other)
        {
            int s = _vertices.Count;

            for (int i = 0; i < other.VertexCount; i++)
                _vertices.Add(new TurtleVertex(other.VertexAt(i)));

            for (int i = 0; i < other.FaceCount; i++)
            {
                var of = other.FaceAt(i);
                var nf = new TurtleFace(of.EdgesVerticesCount);
                for(int j=0; j<of.EdgesVerticesCount; j++)
                {
                    nf.Add(of[j] + s);
                }

                _faces.Add(nf);
            }
        }
Пример #5
0
        public static TurtleMesh ExtractTMesh(Curve c)
        {
            var m = new TurtleMesh();
            Polyline pl;
            c.TryGetPolyline(out pl);

            TurtleFace f = new TurtleFace(pl.Count - 1);

            for (int j = 0; j < pl.Count - 1; j++)
            {
                var v = pl[j];
                f.Add(m.VertexCount);
                m.AddVertex(new TurtleVertex((float)v.X, (float)v.Y, (float)v.Z));
            }
            m.AddFace(f);
            return m;
        }