A little late in response, but my python pvtrace optical ray tracer does just that. It will work as follows:
1) Define a polygon with a list of points and make a Polygon object
points = [[0,0,0],[0,0.1,0],[0.1,0.1,-0.03],[0.1,0,-0.03]] polygon = Polygon(points)
2) Get the intersection with the Ray object
ray = Ray(position=(0,0,0), direction=(0,0,1)) print polygon.intersection(ray)
source share