底面については宿題です。
#kaku_8.py
segment = 8
radius=20.0
from math import *
crad = pi / 180 * 45
irad = 2*pi/segment
doc = MQSystem.getDocument()
obj = MQSystem.newObject();
obj.name = "circle_%d" % segment
for i in range(segment) :
obj.addVertex( MQSystem.newPoint( radius*sin(crad), 0.0, radius*cos(crad) ) )
crad += irad
obj.addVertex( MQSystem.newPoint( 0.0, 10.0, 0.0 ) )
for i in range(segment) :
obj.addFace( [(i+1)%segment,i,segment] ) #側面
#obj.addFace( [0,i, segment] )
doc.addObject( obj )
- -
- -