如何检查点是否在四面体中? [英] How to check whether the point is in the tetrahedron or not?

查看:117
本文介绍了如何检查点是否在四面体中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道四面体的所有坐标和要确定的点.有人知道怎么做吗?我已经尝试确定该点属于四面体的每个三角形,如果对所有三角形都是正确的,则该点位于四面体中.但这是绝对错误的.

I know all coordinates of tetrahedron and the point I would like to determine. So does anyone know how to do it? I've tried to determine the point's belonging to each triangle of tetrahedron, and if it's true to all triangles then the point is in the tetrahedron. But it's absolutely wrong.

推荐答案

您可以通过四个顶点A B C和D定义一个四面体. 因此,您也可以使用4个三角形定义四面体的表面.

You define a tetrahedron by four vertices, A B C and D. Therefore you also can have the 4 triangles defining the surface of the tetrahedron.

现在,您只需检查点P是否在平面的另一侧.每个平面的法线指向远离四面体的中心. 因此,您只需要针对4架飞机进行测试.

You now just check if a point P is on the other side of the plane. The normal of each plane is pointing away from the center of the tetrahedron. So you just have to test against 4 planes.

您的平面方程如下:a*x+b*y+c*z+d=0只需填写点值(x y z).如果结果的符号> 0,则该点与法线在同一侧,结果== 0,该点位于平面中,并且在您的情况下,您需要第三个选项:< 0表示它在背面飞机的. 如果这四个平面都满足,那么您的观点就在四面体之内.

Your plane equation looks like this: a*x+b*y+c*z+d=0 Just fill in the point values (x y z). If the sign of the result is >0 the point is of the same side as the normal, result == 0, point lies in the plane, and in your case you want the third option: <0 means it is on the backside of the plane. If this is fulfilled for all 4 planes, your point lies inside the tetrahedron.

这篇关于如何检查点是否在四面体中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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