Check if drawn path/CGPath intersects itself in an iPhone game
问题 I have a path drawn in OpenGL ES. I can convert it to a CGPath if needed. How would I check if it intersects itself (If the user created a complete loop)? 回答1: Graham Cox has some very interesting thoughts on how to detect the intersection of a CGPathRef and a CGRect, which is similar to your problem and may be educational. The underlying problem is difficult, and most practical solutions are going to be approximations. You may also want to look at this SO article on CGPathRef intersection,