Name

curveDetail()

Description

Sets the resolution at which curves display. The default value is 20. This function is only useful when using the P3D renderer as the default P2D renderer does not use this information.

Examples

  • void setup(){
      size(400,400,P2D);
    }
    
    void draw(){
      background(204);
      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);
    }
    Image output for example 1

Syntax

  • curveDetail(detail)

Parameters

  • detail(int)resolution of the curves

Return

  • void