algorithmic modeling for Rhino
I want to loft a surf from 2 curves in python and I found that Rhino.Geometry.Brep.CreateFromLoft()method seems work for me. this is the code:
import rhinoscriptsyntax as rs
# the Rhino Common SDK access
import Rhino
import Rhino.Geometry as rg
# scriptcontext
import scriptcontext as sc
from System.Collections.Generic import IEnumerable
#######################################
c = rs.coercecurve(crvs)
print(c)
print type(c)
# define Corner None style
CurveOffsetNoneStyle = 0
loftTypeNormal = 0
working_plane = rg.Plane.WorldXY
d = 2000
tol = 0.0001
c.PointAtStart
c.PointAtEnd
# create outside and inside offset curves
c_l = c.Offset(working_plane, d, tol, CurveOffsetNoneStyle)
c_r = c.Offset(working_plane, -d, tol, CurveOffsetNoneStyle)
base_crvs = [c_l, c_r]
a = rg.Brep.CreateFromLoft(curves=base_crvs, start=None, end=None, loftType=loftTypeNormal, closed=True)
# what the fuck IEnumerable?????
when running in grasshopper I got an error:
Runtime error (ArgumentTypeException): expected IEnumerable[Curve], got list
Traceback:
line 33, in script
so How to create a IEnumerable list for CreateFromLoft()to use in python?? looks like it's a c# collection I somehow I tried to search usage from msdn but seems too greek for me. many thanks!!!!
Tags:
I think c_l = c.Offset returns a collection of curves, not a single curve. So your base_crvs = [c_l, c_r] is actually a collection of two collections of curves. Offset expects a collection containing curves.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by