kopia lustrzana https://github.com/villares/sketch-a-day
main
rodzic
93310b4b98
commit
e9c3bab71b
Plik binarny nie jest wyświetlany.
|
Po Szerokość: | Wysokość: | Rozmiar: 434 KiB |
|
|
@ -0,0 +1,39 @@
|
|||
from random import sample
|
||||
from itertools import product
|
||||
from villares import arcs # github.com/villares/villares
|
||||
|
||||
arcs.DEBUG = True
|
||||
BORDER = 100
|
||||
SIZE = 150 # try 100!
|
||||
NUM_POINTS = 6
|
||||
|
||||
def setup():
|
||||
size(500, 500)
|
||||
create_list()
|
||||
|
||||
def create_list():
|
||||
global p_list, r_list
|
||||
radii = [10, 20, 20, 30, 30, 40]
|
||||
grid = list(product(range(BORDER, height - BORDER + 1, SIZE),
|
||||
range(BORDER, height - BORDER + 1, SIZE)))
|
||||
r_list = sample(radii, NUM_POINTS)
|
||||
p_list = sample(grid, NUM_POINTS)
|
||||
|
||||
def draw():
|
||||
background(200)
|
||||
# print(arcs.arc_augmented_poly(p_list, r_list, check_intersection=True))
|
||||
# stroke(128)
|
||||
# strokeWeight(10)
|
||||
# arcs.arc_augmented_poly(p_list, r_list, arc_func=arcs.p_arc, num_points=4)
|
||||
|
||||
strokeWeight(2)
|
||||
fill(240, 100)
|
||||
arcs.arc_augmented_poly(p_list, r_list, arc_func=arcs.b_arc)
|
||||
|
||||
strokeWeight(1)
|
||||
noFill()
|
||||
arcs.arc_filleted_poly(p_list, map(abs, r_list), arc_func=arcs.b_arc)
|
||||
|
||||
|
||||
def keyPressed():
|
||||
if key == ' ': create_list()
|
||||
|
|
@ -26,6 +26,12 @@ Some of the tools I have used:
|
|||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[sketch_2020_09_25a](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_09_25a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
||||
---
|
||||
|
||||

|
||||
|
||||
[sketch_2020_09_24a](https://github.com/villares/sketch-a-day/tree/master/2020/sketch_2020_09_24a) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)]
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue