Re: complex intersections
- Posted by DHarte at AOL.COM Apr 03, 1999
- 466 views
If you mean an arbitrary 2D polygon (a 3D polygonal surface is the same idea), you can define for each side a line equation, and start and end points (probably easiest if you made all the formulas such that the lines all start at t=0 (parametric lines)). Then, take the line that you want to intersect with the polygon, and check it for intersections with each line segment (take into account end points). There are probably optimizations for this (especially if you want a certain type of polygon), but this is the basic idea. For example, if you stored the boundary x and y values for each vertex (besides the t values), you could use logic statements (I'm assuming you're putting this into an algorithm for something) to determine which edges have an intersection and which don't. With that, you would require many fewer computations. Abraham Harte