mikedh / trimesh

Python library for loading and using triangular meshes.
https://trimesh.org
MIT License
3.02k stars 583 forks source link

Mesh Export Size Difference (Local/Remote) #2242

Closed mofibo closed 4 months ago

mofibo commented 5 months ago

Hello,

I noticed that when I export a mesh using:

mesh_var.export("path")

the file size is smaller than when I use:

file_obj = trimesh.exchange.stl.export_stl(mesh_var)
requests.put(url, data=file_obj, headers={"Content-Type": "application/octet-stream"})

For this example, in local, it is 15MB and remote 42MB

Can anyone explain why the sizes are different?

Thanks!

mikedh commented 5 months ago

Hey, is it possible it's the difference between binary and ASCII STL exports?

In [9]: m = trimesh.creation.icosphere()

In [10]: len(m.export(file_type='stl_ascii'))
Out[10]: 371039

In [11]: len(m.export(file_type='stl'))
Out[11]: 64084