Intersections of 3D polygons in python

柔情痞子 提交于 2019-12-05 21:17:05

A bit late on answer but my python optical ray tracing programme pvtrace does exactly this. It would work like this:

1) Define polygon with a 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 point(s) with a Ray object

ray = Ray(position=(0,0,0), direction=(0,0,1))
print polygon.intersection(ray)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!