diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/elements/satin_column.py | 4 | ||||
| -rw-r--r-- | lib/exceptions.py | 7 | ||||
| -rw-r--r-- | lib/stitches/auto_fill.py | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index 5aa7652c..7c29729d 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -12,6 +12,7 @@ import numpy as np from inkex import paths from shapely import affinity as shaffinity from shapely import geometry as shgeo +from shapely import set_precision from shapely.ops import nearest_points from ..debug.debug import debug @@ -572,7 +573,7 @@ class SatinColumn(EmbroideryElement): @cache def flattened_rails(self): """The rails, as LineStrings.""" - paths = [shgeo.LineString(self.flatten_subpath(rail)) for rail in self.rails] + paths = [set_precision(shgeo.LineString(self.flatten_subpath(rail)), 0.00001) for rail in self.rails] rails_to_reverse = self._get_rails_to_reverse() if paths and rails_to_reverse is not None: @@ -698,7 +699,6 @@ class SatinColumn(EmbroideryElement): rails = list(self.flattened_rails) rungs = self.flattened_rungs cut_points = [[], []] - for rung in rungs: intersections = rung.intersection(shgeo.MultiLineString(rails)) # ignore the rungs that are cutting a rail multiple times diff --git a/lib/exceptions.py b/lib/exceptions.py index 8bef185f..c79c771e 100644 --- a/lib/exceptions.py +++ b/lib/exceptions.py @@ -20,8 +20,11 @@ def get_os_version(): os_ver = "Windows " + platform.release() + " version: " + platform.version() if sys.platform == "darwin": # macOS command line progam provides accurate info than python functions - mac_v = subprocess.run(["sw_vers"], capture_output=True, text=True) - os_ver = str(mac_v.stdout.strip()) + mac_v1 = subprocess.run(["sw_vers"], capture_output=True, text=True) + mac_v1 = str(mac_v1.stdout.strip()) + mac_v2 = subprocess.run(["uname", "-m"], capture_output=True, text=True) + mac_v2 = str(mac_v2.stdout.strip()) + os_ver = mac_v1 + "\nCPU:\t\t\t\t" + mac_v2 if sys.platform == "linux": # Getting linux version method used here is for systemd and nonsystemd linux. try: diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py index d3072df3..7e98e434 100644 --- a/lib/stitches/auto_fill.py +++ b/lib/stitches/auto_fill.py @@ -11,7 +11,7 @@ from typing import Iterator import networkx from shapely import geometry as shgeo -from shapely import make_valid, segmentize +from shapely import make_valid, segmentize, set_precision from shapely.ops import snap, unary_union from shapely.strtree import STRtree @@ -487,7 +487,7 @@ def process_travel_edges(graph, fill_stitch_graph, shape, travel_edges): # This makes the distance calculations below a bit faster. We're # not looking for high precision anyway. - outline = shape.boundary.simplify(0.5 * PIXELS_PER_MM, preserve_topology=False) + outline = set_precision(shape.boundary.simplify(0.5 * PIXELS_PER_MM, preserve_topology=False), 0.000001) for ls in travel_edges: # In most cases, ls will be a simple line segment. If we're |
