diff options
| author | rejbasket <39080670+rejbasket@users.noreply.github.com> | 2024-07-20 09:20:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-20 09:20:10 +0200 |
| commit | 9c537f33b9eb4d015316a7867a9e6d1eda6cd70c (patch) | |
| tree | b642c94f5a3c12082dc6c725aac99ec47e25b68a | |
| parent | 67b628b5e337d6d28045fe50261096fa9554f495 (diff) | |
shapely arm fix (#3094)
| -rw-r--r-- | .github/workflows/build.yml | 8 | ||||
| -rwxr-xr-x | bin/generate-version-file | 4 | ||||
| -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 |
5 files changed, 15 insertions, 12 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 721de485..8639c0cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -287,7 +287,7 @@ jobs: run: | brew update - brew install gtk+3 pkg-config gobject-introspection geos libffi gettext jq gnu-getopt || true + brew install gtk+3 pkg-config gobject-introspection libffi gettext jq gnu-getopt || true export LDFLAGS="-L/usr/local/opt/libffi/lib" export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" @@ -307,9 +307,9 @@ jobs: pip install pandas pip install pyarrow # remove and build shapely with brew geos version - pip uninstall -y shapely - pip cache remove shapely - pip install -v shapely --no-binary shapely + # pip uninstall -y shapely + # pip cache remove shapely + # pip install -v shapely --no-binary shapely pip install pyinstaller diff --git a/bin/generate-version-file b/bin/generate-version-file index 36c70944..df3d8459 100755 --- a/bin/generate-version-file +++ b/bin/generate-version-file @@ -2,9 +2,9 @@ VERSION="${GITHUB_REF##*/}" OS="${BUILD:-$(uname)}" - +DATE=$(date +"%Y-%m-%d %H:%M") if [[ "$VERSION" == "" ]]; then VERSION="Manual Install" fi -echo "${VERSION} (${OS})" > VERSION +echo "${VERSION} (${OS}) ${DATE}" > VERSION 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 |
