Determine ordering of polygon 3D

前提是你 提交于 2019-12-11 09:03:42

问题


I have a list of vertices 3D, creating a polygon. I need to triangulate it and i use the cutting ears algorithm. My polygons are non-convex, so i need to find the concave angles in the polygon. I also dont know wich orientation are my polygons ( clockwise or counter clocwise)

Could anyone help me how to determine if is clockwise or counter clockwise

Thank you


回答1:


It's probably simplest to project the polygon into a convenient plane (say z=0) and then use a method like reinier's.

1) Set all z=0. This won't change the answer.

2) Use a method like reinier's or this one to determine whether the polygon is clockwise or counterclockwise, and therefore whether the cross products "should be" +z or -z.

3) Any vertex with a cross product that points in the "wrong" direction is concave.




回答2:


use the cross product

ordering of polygon



来源:https://stackoverflow.com/questions/1199428/determine-ordering-of-polygon-3d

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!