Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions TouchTerrain_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,26 +214,25 @@ def main():
zip_ref.close()
print("unzipped file inside", full_zip_file_name, "into", folder)

# Optional: show the STL files in a browser
import k3d
# get all stl files in that folder
from glob import glob
mesh_files = glob(folder + os.sep + "*.stl")
print "in folder", folder, "using", mesh_files

plot = k3d.plot()

for m in mesh_files:
print m
buf = open(m, 'rb').read()
#buf = str(stl_model)
#buf = buf.encode('utf_32')
print buf[:100]
plot += k3d.stl(buf)

plot.display()


# Optional: show the STL files in a browser
if 1: # set this to 0 if you don't want to show STL files in browser
import k3d
# get all stl files in that folder
from glob import glob
mesh_files = glob(folder + os.sep + "*.stl")
print("in folder", folder, "using", mesh_files)

plot = k3d.plot()

for m in mesh_files:
print(m)
buf = open(m, 'rb').read()
#buf = str(stl_model)
#buf = buf.encode('utf_32')
print(buf[:100])
plot += k3d.stl(buf)

plot.display()

if __name__ == "__main__":

Expand Down