Skip to content

Commit

Permalink
25
Browse files Browse the repository at this point in the history
  • Loading branch information
villares committed Jan 26, 2025
1 parent f0e9538 commit 6c4f900
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
Binary file added 2025/sketch_2025_01_25/sketch_2025_01_25.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions 2025/sketch_2025_01_25/sketch_2025_01_25.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from shapely import Polygon
import py5

def setup():
py5.size(600, 600)
start()

def start():
global ps
pts = [(py5.random_int(10, 50) * 10,
py5.random_int(10, 50) * 10)
for _ in range(10)]
ps = [Polygon(pts)]

def draw():
py5.background(230, 240, 240)
py5.no_fill()
for p in ps:
py5.shape(py5.convert_cached_shape(p))

def key_pressed():
global p
if py5.key in ('+', '='):
ps.append(ps[-1].buffer(10, cap_style='round'))
elif py5.key == '-':
ps.append(ps[-1].buffer(-10, cap_style='round'))
elif py5.key == 's':
py5.save_frame('out###.png')
elif py5.key == ' ':
start()
py5.run_sketch()
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ If you appreciate what I have been doing, you may also support my artistic work,
2025 \| [<b>2024</b>](2024.md) \| [<b>2023</b>](2023.md) \| [<b>2022</b>](2022.md) \| [<b>2021</b>](2021.md) \| [<b>2020</b>](2020.md) \| [<b>2019</b>](2019.md) \| [<b>2018</b>](2018.md)


---

### sketch_2025_01_25

![sketch_2025_01_25](https://raw.githubusercontent.com/villares/sketch-a-day/main/2025/sketch_2025_01_25/sketch_2025_01_25.gif)

[sketch_2025_01_25](https://github.com/villares/sketch-a-day/tree/main/2025/sketch_2025_01_25) [[py5](https://py5coding.org/)]



---

### sketch_2025_01_24
Expand Down

0 comments on commit 6c4f900

Please sign in to comment.