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

Inconsistent behavior for Arc #188

Closed
ziyaointl opened this issue Jun 23, 2020 · 5 comments · Fixed by #189
Closed

Inconsistent behavior for Arc #188

ziyaointl opened this issue Jun 23, 2020 · 5 comments · Fixed by #189
Labels

Comments

@ziyaointl
Copy link
Member

Describe the bug
The behavior for Arc in p5py does match with the Processing Language

To Reproduce

from p5 import *

def draw():
    offset = 0
    x = 0
    while x < 2 * PI:
        arc((50.0 + offset, 50.0), 50.0, 50.0, x, 2 * PI)
        arc((50.0 + offset, 100), 50, 50, x, 2 * PI, 'OPEN')
        arc((50.0 + offset, 150), 50, 50, x, 2 * PI, 'CHORD')
        arc((50.0 + offset, 200), 50, 50, x, 2 * PI, 'PIE')
        x += QUARTER_PI
        offset += 50

if __name__ == '__main__':
    run()
void setup() {
  size(640, 360);
}

void draw() {
  int offset = 0;
  for (float x = 0; x < PI * 2; x += QUARTER_PI) {
     arc(50.0 + offset, 50.0, 50.0, 50.0, x, 2*PI);
     arc(50.0 + offset, 100, 50, 50, x, 2*PI, OPEN);
     arc(50.0 + offset, 150, 50, 50, x, 2*PI, CHORD);
     arc(50.0 + offset, 200, 50, 50, x, 2*PI, PIE);
     offset += 50;
  }
}

Expected behavior
Screen Shot 2020-06-22 at 11 47 09 PM

Actual Behavior
Screen Shot 2020-06-22 at 11 47 25 PM

System information:

  • p5 release (version number or latest commit): 975f07e
  • Python version: 3.8.3
  • Operating system: MacOS 10.15.5
@ziyaointl ziyaointl added the bug label Jun 23, 2020
@ziyaointl
Copy link
Member Author

Some progress on the tessellation branch:
Screen Shot 2020-06-26 at 2 24 24 AM

@jeremydouglass
Copy link
Contributor

@ziyaointl -- congratulations on this great work.

Could you comment on the remaining difference between the "expected" image above and the latest pipeline? It seems like there is a column of points and a line on the right edge that is missing. If that is the case, should those remaining differences in behavior be noted in an open issue -- even if they are not a high priority?

@ziyaointl
Copy link
Member Author

@jeremydouglass Thanks! I think the column of points is actually a bug in Processing. The last column has start angle and end angle both set at 2*PI. Therefore, I think it's sensible for the behavior to be "not draw anything" but it could also be undefined. In p5.js, only PIE mode shows a small dot, and all other rows are empty.

Screen Shot 2020-06-30 at 6 34 16 PM

@jeremydouglass
Copy link
Contributor

Interesting! So would you suggest bug reports on the Processing repo / the p5.js repo?

It is an edge case, but nice if we can collectively minimize "undefined" as much as possible in visual outputs. arc() is already frustrating enough without also being inconsistent...

@ziyaointl
Copy link
Member Author

Yeah, that's a good idea. I opened the respective issues here:
processing/processing#6063
processing/p5.js#4664

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.

2 participants