@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.

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

@villares this looks very nice!

TomLarrow, (edited ) to random
@TomLarrow@vis.social avatar

Fighting a strongly growing sense of #Burnout as everyone tries to do "one last thing" before the end of the year.

Haven't felt creative, but felt the need to do some#CreativeCoding before work just to do something for myself for a change.

Rotating some self overlapping 9 sided shapes to form a slightly curvilinear nonagon in #py5

Code: https://codeberg.org/TomLarrow/creative-coding-experiments/src/branch/main/x_0100/x_0119

py5coding,
@py5coding@fosstodon.org avatar

@TomLarrow I love your eye for colors!

TomLarrow, to genart
@TomLarrow@vis.social avatar

Home sick, watching sick kids. Did some #CreativeCoding in #py5 to keep myself busy

Tried to make a simple as "Can I draw some triangles with rounded corners" and it was more complex than I imagined. Each one was drawn on a separate graphics layer and merged back to the main canvas with an alpha modifying tint, in order to avoid the stroke and fill from overlapping. Add in some boundary checking and cold medicine fog, and this took a lot longer than expected

Code: https://codeberg.org/TomLarrow/creative-coding-experiments/src/branch/main/x_0100/x_0116

semi transparent triangles of yellow, orange, green, and red, and pointing in one of the 4 cardinal directions and overlapping. New colors are created where they merge
semi transparent triangles of dark blue and tan, and orange pointing in one of the 4 cardinal directions and overlapping.
A dense pattern of triangles made up mostly of purple brown, and dark green overlapping and blending to form other colors

py5coding,
@py5coding@fosstodon.org avatar

@TomLarrow @villares yes, indeed! And there will be new shapely features added to #py5 in the next release, making @villares 's suggested approach very easy to implement.

TomLarrow, to genart
@TomLarrow@vis.social avatar

Been a super stressful few weeks, but I've had this #CreativeCoding sketch in #py5 running in the background of my file server generating hundreds of images. It gave me something to look forward to seeing the results at at the end of each day.

Tonight I sorted through the images and picked out a few of my favorites

Code: https://codeberg.org/TomLarrow/creative-coding-experiments/src/branch/main/x_0100/x_0113

Flowing ribbons of purple with bright green highlights
A flow field where lines of red and blue flow together
an abstract curve shape of shades of orange and blue

py5coding,
@py5coding@fosstodon.org avatar

@TomLarrow these are beautiful! Keep it up! And I second @mapto 's comment about the alt texts

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

@villares nice use of Py5Graphics objects as textures!

py5coding, to random
@py5coding@fosstodon.org avatar

release update: I've only written about 20% of the new feature documentation needed for the next release, so I'm way behind where I wanted to be by this date. Bear with me, I'll be doing a lot of writing this weekend and will get this release out as soon as I can.

TomLarrow, to genart
@TomLarrow@vis.social avatar

Some more #creativeCoding flow fields in #py5. These did not appear how I thought the math would make them appear, so I have some additional research and debugging to do. But I like how they look nonetheless.

These still take longer than I'd like to generate, but since they only use 1 thread, I generate 16 at the same time

Code: https://codeberg.org/TomLarrow/creative-coding-experiments/src/branch/main/x_0100/x_0111

Lines seem to flow in a curtain, going from red to yellow to green to a neon blue green before turning back to a dark blue green
This one looks like a red orange series of lightning except there are many many forks branching off of it
deep purple flows to green and blue green in a Y like shape

py5coding,
@py5coding@fosstodon.org avatar

@TomLarrow have a look at profile_draw(), which is an easy to use way to profile your draw() function. I suspect the problem line will be particle.draw() (line 109) but you'll have to tell me.

https://py5coding.org/reference/sketch_profile_draw.html

py5coding,
@py5coding@fosstodon.org avatar

@TomLarrow most of Processing is not threadsafe so you cannot call multiple py5 methods from different threads. I don't think jpype (the bridge py5 uses to connect to py5) works with python multiprocessing. You could try to pre-calculate all of the particles before the sketch starts running, save the results in some data structure, and then use the Sketch to draw the saved data to each frame.

villares, (edited ) to cpp Portuguese
@villares@ciberlandia.pt avatar

Cheers people, anyone into C++ #CPP would like to help both the #Python and #Java communities at once?

I have this #jpype issue that affects many Portuguese-speaking users (and I bet, other international users) that have non-ascii chars in their folder names scattered through their OSs.... https://github.com/jpype-project/jpype/issues/1111

This causes trouble for me personally because #py5 depends on jpype and my students have #ThonnyIDE frequently in a directory with non-ascii chars in its path, due to their usernames or on "Área de Trabalho" (desktop)... etc.

py5coding,
@py5coding@fosstodon.org avatar

@villares I added this to my todo list and will see what I can do after the next release. I should be able to replicate this in a Virtual Machine

py5coding,
@py5coding@fosstodon.org avatar

@villares yes, that would be excellent! Help with this would be much appreciated!!

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

@villares I need to get cracking with documentation for the new #py5 features! I have some of the shapely and trimesh stuff written but not nearly enough...will work on it this weekend

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

@villares what fun!

natera, to Amsterdam
@natera@fosstodon.org avatar

I have a new week in review. In this one I cover the #Amsterdam rental crisis, running, and #CreativeCoding with @py5coding Give it a read here:
https://buttondown.email/natera/archive/week-in-review-2023-10-24/
And if you like, spread the word about the newsletter. Previous editions here: https://buttondown.email/natera/archive/ You can subscribe with RSS 😉

py5coding,
@py5coding@fosstodon.org avatar

@natera thanks for including #py5 in your newsletter! Very happy to read how you use it express your inner creativity with code

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

Shipping software for other people to install and use is so hard. No wonder people learn how to deploy things on servers (which I also find so hard). Sigh...

This post was prompted by me having to write workaround instructions for students because a tool I use (and love) is installing the wrong "pinned" library version, so I have to ask the students to pre-install the library...

py5coding,
@py5coding@fosstodon.org avatar

@villares is this Thonny / py5? Can't we update the plugin to un-pin the library version?

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

@villares Nice. It is useful that you can change the fill color for each vertex in the OpenGL renderers. You can do this for stroke also. The default JAVA2D renderer cannot do this.

villares, (edited ) to python Portuguese
@villares@ciberlandia.pt avatar

I'm enjoying improving my naive folder/image browser in #Python
https://github.com/villares/sketch-a-day/blob/main/admin_scripts/folder_browser.py

Every time I explore #GUI making without a proper GUI library/framework, drawing directly on a window with #py5, I get something useful very quickly with lot's of control, but on the other hand, the code starts getting "complicated" quickly.

#PySimpleGUI is awesome for small forms/panels and, as the name implies, simple GUIs. I quickly got blocked by it for this use case. Maybe one day I'll learn #PyQt and "make the jump" to proper GUI building. But the initial complexity is daunting. I'm probably ignoring/overlooking the initial complexity of py5 too, because I'm so used to it and the subjacent #Processing way of doing things!

py5coding,
@py5coding@fosstodon.org avatar

@villares would it be interesting or useful if #py5 worked with the #processing library ControlP5? I believe this is possible but would require a fork+small adjustments of the ControlP5 code.

Another good option is Jupyter Widgets and maybe use voila. I've had good success with this.

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

@TomLarrow these are pretty and delicate structures. Good job!

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

@villares py5bot is great, isn't it? very easy to make quick images

kantel, to python German

Neue Experimente mit Py5: Ein Sketch – zwei (oder noch mehr) Fenster

Ich gebe es ja zu, ich stehe manchmal ein wenig auf dem Schlauch. So hat es bis gestern gedauert, bis ich herausgefunden hatte, wozu der Class Mode in Py5 eigentlich nützlich ist: Mit ihm kann man nämlich einen Sketch mit mehr als einem Fenster schreiben. https://kantel.github.io/posts/2023093002_py5_2windows/ #Py5 #Python #Processing #CreativeCoding #JupyterLabDesktop

py5coding,
@py5coding@fosstodon.org avatar

@kantel Jupyter notebook widgets work well for adjusting parameters for a running py5 Sketch. Voila should also work just fine on a notebook that uses the py5 kernel. Putting both of these things together is a very useful combination

https://ipywidgets.readthedocs.io/en/latest/

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

@villares very nice design!

TomLarrow, to genart
@TomLarrow@vis.social avatar

Some for this evening in . Points are generated around the screen via a random walk, and then connected with curves altering the color and the blend mode as it progresses through the curves

Code: https://codeberg.org/TomLarrow/creative-coding-experiments/src/branch/main/x_0100/x_0102

A white background on which there are lots of blue stars and diamond shapes
A cloudy blue background on which a series of interlocking diamond like curves are drawn
Even more diamond shaped curves

py5coding,
@py5coding@fosstodon.org avatar

@TomLarrow you are really going to like the new color features in the next #py5 release :)

kantel, to python German

Waldbrandsimulation in Python (Py5) – Stage 1

Ich habe es getan: Ich habe mir die hier vorgestellte Waldbrand-Simulation von Al Sweigart und meine eigene, in Processing.py implementierte Version geschnappt und daraus eine – wie ich hoffe – verbesserte Fassung in Py5 programmiert. https://kantel.github.io/posts/2023092301_forestfire_sim_1/ #Python #Py5 #Processing #Simulation

py5coding,
@py5coding@fosstodon.org avatar

@kantel this is a neat project. Very much like your using #py5 for a scientific #simulation in #python. What are you trying to do with matplotlib? It should work well with py5. There is a convert_image() method that can convert a matplotlib figure to a Py5Image object for you.

Note I'm traveling this week but seem to have some access to the Internet. Will do what I can to help you here.

py5coding,
@py5coding@fosstodon.org avatar

@kantel Is this on a Mac by any chance? OSX has this weird complication where any GUI or animation must run on the "main" thread. This is an OSX thing and has nothing to do with Python or py5. Jupyter shares the main thread with py5 plus there is some special OSX specific python code involved. Matplotlib must also have some special code to work with Jupyter, which might not be compatible with what py5 is doing so perhaps both can't work at the same time.

py5coding,
@py5coding@fosstodon.org avatar

@kantel In any case, you should be able to get matplotlib to work with py5 if you don't open a matplotlib window, by using matplotlib non-interactively. Here is some example code that demos a good approach:

https://gist.github.com/hx2A/200b851db28356410d5e87db80d6afe2

natera, to genart
@natera@fosstodon.org avatar

Nodes and edges to generate a lattice from a simple structure. The system can either link or not link two nodes.
Code available at: https://github.com/nateraluis/generative
#py5 #processing #creativecoding #python

image/png

video/mp4

py5coding,
@py5coding@fosstodon.org avatar

@natera that's a good idea, it would look great on paper. Please post when you do

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