amdsoo / fractal-trees Goto Github PK
View Code? Open in Web Editor NEWA simple project to produce life like trees using recursive methods
A simple project to produce life like trees using recursive methods
1/Go to declaration.py and edit (for instance) # Track current Level Displayed level_max_display = 5 2/Go to the classes.py, you can edit all the parameter of the trees Here are the settings you want to edit / #initial color of the trunk # brown 105 , 75 , 55 self.color_ini_R = 105 self.color_ini_G = 75 self.color_ini_B = 55 #color of the last branches # green 42 , 222 ,33 self.color_fin_R = 42 self.color_fin_G = 222 self.color_fin_B = 33 #color of the leaves , last level # cherry blossom 255 ,71, 107 self.color_leave_R = 25 self.color_leave_G = 5 self.color_leave_B = 245 #some parameters to control the results self.color_variation = 50 self.add_branch_deviation= True self.stump_ratio = 0.05 # self.data explanations # level (0) # branch_length (1)in pixels # branch_radius start (2) in pixels # branch_radius end(3) in pixels # cone_angle (4) in degrees # cone_angle_reference (5) //Relative to parent branch, or absolute angle. # axis_deviation (6) // a % to diversify the angle of deviation # branch_max (7) , number of branches at this level # branch_length_deviation (8) // a % to diversify the length # branch curvature (9) // a % of curvature of the bezier curv at the midpoint of the Length self.data = [ [0, 220, 35, 30, 45, "Relative", 0.1, 2, 0.5, 0.1], [1, 140, 18, 16, 90, "Relative", 0.2, 3, 0.3, 0.2], [2, 90, 13, 11, 90, "Relative", 0.2, 3, 0.2, 0.1], [3, 75, 9, 8, 100, "Relative", 0.2, 3, 0.2, 0.3], [4, 30, 6, 4, 100, "Relative", 0.2, 3, 0.2, 0.3], [5, 17, 4, 4, 100, "Relative", 0.2, 3, 0.2, 0.2], [6, 11, 3, 3, 100, "Relative", 0.4, 3, 0.9, 0.2], [7, 8, 6, 2, 150, "Relative", 0.3, 7, 0.2, 0.2], [8, 4, 2, 1, 90, "Relative", 0.2, 3, 0.2, 0 ], [9, 2, 1, 1, 90, "Relative", 0, 2, 0, 0] ] 3/RUN the main.py to observe the results
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.