Ejemplo n.º 1
0
        public Task <bool> Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath, IProgress <ProgressStatus> progress, CancellationToken cancellationToken)
        {
            if (libraryItems.OfType <ILibraryAsset>().FirstOrDefault() is ILibraryAsset libraryItem)
            {
                return(MeshExport.ExportMesh(libraryItem, outputPath));
            }

            return(Task.FromResult(false));
        }
Ejemplo n.º 2
0
        public Task <bool> Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath)
        {
            if (libraryItems.OfType <ILibraryAsset>().FirstOrDefault() is ILibraryAsset libraryItem)
            {
                return(MeshExport.ExportMesh(libraryItem, outputPath));
            }

            return(Task.FromResult(false));
        }
Ejemplo n.º 3
0
        public async Task <List <ValidationError> > Generate(IEnumerable <ILibraryItem> libraryItems, string outputPath, IProgress <ProgressStatus> progress, CancellationToken cancellationToken)
        {
            var firstItem = libraryItems.OfType <ILibraryAsset>().FirstOrDefault();

            if (firstItem is ILibraryAsset libraryItem)
            {
                if (MeshExport.ExportMesh(libraryItem, outputPath).Result)
                {
                    return(null);
                }
            }

            return(new List <ValidationError>()
            {
                new ValidationError()
                {
                    Error = "Item cannot be exported as STL".Localize(),
                    Details = firstItem?.ToString() ?? ""
                }
            });
        }