question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading big stl file (100mb) leads to no result

See original GitHub issue

Hi, I’m using the hdx:Viewport3DX to display stl files in my WPF application. This is working fine for normal stl files (a few mb big). However once I try to display a bigger file, the Importer gets back null for the result.

This is how I read the file.

private async Task<bool> read3dFile(string path)
        {
            if (path == null)
            {
                return false;
            }
            IsLoadingStl = true;
            bool succeeded = false;
            await Task.Run(() =>
            {
                var loader = new Importer();
                return loader.Load(path, new ImporterConfiguration()
                {
                    EnableParallelProcessing = true,
                });
            }).ContinueWith((result) =>
            {
                if (result.IsCompleted)
                {
                    scene = result.Result;
                    GroupModel.Clear();
                    if (scene != null)
                    {
                        GroupModel.AddNode(scene.Root);
                        succeeded = true;
                    }
                }
                else if (result.IsFaulted && result.Exception != null)
                {
                    MessageBox.Show(result.Exception.Message);
                }
                IsLoadingStl = false;
            }, TaskScheduler.FromCurrentSynchronizationContext());
            Messenger.Default.Send(new NotificationMessage(null, "ZoomToFitStl"));
            IsLoadingStl = false;
            return succeeded;
        }

the result.IsComplete is true, however the result.Result is null. I tried to read the file below: https://www.thingiverse.com/thing:2506681

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
holancecommented, Jan 16, 2021

Seems like you are loading the same file twice. Once using the IxMilia to create a STL object. Then try to use assimp to load again. Maybe the file is locked for reading by IxMilia library, then you try to read the file again using assimp, and failed. I comment out Model = Load(StlFilePath); in Stl.cs constructor and it is working now.

0reactions
AndreasReitbergercommented, Jan 26, 2021

It seems to be assimp to internal issue.

Is there something I can do to fix this? Thanks for looking into this matter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

STL uploading problems - General Discussion
1GB is a very large file–most likely your resolution is too high. I use 3ds Max, so when I print I check what...
Read more >
STL Won't Import (Runtime Error!) - CarveWright Support
Possible Causes. Most likely the STL file is too large. Because the importer is designed to slice up the model and allow for...
Read more >
What are the top STL file errors? Here's how to fix them
Faulty or poorly exported STL files can lead to unexpected results: missing faces, poor resolution or other geometric inaccuracies. Also, the 3D printing ......
Read more >
Need to import 550MB STL file, but Cura won't load it
I've got an STL from a site called terrain2stl, combined all the files in Netfabb, but now Cura won't load it. The file...
Read more >
How to Reduce the File Size of .STL and .OBJ 3D Models
Learn how you can reduce the size of your 3D model files while keeping a high level of ... For example, i.materialise has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found