how to convert this vex code to python code to use in python sop node?
int pts = primpoints(0, @primnum);
int prim = addprim(0, “poly”);
for(int i=0; i<len(pts); i++){
int pt1 = pts;
int pt2 = pts;
vector pos1 = point(0, “P”, pt1);
vector pos2 = point(0, “P”, pt2);
vector npos1 = pos1 + (pos2-pos1) / 3.0;
vector npos2 = pos1 + (pos2-pos1) * 2.0 / 3.0;
matrix mat = ident();
rotate(mat, radians(-60), set(0, 1, 0));
vector npos3 = npos1 + (pos2 - pos1) / 3.0 * mat;
int npt1 = addpoint(0, npos1);
int npt2 = addpoint(0, npos2);
int npt3 = addpoint(0, npos3);
addvertex(0, prim, pt1);
addvertex(0, prim, npt1);
addvertex(0, prim, npt3);
addvertex(0, prim, npt2);
}
removeprim(0, @primnum, 1);
Found 1 posts.
Search results Show results as topic list.
Technical Discussion » Access points by number in python
- thihaA
- 1 posts
- Offline
-
- Quick Links