SHOW:
|
|
- or go back to the newest paste.
1 | - | # this requires a polygonal object to already exist with some |
1 | + | |
2 | - | # fairly specific edge numberings and positioning |
2 | + | |
3 | # commands to add new faces to the existing ones. | |
4 | ||
5 | - | #stringconstruct = 'a=[' + str(10) + ',(-0,0,' + str(3)+ ')]' |
5 | + | |
6 | import maya.cmds as plg | |
7 | plg.polyCreateFacet(p=[(0.0, 0.0, 0.0), (1.725, 0.0, 0.0), (0.868, 0.0, 1.5)]) | |
8 | - | #stringconstruct = 'a=[' + str(7) + ',(-4,0,' + str(3)+ ')]' |
8 | + | |
9 | #edgeNum = 1 | |
10 | #xValEven = 0.8625 | |
11 | - | #stringconstruct = 'a=[' + str(6) + ',(-0,0,' + str(2)+ ')]' |
11 | + | #xValOdd = 0.8625 |
12 | #yVal = 0 | |
13 | #zVal = 1.5 | |
14 | - | #stringconstruct = 'a=[' + str(3) + ',(-4,0,' + str(2)+ ')]' |
14 | + | #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*3) + ',0,' + str(zVal)+ ')]' |
15 | #eval('plg.polyAppend(' + stringconstruct + ')') | |
16 | #edgeNum = edgeNum + 2 | |
17 | - | #stringconstruct = 'a=[' + str(2) + ',(-0,0,' + str(1)+ ')]' |
17 | + | #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*4) + ',0,' + str(0)+ ')]' |
18 | #eval('plg.polyAppend(' + stringconstruct + ')') | |
19 | #edgeNum = edgeNum + 3 | |
20 | #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*5) + ',0,' + str(zVal)+ ')]' | |
21 | #eval('plg.polyAppend(' + stringconstruct + ')') | |
22 | - | edgeNum = 2 |
22 | + | #edgeNum = edgeNum + 1 |
23 | - | xValEven = 1 |
23 | + | #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*6) + ',0,' + str(0)+ ')]' |
24 | - | xValOdd = -4 |
24 | + | |
25 | #edgeNum = edgeNum + 3 | |
26 | - | zVal = 1 |
26 | + | #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*7) + ',0,' + str(zVal)+ ')]' |
27 | - | for i in range(1,100): |
27 | + | |
28 | - | stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven) + ',0,' + str(zVal)+ ')]' |
28 | + | #edgeNum = edgeNum + 1 |
29 | - | eval('plg.polyAppend(' + stringconstruct + ')') |
29 | + | #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*8) + ',0,' + str(0)+ ')]' |
30 | - | edgeNum = edgeNum + 1 |
30 | + | |
31 | - | zVal = zVal + 1 |
31 | + | |
32 | - | stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd) + ',0,' + str(zVal)+ ')]' |
32 | + | |
33 | - | eval('plg.polyAppend(' + stringconstruct + ')') |
33 | + | |
34 | - | edgeNum = edgeNum + 3 |
34 | + | edgeNum = 1 |
35 | - | xValEven = math.cos((i*math.pi)/5) |
35 | + | xValEven = 0.8625 |
36 | - | xValOdd = math.cos((i*math.pi)/5)-4 |
36 | + | xValOdd = 0.8625 |
37 | - | |
37 | + | |
38 | zVal = 1.5 | |
39 | for i in range(2,10): | |
40 | xValEven = (.8625*i * 2) | |
41 | xValOdd = (.8625*i * 2) - .8625 | |
42 | stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd) + ',0,' + str(zVal)+ ')]' | |
43 | eval('plg.polyAppend(' + stringconstruct + ')') | |
44 | edgeNum = edgeNum + 1 | |
45 | if i==2: | |
46 | edgeNum = edgeNum + 1 | |
47 | stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven) + ',0,' + str(0)+ ')]' | |
48 | eval('plg.polyAppend(' + stringconstruct + ')') | |
49 | edgeNum = edgeNum + 3 |