From 01395134ee426b508dd39f2bbf104861c4ef6ed8 Mon Sep 17 00:00:00 2001 From: jan Date: Thu, 7 Sep 2017 21:59:44 -0700 Subject: [PATCH] Also clean vertices before cutting --- masque/shapes/polygon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/masque/shapes/polygon.py b/masque/shapes/polygon.py index b341535..7de2183 100644 --- a/masque/shapes/polygon.py +++ b/masque/shapes/polygon.py @@ -186,7 +186,10 @@ class Polygon(Shape): :return: List of Polygon objects """ import float_raster - xy = (self.offset + self.vertices).T + xy_complex = self.vertices[:, 1] + 1j * self.vertices[:, 2] + xy_cleaned = _clean_complex_vertices(xy_complex) + xy = numpy.vstack((numpy.real(xy_cleaned)[None, :], + numpy.imag(xy_cleaned)[None, :])) if cut_xs is None: cut_xs = tuple()