确定多边形的3D订购多边形

2023-09-08 10:46:51 作者:无二八怪小青年

予有顶点三维的列表,创建一个多边形。 我需要三角它,我用的是切割耳朵算法。 我的多边形是非凸的,所以我需要找到凹角的多边形。 我也不知道至极的方向是我的多边形(顺时针或逆时针clocwise)

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

感谢您

推荐答案

这可能是最简单的项目多边形到一个方便的面(比如Z = 0),然后使用像reinier的方法。

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

1)将所有的z = 0。这不会改变问题的答案。

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

2)使用像reinier的或方法这个,以确定多边形是否顺时针或逆时针的,因此无论是交叉产品应为+ Z或-Z。

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)配有一指向在错误方向交叉积不限顶点是凹

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