Very nice (to both authors). Here is a little experiment for any one who is game. I don't know if it's easy because of how the polygons are formed. If some polygons are formed by the edges of others this won't work (there will be holes there). But it might be easy and holes might not be a bad thing. Use POLYSTART and POLYEND to define each polygon rather than FILL. (Pencolor will determine the coler of the shaded polygon that will be draw). NP and RP will have to be modified to save the 3D position and orientation instead of the 2D position and Heading. Once your done draw the figure and ROLL the turtle say 20 degrees and draw again, ROLL 20 and draw again etc. To make a 3D figure. And for those new to 3D start the process with PERSPECTIVE and finish it with POLYVIEW. For example this draws 8 squares rotated in 3D space. cs perspective setpencolor [128 0 0] repeat 8 [polystart repeat 4 [fd 100 rt 90] polyend rr 45] polyview The idea is to replace the square with your figure. mike sandy wrote: > > Here is a coloured version of penrose tiling using np and rp. > Use 'procs' to edit > ------ > to aaa > ; try penrose 120 4 > ; 'large' and 'small' are the penrose rhombs > ; 'pent' is the initial design > ; but can be any design involving the rhombs (large, small). > ; Use 'large :size :level' and then 'small :size :level' > ; with :level=1 then 2 > ; to see the recursion links. > end > > to large :l :n > if :n=0 [pu stop] > if :n=1 [pd] > fd :l lt 2*:ang > np > lt :ang small :l/:tau :n-1 > rp > fd :l lt 3*:ang > np > lt :ang large :l/:tau :n-1 > rt 2*:ang large :l/:tau :n-1 > rp > fd :l > np > small :l/:tau :n-1 rt :ang bk :l/:tau > lt :ang large :l/:tau :n-1 > rp > lt 2*:ang > fd :l lt 3*:ang > pu > if :n=1 [np lt 20 fd 5 setfc [255 0 0] fill rp] > end > > to penrose :size :level > cs > ht pu > setpc [0 0 0] > localmake "ang 36 > localmake "tau (1+sqrt 5)/2 > bk :size*:tau > rt 2*:ang > ;small :size :level > ;large :size :level > pent :size :level > end > > to pent :l :n > if :n=0 [pu stop] > ;; draw central pattern > repeat 5 [lt :ang large :l :n rt :ang > fd :l lt :ang fd :l lt :ang] > end > > to procs > ed[aaa penrose pent large small] > end > > to small :l :n > if :n=0 [pu stop] > if :n=1 [pd] > np > rt :ang large :l/:tau :n-1 > np > lt 3*:ang fd :l/:tau rt 180 > small :l/:tau :n-1 > rt 4*:ang small :l/:tau :n-1 > rp > lt 4*:ang large :l/:tau :n-1 > rp > fd :l lt 4*:ang fd :l lt :ang > fd :l lt 4*:ang fd :l lt :ang > pu > if :n=1 [np lt 20 fd 5 setfc [0 255 0] fill rp] > end > > ------------------------------------------------------------------------------------------------------------------------------------ > > Name: penrose.GIF > penrose.GIF Type: GIF Image (image/gif) > Encoding: base64 -- =============================================================== George Mills (mills@softronix.com) http://www.softronix.com/ The www page contains some very powerful educational software. Our single most important investment is our kids. --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home