Re: complex intersections

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu