public static IndexedGeometry GetIndexedGeometry(
     this PolyMesh mesh,
     PolyMesh.GetGeometryOptions options = PolyMesh.GetGeometryOptions.Default,
     double absoluteEps = 10e-6)
 {
     return(mesh.GetIndexedGeometry(mesh.FaceCount.Range(), options, absoluteEps));
 }
        public static IndexedGeometry GetIndexedGeometry(
            this PolyMesh mesh,
            IEnumerable <int> faceIndices,
            PolyMesh.GetGeometryOptions options = PolyMesh.GetGeometryOptions.Default,
            double absoluteEps = 10e-6
            )
        {
            var faceAttributes       = mesh.FaceAttributes.Keys.Where(k => k.IsPositive).ToArray();
            var vertexAttributes     = mesh.VertexAttributes.Keys.Where(k => k.IsPositive).ToArray();
            var faceVertexAttributes = mesh.FaceVertexAttributes.Keys.Where(k => k.IsPositive).ToArray();
            var instanceAttributes   = mesh.InstanceAttributes.Keys.ToArray();

            return(mesh.GetIndexedGeometry(options, absoluteEps,
                                           faceIndices, faceAttributes, vertexAttributes, faceVertexAttributes,
                                           instanceAttributes));
        }
        public static IndexedGeometry GetIndexedGeometry(
            this PolyMesh mesh,
            PolyMesh.GetGeometryOptions options,
            double absoluteEps,
            IEnumerable <int> faceIndices,
            IEnumerable <Symbol> faceAttributeNames,
            IEnumerable <Symbol> vertexAttributeNames,
            IEnumerable <Symbol> faceVertexAttributeNames,
            IEnumerable <Symbol> instanceAttributeNames)
        {
            var faceBackMap = faceIndices.ToArray();
            var faceAttributeArray
                = (from a in faceAttributeNames
                   select PolyMesh.GetIAttribute(a, mesh.FaceAttributes)).WhereNotNull().ToArray();
            var vertexAttributeArray
                = (from a in vertexAttributeNames
                   select PolyMesh.GetIAttribute(a, mesh.VertexAttributes)).WhereNotNull().ToArray();
            var faceVertexAttributeArray
                = (from a in faceVertexAttributeNames
                   select PolyMesh.GetIAttribute(a, mesh.FaceVertexAttributes)).WhereNotNull().ToArray();

            var instanceAttributes = new SymbolDict <object>();

            foreach (var name in instanceAttributeNames)
            {
                instanceAttributes[name] = mesh.InstanceAttributes[name];
            }

            return(mesh.GetIndexedGeometry(
                       options,
                       absoluteEps,
                       faceBackMap,
                       faceAttributeArray,
                       vertexAttributeArray,
                       faceVertexAttributeArray,
                       instanceAttributes
                       ));
        }