rotating NSBezierPath objects
rotating NSBezierPath objects
- Subject: rotating NSBezierPath objects
- From: William Squires <email@hidden>
- Date: Fri, 06 Jul 2012 19:10:42 -0500
Okay, I see in the doc set that you can perform an NSAffineTransform on an NSBezierPath, but how do I perform a rotation of the NSBezierPath about an arbitrary CGPoint and with a specified angle in radians? Is this something deep in CoreGraphics, or CoreAnimation? If not, I can do the trigonometry myself if I can get the list of points that make up the NSBezierPath, but it seems these aren't exposed, only NSBezierPathElement objects. Help!
Also, what is the formula for calculating the area of an arbitrary triangle defined by three non-collinear points in 2D space? (i.e. I can't assume the triangle even has a 90 degree angle in it, or any other such shortcuts…)
Finally, If an NSBezierPath consisting of a closed circuit of points:
…
NSBezierPath *mySquarePath = [NSBezierPath bezierPath];
[mySquarePath setLineWidth:1.0];
[mySquarePath moveToPoint:CGPointMake(0.0, 0.0)];
[mySquarePath lineToPoint:CGPointMake(10.0, 0.0)];
[mySquarePath lineToPoint:CGPointMake(10.0, 10.0)];
[mySquarePath lineToPoint:CGPointMake(0.0, 10.0)];
[mySquarePath closePath];
…
will [mySquarePath containsPoint:CGPointMake(5.0, 5.0)] return YES even before I fill or stroke the path, or do I have to fill the path first?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden