fstl

A fast STL file viewer
git clone https://git.sinitax.com/fstl/fstl
Log | Files | Refs | README | sfeed.txt

commit a5726c8461fbd277ee03723e75f7094f3bdddebb
parent dfd243a7a669154eac0eff33bf8def38823c5f40
Author: Jakob Haufe <sur5r@sur5r.net>
Date:   Fri, 26 May 2023 11:26:23 +0200

Wait for the STL file size to stop changing.

Fixes #37.

It's the approach from #106 but using Qt only.

Diffstat:
Msrc/loader.cpp | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/loader.cpp b/src/loader.cpp @@ -116,6 +116,15 @@ Mesh* Loader::load_stl() return NULL; } + qint64 file_size, file_size_old; + file_size = file.size(); + do { + file_size_old = file_size; + usleep(100000); + file_size = file.size(); + } + while(file_size != file_size_old); + // First, try to read the stl as an ASCII file if (file.read(5) == "solid") {