过节又来问问题了,偶然要用到一个中空的球体,开始以为很简单,使用两个球布尔相减不就可以了
import rhinoscriptsyntax as rs
s1 = rs.AddSphere([0,0,0], 5)
s2 = rs.AddSphere([0,0,0], 10)
s2 = rs.BooleanDifference(s2, s1)
if(s2 == None):
rs.MessageBox('ERR')
else:
rs.MessageBox('OK')
显示是成功了,但是用剖面查看,球本身还是实心的,
又用box实验了一下,结果是一样的
import rhinoscriptsyntax as rs
L1 = 2000
W1 = 1000
H1 = 1000;
floor = 100
#Create out box
outer_corns = [
[0,0,0],[0, W1, 0],[L1, W1, 0],[L1, 0, 0],
[0, 0, H1],[0, W1, H1],[L1, W1, H1],[L1, 0, H1]
]
outbox = rs.AddBox(outer_corns);
rs.MoveObject(outbox, [-L1/2, -W1/2, -H1/2])
#Create inner box
L2 = L1 - 2*floor
W2 = W1 - 2*floor
H2 = H1 - 2*floor
inner_corns = [
[0,0,0],[0, W2, 0],[L2, W2, 0],[L2, 0, 0],
[0, 0, H2],[0, W2, H2],[L2, W2, H2],[L2, 0, H2]
]
innerbox = rs.AddBox(inner_corns);
rs.MoveObject(innerbox, [-L2/2, -W2/2, -H2/2])
#Get out box layer
outbox = rs.BooleanDifference(outbox, innerbox)
rs.MoveObject(outbox, [L1/2, W1/2, H1/2])
把H2 = H1 - 2*floor改为H2 = H1就可以切出一个边框,不知道为什么中空的就不行,请各位指教
|
|
举报