Palm Tree Leaf
Outsite my office window, there are many palm trees. I thought about making one so it may be reused later to make a full tree.
There are patterns in the palm tree leaves. For example, leaves on the two sides could be alternating or symmetrical. This one I created is symmetrical, but it could be easily midfied to be alternating I think.
The leaves may look complex to construct, but it can be easy if starting from just one leaf. As seen in the leaf procedure, I carefully walked the turtle to create two symmetrical faces for a leaf.
Two faces are not on the same plane and they have slightly different colours. Once that is done, another repeat can be used to generate more leaves. The leaves I have started from shorter and got longer, they also converge to the stem at the end.
During the repeat, I also roll the turtle up and down a bit to create the curved stem. At the end of the logo program, I connected the path to make the stem (as a black line). The stem looks too thin. I will need to add lineproperties into VRMath2 Editor so in the future the line can be thicker.
Below is the Logo program.
; Palm tree leaf ; By Andy Yeh (2015) RESET CLEAN HOME CT SETBG 39 MAKE "stempos [] ; to collect positions for stem TO leaf :l FACE CM SETPC 177 520 73 PD MAKE "p POS MAKE "o ORI TL 30 FD :l LT 6 BK :l/5 RT 3 BK :l/5 RT 3 BK :l/5 RT 3 BK :l/5 RT 3 METER SETPOS :p CM TR 30 SETH :o JUMP SETPC 109 320 44 TR 30 FD :l RT 6 BK :l/5 LT 3 BK :l/5 LT 3 BK :l/5 LT 3 BK :l/5 LT 3 METER SETPOS :p CM TL 30 SETH :o PU END TO fn :in MAKE "d :in - 30 IFELSE :d > 0 [ OUTPUT 30 + SQRT :d ] [ OUTPUT :in ] END RU 90 REPEAT 15 [ PUSH "stempos POS LT 75 RU 10 MAKE "r REPCOUNT*4 MAKE "ll 40 + fn :r leaf :ll RD 10 RT 150 RU 10 leaf :ll RD 10 LT 75 CM FD 8 RD 3 ] REPEAT 18 [ PUSH "stempos POS MAKE "angle 75 - REPCOUNT * 4 LT :angle RU 10 leaf :ll RD 10 RT :angle*2 RU 10 leaf :ll RD 10 LT :angle CM FD 8 RD 4 TL 3 ] METER LINE SETPCNAME "black PD REPEAT COUNT :stempos [ SETPOS POP "stempos ] PU
Here are the files if interested: palm_tree_leaf.logo palm_tree_leaf.x3d
- Andy's blog
- Login or register to post comments
- 4459 reads