This is a mixin class that provides some methods suitable for use with objects that have a set of (x,y) coordinate pairs.
CalcBoundingBox | |
Move | Move(Delta): moves the object by delta, where delta is an (dx, |
SetPoints | Sets the coordinates of the points of the object to Points (NX2 array). |
This is a mixin class that provides some methods suitable for use with objects that have a set of (x,y) coordinate pairs.
Move(Delta): moves the object by delta, where delta is an (dx, dy) pair. Ideally a Numpy array of shape (2,)
Sets the coordinates of the points of the object to Points (NX2 array).
By default, a copy is made, if copy is set to False, a reference is used, iff Points is a NumPy array of Floats. This allows you to change some or all of the points without making any copies.
For example:
Points = Object.Points Points += (5,10) # shifts the points 5 in the x dir, and 10 in the y dir. Object.SetPoints(Points, False) # Sets the points to the same array as it was