p5 is a Python package based on the core ideas of Processing.

Overview

p5

License Version Slack SanityTests Pylint Pytest

p5 is a Python library that provides high level drawing functionality to help you quickly create simulations and interactive art using Python. It combines the core ideas of Processing — learning to code in a visual context — with Python's readability to make programming more accessible to beginners, educators, and artists.

To report a bug / make a feature request use the issues page in this repository. You can also use the discourse platform to ask/discuss anything related to p5py.

Example

https://github.com/p5py/p5/raw/develop/docs/_static/readme.gif

p5 programs are called "sketches" and are run as any other Python program. The sketch above, for instance, draws a circle at the mouse location that gets a random reddish color when the mouse is pressed and is white otherwise; the size of the circle is chosen randomly. The Python code for the sketch looks like:

from p5 import *

def setup():
    size(640, 360)
    no_stroke()
    background(204)

def draw():
    if mouse_is_pressed:
        fill(random_uniform(255), random_uniform(127), random_uniform(51), 127)
    else:
        fill(255, 15)

    circle_size = random_uniform(low=10, high=80)

    circle((mouse_x, mouse_y), circle_size)

def key_pressed(event):
    background(204)

run()

Documentation

The p5py documentation can be found here p5 documentation

Installation

Take a look at the installation steps here in the p5 installation page

Contributing

We welcome contributions from anyone, even if you are new to open source. You can start by fixing the existing issues in p5py. In case you need any help or support from the p5py development community, you can join our slack group.

License

p5 is licensed under the GPLv3. See LICENSE for more details. p5 also includes the following components from other open source projects:

All licenses for these external components are available in the LICENSES folder.

Comments
  • IO module in p5py

    IO module in p5py

    Is your feature request related to a problem? Please describe. Yes, P5py currently doesn't have an IO module. I would like to work with live data/APIs/serial-input from my python processing sketch.

    Describe the solution you'd like I would like functions in sync with IO module of p5.js so that new users coming to p5py from p5.js do not face any difficulty.

    Describe alternatives you've considered Requests library can be used to perform GET/POST requests.

    Additional context I understand that most of these issues could be resolved through the requests library, thus if possible the IO module could also contain serial input (via USB) etc.

    I would be interested to work on this project.

    opened by nakul-shahdadpuri 24
  • push_matrix() and pop_matrix() not working

    push_matrix() and pop_matrix() not working

    using pop_matrix() does not restore the transform matrix to the previous state. I tried using the exact codes mentioned in your documentation : https://p5.readthedocs.io/_/downloads/en/latest/pdf/.

    from p5 import * def setup(): size(200, 200) def draw(): background(255) fill(192) no_stroke() rect((40, 40), 40, 40) push_matrix() translate(40, 40) rotate(radians(45)) fill(0) rect((40, 40), 40, 40) pop_matrix() if name == 'main': run()

    The following code clearly depicts the error

    opened by tyagi619 24
  • Sketch window stops refreshing on Mac.

    Sketch window stops refreshing on Mac.

    Test Script: p5-examples/basics/math/sine.py. The bug affects all sketches.

    Expected behavior: sine-correct

    Actual behavior The sketch window stops refreshing after a couple of frames are drawn when a newer version of Pyglet (1.3b) is installed.

    sine

    Errors produced (if any): None

    p5 version: 2b96dfc1d2126867e70bc727d0cc7ffc5da8eabc

    Python version: 3.6 Operating System: Mac OS

    bug help-wanted platform-mac priority-high 
    opened by abhikpal 22
  • Bug: Does not install or get the shaders directory

    Bug: Does not install or get the shaders directory

    Describe the bug I forked the repo and downloaded it. I renamed the main directory to main where code is not located so that the main and the local library do not clash.

    To Reproduce Just download and run the repo with the original p5 version installed from pip

    Expected behavior Should work as the folder was renamed so it should not clash.

    bug 
    opened by Andy-Python-Programmer 19
  • metadata-generation-failed

    metadata-generation-failed

    Describe the bug Error when generating metadata on this step(Preparing metadata (pyproject.toml) did not run successfully.)

    To Reproduce Steps to reproduce the behavior (if applicable)

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots image

    System information:

    • p5 release (version number or latest commit): latest version
    • Python versions: 3.10 and 3.9
    • Operating system: windows 10 x64

    Additional context Add any other context about the problem here.

    opened by osama1998H 18
  • formatted the whole code with autopep8

    formatted the whole code with autopep8

    Related to #255

    No merge conflicts and only python files are formatted, .rst and md files are not affected.

    Command ran :

    find . -name '*.py' -exec autopep8 --in-place --aggressive '{}' \;
    
    opened by tushar5526 16
  • The quest for better tessellation

    The quest for better tessellation

    This issue attempts to explore some of the options for

    1. Improving tessellation/triangulation performance
    2. Support tessellation/triangulation in 3D

    Current implementation in p5py

    The existing implementation uses the triangle python module to triangulate shapes before sending them to the GPU. The triangle module is in turn a wrapper around the Triangle C library written by Jonathan Shewchuck that implements the Delaunay triangulation algorithm.

    This site notes that the Triangle Library by Prof. Shewchuck has several deficiencies. In particular,

    1. It does not like duplicate vertices or duplicate edges. 'Duplicate' in this case is relative to numeric precision: For a building 10-100 meters in size, two vertices within 8cm of each other, defining a very short edge, can cause Triangle to crash.
    2. It does not like it when a hole (inner ring) in the polygon has a vertex in the same location as one in the outer ring (crash).

    In fact, the problems mentioned above are rather minor. The biggest problem of all is probably the fact that triangle does not support 3D points.

    Current implementation in Processing and p5.js

    Maybe we can reference the triangulation implementations in other branches of the processing language? Here's what I found:

    For Processing (OpenGL backend), GLU was referenced through the JOGL binding, evidenced by source files PGraphicsOpenGL.java#L10985 and PJOGL.java#L605. Given that we don't have JOGL on Python and GLFW doesn't support GLU, we might have to look for other options.

    For p5.js, tessellation support was achieved via libtess.js, which uses the GLU tessellation algorithm but rewritten in JavaScript (reference).

    Exploring our options

    OpenGL/GLU

    From first glance, using OpenGL is as simple as using the following API:

    gluTessBeginPolygon(tess, user_data);
        gluTessBeginContour(tess);
            gluTessVertex(tess, coords, vertex_data);
            ...
            gluTessVertex(tess, coords_n, vertex_data);
        gluTessEndContour(tess);
    gluTessEndPolygon(tess);
    

    (Code example adapted from songho.ca)

    However, further searches indicated that this API is not part of OpenGL core, but part of GLU (OpenGL Utility Library). According to GLFW

    GLU has been deprecated and should not be used in new code.

    So GLFW isn't helpful here.

    I asked the question of how to use GLU bindings on the vispy Gitter chat after not finding anything related to GLU on their documentation. I did get a response from vispy maintainers very quickly. Thank you! However, he confirmed that vispy does not currently support the tessellation API.

    Short answer is no. Long answer: I'm not familiar with the gluTess API specifically, but I'm guessing this has to do with tessellation shaders, right? Currently VisPy does not have any support for tessellation shaders but I think there are PRs trying to add it. In the last year we added support for geometry shaders which really set up the interfaces for adding additional shaders like the tessellation shaders, but so far these have not been added. [email protected]

    Given that our current dependencies don't have this functionality, another option is to introduce a new library called PyOpenGL, which offers a wrapper for GLU (in addition to a lot more OpenGL functionality). Since we already have vispy.gloo for making OpenGL calls, we may want to discuss whether it's worth it to introduce another dependency with potentially the same capability as vispy but only use it for tessellation.

    Scipy

    Scipy also has a function that performs the Delaunay triangulation algorithm. Instead of wrapping around Prof. Shewchuck's library, it wraps around Qhull. This supports both 2D and 3D. However, the Qhull website says the library only works with convex hulls, so non-convex objects (e.g. objects with holes created by begin_contour) wouldn't work.

    Moving Forward

    Between scipy and PyOpenGL, I am leaning towards PyOpenGL because it uses the same underlying algorithm as the Processing Language and p5.js while also supporting non-convex shapes. The downside is that it's a rather large library that overlaps in features with vispy. If you have an opinion on this subject, leave a comment down below!

    Roadmap

    Here's my tentative plan to improve tessellation in p5py:

    • [x] Build sample scenes for profiling
    • [x] Profile performance of master branch as baseline
    • [x] Fix obvious performance issues (if any)
    • [x] Replace triangle with PyOpenGL, or another triangulation library
    • [x] Profile again and compare to baseline
    • [x] Implement parts of begin_shape and end_shape that only requires trivial/no triangulation in 3D (i.e. POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, and QUAD_STRIP).
    • [x] Implement the complete version of begin_shape and end_shape in 3D (i.e. TESS in addition to the modes mentioned above).
    • [x] (Stretch goal) Implement begin_contour and end_contour in 3D.
    • [x] Document API changes
    enhancement GSoC2020 
    opened by ziyaointl 15
  • AttributeError: module 'p5.core.p5' has no attribute 'exit'

    AttributeError: module 'p5.core.p5' has no attribute 'exit'

    Describe the bug I tried running the sample code in p5 README text in spyder 4, Jupyter Notebook, and external windows terminal. The same error(AttribureError: ...) pops up in the first two. The terminal , however properly executes this code. Please let me know how to fix it. (i find it comfortable to run codes in those environments...) To Reproduce Try running the code in those environments:

    samplep5.txt

    Screenshots The errors i got in the two environments error_jupy.txt : error_spy.txt

    System information:

    • p5 release 0.6.0
    • Python 3.7.6
    • Operating system: Windows 10
    enhancement 
    opened by Gautameshwar 15
  • Add the black formatter GitHub Action

    Add the black formatter GitHub Action

    Is your feature request related to a problem? Please describe. There is a need for a uniform coding style across p5py

    Describe the solution you'd like Add a GitHub action that checks a PR for coding style using black. The GHA should be able to format the code and commit it to the PR if the PR is not following the coding style.

    good-first-issue 
    opened by tushar5526 14
  • Fixes #158 Fixed the issue where no_loop() was drawing another extra …

    Fixes #158 Fixed the issue where no_loop() was drawing another extra …

    …frame when used in draw()

    Now no_loop() checks from where it is being called and draws another frame if it is called from setup() and dont call another frame when called in draw()

    Closes #158 properly

    The earlier PR of mine is causing a problem if we call no_loop() in setup() method, things are coded in a way to draw another frame when we use no_loop(), so if there is a no_loop() present in draw() , first draw() is called initially the no_loop() is encountered, but no_loop() is set in a way so that it calls exactly one another frame, hence we are getting the bug mentioned in this issue

    no_loop() was made to draw another loop because, if no_loop() is present in setup(), then first setup() is called, which calls no_loop(), no_loop() do not let the draw() function get called in the next the next iteration(hence nothing would be drawn after that) that's why the developer made a check that no_loop() will draw one more frame so if no_loop() is present in setup() things will work properly

    Possible fixes for this bug and the problem I mentioned is, if no_loop() was called from setup() then we call draw() in other iteration , and if it is called in draw(), then we dont call another draw_loop() in the next iteration, or better let this bug be there !

    I have tested this approach and tested it with the current bugs plus also with redraw() function and checked frame_count to be correct, but you may test it again in some other way :

    Things to test

    • no_loop() in setup() -no_loop() in draw() -redraw() -checking whether frame_count is correct after each frame is drawn
    opened by tushar5526 13
  • Interactivity Tutorials The key variable stores example raise ValueError(

    Interactivity Tutorials The key variable stores example raise ValueError("text_size is nor supported for Bitmap Fonts")

    Describe the bug The following example, within the Interactivity tutorials when running, the following error occurs

    In the Interactivity Tutorial in Keyboard data section the next example

    from p5 import *
    
    def setup():
        size(100, 100)
        text_size(60)
    
    def draw():
        background(0)
        text(key, 20, 75) # Draw at coordinate (20,75)
    
    if __name__ == '__main__':
        run()
    

    when run shows the fallowing error:
    raise ValueError("text_size is nor supported for Bitmap Fonts")

    To Reproduce Just copy and paste the example in a text editor and run the script

    Expected behavior Should show in the window the key pressed in a specify size

    Screenshots p5 error

    System information:

    • p5 release (0.6.0):
    • Python version: 3.7.4
    • Operating system: Windows 10

    Additional context Changing the script to

    from p5 import *
    
    
    def setup():
        size(150, 150)
       # text_size(60) need to comment this line
    
    
    def draw():
        background(0)
        text(str(key), (20, 75))  # add str() to key
    
    run()
    

    Give me the next result:

    p5 error 2

    Key NOT pressed:

    key_not_pressed

    Key pressed: key_pressed

    So as you can see, a get a similar behavior expected from the example with this changes, but I don't know if this is a real fix or its something else under the hood

    font 
    opened by edurojasr 13
  • Depending on WebGL

    Depending on WebGL

    Hey folks, I know nothing about GL technologies, but I wrote an app to run processing on the web with python using pyscript: elektrasdream.com And I thought it'd be better to use a proper implementation of p5js rather than a mix of js (p5js) and python, which is what I have right now. So that's why I'm reaching out: I'm wondering how hard it'd be to depend on WebGL instead of GLFW and if it's easy/possible/someone does the job would we lose a lot of features? Cheers and thanks,

    opened by marimeireles 1
  • Fix#362 : Fixed order of GHAs

    Fix#362 : Fixed order of GHAs

    Related to #362 .

    Hey @tushar5526 @ziyaointl ! I have restructured the build tests and compiled all of them into one singe GHA.Can you test this?

    Explaination of changes: added a needs parameter in every job connecting it with the previous job.

    opened by RyanWalker277 0
  • Feature request: Conda package

    Feature request: Conda package

    I see many projects that have "non-python" dependencies, like is the case of GLFW for p5py, to use Anaconda/miniconda as an install option, as it is able to install more stuff in your system, in a single step.

    Have you considered having a conda package?

    good-first-issue 
    opened by villares 3
  • Question: Shouldn't `pip install p5py` get you PyOpenGL?

    Question: Shouldn't `pip install p5py` get you PyOpenGL?

    I have the impression that after pip install p5py I didn't get PyOpenGL.

    So I did install PyOpenGL and everything worked. Was this a fluke, or something on my system? If this is not a mirage, if this is by design, could it be changed so that installation for beginners is easier?

    I'm using Manjaro Linux.

    opened by villares 1
  • Error while installing p5

    Error while installing p5

    Describe the bug when I try to install this library viapip install p5 I get an error about Pillow installation failure, but I already have the latest version of Pillow installed To Reproduce run pip install p5

    Expected behavior p5 will install normally

    Screenshots image image image

    System information:

    • p5 release (version number or latest commit): 0.8.1
    • Python version: 3.11
    • Operating system: Windows 10 x64

    Additional context none

    opened by maksim10411072 2
  • Error running only with renderer as Skia

    Error running only with renderer as Skia

    My installation works fine with vispy but fails wih Skia.

    Traceback (most recent call last):
      File "test.py", line 96, in <module>
        run(renderer="skia")
      File "/Users/mahdi/.local/lib/python3.8/site-packages/p5/sketch/userspace.py", line 231, in run
        p5.sketch.start()
      File "/Users/mahdi/.local/lib/python3.8/site-packages/p5/sketch/Skia2DRenderer/base.py", line 156, in start
        self.window = self.glfw_window()
      File "/Users/mahdi/.local/lib/python3.8/site-packages/p5/sketch/Skia2DRenderer/base.py", line 76, in glfw_window
        if not glfw.init():
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 714, in init
        res = _glfw.glfwInit()
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 616, in errcheck
        _reraise(exc[1], exc[2])
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 52, in _reraise
        raise exception.with_traceback(traceback)
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 595, in callback_wrapper
        return func(*args, **kwargs)
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 808, in _handle_glfw_errors
        raise GLFWError(message)
    glfw.GLFWError: (65544) b'Cocoa: Failed to find service port for display'
    

    Not sure where to start troubleshooting this. Any suggestions would be greatly appreciated

    opened by mahdi-b 2
Releases(v0.8.1)
  • v0.8.1(Nov 15, 2022)

    v0.8.1

    We are happy to announce the final developmental release under the summer fellowship at The Processing Foundation The project was supervised by Mark Zhang. This release adds on to the experimental 2D renderer using Skia.

    New Features

    Typography support for skia #371

    - p5py now support all types of fonts as found in other processing ports
    - 5x efficiency in font sketches as compared to vispy renderer
    

    Image APIs for "skia" #344

    Support for Offscreen buffers #386

    - create_grahpics is now available in p5py's skia renderer
    

    Support for python 3.10 #395

    - Please see the attached note below
    

    This release includes contributions from @tushar5526, @ziyaointl, and @Mr-Sunglasses, Thank you!

    PS: There are a lot of good open issues that currently need help and we would love your contributions!

    NOTE

    pyopengl-accelarate is omitted from the requirements.txt temporarily. See #397 for more information about this. If you are looking for better 3D performance you can install it from the requirements.txt file.

    benchmark | with pyopengl-accelerate | without pyopengl-accelerate | change -- | -- | -- | -- arcs | 8.944169 | 9.764988 | 9.18% arm | 2.612446 | 2.611884 | -0.02% basic_shapes | 2.629553 | 2.688781 | 2.25% begin_contour | 2.684205 | 2.711441 | 1.01% curves | 4.766132 | 4.962305 | 4.12% custom_shapes | 4.643741 | 4.754362 | 2.38% custom_shapes2 | 3.75905 | 3.791483 | 0.86% point_demo | 2.880713 | 2.939999 | 2.06% primitives | 3.651718 | 3.717032 | 1.79% spinning-cone_p3d | 9.417307 | 9.437273 | 0.21% tetrahedron_p3d | 8.114283 | 8.203861 | 1.10% triangle_strip | 3.228278 | 3.228012 | -0.01% world_p3d | 26.883501 | 26.991062 | 0.40%

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Aug 4, 2022)

    v0.8.0

    We are happy to announce another developmental release under the summer fellowship at The Processing Foundation. The project was supervised by Mark Zhang. This release comes with an experimental 2D renderer using Skia. The skia 2D renderer shows significant improvements in both rendering and efficiency of the sketches.

    You can use the new 2D renderer by using the renderer argument in run function run(renderer='skia')

    Bug Fixes

    • #276
    • #311
    • #308
    • #309
    • #355
    • #352

    New Features

    • Along with the snake_case convention we support the camelCase convention for most Processing APIs #280
    • New experimental 2D renderer "skia" #344. Skia currently does not support typography and Image APIs, they will be implemented in further releases.

    List of New APIs

    • frame_rate{.interpreted-text role="any"} sets frame rate for a sketch (only for skia)
    • rect{.interpreted-text role="any"} now supports border radius (only for skia)
    • CORNERS{.interpreted-text role="any"} CORNERS mode added (only for skia)
    • focussed{.interpreted-text role="any"} holds whether the current window is in focus or not (only for skia)

    All the API previously present are supported as well in skia.

    Here are some profiling results comparing the time taken to draw 100 frames for different sketches

    | Name | Skia | Vispy | |-----------------|--------|--------| | arcs | 2.11s | 10.06s | | custom_shapes | 1.84s | 5.00s | | triangle_strip | 2.55s | 3.33s | | curves | 1.76s | 5.41s | | primitives | 1.73s | 3.9s |

    This release includes contributions from @tushar5526, @niklasr22, @ziyaointl, @nakul-shahdadpuri, @andreasWallner, @janbehrens, @yogeshhk, @cuppajoeman, @willtryagain, @parsoyaarihant, @Kartik-byte, @Andy-Python-Programmer, @Mr-Sunglasses Thank you!

    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Sep 2, 2020)

    We are happy to announce another developmental release from Google Summer of Code 2020! This is the final release for GSOC this year and includes API refactors, additions, and bug fixes with compatibility and stability as foci.

    List of New APIs

    • fract calculates the fractional part of a number. Contributed by @tushar5526
    • http_get and http_post makes HTTP requests to the web. Contrbuted by @nakul-shahdadpuri
    • pop_matrix and pop_style are alternatives to the context manager syntax used by previous version. Accordingly, push_matrix and pop_matrix can now both act as context managers and be directly called like in Processing or p5.js

    The following additional signatures are added for compatibility with other Processing dialects

    • line(x1, y1, x2, y2)
    • line(x1, y1, z1, x2, y2, z2)
    • ellipse(a, b, c, d, mode=None)
    • circle(x, y, radius, mode=None)
    • arc(x, y, width, height, start_angle, stop_angle, mode=None, ellipse_mode=None)
    • image(img, x, y)
    • image(img, x, y, w, h)
    • triangle(x1, y1, x2, y2, x3, y3)
    • quad(x1, y1, x2, y2, x3, y3, x4, y4)
    • rect(x, y, w, h)
    • square(x, y, side_length)
    • bezier(x1, y1, x2, y2, x3, y3, x4, y4)
    • bezier(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4)
    • curve(x1, y1, x2, y2, x3, y3, x4, y4)
    • curve(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4)
    • camera(position_x, position_y, position_z, target_x, target_y, target_z, up_x, up_y, up_z)
    • camera(position, target_position, up_vector)
    • text(text_string, x, y)
    • text(text_string, x, y, z)

    The following functions can now take floats and tuples of arbitrary length

    • bezier_point
    • bezier_tangent
    • curve_point
    • curve_tangent
    • quadratic_point

    List of issues fixed in this release

    • #186 begin_shape('POINTS') does not draw points
    • #161 Cant use stroke_weight for points
    • #238 Point shape causing concatenate error
    • #171 Add support for pop syntax

    This release includes contributions from @nakul-shahdadpuri, @tushar5526, and @parsoyaarihant. Thank you!

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Aug 30, 2020)

    We are happy to announce another developmental release from Google Summer of Code! This release includes bug fixes, a refactored rendering pipeline with improved performance, new 3D capabilities, and new example code.

    List of New APIs

    • New materials in P3D
      • normal_material assigns a color to a pixel solely based on the normal vector of the fragment being rendered. Useful for debugging
      • basic_material returns a uniform color.
      • blinn_phong_material is a material based on the Blinn-Phong reflection model. This is the most “realistic” material in p5py. Parameters to adjust it include
        • ambient is the color that interacts with ambient_lights
        • diffuse/emissive is the surface color that interacts with point_lights and directional_lights
        • specular is the highlight color that interacts with point_lights and directional_lights
        • shininess determines how glossy a surface is
    • Lighting system in P3D
      • lights creates default lights
      • ambient_light is a light that's uniform everywhere
      • directional_light comes from one direction: it is stronger when hitting a surface squarely, and weaker if it hits at a gentle angle.
      • point_light comes from one location and emits to all directions.
      • light_specular controls the color of the specular highlight
      • light_falloff controls how fast a light fades with distance

    List of issues fixed in this release

    • #31 Implement saveFrame()
    • #155 Output canvas to video or sequence of png's
    • #156 push_matrix() and pop_matrix() not working
    • #158 no_loop incorrectly allows an extra draw frame
    • #172 begin_contour and end_contour not working
    • #175 no_loop() when used in setup() don't call draw() but it should call draw() only once
    • #152 Occlusion of shapes in 3D Mode
    • #180 Tutorial wrong? pop_matrix() does nothing, but should be refered as reset_matrix() instead
    • #167 end_shape() is closing shapes without 'CLOSE'
    • #188 Inconsistent behavior for Arc
    • #195 Not able to create holes in a shape using begin and end contour
    • #201 remap map to remap
    • #141 AttributeError: 'Geometry' object has no attribute 'children'
    • #173 The quest for better tessellation
    • #183 Scalling with scale(1,0) does nothing. but scale(0,1) works
    • #217 Bug: Does not install or get the shaders directory
    • #213 Add support for renderer attribute in run() function
    • #222 Update installation scripts
    • #174 Add 3D material and lighting APIs
    • #66 VS Code + pylint integration with p5

    This release also includes contributions from @parsoyaarihant, @jeremydouglass, @tushar5526, @Hansimov, @ReneTC, @Andy-Python-Programmer, and @galaxyproduction. Thank you!

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Apr 8, 2020)

    We're happy to announce a developmental release from this Google Summer of Code 2019 project! This release includes addition of new APIs. In addition to the new APIs, many examples and tutorials are added for p5 modules (the details can be found on the p5 documentation website).

    List of new APIs

    • Typography methods p5.text_align, p5.text_leading and p5.text_size allows the user to control different position and size attributes of the text. Methods p5.text_ascent, p5.text_descent and p5.text_width can be used to obtain different dimensional attributes of text.

    • p5.load_shape function allows the user to load an SVG file which can be rendered on the screen. The SVG shape is converted into PShape primitives and rendered on the screen using p5.shape method.

    • The methods p5.begin_shape and p5.end_shape can be used to make custom shapes defined by different vertex types (p5.vertex, p5.curve_vertex, p5.bezier_vertex, p5.quadratic_vertex). Contours inside a shape can also be created using p5.begin_contour and p5.end_contour methods.

    • Stroke methods allows the user to control the stroke width and styles:

      • p5.stroke_weight: allows for specifying the width of stroke
      • p5.stroke_cap: allows the user to set the style of line endings
      • p5.stroke_join: allows the user to set the style of joints which connect the line segments
    • This release introduces limited 3D support. New functions for :

      • The p5.camera allows for specifying the camera coordinates in 3D space
      • The projection functions p5.ortho and p5.perspective allow the user to control the type of projection system being used to render 3D objects on the screen
      • New 3D shape primitives are added: p5.box, p5.plane, p5.sphere, p5.ellipsoid, p5.cylinder, p5.cone, p5.torus

    List of issues fixed in this release

    • #129 millis() does not go beyond 1 second and gives microseconds()
    • #114 Rectangle not overlaying on line correctly
    • #91 Arc does not render correctly with transparency
    • #90 arc outline shows up as line in corner of window

    This release also includes contributions from @edurojasr, @abhikpal and @jeremydouglass. Thanks :)

    Source code(tar.gz)
    Source code(zip)
    p5-0.6.0.tar.gz(56.13 KB)
    p5-0.6.0.zip(112.04 KB)
  • v0.5.0(Apr 14, 2020)

    p5 version 0.5.0 is the final release for the Google Summer of Code 2018 project by Abhik Pal The project was supervised by Manindra Mohrarna of the Processing Foundation. The goal of the project were:

    1. Move the internal windowing and OpenGL framework to vispy
    2. Add support for user defined polygons
    3. Add image support

    We met all of these goals completely. The first was covered by a release from earlier in the summer. These release notes summarize our later two goals. In addition to the stated goals we were also able to add minimal typography support and port some tutorials from Processing to p5:

    • Color by Daniel Shiffman
    • Vectors by Daniel Shiffman
    • Electronics by Hernando Berragán and Casey Reas

    API Additions

    • The p5.PShape class is equivalent to PShape in Processing. This allows creation of arbitrary user defined polygons that can have their own style (fill, stroke, etc) and transform (rotation, translation) attributes.

    • The p5.PImage class allows for manipulating images in p5. Most of the API is similar to that of Processing's. Each image object "pretends" to be a 2D array and hence operations for cropping, copying, and pasting data can have implemented as indexing operations on the image. For instance, given some image img with dimensions 800 × 600, img[400:, :300] gives a new image with the required region. Individual pixels can be set / read as p5.Color objects though indices into the image. The class also includes functionality to apply filters and blend two images together.

    • The p5.load_image and p5.image function allow, respectively, loading and displaying images on the screen.

    • The p5.image_mode function controls how parameters to p5.image are interpreted.

    • p5.tint and the related p5.no_tint function allow for setting and disabling tinting of images that are drawn on the screen.

    • The p5.load_pixels context manager loads the current display as a global pixels PImage object. This combines functionality of Processing's loadPixels() and updatePixels().

    • p5.save and p5.save_frame methods allow users to either save the current state of the sketch or the final rendered frame as an image.

    • This release also introduces some basic typography functions like p5.text for displaying text on screen. The p5.load_font and p5.create_font allow loading font files to change the display typeface using text_font. As of now, only TrueType (ttf) and bitmap fonts are sup

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0a1.dev2(Jul 18, 2018)

    We're happy to announce a developmental release from this year's Google Summer of Code project! While we haven't changed the public API much, the whole backend has been re-written to use vispy. This has allowed us to remove many platform specific issues. In particular, this release closes the following pending issues and pull requests:

    • #10: Sketch window stops refreshing on Mac.
    • #15: Blank sketch window on Mac
    • #16: Mouse_x and mouse_y returning negative values
    • #17: Set range limit on mouse_x and mouse_y values
    • #18: matmul operator doesn't work on Python 3.4 and less.
    • #22: Replaced @ with np.dot()
    • #23: Tuple unpacking incompatible with Python 3.4 and less.
    • #35: Removed pyglet.window.get_platform()
    • #36: Fixed distance() of class Vector by adding np.sqrt
    • #37: raise an error, when Vector.normalize() tries to normalize a "zero-vector"
    • #38: raise ValueError when Magnitude of Vector is 0
    • #39: background() inside setup() behaves strangely
    • #40: fix bug #23: Tuple unpacking incompatible with Python 3.4 and less
    • #41: matmul operator on Python version <= 3.4 (rel: #18)
    • #47: key variable not working
    • #49: Fix retina issues on the mac.
    • #50: #49 breaks the documentation auto generation
    • #9: Sketch does not cover the entire window on retina displays.

    This release also includes contributions from @parsoyaarihant, @Devrim-Celik, @hx2A, and @antiboredom. Thank you : )

    Head over to the installation page for getting started with the new p5 version! The documentation is hosted on p5.rtfd.io and we have many example sketches in a separate repository.

    We're excited to hear what you have to say!

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0a1(Aug 20, 2017)

    People,

    We've been working for the last twelve or so weeks to get most of the internal plumbing done and expose an API that people can start playing around with. And today we're happy to announce the first alpha release of p5 :tada:

    As of this release, we have support for:

    • Running basic p5 sketches.
    • An interface to events and event handlers.
    • Drawing 2D shapes.
    • Full support for parsing and using colors (except support for using hex-codes)
    • Full support for all utility functions for math, vectors, etc.

    Links to help you get started:

    Mac users might face some issues getting the sketches to run. We haven't been able to consistently reproduce the issues, but please take a look at issue #9 and issue #10 .

    Meanwhile, as we write more documentation, fix bugs, and port tutorials from Processing, we would love to know what you think! Couple of ways you can reach out to us:

    p5 started off as a Google Summer of Code project and even though the official coding period will end in little less than a week, development on p5 will continue. Feedback, contributions, and criticism are more than welcome :)

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0dev4(Jul 19, 2017)

Owner
p5py
p5py
Extract continuous and discrete relaxation spectra from G(t)

pyReSpect-time Extract continuous and discrete relaxation spectra from stress relaxation modulus G(t). The papers which describe the method and test c

3 Nov 03, 2022
A good Tool to comment on xmw

A good Tool to comment on xmw

1 Feb 10, 2022
CDM Device Checker for python

CDM Device Checker for python

zackmark29 79 Dec 14, 2022
Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Source-o-grapher is a tool built with the aim to investigate software resilience aspects of Open Source Software (OSS) projects.

Aristotle University 5 Jun 28, 2022
"Hacking" the (Telekom) Zyxel GPON SFP module (PMG3000-D20B)

"Hacking" the (Telekom) Zyxel GPON SFP module (PMG3000-D20B) The SFP can be sour

Matthias Riegler 52 Jan 03, 2023
Customisable coding font with alternates, ligatures and contextual positioning

Guide Ligature Support Links Log License Guide Live Preview + Download larsenwork.com/monoid Install Quit your editor/program. Unzip and open the fold

Andreas Larsen 7.6k Dec 30, 2022
Convert Photoshop curves (acv) to xmp presets for Lightroom

acv2xmp Convert Photoshop curves (acv) to Lightroom preset (xmp) acv2xmp.py Basic command prompt that relies on standard library only and can be used

5 Feb 06, 2022
Exercise to teach a newcomer to the CLSP grid to set up their environment and run jobs

Exercise to teach a newcomer to the CLSP grid to set up their environment and run jobs

Alexandra 2 May 18, 2022
A totally unrealistic cell growth/reproduction simulation.

A totally unrealistic cell growth/reproduction simulation.

Andrien Wiandyano 1 Oct 24, 2021
Would upload anything I do with/related to brainfuck

My Brainfu*k Repo Basically wanted to create something with Brainfu*k but realized that with the smol brain I have, I need to see the cell values real

Rafeed 1 Mar 22, 2022
ArinjoyTheDev 1 Jul 17, 2022
A ULauncher/Albert extension that supports currency, units and date time conversion, as well as a calculator that supports complex numbers and functions.

Ulauncher/Albert Calculate Anything Ulauncher/Albert Calculate Anything is an extension for Ulauncher and Albert to calculate things like currency, ti

tchar 67 Jan 01, 2023
CaskDB is a disk-based, embedded, persistent, key-value store based on the Riak's bitcask paper, written in Python.

CaskDB - Disk based Log Structured Hash Table Store CaskDB is a disk-based, embedded, persistent, key-value store based on the Riak's bitcask paper, w

886 Dec 27, 2022
A simple python project that can find Tangkeke in a given image.

A simple python project that can find Tangkeke in a given image. Make the real Tangkeke image as a kernel to convolute the target image. The area wher

张志衡 1 Dec 08, 2021
Fully cross-platform toolkit (and library!) for MachO+Obj-C editing/analysis

fully cross-platform toolkit (and library!) for MachO+Obj-C editing/analysis. Includes a cli kit, a curses GUI, ObjC header dumping, and much more.

cynder 301 Dec 28, 2022
Fastest python library for making asynchronous group requests.

FGrequests: Fastest Asynchronous Group Requests Installation Install using pip: pip install fgrequests Documentation Pretty easy to use. import fgrequ

Farid Chowdhury 14 Nov 22, 2022
This is the Quiz that I made using Python Programming Language. This can only run in the Terminal

This is the Quiz that I made using Python Programming Language. This can only run in the Terminal

YOSHITHA RATHNAYAKE 1 Apr 08, 2022
Combines power of torch, numerical methods to conquer and solve ALL {O,P}DEs

torch_DE_solver Combines power of torch, numerical methods and math overall to conquer and solve ALL {O,P}DEs There are three examples to provide a li

Natural Systems Simulation Lab 28 Dec 12, 2022
🏆 A ranked list of awesome Python open-source libraries and tools. Updated weekly.

Best-of Python 🏆 A ranked list of awesome Python open-source libraries & tools. Updated weekly. This curated list contains 230 awesome open-source pr

Machine Learning Tooling 2.7k Jan 03, 2023
Bitflip Fault Simulation Platform by Daniele Rizzieri (2021)

SEE Injection Framework 2021 This repository contains two Single Event Effect (SEE) injection platforms. The first one is called BFSP - "Bitflip Fault

Daniele Rizzieri 2 Nov 05, 2022