Skip to content

Commit

Permalink
add Giulio's mod #RH-30298
Browse files Browse the repository at this point in the history
  • Loading branch information
acormier committed May 23, 2015
1 parent 946c8ed commit 04da973
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions Scripts/rhinoscript/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2053,23 +2053,20 @@ def TrimBrep(object_id, cutter, tolerance=None):
else: cutter = rhutil.coerceplane(cutter, True)
if tolerance is None: tolerance = scriptcontext.doc.ModelAbsoluteTolerance
breps = brep.Trim(cutter, tolerance)
if scriptcontext.id == 2: #gh
return breps
rhobj = rhutil.coercerhinoobject(object_id)
if rhobj:
attr = rhobj.Attributes if scriptcontext.id == 1 else None #no attributes in gh
rc = []
for i in range(len(breps)):
if i==0:
scriptcontext.doc.Objects.Replace(rhobj.Id, breps[i])
rc.append(rhobj.Id)
else:
rc.append(scriptcontext.doc.Objects.AddBrep(breps[i], attr))
else:
rhobj = rhutil.coercerhinoobject(object_id)
if rhobj:
attr = rhobj.Attributes
rc = []
for i in range(len(breps)):
if i==0:
scriptcontext.doc.Objects.Replace(rhobj.Id, breps[i])
rc.append(rhobj.Id)
else:
rc.append(scriptcontext.doc.Objects.AddBrep(breps[i], attr))
else:
rc = [scriptcontext.doc.Objects.AddBrep(brep) for brep in breps]
scriptcontext.doc.Views.Redraw()
return rc
rc = [scriptcontext.doc.Objects.AddBrep(brep) for brep in breps]
scriptcontext.doc.Views.Redraw()
return rc


def TrimSurface( surface_id, direction, interval, delete_input=False):
Expand Down

0 comments on commit 04da973

Please sign in to comment.