processing / processing/processing4

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

Open
#401 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

opengl
Dominant language
Java
Stars
497
Forks
183
Avg merge
4h 39m
Merged PRs (30d)
3

Description

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();
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided sketch with P2D at s = 600 and s = 1, then compare it without P2D. Trace the P2D and P3D handling of ROUND stroke caps and joins, focusing on how arc-point counts use strokeWeight and scale. Done means scaled-down strokes retain visible, smooth round endcaps and joins.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.