5角形というか三角形のポリゴンが5つ並んだmetasequoia python scriptです。
#polygon5.py
segment = 5
radius=200.0
from math import *
crad = pi / 180 * 45
irad = 2*pi/segment
doc = MQSystem.getDocument()
segment = 5
radius=200.0
from math import *
crad = pi / 180 * 45
irad = 2*pi/segment
doc = MQSystem.getDocument()
obj = MQSystem.newObject()
obj.name = "polygon_%d" % segment
obj.addVertex( MQSystem.newPoint( radius*sin(crad), 0.0, radius*cos(crad) ) )#0
crad = crad+irad
obj.addVertex( MQSystem.newPoint( radius*sin(crad), 0.0, radius*cos(crad) ) )#1
crad = crad+irad
obj.addVertex( MQSystem.newPoint( radius*sin(crad), 0.0, radius*cos(crad) ) )#2
crad = crad+irad
obj.addVertex( MQSystem.newPoint( radius*sin(crad), 0.0, radius*cos(crad) ) )#3
crad = crad+irad
obj.addVertex( MQSystem.newPoint( radius*sin(crad), 0.0, radius*cos(crad) ) )#4
obj.addVertex( MQSystem.newPoint( 0.0, 100.0, 0.0 ) )#5
obj.addFace([0,5,1])
obj.addFace([1,5,2])
obj.addFace([2,5,3])
obj.addFace([3,5,4])
obj.addFace([4,5,0])
doc.addObject( obj )
- -
- -