Skip to content

Commit 9eebcd5

Browse files
committed
Fix surface trim curve exporting issue
1 parent a4ae21a commit 9eebcd5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

geomdl/_exchange.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,15 @@ def export_dict_surf(obj):
361361

362362
# Trim curves
363363
if obj.trims:
364+
trim_data = dict(count=len(obj.trims))
364365
trim_curve_typemap = dict(spline=export_dict_crv, freeform=export_dict_ff)
365366
trim_curves = []
366367
for trim in obj.trims:
367368
if trim.type in trim_curve_typemap:
368369
tdata = trim_curve_typemap[trim.type](trim)
369370
trim_curves.append(tdata)
370-
data['trims'] = trim_curves
371+
trim_data['data'] = trim_curves
372+
data['trims'] = trim_data
371373

372374
return data
373375

@@ -506,7 +508,6 @@ def import_dict_str(file_src, delta, callback, tmpl):
506508

507509

508510
def export_dict_str(obj, callback):
509-
count = 1
510511
if obj.pdimension == 1:
511512
export_type = "curve"
512513
data = [export_dict_crv(o) for o in obj]
@@ -523,7 +524,7 @@ def export_dict_str(obj, callback):
523524
data = dict(
524525
shape=dict(
525526
type=export_type,
526-
count=count,
527+
count=len(obj),
527528
data=tuple(data)
528529
)
529530
)

0 commit comments

Comments
 (0)