Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant use stroke_weight for points #161

Closed
arieltl opened this issue Apr 29, 2020 · 4 comments · Fixed by #242
Closed

Cant use stroke_weight for points #161

arieltl opened this issue Apr 29, 2020 · 4 comments · Fixed by #242
Assignees
Labels

Comments

@arieltl
Copy link

arieltl commented Apr 29, 2020

A clear and concise description of what the bug is.
in processing.py you can use strokeWeight to change the size of points but in p5py points seems to always be 1 pixel regardless of using stroke_weight or not.

@jeremydouglass
Copy link
Contributor

Thanks @portalgamesmais. Could you provide a simple example test sketch?

@arieltl
Copy link
Author

arieltl commented Apr 30, 2020

in processing.py the following sketch:

def setup():
    size(200,200)
    noLoop()

def draw():
    background(0)
    stroke(255)
    point(10,50)
    strokeWeight(10)
    point(50,50)

results in:
image

wile in p5py the following sketch:

from p5 import *


def setup():
    size(200,200)
    no_loop()

def draw():
    background(0)
    stroke(255)
    point(10,50)
    stroke_weight(10)
    point(50,50)

if __name__ == '__main__':
    run()

results in:
image

@DamasdiGabor
Copy link

I also have this problem. I have installed p5 using pip. Since this was my first try with p5 it took me a while to convince myself that this is a bug.

@jeremydouglass
Copy link
Contributor

jeremydouglass commented May 2, 2020

For anyone thinking about working on this issue: The way that points are rendered in Processing(Java) is surprisingly complex under the hood due to support for strokeCap and how the behavior aligns with PostScript / CSS. So, in addition to strokeWeight() making points bigger, strokeCap() may make points invisible.

For recent discussion in Processing / Processing-docs, see:

processing/processing-docs#792
processing/processing#5957

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants