- import rhinoscriptsyntax as rs
- def getcolor(parameter):
- red = 255*parameter
- if red > 255:
- red = 255
- if red < 0:
- red = 0
- return (red,0,255-red)
- def dividecurve(curve_id,parameter):
- domain = rs.CurveDomain(curve_id)
- t_curve = domain[0] + (domain[1] - domain[0])*parameter
- point = rs.EvaluateCurve(curve_id,t_curve)
- if point:
- line = rs.AddLine(point,[0,0,0])
- line = rs.ObjectColor(line,getcolor(parameter))
- def main():
- curve_id = rs.GetObject('select a curve please:',rs.filter.curve,True,False)
- global t
- t = 0
- while t <= 1:
- dividecurve(curve_id,t)
- t += 0.002
- main()
复制代码 想请教各位大神、如何将一个可以在rhinopython中运行的代码放在ghpyth中运行、、需要改些什么、注意事项又有哪些啊?以这个为例、效果大概如图、、不知道有没有大神可以帮忙改改看、小弟在这里万分感谢啊!!!
|