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); }
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; }
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); } }
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); } }
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; }