Triangle.ProjectToTriangle C# (CSharp) Method

ProjectToTriangle() private method

private ProjectToTriangle ( Vector3D, point ) : Vector3D,
point Vector3D,
return Vector3D,
    Vector3D ProjectToTriangle(Vector3D point)
    {
        Plane3D plane = new Plane3D(Normal, points[0]);
        bool isPointInPlane = System.Math.Abs(plane.GetDistanceToPoint(point))<0.0001;
        if (!isPointInPlane) {
            double dist;
            point.y = 0;
            var ray = new RayD(point, Vector3D.up);
            plane.Raycast(ray, out dist);
            point.y = dist;
        }
        return point;
    }