processing / processing-website

Repository for the processing.org website
https://processing.org
GNU General Public License v2.0
64 stars 95 forks source link

curveDetail example uses default renderer #334

Closed clankill3r closed 1 year ago

clankill3r commented 1 year ago

https://processing.org/reference/curveDetail_.html

This is the example for curveDetail:

Screenshot 2022-09-19 at 11 56 20

The thing is, the example should not use the default renderer cause curveDetail does not work there. This is what it looks like when switching to P2D (as intended):

Screenshot 2022-09-19 at 11 56 54

Also it makes more sense to have all draw code in setup, cause now the first curve will become white after the first frame, and the become all ugly from drawing on top of each other.

SableRaf commented 1 year ago

Hi Doeke you're absolutely correct! If you want to make a pull request for this I will happily merge it.

The following code works as intended:

void setup(){
  size(400,400,P2D);
}

void draw(){
  curveDetail(1);
  drawCurves(-60);
  stroke(126);
  curveDetail(2);
  drawCurves(0);
  stroke(255);
  curveDetail(4);
  drawCurves(60);
  noLoop();
}

void drawCurves(float y) {
  noFill();
  curve( 20, 112+y,  20, 112+y, 292, 104+y, 292, 252+y);
  curve( 20, 112+y, 292, 104+y, 292, 252+y, 60, 268+y); 
  curve(292, 104+y, 292, 252+y, 60, 268+y, 60, 268+y);
}
yogitheboss commented 1 year ago

@SableRaf can I work on this issue ?

SableRaf commented 1 year ago

Hi @yogitheboss. Thanks for your help ✨ I have assigned the issue to you. You will find information on how to update examples in the reference in reference.md. Let me know if you have any questions.

yogitheboss commented 1 year ago

I think you can close this issue as it has been fixed @SableRaf