三维空间中任意平面上的三角形点集

时间:2017-12-16 18:44:38

标签: unity3d 3d triangulation

我在3D空间中有一组点。最大误差为10 ^ -5我可以通过它们放置一个平面(误差是从点到平面的距离)。

有没有办法在这个任意平面上对这些点进行三角测量?我已经尝试过Bowyer-Watson,但这仅在误差为0时有效。还有其他任何东西,它不会三角测量,或者我不会得到一个好的三角测量(重叠的三角形)。

修改

我想我发现了这个问题。在某些角度,bowyer Watson算法不起作用,因为我对外心的计算是关闭的。如何计算3D中三角形的外心?

1 个答案:

答案 0 :(得分:0)

因为我知道飞机上的点,我可以计算一个矢量。这个向量位于飞机上。接下来我计算点的质心。

使用矢量和质心我可以在平面上创建一个大三角形

        Vertex p1 = new Vertex(dir * 3000 + center);
        Vertex p2 = new Vertex(Quaternion.AngleAxis(120, plane.normal) * dir * 3000 + center);
        Vertex p3 = new Vertex(Quaternion.AngleAxis(240, plane.normal) * dir * 3000 + center);

现在我有了三角形,我可以使用Bowyer-Watson。 对于3D中的外心,我使用:

Vector3 ac = p3 - p1;
    Vector3 ab = p2 - p1;
    Vector3 abXac = Vector3.Cross(ab, ac);

    circumceter = p1 + (Vector3.Cross(abXac, ab) * ac.sqrMagnitude + Vector3.Cross(ac, abXac) * ab.sqrMagnitude) / (2 * abXac.sqrMagnitude);

现在我在3D的任意平面上都有一组三角形的点。

相关问题