Skip to content

creating line2d instances with numpy arrays of coordinates - problems #736

Closed
@jmfloyd

Description

@jmfloyd

I was creating a number of lines, using a dummy array that I kept changing the coordinate values in. This results in all lines effectively having the same coordinates (as the last line created) if queried with pick or other means, even though they plot up properly (not sure why). If I do the line construct with a numpy copy(), it works properly. Obviously a numpy reference is stored in the instance, of course that reference does not change though the values in the numpy data does. Hence the behaviour. No errors reported.

Change the coords to lists - all works.

Possible fix - test for array and do a copy or create a list from it. Need to ensure a reference to the original is not kept,as it may keep changing.

Can provide a short code example.

Using V1.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions