Arcs not drawn correctly when start angle less than end angle
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
調査の方向性
enable.gcbench.suite の再現を実行し、特に π/2 と 0 を使い、clockwise の両方の設定で行う gc.arc 呼び出しを実行して、issue に示されている Agg と Quartz の出力を比較する。まず、意図された角度と winding のセマンティクスを確認する。これらのケースで選択した動作に一貫性があり、説明されている不連続性や誤った clockwise の結果を導入しなければ完了とする。
索引モデルが issue の本文から書いたものです。
説明
Observed behaviour
Drawing from π/2 to 0 (it might be arguable that Agg is correct here):
Agg

Quartz

Drawing from π/2 to 0 with clockwise True (Agg is clearly not right, Quartz is at least consistent):
Agg

Quartz

To reproduce
Add these to enable.gcbench.suite and run:
class draw_arc_backwards:
def __init__(self, gc, module):
self.gc = gc
def __call__(self):
with self.gc:
self.gc.begin_path()
self.gc.arc(100.0, 100.0, 30.0, np.pi / 2, 0.0)
self.gc.set_fill_color((0.33, 0.66, 0.99, 1.0))
self.gc.fill_path()
class draw_arc_backwards_clockwise:
def __init__(self, gc, module):
self.gc = gc
def __call__(self):
with self.gc:
self.gc.begin_path()
self.gc.arc(100.0, 100.0, 30.0, np.pi / 2, 0.0, True)
self.gc.set_fill_color((0.33, 0.66, 0.99, 1.0))
self.gc.fill_path()
Expected behaviour
Not entirely sure.
Quartz is consistent, but has a significant discontinuity when the end angle sweeps over start angle, which may be problematic for plotting sectors and arcs (need to adjust cw flag appropriately when drawing). Agg avoids this, but the result when drawing "clockwise" doesn't make any sense at all. I suspect that the way that Quartz does it will be similar in other 2D libraries, since the Quartz call is a straight-through call to the underlying CoreGraphics routines.
A different possible interpretation is that an arc from one angle to another should be the path swept out between the angles, including windings (with associated effects on EOF vs. winding number fill, so 0 to 4π would be EOF empty), but then the purpose of the cw flag is unclear (one interpretation would be that it means angles are treated as clockwise from the x-axis).
In the end, I would be happy with being consistent with Quartz or HTML Canvas behaviour.
Whatever fix is put in place, it may impact rendering in downstream libraries.
- 主要言語
- C
- スター
- 97
- フォーク
- 45
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
enthought/enable のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 50/100
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 50/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
enthought/enable の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
BasedHardware/omi#19711 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/ebpf-for-windows#5604 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
trezor/trezor-firmware#7985 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信