On 07/03/2010 12:19 PM, Taco Hoekwater wrote:
On 07/03/2010 10:03 AM, Taco Hoekwater wrote:
If this is too complicated, it might help if I can find out if a given point lies inside a given cycled path.
Even this is fairly tricky. Some important questions are:
I thought this was a neat thing to try to write a macro for. Attached is a test file that defines a macro inside() that takes two arguments: a point and a cyclic path. It returns true if the point lies inside that path, in most cases. There are lots of problems with it; what happens to a point actually on the curve is basically undefined, and self-intersects sometimes make it fail in interesting ways.
Here is a somewhat smarter version of the same macro. This one seems ok at first glance (extensive testing will probably show border cases that are not covered). Best wishes, Taco