FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
plotdevice/examples/Grid/Foliage.pv at modern · plotdevice/plotdevice · GitHub
plotdevice
plotdevice
Repository navigation
Code
Issues
10
(10)
Pull requests
4
(4)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
plotdevice
/
examples
/
Grid
/
Foliage.pv
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (16 loc) · 601 Bytes
Breadcrumbs
plotdevice
/
examples
/
Grid
/
Foliage.pv
Copy path
File metadata and controls
20 lines (16 loc) · 601 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
Digital gardening.
The foliage are actually green stars with random inner and outer
radii and a random number of points. They are randomly skewed to
make things look more organic.
"""
size(700, 700)
translate(50,50)
# By using HSV colormode, we can change the saturation and brightness
# of the leaves to get more natural color variations.
color(HSV)
# Generate a 50 x 50 grid. Each row and column is 12 points wide.
for x, y in grid(50,50,12,12):
fill(0.3,random(),random(0.2,0.6),0.8)
with skew(random(-50,50)):
star(x+random(-5,5),y+random(-5,5),random(10),random(1,40),15)
Back
|
FazBrowse Home
|
New Git URL