processing / processing/p5.js-web-editor

Arc doesn't work with clip function on the editor

Open
#3,755 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

p5.js version

2.1.1

What is your operating system?

Windows

Web browser and version

Edge 143.0.3650.75

Actual Behavior

When I add an arc to the clip function it doesn't show anything drawn afterwards. It works normally with circle for example. Seems to work fine on version 1.11.11

Expected Behavior

show the drawn vectors inside the arc defined in the beginClip(); endClip(); or using the mask function.

Steps to reproduce

function setup() {
createCanvas(100, 100);

background(200);

// Create a mask.
beginClip();
arc(width/2, height/2, 50, 50,PI-radians(30),PI+radians(30))
endClip();

// Draw a backing shape.
rect(0,0,width, height)

describe('A white triangle and circle on a gray background.');
}

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

Run the supplied setup sketch with p5.js 2.1.1 and compare its arc clipping with the reported working 1.11.11 behavior. Start at the beginClip(), arc(), and endClip() entry points, then verify that shapes drawn afterward appear inside the arc-defined clip or mask.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.