From 3514f878ee495e87a4f44cc971de242640fab3d4 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sun, 23 Jan 2022 08:36:07 +0100 Subject: multipart geometry in intersect region (#1475) --- lib/stitches/fill.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/stitches/fill.py') diff --git a/lib/stitches/fill.py b/lib/stitches/fill.py index d134be32..21e35d83 100644 --- a/lib/stitches/fill.py +++ b/lib/stitches/fill.py @@ -143,8 +143,8 @@ def intersect_region_with_grating(shape, angle, row_spacing, end_row_spacing=Non res = grating_line.intersection(shape) - if (isinstance(res, shapely.geometry.MultiLineString)): - runs = [line_string.coords for line_string in res.geoms] + if (isinstance(res, shapely.geometry.MultiLineString) or isinstance(res, shapely.geometry.GeometryCollection)): + runs = [line_string.coords for line_string in res.geoms if isinstance(line_string, shapely.geometry.LineString)] else: if res.is_empty or len(res.coords) == 1: # ignore if we intersected at a single point or no points -- cgit v1.2.3