计算非凸多面体的向外法线 [英] calculating outward normal of a non-convex polyhedral

查看:272
本文介绍了计算非凸多面体的向外法线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果多面体的所有节点(可能是非凸的)并且其坐标已知,则按顺序给出面的点(围绕向外法线的逆时针或顺时针),如何获得向外法线每个面的向量?

If all nodes of a polyhedron (may be non-convex) and their coordinates are known, the points of a face are given in order (anti-clockwise or clockwise around the outward normal), how do I obtain the outward normal vector of each face?

这是凸多面体的一种方法:
计算人脸法线和缠绕

Here is a method for convex polyhedron: Computing face normals and winding

普通的多面体可能是非凸的吗?

How about a general polyhedron that could be non-convex?

推荐答案

这里是一种方法。固定多面体 P 的一个面F0的方向。您尚不知道该
是否从外部逆时针旋转,因此右手规则给出了一个
向外指向叉积法线的法线。

Here is one method. Fix the orientation of one face F0 of your polyhedron P. You don't yet know if this is counterclockwise from the outside, so that the right-hand-rule gives an outward pointing normal from the cross product.

现在将相邻面F1定向为与F0的方向兼容,因为
共享边的方向为→在F0和←中在F1中继续传播面孔的
方向,直到 P 的每个面孔与F0一致。因此,现在所有法线
都指向内或全部指向外部。

Now orient an adjacent face F1 to be compatible with F0's orientation, in that the shared edge is oriented → in F0 and ← in F1. Continue propagating the orientations of faces until every face of P is consistent with F0. So now all normals either point inward or all point outward.

现在,通过对有符号的四面体体积求和来计算 P 的体积。如果所有面都逆时针旋转,则音量
将为正,如果全部为顺时针旋转,音量
将为负。如果结果为负,则反转所有面部方向。

Now compute the volume of P by summing signed tetrahedra volumes. The volume will be positive if all faces are oriented counterclockwise, and negative if all clockwise. If it comes out negative, reverse all face orientations.

计算签名的卷遍布整个网络,包括:
C语言中的计算几何

Computing the signed volume is all over the web, including here: Computational Geometry in C.

这篇关于计算非凸多面体的向外法线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆