// ===== 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.inc" global_settings { assumed_gamma 1.0 } default { texture { pigment { color rgb <1, 1, 1> } finish { diffuse 0 emission color rgb <1, 1, 1> } } } // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10 // Hilbert curve from lsfp.pdf p. 25, example b; // L_Sys\ls17_hilb1.pov // // Variables #declare Rules[asc("F")] = "F"; #declare Rules[asc("X")] = "-YF+XFX+FY-"; #declare Rules[asc("Y")] = "+XF-YFY-FX+"; InsertNoChangeFunctions(Functions, "X") InsertNoChangeFunctions(Functions, "Y") #declare Axiom = "X"; #declare Iterations = 6; #declare StackSize = 2*Iterations; #declare L_string = L_Transform(Axiom, Rules, Iterations); #declare pStart = < -30, -30, 0>; #declare InitialLength = 1.0; #declare InitialRadius = 0.1; #declare InitialHeading = radians(0.0); #declare InitialTurnAngle = radians(90.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 ) pigment { color srgb <0.99, 0.75, 0.29> } } // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10 background { color srgb <0.00, 0.19, 0.29> } #declare Scale = 32; camera { orthographic location -100*z direction z right Scale*4*x up Scale*3*y } // ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7 ======= 8 ======= 9 ======= 10