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

Rescaling issue #6

Open
braice opened this issue Oct 21, 2016 · 0 comments
Open

Rescaling issue #6

braice opened this issue Oct 21, 2016 · 0 comments

Comments

@braice
Copy link

braice commented Oct 21, 2016

Hello

I found a bug in the handling of the max size in numpy2stl.py

When the condition is triggered on one dimension, all the scale values are changed at the same time instead of the dimension in question, meaning that lines like
xsize = facets[:, 3::3].ptp()
if xsize > max_width:
facets = facets * float(max_width) / xsize

should become

xsize = facets[:, 3::3].ptp()
if xsize > max_width:
    facets[:, 3::3] = facets[:, 3::3] * float(max_width) / xsize

Then it fixes the issue (with the proper indices)

Brice

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