kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
53c22853ce
commit
fee68a767a
Plik binarny nie jest wyświetlany.
|
Po Szerokość: | Wysokość: | Rozmiar: 571 KiB |
|
|
@ -0,0 +1,29 @@
|
|||
import py5
|
||||
from shapely import Polygon, Point
|
||||
|
||||
def setup():
|
||||
py5.size(400, 400)
|
||||
py5.stroke_join(py5.ROUND)
|
||||
|
||||
def draw():
|
||||
py5.background(200)
|
||||
pts = ((100, 100), (300, 100),
|
||||
(py5.mouse_x, py5.mouse_y))
|
||||
xs, ys = zip(*pts)
|
||||
cx = sum(xs) / len(xs)
|
||||
cy = sum(ys) / len(ys)
|
||||
tri = Polygon(pts)
|
||||
py5.no_fill()
|
||||
py5.stroke_weight(1)
|
||||
py5.stroke(0, 200, 0)
|
||||
py5.shape(Point(cx, cy).buffer(5))
|
||||
py5.stroke(0, 0, 200)
|
||||
py5.shape(tri.envelope.buffer(2))
|
||||
py5.shape(tri.envelope.centroid.buffer(5))
|
||||
py5.stroke_weight(3)
|
||||
py5.stroke(0)
|
||||
py5.shape(tri)
|
||||
py5.fill(0)
|
||||
py5.shape(tri.centroid.buffer(2))
|
||||
|
||||
py5.run_sketch(block=False)
|
||||
|
|
@ -26,6 +26,16 @@ If you appreciate what I have been doing, you may also support my artistic work,
|
|||
|
||||
<!-- SKETCHES_START -->
|
||||
|
||||
### sketch_2025_08_25
|
||||
|
||||

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

|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue