@py5coding@fosstodon.org
@py5coding@fosstodon.org avatar

py5coding

@py5coding@fosstodon.org

Official Mastodon account of the #py5 project.

py5 is a new version of #processing for #python.

Created and maintained by https://mastodon.art/@hx2A and the py5 community.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

kevinbowen, to python
@kevinbowen@fosstodon.org avatar

Ending up going down a silly, little rat-hole today setting up a project to play with #py5

Seems like py5 won't play nice with #pdm It does, however, work fine with poetry. 🤔

I had been taking pdm for a test drive this month; but, at least for some graphics tinkering I will use poetry for dependency management. Unless I can figure out what the bug is between py5 & pdm. Yay!

#python

py5coding,
@py5coding@fosstodon.org avatar

@kevinbowen @diazona I am not familiar with pdm and don't know why this isn't working. I would try installing all of py5's dependencies without py5 and see if that works. This would help isolate the problem. There could be a bug in pdm. It happens the py5 Python package contains some jar files, which perhaps pdm is not prepared to handle.

chimiseanga, to genart
py5coding,
@py5coding@fosstodon.org avatar

@chimiseanga nice looking pattern!

ericof, to sketch Portuguese
@ericof@pynews.com.br avatar
py5coding,
@py5coding@fosstodon.org avatar

@ericof Are these strange attractors? These are beautiful!

py5coding, to random
@py5coding@fosstodon.org avatar

Many thanks for Nick McIntyre (https://github.com/nickmcintyre), an artist, writer, and teacher in the US, for becoming py5coding's first GitHub sponsor!! Very appreciative of Nick's support for future #py5 development.

If you'd also like to sponsor #py5, the link is here:

https://github.com/sponsors/py5coding

No pressure though to become a sponsor though! If you have bills to pay or are in any way struggling, don't worry about it. Thank you, everyone, for using #py5! Your support means a lot.

py5coding, to random
@py5coding@fosstodon.org avatar

The latest version of works with objects, implicitly converting them to Py5Shape objects & drawing them to the screen:

from shapely import Polygon

size(999,999)
stroke_weight(19)
p=Polygon([[9,9], [9,990], [990,990], [990,9]])
for _ in range(8):
shape(p:=p.buffer(-50, single_sided=True))

py5coding, to random
@py5coding@fosstodon.org avatar

There's now a #py5 category in the #processing discourse!

https://discourse.processing.org/c/28

Let's start using it to talk about #py5 and share what we are working on!

villares, to python Portuguese
@villares@pynews.com.br avatar
py5coding,
@py5coding@fosstodon.org avatar

@villares pixels? #genuary4?

py5coding, to random
@py5coding@fosstodon.org avatar

#py5 lets you manipulate pixels with np_pixels[], a #numpy array with 3 dimensions, much like how you'd work with pixels using other Python tools.

size(999,999)
background('w')
load_np_pixels()
for _ in range(99):
x,y,c=random_int(900), random_int(900), random_int(1,3)
np_pixels[x:x+99,y:y+99,c]=0
update_np_pixels()

#genuary #genuary4 #processing

py5coding, to python
@py5coding@fosstodon.org avatar

#py5's new to_pil() method returns the frame as a PIL Image, making it easy to implement a Droste effect with a loop:

size(1024, 1024)
background('w')
image(Image.open('logo.png'), 512, 512)
for _ in range(9):
image(to_pil().resize((595, 595)), 0, 0)

#genuary #genuary3 #processing #python #art

py5coding, to random
@py5coding@fosstodon.org avatar

This week's #py5 release added a new color mode based on matplotlib's colormaps, adding to the existing RGB and HSB modes:

size(999,999)  
color_mode(CMAP,mpl.colormaps['jet'])  
stroke_weight(99)  
for _ in range(999):  
 stroke(random(),99)  
 point(random(999), random(999))  

#Genuary #processing #Genuary2

py5coding,
@py5coding@fosstodon.org avatar

@mdione Hmmm, I thought I posted it but must have forgotten the attachment. Thanks for asking:

ericof, to sketch Portuguese
@ericof@pynews.com.br avatar
py5coding,
@py5coding@fosstodon.org avatar

@ericof The latest release of #py5 has a new ColorMap color mode that I think you'll like:

https://py5coding.org/integrations/matplotlib.html#colormap-color-mode

villares, to random Portuguese
@villares@ciberlandia.pt avatar

can be a bit weird, even installing pip install trimesh[all] I still got issues because I was missing (which I usually install for other reasons!)

py5coding,
@py5coding@fosstodon.org avatar

@villares why not use trimesh[easy]? And what's wrong with networkx?

py5coding, to random
@py5coding@fosstodon.org avatar

A new version of #py5 is out! A major upgrade with exciting features for trimesh, shapely, matplotlib, & more!

https://ixora.io/blog/new-release-0100a0/

Despite having COVID I got the release out before the year ended...but most of you are probably in NYE mode already so look for more #py5 posts in the year demoing what's new!

villares, to python Portuguese
@villares@pynews.com.br avatar
py5coding,
@py5coding@fosstodon.org avatar

@villares Looks good! Made with trimesh facets?

villares, to python Portuguese
@villares@pynews.com.br avatar

I'm very pleased with this, today. This sketch built upon some earlier "arrow works", but now with some 3D. I'm sure that having gone for some swimming today improved my creative powers :)

Animated show of versions of a generated pile of colorful translucent arrow-like polylines

py5coding,
@py5coding@fosstodon.org avatar

@villares These are neat. Are you using shapely for each layer?

py5coding,
@py5coding@fosstodon.org avatar

@villares @villares recently I wrote code to do exactly that with Shapely Polygons. I can dig up the code if you want help with that. The basic idea is to convert Shapely objects to trimesh Path2D objects and then extrude. The new convert_shape() method will be useful there also.

py5coding,
@py5coding@fosstodon.org avatar

@villares @villares oh, excellent! I didn't know about that method! that is much easier than what I was doing

py5coding,
@py5coding@fosstodon.org avatar

@villares @villares culling edges from co-planar faces is a trimesh thing. It considers "facets" to be a group of connected co-planar faces. Try drawing each of the 3D object's facets as a polygon.

py5coding,
@py5coding@fosstodon.org avatar

@villares @villares Good luck!

I emailed Tristan this morning about the Thonny plugin. I hope he has time to work on py5 stuff but I understand his PhD needs to take priority. I did ask him to add me as a collaborator so I can make changes to the code and ultimately do a release...in 2024 I want to work to add to py5's position as a suitable platform for educators to teach Python to their students.

villares, (edited ) to Java
@villares@ciberlandia.pt avatar

Let's talk about tips for those coming from to in !
https://github.com/py5coding/py5generator/discussions/389

  • The slightly different snake_case names
  • How about the P-Classes?
    • PImage, PVector
  • About the libraries
  • More tips for porting Processing Java code to py5
    • Getting started on quick code conversions!
    • A table with some equivalences for conversion
    • Looping with for
    • Global variables
    • Strings & chars
    • OO differences (and similarities)
    • Data structures
py5coding,
@py5coding@fosstodon.org avatar

@TomLarrow @villares also, observe that #py5 has proper typehints builtin to all methods and functions. This makes it easier to code with py5 in IDEs that support them, like VSCode.

py5coding, to random
@py5coding@fosstodon.org avatar

Happy Holidays, from py5 !

Made with #axidraw and #py5

image/jpeg
image/jpeg

TomLarrow, to genart
@TomLarrow@vis.social avatar
py5coding,
@py5coding@fosstodon.org avatar

@TomLarrow nice work! The next #py5 release has new functionality for shapely that will let you simplify this code a bit

villares, to random
@villares@ciberlandia.pt avatar

I'm such a gamer (not), I think I played for 2 days on Steam for the entirety of 2023

py5coding,
@py5coding@fosstodon.org avatar

@villares an excellent way to spend the evening

py5coding, to random
@py5coding@fosstodon.org avatar

Folks: I continue to inch towards the next release and have most of the new documentation written. There are some challenges w/ holiday-related responsibilities and also my dad is having some health problems, but I'm still optimistic the release will be done by the end of the year. Stay tuned!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • ngwrru68w68
  • everett
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • cubers
  • Durango
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • DreamBathrooms
  • megavids
  • GTA5RPClips
  • osvaldo12
  • tacticalgear
  • modclub
  • cisconetworking
  • mdbf
  • tester
  • ethstaker
  • Leos
  • normalnudes
  • provamag3
  • anitta
  • lostlight
  • All magazines