struct mrpt::opengl::CPolyhedron::TPolyhedronFace

Struct used to store a polyhedron face.

Consists on a set of vertex indices and a normal vector.

#include <mrpt/opengl/CPolyhedron.h>

struct TPolyhedronFace
{
    //
fields

    std::vector<uint32_t> vertices;
    mrpt::math::TVector3D normal;

    //
methods

    double area(const std::vector<mrpt::math::TPoint3D>& vertices) const;
    void getCenter(const std::vector<mrpt::math::TPoint3D>& vertices, mrpt::math::TPoint3D& p) const;
};

Fields

std::vector<uint32_t> vertices

Vector of indices to the vertex list.

mrpt::math::TVector3D normal

Normal vector.

Methods

double area(const std::vector<mrpt::math::TPoint3D>& vertices) const

Given a set of vertices, computes the area of this face.

void getCenter(const std::vector<mrpt::math::TPoint3D>& vertices, mrpt::math::TPoint3D& p) const

Given a set of vertices, get this face’s center.