erbay Posted May 9, 2017 Share Posted May 9, 2017 (edited) Studying VEX i create penrose tile setup, maybe it will be interesting for someone who is beggining scripting in vex. HIP https://www.dropbox.com/s/m6ysgiljl7m0k40/penrose_tile.hip?dl=0 Edited May 9, 2017 by erbay 5 Quote Link to comment Share on other sites More sharing options...
erbay Posted May 9, 2017 Author Share Posted May 9, 2017 1 minute ago, erbay said: Studying VEX i create penrose tile setup, maybe it will be interesting for someone who is beggining scripting in vex. HIP https://www.dropbox.com/s/m6ysgiljl7m0k40/penrose_tile.hip?dl=0 https://www.behance.net/erikbaymukcf7d 2 Quote Link to comment Share on other sites More sharing options...
f1480187 Posted May 12, 2017 Share Posted May 12, 2017 (edited) Here is simple version based on Python implementation. // Primitive wrangle. // http://preshing.com/20110831/penrose-tiling-explained/ int pts[] = primpoints(0, @primnum); vector a = point(0, "P", pts[0]); vector b = point(0, "P", pts[1]); vector c = point(0, "P", pts[2]); float g = (1 + sqrt(5)) / 2; vector p = a + (b - a) / g; vector q = b + (a - b) / g; vector r = b + (c - b) / g; #define RED true #define BLUE false #define SAME @group_reversed #define REVERSED !@group_reversed void triangle(vector a, b, c; int red_or_blue, same_or_reversed) { int prim = addprim(0, "poly"); addvertex(0, prim, addpoint(0, a)); addvertex(0, prim, addpoint(0, b)); addvertex(0, prim, addpoint(0, c)); setprimgroup(0, "red", prim, red_or_blue); setprimgroup(0, "reversed", prim, same_or_reversed); } if (@group_red) { triangle(c, p, b, RED, SAME); triangle(p, c, a, BLUE, SAME); } else { triangle(r, q, a, RED, REVERSED); triangle(q, r, b, BLUE, REVERSED); triangle(r, c, a, BLUE, SAME); } // Lengths of virtual edges to group for dissolve later. setdetailattrib(0, "virtual_edge_long", distance(a, c)); setdetailattrib(0, "virtual_edge_short", distance(p, b)); removeprim(0, @primnum, true); penrose.hipnc Edited May 12, 2017 by f1480187 5 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.