// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10 /* https://github.com/t-o-k/POV-Ray-L-system Copyright (c) 2023 Tor Olav Kristensen, http://subcube.com Use of this source code is governed by the GNU Lesser General Public License version 3, which can be found in the LICENSE file. */ // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10 #version 3.7; #include "L-system_2D.inc" #include "colors.inc" #include "textures.inc" #include "metals.inc" #include "golds.inc" global_settings { assumed_gamma 2.2 } // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10 // Cordate Leaf from Przemyslaw Prusinkiewicz and Aristid Lindenmayer 'The Algorithmic Beauty of Plants', page 123 (135), fig. 5.5; // Adapted by Droj (10 Oct 2023); // // #declare Rules[asc("F")] = "F"; // Variables #declare Rules[asc("A")] = "[+A]>C"; #declare Rules[asc("B")] = "[-B]>C"; #declare Rules[asc("C")] = "FFFC#@"; InsertNoChangeFunctions(Functions, "ABC") #declare LengthScale = 0.85; #declare LengthIncrement = 0.005; // > => { l*LengthScale + LengthIncrement } InsertLengthFunctions(Functions, LengthScale, LengthIncrement) #declare RadiusScale = 1.0; // # => r*RadiusScale + RadiusIncrement #declare RadiusIncrement = 0.1; InsertRadiusFunctions(Functions, RadiusScale, RadiusIncrement) // Axiom #declare Axiom = "FF[A][B]"; #declare Iterations = 12; #declare StackSize = 2*Iterations; #declare L_string = L_Transform(Axiom, Rules, Iterations); #declare pStart = < 0, -15, 0>; #declare InitialLength = 1.0; #declare InitialRadius = 0.15; #declare InitialHeading = radians(90.0); #declare InitialTurnAngle = radians(12.0); // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10 union { L_Draw( Functions, L_string, StackSize, pStart, InitialLength, InitialRadius, InitialHeading, InitialTurnAngle, true, true false, "" ) texture { T_Gold_5C } translate < 0.0, 0.0, 0.0 > scale 2.0 } // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10 background { color <0.0,0.0,0.0> } camera { perspective location <0, 0, -100> sky <0.0, 1.0, 0.0> up <0.0, 1.0, 0.0> right x*image_width/image_height angle 54.0 look_at <0, 0, 0> } light_source { <0, 0, 0> color rgb <1, 1, 1> translate <-15, 50, -100> } // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10