Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STL Load Progress Bar is Weak #6

Open
MaskedRetriever opened this issue Aug 7, 2010 · 3 comments
Open

STL Load Progress Bar is Weak #6

MaskedRetriever opened this issue Aug 7, 2010 · 3 comments

Comments

@MaskedRetriever
Copy link
Owner

Threading the STL load is a great idea in that the applet starts up right away, even with big meshes. However the STL loading operation doesn't really support giving the user a clear idea of how long this is taking at the moment. For now I'm going to add a message to the progress bar to the effect of "this may take a while".

Not ideal, obviously.

@revarbat
Copy link
Collaborator

revarbat commented Aug 9, 2010

Easy solution: at the start of STL file load, get the file size, then keep track of how many bytes you've read of the file, then fill in the progress bar based on what percentage of the file you've read in bytes.

File file = new File("filename.stl");
long length = file.length();

@MaskedRetriever
Copy link
Owner Author

Hm, I think when I wrote this I was convinced generating the file pointer actually loaded the whole file. Hoping I was wrong....

@MaskedRetriever
Copy link
Owner Author

Oh wait, here it is:
byte b[] = loadBytes(FileName);

This does the entire file load as one operation (in terms of Processing at least) meaning I'll have to break it up somehow if I want the speedup...
And it happens in the Mesh Constructor. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants