Arcs not drawn correctly when start angle less than end angle
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- computer-graphics
Direzione di ricerca
Esegui le riproduzioni in enable.gcbench.suite, in particolare le chiamate a gc.arc che usano π/2 e 0 con entrambe le impostazioni di clockwise, e confronta l’output di Agg e Quartz mostrato nell’issue. Determina innanzitutto la semantica prevista dell’angolo e di winding; il lavoro è completato quando il comportamento scelto è coerente per questi casi e non introduce la discontinuità o il risultato incorrecto di clockwise descritto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C
- Stelle
- 97
- Fork
- 45
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di enthought/enable
-
Add Enable to conda-forgeAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 50/100
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 50/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Tutte le issue di enthought/enable
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
NabuCasa/silabs-firmware-builder#231 · 1 commento ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/pg_clickhouse#383 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
johnsonjh/emu2-cpm86#68 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno