Maftei Albert-Alexandru 4 rokov pred
rodič
commit
2e3590182f
2 zmenil súbory, kde vykonal 2 pridanie a 3 odobranie
  1. 1 1
      appParsers/ParseDXF.py
  2. 1 2
      camlib.py

+ 1 - 1
appParsers/ParseDXF.py

@@ -5,7 +5,7 @@
 # MIT Licence                                              #
 # MIT Licence                                              #
 # ##########################################################
 # ##########################################################
 
 
-from shapely.geometry import LineString
+from shapely.geometry import LineString, Point
 from shapely.affinity import rotate
 from shapely.affinity import rotate
 # Vector was an older name for Vec3; try both for backward compatibility:
 # Vector was an older name for Vec3; try both for backward compatibility:
 try:
 try:

+ 1 - 2
camlib.py

@@ -37,7 +37,6 @@ from shapely.geometry import shape
 # Used for solid polygons in Matplotlib
 # Used for solid polygons in Matplotlib
 from descartes.patch import PolygonPatch
 from descartes.patch import PolygonPatch
 # ---------------------------------------
 # ---------------------------------------
-
 # Fix for python 3.10
 # Fix for python 3.10
 try:
 try:
     from collections import Iterable
     from collections import Iterable
@@ -1267,7 +1266,7 @@ class Geometry(object):
 
 
         merged_lines = linemerge(geos_lines)
         merged_lines = linemerge(geos_lines)
         geos = geos_polys
         geos = geos_polys
-        for l in merged_lines:
+        for l in list(map(LineString, zip(merged_lines.coords[:-1], merged_lines.coords[1:]))):
             geos.append(l)
             geos.append(l)
 
 
         # Add to object
         # Add to object