wolph / numpy-stl

Simple library to make working with STL files (and 3D objects in general) fast and easy.
http://numpy-stl.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
605 stars 103 forks source link

Scale at file import #144

Closed Pentaerythritol closed 3 years ago

Pentaerythritol commented 3 years ago

Hello !

I have an issue with with stl file from Catia V5 where the files are imported in meter instead of millimeters. Is there a solution to scale the whole mesh object without scaling by hand every objects?

Thanks

wolph commented 3 years ago

It should be pretty simple actually :)

I think this should work:

stl_file = stl.StlMesh(input_filename)
stl_file.vectors /= 1000
stl_file.save(output_filename)
Pentaerythritol commented 3 years ago

Sorry for the late answer, but it worked nicely, thanks !

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.