fixed shapely 2.0 - added remove doubles to overcuts, overcuts-b and silhouette offset

pull/224/head
palain 2023-01-03 14:30:55 -04:00
rodzic f8e354c46a
commit ee35270166
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -170,6 +170,7 @@ class CamCurveOvercuts(bpy.types.Operator):
return context.active_object is not None and (context.active_object.type in ['CURVE', 'FONT'])
def execute(self, context):
bpy.ops.object.curve_remove_doubles()
o1 = bpy.context.active_object
shapes = utils.curveToShapely(o1)
negative_overcuts = []
@ -177,7 +178,7 @@ class CamCurveOvercuts(bpy.types.Operator):
diameter = self.diameter * 1.001
for s in shapes.geoms:
s = shapely.geometry.polygon.orient(s, 1)
if s.boundary.type == 'LineString':
if s.boundary.geom_type == 'LineString':
loops = [s.boundary]
else:
loops = s.boundary
@ -266,6 +267,7 @@ class CamCurveOvercutsB(bpy.types.Operator):
return context.active_object is not None and context.active_object.type == 'CURVE'
def execute(self, context):
bpy.ops.object.curve_remove_doubles()
o1 = bpy.context.active_object
shapes = utils.curveToShapely(o1)
negative_overcuts = []
@ -609,6 +611,7 @@ class CamOffsetSilhouete(bpy.types.Operator):
context.active_object.type == 'MESH')
def execute(self, context): # this is almost same as getobjectoutline, just without the need of operation data
bpy.ops.object.curve_remove_doubles()
ob = context.active_object
if self.opencurve and ob.type == 'CURVE':
bpy.ops.object.duplicate()

Wyświetl plik

@ -83,7 +83,7 @@ def shapelyToCoords(anydata):
# print(p.geom_type)
if p.is_empty:
return seq
elif p.type == 'Polygon':
elif p.geom_type == 'Polygon':
# print('polygon')
clen = len(p.exterior.coords)