processing / processing/processing4
Add `beginClip()` and `endClip()` masking functions
オープン
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 494
- フォーク
- 183
- 平均マージ
- 4時間 39分
- マージ済み PR(30日)
- 3
説明
Relevant sub-area for this feature?
Core/Environment/Rendering
Feature details
Feature description
Add beginClip() and endClip() to define clipping masks using drawing commands. Shapes drawn between these calls become the mask. An optional invert flag enables inverse masking.
Benefits
- More intuitive and less verbose than
mask() - Matches p5.js API and reduces cognitive load when switching from one to the other
Challenges
- Not sure
Additional context
See https://p5js.org/reference/p5/beginClip/
Example code
This mask() code...
// Create pattern graphics
pattern = createGraphics(width, height);
pattern.beginDraw();
pattern.background(255);
pattern.stroke(0);
pattern.strokeWeight(2);
for (int x = 0; x < width; x += 10) {
pattern.line(x, 0, x, height);
}
pattern.endDraw();
// Create mask graphics (white circle on black)
maskImg = createGraphics(width, height);
maskImg.beginDraw();
maskImg.background(0);
maskImg.noStroke();
maskImg.fill(255);
maskImg.ellipse(width/2, height/2, 200, 200);
maskImg.endDraw();
// Apply mask to pattern
pattern.mask(maskImg);
... becomes this using beginClip()/endClip():
// Define clipping region
beginClip();
ellipse(width/2, height/2, 200, 200);
endClip();
// Draw pattern inside the clip
stroke(0);
strokeWeight(2);
for (int x = 0; x < width; x += 10) {
line(x, 0, x, height);
}
Would you like to help implement this feature?
No, I’m just suggesting the feature
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Core/Environment/Rendering 領域から始め、既存の mask() の動作と、リンクされている p5.js beginClip() のリファレンスを読みます。beginClip()、endClip()、およびオプションの invert フラグがどのように動作すべきかを定義し、その後、呼び出しの間の描画コマンドが期待どおりの通常および反転クリッピング動作を生成することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- computer-graphics
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100