ソースを参照

Fix .dxf import

Maftei Albert-Alexandru 4 年 前
コミット
2e3590182f
2 ファイル変更2 行追加3 行削除
  1. 1 1
      appParsers/ParseDXF.py
  2. 1 2
      camlib.py

+ 1 - 1
appParsers/ParseDXF.py

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

+ 1 - 2
camlib.py

@@ -37,7 +37,6 @@ from shapely.geometry import shape
 # Used for solid polygons in Matplotlib
 from descartes.patch import PolygonPatch
 # ---------------------------------------
-
 # Fix for python 3.10
 try:
     from collections import Iterable
@@ -1267,7 +1266,7 @@ class Geometry(object):
 
         merged_lines = linemerge(geos_lines)
         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)
 
         # Add to object