Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # the top comments are notes on how maya constructs edges what are the appropriate
- # commands to add new faces to the existing ones.
- import math
- import maya.cmds as plg
- plg.polyCreateFacet(p=[(0.0, 0.0, 0.0), (1.725, 0.0, 0.0), (0.868, 0.0, 1.5)])
- #edgeNum = 1
- #xValEven = 0.8625
- #xValOdd = 0.8625
- #yVal = 0
- #zVal = 1.5
- #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*3) + ',0,' + str(zVal)+ ')]'
- #eval('plg.polyAppend(' + stringconstruct + ')')
- #edgeNum = edgeNum + 2
- #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*4) + ',0,' + str(0)+ ')]'
- #eval('plg.polyAppend(' + stringconstruct + ')')
- #edgeNum = edgeNum + 3
- #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*5) + ',0,' + str(zVal)+ ')]'
- #eval('plg.polyAppend(' + stringconstruct + ')')
- #edgeNum = edgeNum + 1
- #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*6) + ',0,' + str(0)+ ')]'
- #eval('plg.polyAppend(' + stringconstruct + ')')
- #edgeNum = edgeNum + 3
- #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd*7) + ',0,' + str(zVal)+ ')]'
- #eval('plg.polyAppend(' + stringconstruct + ')')
- #edgeNum = edgeNum + 1
- #stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven*8) + ',0,' + str(0)+ ')]'
- #eval('plg.polyAppend(' + stringconstruct + ')')
- edgeNum = 1
- xValEven = 0.8625
- xValOdd = 0.8625
- yVal = 0
- zVal = 1.5
- for i in range(2,10):
- xValEven = (.8625*i * 2)
- xValOdd = (.8625*i * 2) - .8625
- stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValOdd) + ',0,' + str(zVal)+ ')]'
- eval('plg.polyAppend(' + stringconstruct + ')')
- edgeNum = edgeNum + 1
- if i==2:
- edgeNum = edgeNum + 1
- stringconstruct = 'a=[' + str(edgeNum) + ',(' + str(xValEven) + ',0,' + str(0)+ ')]'
- eval('plg.polyAppend(' + stringconstruct + ')')
- edgeNum = edgeNum + 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement