Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Writing STL to buffer fails #1443

Open
wayofsamu opened this issue Nov 21, 2023 · 0 comments
Open

[BUG] Writing STL to buffer fails #1443

wayofsamu opened this issue Nov 21, 2023 · 0 comments

Comments

@wayofsamu
Copy link

Hey,

Thank you for your awesome tool.
A small bug occurred, when I tried to write a stl file to buffer.

--> [254](https://file+.vscode-resource.vscode-cdn.net/run/media/samuels/Volume/TracOptic%20Progress/UNOTT_CSI/venv310/lib/python3.10/site-packages/meshio/stl/_stl.py:254) a.tofile(fh)

UnsupportedOperation: fileno

I would change

a.tofile(fh)

to

if is_buffer(filename, "wb"):
    fh.write(a.tobytes())
else:
    a.tofile(fh)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant