Os exemplos mais abaixo neste Gist são a inspiração para 3 videozinhos sobre Azulejos de Truchet com py5 (usando py5 imported mode no Thonny)
- 1 https://peertube.lhc.net.br/w/umbmBicMFuUVKDD6gpnWpM
- 2 https://peertube.lhc.net.br/w/9wiWAvqigruASr3Kj4F7id
- 3 https://peertube.lhc.net.br/w/in7VefyJJAwcEcKfwDerts
Se você gostar, considere apoiar a instância do PeerTube do LHC que hospeda os vídeos https://peertube.lhc.net.br e me apoiar (que fiz esse material) https://liberapay.com/villares
a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
An example/template for generating a mutiple page PDF using py5. | |
Imported mode style - You'll need to use the thonny-py5mode plug-in or the sketch_runner tool | |
CC0 / Public Domain dedication - by Alexandre B A Villares | |
""" | |
NUM_PAGES = 10 | |
s = 0.71 # scale factor 1 => 356 x 275 trying 252 x 195 | |
rs = 1 # starting random seed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import py5 | |
fator_escala = 3.78 * 50 / 189 | |
NOME = "caixa_flex-v1" # Precisa ser cortado 2x! só desenha "meia caixa" | |
W, H, P = 200, 120, 50 # dimensões | |
R = 30 # raio | |
XO, YO = 50, 50 # offset do desenho na página | |
def setup(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You *need* to install py5! | |
# Instructions at https://py5.ixora.io/ | |
from collections import Counter | |
from random import randint | |
import py5 | |
cell_size = 4 | |
current_board = set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# From Pytnon to Numpy | |
# Copyright (2017) Nicolas P. Rougier - BSD license | |
# More information at https://github.com/rougier/numpy-book | |
# ----------------------------------------------------------------------------- | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.path import Path | |
from matplotlib.animation import FuncAnimation | |
from matplotlib.collections import PathCollection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Downloads images from my notes at HackMD.io. | |
Creates new MD files with relative path image links. | |
Uses the links from the 'notes-backup' files downloaded with | |
download_notes.py (run it first) | |
I was skipping images hosted from my dreamhost account | |
but decided to download them too. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/home/villares/miniconda3/bin/python | |
""" | |
Based on: PytSimpleGUI demo for displaying any format of image file. | |
2022 - Alexandre B A Villares - I just added some PNG metadata viewing | |
for use with villares.helpers.save_png_with_src() | |
github.com/villares/villares/ | |
2023 - Alexandre B A Villares - Moved from os.path to pathlib.Path | |
and added folders to the list! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Make a PDF A3 zine combining 8 pages from a source PDF | |
WIP: I'd like to have an option for the 9th page (index=8) to be a poster in the backside or not. | |
------------------------------------------------------------------------------- | |
License: GNU GPL V3 | |
(c) 2023 Alexandre Villares | |
Based on https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/examples/combine-pages/combine.py | |
(c) 2018 Jorj X. McKie |
NewerOlder