mikedh / trimesh

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

Mesh Export Size Difference (Local/Remote) #2242

Open mofibo opened 1 week ago

mofibo commented 1 week 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 6 days 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