| Sign In/My Account | View Cart |
| Article: |
Introduction to Cocoa Graphics, Part 2 | |
| Subject: | happy you figured it out | |
| Date: | 2001-11-20 22:29:03 | |
| From: | psheldon | |
|
Response to: thinking in box, curve out of box ;-)
|
||
|
Now, 12:30 A.M. I'm anxious and excited to try out the code and follow your story and see if I can grasp what is going on. I'm sure happy that os 10.1 allows me to connect to my internet computer's lower os 9 appletalk and port over the sample code you give . I shall comment it (take notes on it) and read your story to get the connections going in my head. At first I can be pretty dense, so I better hold off until morning or I'll get in the wrong frame of mind to sleep. But, I'd sure like to peak at it. Do you know the feeling? |
||
Showing messages 1 through 4 of 4.
An interesting thing I found: When you draw the arc, it conforms to the angle from which you have created. However, if you append to the arc, it does not append to the ever-floating end of the arc, but to the "toPoint:" argument (!). That means the computer will go back and connect itself, thus drawing an ugly line where none originally existed. This intuitively does not make sense, but from a computer programmer's point of view it is necessary.
One of the weaknesses of this function is it's reliance on static points. If you want to make a continuous path, you _have_ to know that your end point is at precisely the point at which the arc becomes tangent to the second line. The second point of tangential contact is equidistant from the apex as the first point of tangential contact. Using manual drafting means, you could discover these points by drawing an arc using the apex as the center point for your compass. You could then find the arc's center by drawing two separate arcs of the desired radial length from each of the two end points, the center being at the intersection point. Then finally, you would draw the arc while carefully erasing all of the other lines.
Unfortunately, we do not have the convenience of a compass to measure where the second point should be. Up to this point it has just been a static point. This is insufficient. We need to find a way to calculate this point and have it change automatically to accommodate the changes in the arc's radius. We need to do the same for the starting point, as I have noticed the arc does not necessarily start at our starting point, but wherever it is mathematically to do so. The starting point, fromPoint and toPoint are used as guides for arc creation but starting or ending points for subsequent path creation. I'll have to think about this one and post more later.