Skip to content

OpenGL strokeCap(ROUND) and strokeJoin should account for scale when computing the number of arc points #401

Open
@processing-bot

Description

@processing-bot

Created by: scudly

The default renderer very smoothly supports zooming in on ROUND line endcaps and joins while maintaining their roundness. P2D and P3D, however, assume that any strokeWeight less than one won't have visible endcaps even when the scale factor blows them up to many pixels in size.

The following code runs fine with s = 600, i.e., no scaling. Change to s = 1, however, and the endcaps and joins disappear. Remove the P2D and both cases will stay smooth.

float s = 600;
void setup() {
  size( 600, 600, P2D );
  noFill();
  scale( height/s );
  strokeWeight( 0.2*s );
  point( 0.3*s, 0.3*s );
  strokeJoin( ROUND );
  beginShape();
  vertex( 0.6*s, 0.2*s );
  vertex( 0.8*s, 0.8*s );
  vertex( 0.2*s, 0.6*s );
  endShape();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions