-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arc Examples? #87
Comments
Additional remarks. I found a suitable arc example in polar_examples.py, where polygons are in fact visually arcs of a certain thickness. I had missed this point during my initial searching through the code. You could say using polygons in the manner is akin to specifying arcs with a certain line width. I'm struggling to fully understand the Geometry concepts. The ColumnGeometry, which seemed to be the more complex one at first, actually makes the most sense to me. The Geometry and RowGeometry are still a bit of a mystery. Short of writing a whole tutorial, are there any further examples you could provide which elaborate on how these are used? Did you make up this Geometry concept? If not, and it's a common thing in the graphics world, are there any papers one could read that explain this in more detail? Also, I tried to learn more by just poking around in the REPL and experimenting with Geometries. But none of the classes have a str or repr method. It's difficult to peek inside and see what's going on. Could you add those to these classes? |
An arc is a line of constant theta in polar coordinates, so you to create a single arc geometry centred at 120, 120 with radius 100, from 45 degrees subtending an angle of 90 degrees, you could do something like:
... and this example just made me realise that I haven't exposed the
but until then you'll have to do the low-level
To create a circular wedge like the screen of a meter-style display, you might use a polar rectangle instead, eg.:
(this goes from radius 90 to radius 110 = 90+20, and angle 240 to 300). For Geometries more generally, there is a tutorial section on geometry here: https://unital.github.io/tempe/user_guide/tutorial.html#shapes-and-geometry which hopefully gives the basic ideas. The geometry concept comes from ideas in Wilkinson's Grammar of Graphics, together with the practical considerations around speed and memory that make drawing many similar objects at once is faster and more efficient than having many independent objects. It also has some inspiration from OpenGL's drawing primitives. In terms of the objects:
You don't have to use Geometry objects if you don't want to. You can just use lists of tuples of coordinates if you want: the geometries are just for memory efficiency. |
I've read the documentation, and it seems possible to make an arc using polar_theta_lines(). I found and can reproduce the polar_r_lines() from one of the examples, but I don't see any examples of arcs. Could you provide a code snippet, please? The point I'm getting stuck on is how to build the necessary geometry.
The text was updated successfully, but these errors were encountered: