NCF参数化建筑论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: f(x)
打印 上一主题 下一主题

[相关书籍] RhinoScript深入教程

[复制链接]
41m
发表于 2010-3-23 11:04:35 | 只看该作者
好......................
42m
发表于 2010-3-26 23:28:18 | 只看该作者
好棒的表現  我喜歡
43m
发表于 2010-4-17 23:58:38 | 只看该作者
从看例子开始,当觉得没什么好看时事就成了
44m
发表于 2010-4-26 20:52:51 | 只看该作者
太好了 太好了太好了太好了 太好了太好了太好了 太好了太好了太好了 太好了太好了太好了 太好了太好了太好了 太好了太好了
45m
发表于 2010-5-16 20:22:16 | 只看该作者
very useful
46m
发表于 2010-5-16 20:56:05 | 只看该作者
希望多一些这样的东西给初学者
47m
发表于 2010-5-16 20:56:34 | 只看该作者
very useful~~~
48m
发表于 2010-5-18 12:16:00 | 只看该作者
难呀,一个个学吧
49m
发表于 2010-5-18 22:03:18 | 只看该作者
现在还看不懂  不过感谢楼主的分享精神
50m
发表于 2010-6-4 11:01:13 | 只看该作者
Rhino 4.0 RS6版有一个“ShootRay”函数是专门干这个的,呵呵!
51m
发表于 2010-6-4 12:39:14 | 只看该作者
看看看啊看看
52m
发表于 2010-7-2 17:51:07 | 只看该作者
还是要学习啊 大学学的C语言快忘完了
53m
发表于 2010-7-6 16:19:38 | 只看该作者
汗,,,怎么搞的啊,,牛
54m
发表于 2010-7-7 11:44:18 | 只看该作者
感谢分享。。。
55m
发表于 2010-7-18 15:47:32 | 只看该作者
还是在学校念书的人心静得下来, 等到工作了,心都散了。

我又来坐坐,学习学习。
56m
发表于 2010-7-30 20:51:13 | 只看该作者
能否为你的脚本注释?很难明白
57m
发表于 2010-8-6 19:11:15 | 只看该作者
好东西啊。。。。。
58m
发表于 2010-8-10 10:38:02 | 只看该作者
maya......  学不过来了
59m
发表于 2010-8-15 16:38:23 | 只看该作者
很好的练习,感谢楼主!

自己也刚开始学
好多地方,慢慢才弄明白,加了些注释,希望大家能更理解
60m
发表于 2010-8-15 16:39:55 | 只看该作者
Call Main()
Sub Main()
Rhino.AddLayer "black",RGB(0,0,0)    'define a New layer

Dim headPt,endPt : endPt = Array (0,0,0)
'define begining point and terminal point
'pre-define the coordinate of the endPoint as the Looping beginning Point
Dim StrLine
Dim r,g,b : r=0 : g=0 : b=0   'define the RGB colour Value
Dim count : count = 0    'define the looping counter
Const EDGELEN = 500    'Define the Length of Line

Do
  headPt = endPt   'evaluate the coordinate to headpoint
  endPt = getPt (EDGELEN)    'call the subroutine,get a random point
  strLine = Rhino.AddLine(headPt,endPt)    'create a line
  Rhino.ObjectLayer strLine ,"black"    'set the Layer of Line
  Rhino.ObjectColor strLine ,RGB(r,g,b)    'set the color of Line, 1st is whight
   
  r = r + 1    'shift the R color ,step-Len is 1
  If r >= 255 Then
   r = 0
  End If
  b = b + 2    'shift the B color ,step-Len is 2
  If b >= 255 Then
   b = 0
  End If
  g = g + 3    'shift the G color ,step-Len is 3
  If g >= 255 Then
   g = 0
  End If
  '此处将RGB的步长调整为不同,这样就可以生成彩色的线了
  
  count = count + 1    'The looping step
  
  If count > 5000 Then Exit Do   ' The looping Judge term
  
Loop


End Sub
Function getPt (EDGELEN)   'subroutine
Dim randomNum : randomNum = Int(Rnd()*6)    'generate a random number 0~6
Select Case randomNum    'condition Judgement
  Case 0
   getPt = Array(Int(Rnd() * EDGELEN), Int(Rnd() * EDGELEN), 0)
  ' get a point on x-y plane
  Case 1
   getPt = Array(0, Int(Rnd() * EDGELEN), Int(Rnd() * EDGELEN))
  ' get a point on y-z plane
  Case 2
   getPt = Array(Int(Rnd() * EDGELEN), 0, Int(Rnd() * EDGELEN))
  ' get a point on x-z plane
  Case 3
   getPt = Array(Int(Rnd() * EDGELEN), Int(Rnd() * EDGELEN), EDGELEN)
  ' get a point on plane which parallel to x-y plane with 500 distance
  Case 4
   getPt = Array(Int(Rnd() * EDGELEN), EDGELEN, Int(Rnd() * EDGELEN))
  ' get a point on plane which parallel to x-z plane with 500 distance
  Case 5
   getPt = Array(EDGELEN, Int(Rnd() * EDGELEN), Int(Rnd()* EDGELEN))
  ' get a point on plane which parallel to y-z plane with 500 distance
  Case Else
   rhino.Print "else"
End Select
End Function

小黑屋|手机版|NCF参数化建筑论坛 ( 浙ICP备2020044100号-2 )    辽公网安备21021102000973号

GMT+8, 2024-5-3 04:02 , Processed in 0.066802 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表