Example #1
0
    public BoundsD GetBoundsD()
    {
        BoundsD res = new BoundsD(vert.positionD, Vector3D.zero);

        res.Encapsulate(prev.vert.positionD);
        return(res);
    }
Example #2
0
    static List <Vertex> CreateBoundingTriangle(HMesh mesh, List <Vector3D> position)
    {
        BoundsD b = new BoundsD(position[0], Vector3D.zero);

        for (int i = 1; i < position.Count; i++)
        {
            b.Encapsulate(position[i]);
        }
        // encapsulate triangle

        b.center  = b.center + b.extents * 3.1f;
        b.extents = b.extents * 10000f;
        Vector3D v1 = b.min;
        Vector3D v2 = b.min + Vector3D.forward * b.size.z;
        Vector3D v3 = b.min + Vector3D.right * b.size.x;


        Face          face             = mesh.CreateTriangle(v1, v2, v3);
        List <Vertex> boundingVertices = new List <Vertex>();

        foreach (var he in face.Circulate())
        {
            boundingVertices.Add(he.vert);
        }
        return(boundingVertices);
    }
Example #3
0
    public BoundsD ComputeBoundsD()
    {
        if (vertices.Count == 0)
        {
            return(new BoundsD(Vector3D.zero, Vector3D.zero));
        }
        BoundsD res = new BoundsD(vertices[0].positionD, Vector3D.zero);

        foreach (var v in vertices)
        {
            res.Encapsulate(v.positionD);
        }
        return(res);
    }
Example #4
0
    public BoundsD GetBoundsD()
    {
        if (IsDestroyed())
        {
            Debug.LogWarning("Face is destroyed");
        }

        /*if (!IsValid())
         * {
         *  Debug.LogWarning("Face is invalid");
         * }*/
        BoundsD res = new BoundsD(halfedge.vert.positionD, Vector3D.zero);

        foreach (var he in Circulate())
        {
            res.Encapsulate(he.vert.positionD);
        }
        return(res);
    }