parametricCurve function
- Lingua principale
- Haskell
- Stelle
- 1.3k
- Fork
- 201
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
In a conversation with someone, I recently realized that a lot of real graphics work is done with parametric curves. There's no way to draw these in CodeWorld.
My proposal:
In codeworld-api:
parametricCurve :: (Double -> Point) -> Picture
thickParametricCurve :: Double {- thickness -} -> (Double -> Point) -> Picture
In codeworld-base:
parametricCurve :: (Number -> Point) -> Picture
thickParametricCurve :: (Number -> Point, Number {- thickness -}) -> Picture
One could add `parametricClosedCurve`, `thickParametricClosedCurve`, and `solidParametricClosedCurve` in a similar vein.
In this API, I'm assuming that the parameter would vary between 0 and 1. You could imagine passing in a range instead, but I think that makes the API too complex, and I'd rather give students an opportunity to make use of scaling and fractional values on their own.
The actual drawing would be done by sampling. One could even be clever and choose more anchor points when the curve is more complex, or when the picture is scaled up. It's not clear exactly how clever one should be here.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando le API codeworld-api e codeworld-base alla ricerca di primitive esistenti per curve e immagini. Definisci come parametricCurve e thickParametricCurve debbano campionare una funzione per i parametri da 0 a 1, incluso il funzionamento del campionamento adattivo o del ridimensionamento. Il lavoro è completo quando le funzioni proposte disegnano curve parametriche attraverso entrambe le API e sono stati definiti il comportamento e gli eventuali ampliamenti per le curve chiuse.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- haskell
- Ambito
- computer-graphics
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100