|
a grievance with the API... |
Mark Oates
Member #1,146
March 2001
|
So, this has kinda been bothering me for awhile. current API: al_draw_circle(); // draws an outlined circle al_draw_filled_circle(); // draws a filled circle every time I want to use it, this is what I expect: al_draw_circle(); // draws a filled circle al_draw_outlined_circle(); // draws the stroke of the circle This has happened a lot. Normally for something like this, I would defer to the methodology of the API and give it time to sink in, but I trip up every time when using the primitive functions in this regard and my mind can't seem to acclimate to it. So, I've decided to mention it, and am offering the possibility that the API could be incorrect. Giving it some thought, here's some reasoning I've come up with:
TLDR; From a computer graphics standpoint I can't conceive of the stroke of a circle as the "circle", and a filled circle as the "other" one. Thoughts? -- |
Arthur Kalliokoski
Second in Command
February 2005
|
If someone gave you a pencil and paper and asked you to draw a circle, what would you do? Mark Oates said: The filled primitive is more "primitive" than the outlined variation, which involves more intricate math to breakdown the stroke into smaller primitives How so? The filled version not only has to do the chords (I assume that's what you mean by "stroke") but also has to fill it. They all watch too much MSNBC... they get ideas. |
André Silva
Member #11,991
May 2010
|
I also trip up most of the time, but when it's time to fill in the parameters for the function, I always realize if there's a parameter missing or in excess.
|
Evert
Member #794
November 2000
|
I just double-checked the following two definitions on Wolfram Mathworld: This also echoes my own expectations of what al_draw_circle() should do. I would not opt for al_draw_disk() though since disk is a bit more obscure, and consistency between circle/rectangle/polygon is IMO more important. Quote: Thoughts? I think you have an incorrect notion of what a circle is and there is nothing to fix. |
SiegeLord
Member #7,827
October 2006
|
al_draw_disk was considered, to mirror the mathematical definition, but was rejected because there isn't a good analogue for rectangles, ellipses etc. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Chris Katko
Member #1,881
January 2002
|
From a Mechanical Engineer's standpoint: I've never mistaken "circle" to mean a filled circle. -----sig: |
Mark Oates
Member #1,146
March 2001
|
Evert said: I just double-checked the following two definitions on Wolfram Mathworld:
SiegeLord said: al_draw_disk was considered, to mirror the mathematical definition, but was rejected because there isn't a good analogue for rectangles, ellipses etc.
Chris Katko said: From a Mechanical Engineer's standpoint: I've never mistaken "circle" to mean a filled circle. Ok. The impression I get is that, from a mathematics standpoint there is some logic to it. I'm coming from a graphic design standpoint, so I'm inclined to distinguish stroke (outline) and fill in that way. However, according to the wolfram definition, a circle would still have an outline width of NULL. One would create a circle object, and then use the definition to draw a stroke or fill. But yea, I'm not advocating that, that's going down the rabbit hole. usability--. Arthur Kalliokoski said: If someone gave you a pencil and paper and asked you to draw a circle, what would you do? Except I'm not drawing with a pencil, I'm drawing with a computer. (Or, I'm not drawing using the pencil tool, I'm drawing using the circle tool.) I see what you're saying though, point taken. Quote: How so? The filled version not only has to do the chords (I assume that's what you mean by "stroke") but also has to fill it. I don't know what chords are (that sounds fancy). Is that like a pie slice? I'm referring to the stroke as the operation that is the outline. Illustrator, Photoshop, and Canvas for example. It looks like SDL delineates drawshape() and drawfilledshape() like our current API... so that's a good sign... *cough* -- |
Arthur Kalliokoski
Second in Command
February 2005
|
http://en.wikipedia.org/wiki/Chord_%28geometry%29 Since it draws connected line segments to approximate a circle. Or it could draw lines tangent to the circle, almost the same. They all watch too much MSNBC... they get ideas. |
Johan Halmén
Member #1,550
September 2001
|
A chord is a line that connects one point on the circle with another. Chords here mean either horizontal or vertical pixel rows that fill the circle area. Drawing a circle simply means drawing the outline. In A4 the reault was a width of 1 pixel. When drawing with say Incscape, you might be able to define a zero width, which still is 1 pixel on the screen no matter how much you scale. In that sense, zero width is not the same as invisible. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest. |
Gideon Weems
Member #3,925
October 2003
|
Quote: I think you have an incorrect notion of what a circle is and there is nothing to fix. Ah, but the question is about a representation of this abstract idea we call a circle and not the circle itself. Perhaps a more proper API would forgo al_draw_circle() entirely and instead provide al_draw_circle_perimeter() and al_draw_circle_area(). ... That might be going a little overboard, though. |
|