I was going to provide Jeff with the same link to Kevin Lindsey's pages that vmmdragon provided. And I too was going to talk about drawing a point to some exterior edge (just beyond the bounding box) and then counting the number of intersections (if it is even then the point is outside, if odd, inside, except in a few cases -- like where the line is tangent to the curve). Once the curve is broken into little pieces: linear, arc, and bezier, then is when Kevin Lindsey's stuff comes in real handy -- but it's still a rather sizable bit of programming.
It got me wondering if another approach might work -- others here might be able to say no it won't (maybe because of security?) or if it would -- namely render the <path> in SVG. Add an onclick listener to the <path> that sends "true" to some function, then use createEvent() to build a mouse click at point (x,y). If the <path> hears the event then x,y must be on the inside. I haven't played much with createEvent() or with simulating mouseclicks, but this might make for a real simple way of doing it. The possible security problem is that you could use simulated clicks to do naughty things, so it may be that click events are yoked to specific objects rather than happening arbitrarily at screen coordinates. Does someone know for sure? David >--- In ><mailto:svg-developers%40yahoogroups.com>[email protected], >"vmmdragon" <[EMAIL PROTECTED]> wrote: > > > > --- In > <mailto:svg-developers%40yahoogroups.com>[email protected], > "rs274d" <jge14@> wrote: > > > > > > Can anyone someone guide me in determining if a point is inside or > > > outside of a closed path? I can manage this for polygons but I'm lost > > > where to start on paths. Alternatively has someone written code they > > > would share on converting paths to polygons? Any help is much > > appreciated. > > > > > > Thanks, > > > > > > Jeff E. > > > > > > > Take a look at > <http://kevlindev.com/geometry/>http://kevlindev.com/geometry/ > > he's got a great working SVG example. > > > > M. > > >M. > >Thanks for the pointer - but I could not find an example of >determining if a point is inside or outside of a path. Lots of >examples of intersection with paths and an example of a point in a >polygon. > >What I'm trying to do is determine if a point (start of a piece of >text) in layer 1 is inside or outside of a several paths (mixed >absolute and relative) on layer 2. > >I have this working great if layer 2 containing polygons but I am >struggling for a way to do the same with paths. > >Many Thanks, >Jeff E. > > ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

