Skip to content

Numerical issues #13

@dli7319

Description

@dli7319

When I run generate_perlin_noise_2d((721, 1281), (7, 7), (True, True))
I get the following issue:
ValueError: operands could not be broadcast together with shapes (722,1281,2) (721,1281,2)

This can be fixed by enumerating the grid manually instead of using np.mgrid:

    grid = np.stack(np.meshgrid(
        np.arange(0, shape[1]) * res[1] / shape[1],
        np.arange(0, shape[0]) * res[0] / shape[0],
    )[::-1], axis=-1)

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