Skip to content

Rescaling issue #6

Description

@braice

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions