Skip to content

Rescaling issue #6

@braice

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

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