找回密码
 注册
搜索
查看: 16507|回复: 15

[个人作品] 小试--开洞代码

[复制链接]
发表于 2011-1-3 18:09:23 | 显示全部楼层 |阅读模式
本帖最后由 1235813 于 2011-1-3 18:16 编辑

Option Explicit

Call Main()
Sub Main()

dim srfs
dim p()
srfs=rhino.GetObjects("planar surfaces",8,true,true)
dim j
call rhino.EnableRedraw(false)
for j=0 to ubound(srfs)
  
dim srf
  srf=srfs(j)
'dim p
'p=rhino.surfacepoints(srf)

  dim c
  dim c1
  c=rhino.duplicatesurfaceborder(srf)
  c1=rhino.explodecurves(c)
  
  dim i,n
  n=ubound(c1)
  redim p(n)
  for i=0 to ubound(c1)
   p(i)=rhino.CurveStartPoint(c1(i))
  Next
  
  
  dim pointscount
  pointscount=ubound(p)+1
  redim preserve p(pointscount)
  p(pointscount)=p(0)


  'call rhino.addpoints(p)
  'dim i,j
  'j=0
  'for each i in p
  'call  rhino.addtext(j,i)
  'j=j+1
  'Next
  
  dim c2,srf2
  c2=rhino.AddCurve(p,3)
  srf2=rhino.AddPlanarSrf(c2)
  call rhino.BooleanDifference(srf,srf2)
     
  call rhino.DeleteObjects(c)
  call rhino.DeleteObjects(c1)
  call rhino.DeleteObject(c2)
  
next

call rhino.EnableRedraw(true)
End Sub

好像需要rhino5.0支持
2011-01-03_180248.jpg

评分

参与人数 2强度 +4 照度 +32 收起 理由
weiwei + 1 + 2 很棒的教學
musofan + 3 + 30 感谢分享

查看全部评分

发表于 2011-1-3 19:03:24 | 显示全部楼层
~中间也是布尔之后的开洞么? 挺不错的~
回复

使用道具 举报

 楼主| 发表于 2011-1-3 22:09:15 | 显示全部楼层
是的,布尔运算
回复

使用道具 举报

发表于 2011-1-5 14:11:35 | 显示全部楼层
哇!这个好啊!谢谢楼主
回复

使用道具 举报

发表于 2011-1-28 04:58:32 | 显示全部楼层
相当不错 学习
回复

使用道具 举报

发表于 2011-1-28 21:55:20 | 显示全部楼层
开得有点怪异。。。不过试试吧
回复

使用道具 举报

发表于 2011-3-24 07:50:50 | 显示全部楼层
谢谢楼主分享
回复

使用道具 举报

发表于 2011-3-31 14:37:52 | 显示全部楼层
我来学习,我来攒分。。。
回复

使用道具 举报

发表于 2011-12-9 21:58:57 | 显示全部楼层
谢谢。。。。。。
回复

使用道具 举报

发表于 2011-12-14 18:17:18 | 显示全部楼层
谢谢楼主分享
回复

使用道具 举报

发表于 2011-12-14 19:28:27 | 显示全部楼层
谢谢lz分享啦。哎为了照度跟权限,没办法了~
回复

使用道具 举报

头像被屏蔽
发表于 2012-1-5 10:15:09 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2012-3-1 08:41:36 | 显示全部楼层
实验一下!然后回来支持你!
回复

使用道具 举报

发表于 2012-3-6 14:32:48 | 显示全部楼层
不错啊~Rhino4好像也行吧
回复

使用道具 举报

发表于 2012-3-7 15:35:22 | 显示全部楼层
看的头发晕
回复

使用道具 举报

发表于 2012-3-9 11:06:37 | 显示全部楼层
感谢分享~~~~~~
回复

使用道具 举报

NCFZ微信公众号

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

GMT+8, 2026-11-23 19:51 , Processed in 0.048793 second(s), 29 queries , Gzip On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

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