Created
November 15, 2021 15:27
-
-
Save peeweek/e8694af77aea2a8bd83ccbab0e142ac7 to your computer and use it in GitHub Desktop.
Houdini Python Create Triangle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| node = hou.pwd() | |
| geo = node.geometry() | |
| def pt(angle, dist): | |
| return(math.cos(angle * 3.1415926535)*dist, math.sin(angle * 3.1415926535)*dist,0) | |
| p1 = geo.createPoint() | |
| p1.setPosition(pt(0,1)) | |
| p2 = geo.createPoint() | |
| p2.setPosition(pt(0.6666666,1)) | |
| p3 = geo.createPoint() | |
| p3.setPosition(pt(1.3333333,1)) | |
| poly = geo.createPolygon() | |
| poly.addVertex(p1) | |
| poly.addVertex(p2) | |
| poly.addVertex(p3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment