public virtual bool Extrude() { MeshEditor editor = new MeshEditor(Mesh); editor.SeparateTriangles(Triangles, true, out EdgePairs); MeshNormals normals = null; bool bHaveNormals = Mesh.HasVertexNormals; if (!bHaveNormals) { normals = new MeshNormals(Mesh); normals.Compute(); } ExtrudeVertices = new MeshVertexSelection(Mesh); ExtrudeVertices.SelectTriangleVertices(Triangles); Vector3d[] NewVertices = new Vector3d[ExtrudeVertices.Count]; int k = 0; foreach (int vid in ExtrudeVertices) { Vector3d v = Mesh.GetVertex(vid); Vector3f n = (bHaveNormals) ? Mesh.GetVertexNormal(vid) : (Vector3f)normals.Normals[vid]; NewVertices[k++] = ExtrudedPositionF(v, n, vid); } k = 0; foreach (int vid in ExtrudeVertices) { Mesh.SetVertex(vid, NewVertices[k++]); } SetGroupID = Group.GetGroupID(Mesh); JoinTriangles = editor.StitchUnorderedEdges(EdgePairs, SetGroupID); return(true); }