diff --git a/2019/sketch_190527a/0002.png b/2019/sketch_190527a/0002.png deleted file mode 100644 index 8dfaeeea..00000000 Binary files a/2019/sketch_190527a/0002.png and /dev/null differ diff --git a/2019/sketch_190527a/0029.png b/2019/sketch_190527a/0029.png deleted file mode 100644 index 9d48a996..00000000 Binary files a/2019/sketch_190527a/0029.png and /dev/null differ diff --git a/2019/sketch_190527a/gif_exporter.py b/2019/sketch_190527a/gif_exporter.py deleted file mode 100644 index 51c431df..00000000 --- a/2019/sketch_190527a/gif_exporter.py +++ /dev/null @@ -1,40 +0,0 @@ -""" -Alexandre B A Villares http://abav.lugaralgum.com - GPL v3 - -A helper for the Processing gifAnimation library https://github.com/extrapixel/gif-animation/tree/3.0 -Download from https://github.com/villares/processing-play/blob/master/export_GIF/unzip_and_move_to_libraries_GifAnimation.zip -This helper was inspired by an example by Art Simon https://github.com/APCSPrinciples/AnimatedGIF/ - -# add at the start of your sketch: - add_library('gifAnimation') - from gif_exporter import gif_export -# add at the end of draw(): - gif_export(GifMaker) -""" - -def gif_export(GifMaker, # gets a reference to the library - filename="exported", # .gif will be added - repeat=0, # 0 makes it an "endless" animation - quality=255, # quality range 0 - 255 - delay=200, # this is quick - frames=0, # 0 will stop on keyPressed or frameCount >= 100000 - finish=False): # force stop - global gifExporter - try: - gifExporter - except NameError: - gifExporter = GifMaker(this, filename + ".gif") - gifExporter.setRepeat(repeat) - gifExporter.setQuality(quality) - gifExporter.setDelay(delay) - - gifExporter.addFrame() - - if frames == 0: - if keyPressed and key == "e": - finish = True - - if finish: - gifExporter.finish() - print("gif saved") - exit() diff --git a/2019/sketch_190527a/shuffle.png b/2019/sketch_190527a/shuffle.png deleted file mode 100644 index e466b06b..00000000 Binary files a/2019/sketch_190527a/shuffle.png and /dev/null differ diff --git a/2019/sketch_190527a/sketch_190526a.png b/2019/sketch_190527a/sketch_190526a.png deleted file mode 100644 index 358179e0..00000000 Binary files a/2019/sketch_190527a/sketch_190526a.png and /dev/null differ diff --git a/2019/sketch_190527a/sketch_190526b.png b/2019/sketch_190527a/sketch_190526b.png deleted file mode 100644 index 52834161..00000000 Binary files a/2019/sketch_190527a/sketch_190526b.png and /dev/null differ diff --git a/2019/sketch_190527a/sketch_190527a.pyde b/2019/sketch_190527a/sketch_190527a.pyde deleted file mode 100644 index addaa6a2..00000000 --- a/2019/sketch_190527a/sketch_190527a.pyde +++ /dev/null @@ -1,83 +0,0 @@ -# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day -# More explorations of lines in grids - -from random import shuffle -from itertools import product, combinations, permutations, combinations_with_replacement -from gif_exporter import gif_export -add_library('GifAnimation') - -space = 10 -position = 0 # initial position - - -def setup(): - global line_combos, W, H, position, num - size(1340, 560) - frameRate(5) - rectMode(CENTER) - strokeWeight(1) - # grid = product(range(-1, 1), repeat=2) # 2X2 - # grid = product(range(-1, 2), repeat=2) # 3X3 - grid = product(range(-2, 2), repeat=2) # 4X4 - - # all possible lines - lines = combinations(grid, 2) - # colect only short lines - short_lines = [] - for l in lines: - (x0, y0), (x1, y1) = l[0], l[1] - if dist(x0, y0, x1, y1) > 3: # short as defined here... - short_lines.append(l) - num_short_lines = len(short_lines) - println("Number of possible lines: {}".format(num_short_lines)) - # main stuff - line_combos = list(combinations(short_lines, 4)) - # shuffle(line_combos) # ucomment to shuffle! - num = len(line_combos) - println(num) - W, H = (width - space) / space, (height - space) / space - println((W, H, W * H)) - - -def draw(): - global position - background(240) - i = position - for y in range(H): - for x in range(W): - if i < len(line_combos): - pushMatrix() - translate(space + space * x, space + space * y) - draw_combo(i) - popMatrix() - i += 1 - else: noLoop() - if i < len(line_combos): - # gif_export(GifMaker, SKETCH_NAME + "-" + str(num)) - position += W - -def draw_combo(i): - colorMode(RGB) - siz = space / 3. - for i, sl in enumerate(line_combos[i]): - colorMode(HSB) - # stroke(i * 64, 160, 160) - (x0, y0), (x1, y1) = sl[0], sl[1] - line(x0 * siz, y0 * siz, x1 * siz, y1 * siz) - -def keyPressed(): - if key == "s": - saveFrame("####.png") - -def settings(): - from os import path - global SKETCH_NAME - SKETCH_NAME = path.basename(sketchPath()) - OUTPUT = ".png" - println( - """ -![{0}]({2}/{0}/{0}{1}) - -[{0}](https://github.com/villares/sketch-a-day/tree/master/{2}/{0}) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)] -""".format(SKETCH_NAME, OUTPUT, year()) - ) diff --git a/2019/sketch_190528a/0002.png b/2019/sketch_190528a/0002.png deleted file mode 100644 index 8dfaeeea..00000000 Binary files a/2019/sketch_190528a/0002.png and /dev/null differ diff --git a/2019/sketch_190528a/0029.png b/2019/sketch_190528a/0029.png deleted file mode 100644 index 9d48a996..00000000 Binary files a/2019/sketch_190528a/0029.png and /dev/null differ diff --git a/2019/sketch_190528a/gif_exporter.py b/2019/sketch_190528a/gif_exporter.py deleted file mode 100644 index 51c431df..00000000 --- a/2019/sketch_190528a/gif_exporter.py +++ /dev/null @@ -1,40 +0,0 @@ -""" -Alexandre B A Villares http://abav.lugaralgum.com - GPL v3 - -A helper for the Processing gifAnimation library https://github.com/extrapixel/gif-animation/tree/3.0 -Download from https://github.com/villares/processing-play/blob/master/export_GIF/unzip_and_move_to_libraries_GifAnimation.zip -This helper was inspired by an example by Art Simon https://github.com/APCSPrinciples/AnimatedGIF/ - -# add at the start of your sketch: - add_library('gifAnimation') - from gif_exporter import gif_export -# add at the end of draw(): - gif_export(GifMaker) -""" - -def gif_export(GifMaker, # gets a reference to the library - filename="exported", # .gif will be added - repeat=0, # 0 makes it an "endless" animation - quality=255, # quality range 0 - 255 - delay=200, # this is quick - frames=0, # 0 will stop on keyPressed or frameCount >= 100000 - finish=False): # force stop - global gifExporter - try: - gifExporter - except NameError: - gifExporter = GifMaker(this, filename + ".gif") - gifExporter.setRepeat(repeat) - gifExporter.setQuality(quality) - gifExporter.setDelay(delay) - - gifExporter.addFrame() - - if frames == 0: - if keyPressed and key == "e": - finish = True - - if finish: - gifExporter.finish() - print("gif saved") - exit() diff --git a/2019/sketch_190528a/shuffle.png b/2019/sketch_190528a/shuffle.png deleted file mode 100644 index e466b06b..00000000 Binary files a/2019/sketch_190528a/shuffle.png and /dev/null differ diff --git a/2019/sketch_190528a/sketch_190526a.png b/2019/sketch_190528a/sketch_190526a.png deleted file mode 100644 index 358179e0..00000000 Binary files a/2019/sketch_190528a/sketch_190526a.png and /dev/null differ diff --git a/2019/sketch_190528a/sketch_190526b.png b/2019/sketch_190528a/sketch_190526b.png deleted file mode 100644 index 52834161..00000000 Binary files a/2019/sketch_190528a/sketch_190526b.png and /dev/null differ diff --git a/2019/sketch_190528a/sketch_190528a.pyde b/2019/sketch_190528a/sketch_190528a.pyde deleted file mode 100644 index d2cd64d1..00000000 --- a/2019/sketch_190528a/sketch_190528a.pyde +++ /dev/null @@ -1,84 +0,0 @@ -# Alexandre B A Villares - https://abav.lugaralgum.com/sketch-a-day -# More explorations of lines in grids - -from random import shuffle -from itertools import product, combinations, permutations, combinations_with_replacement -from gif_exporter import gif_export -add_library('GifAnimation') - -space = 10 -position = 0 # initial position - - -def setup(): - global line_combos, W, H, position, num - size(620, 630) - frameRate(5) - rectMode(CENTER) - strokeWeight(2) - # grid = product(range(-1, 1), repeat=2) # 2X2 - # grid = product(range(-1, 2), repeat=2) # 3X3 - grid = product(range(-2, 2), repeat=2) # 4X4 - - # all possible lines - lines = combinations(grid, 2) - # colect only short lines - short_lines = [] - for l in lines: - (x0, y0), (x1, y1) = l[0], l[1] - if dist(x0, y0, x1, y1) > 2: # short as defined here... - short_lines.append(l) - num_short_lines = len(short_lines) - println("Number of possible lines: {}".format(num_short_lines)) - # main stuff - line_combos = list(permutations(short_lines, 2)) - # shuffle(line_combos) # ucomment to shuffle! - num = len(line_combos) - println(num) - W, H = (width - space) / space, (height - space) / space - println((W, H, W * H)) - - -def draw(): - global position - background(240) - i = position - for y in range(H): - for x in range(W): - if i < len(line_combos): - pushMatrix() - translate(space + space * x, space + space * y) - draw_combo(i) - popMatrix() - i += 1 - else: noLoop() - if i < len(line_combos): - # gif_export(GifMaker, SKETCH_NAME + "-" + str(num)) - position += W - -def draw_combo(i): - colorMode(RGB) - siz = space / 3. - for i, sl in enumerate(line_combos[i]): - # colorMode(HSB) - if i: stroke(0, 0, 128) - else: stroke(0) - (x0, y0), (x1, y1) = sl[0], sl[1] - line(x0 * siz, y0 * siz, x1 * siz, y1 * siz) - -def keyPressed(): - if key == "s": - saveFrame("####.png") - -def settings(): - from os import path - global SKETCH_NAME - SKETCH_NAME = path.basename(sketchPath()) - OUTPUT = ".png" - println( - """ -![{0}]({2}/{0}/{0}{1}) - -[{0}](https://github.com/villares/sketch-a-day/tree/master/{2}/{0}) [[Py.Processing](https://villares.github.io/como-instalar-o-processing-modo-python/index-EN)] -""".format(SKETCH_NAME, OUTPUT, year()) - )