Skip to content

Commit

Permalink
Fix surface trim curve exporting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur Rauf Bingol committed Apr 17, 2019
1 parent a4ae21a commit 9eebcd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions geomdl/_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,15 @@ def export_dict_surf(obj):

# Trim curves
if obj.trims:
trim_data = dict(count=len(obj.trims))
trim_curve_typemap = dict(spline=export_dict_crv, freeform=export_dict_ff)
trim_curves = []
for trim in obj.trims:
if trim.type in trim_curve_typemap:
tdata = trim_curve_typemap[trim.type](trim)
trim_curves.append(tdata)
data['trims'] = trim_curves
trim_data['data'] = trim_curves
data['trims'] = trim_data

return data

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


def export_dict_str(obj, callback):
count = 1
if obj.pdimension == 1:
export_type = "curve"
data = [export_dict_crv(o) for o in obj]
Expand All @@ -523,7 +524,7 @@ def export_dict_str(obj, callback):
data = dict(
shape=dict(
type=export_type,
count=count,
count=len(obj),
data=tuple(data)
)
)
Expand Down

0 comments on commit 9eebcd5

Please sign in to comment.