Open MaskedRetriever opened 14 years ago
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();
Hm, I think when I wrote this I was convinced generating the file pointer actually loaded the whole file. Hoping I was wrong....
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
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.