14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/views.h>
45template <
typename Scalar,
typename Index,
typename DerivedV,
typename DerivedF>
47 const Eigen::MatrixBase<DerivedV>& V,
48 const Eigen::MatrixBase<DerivedF>& F)
51 mesh.add_vertices(
static_cast<Index
>(V.rows()));
52 mesh.add_polygons(
static_cast<Index
>(F.rows()),
static_cast<Index
>(F.cols()));
54 facet_ref(mesh) = F.template cast<Index>();
SurfaceMesh< Scalar, Index > eigen_to_surface_mesh(const Eigen::MatrixBase< DerivedV > &V, const Eigen::MatrixBase< DerivedF > &F)
Create a SurfaceMesh from a igl-style pair of matrices (V, F).
Definition: eigen_convert.h:46
RowMatrixView< Scalar > vertex_ref(SurfaceMesh< Scalar, Index > &mesh)
Returns a writable view of the mesh vertices in the form of an Eigen matrix.
Definition: views.cpp:150
RowMatrixView< Index > facet_ref(SurfaceMesh< Scalar, Index > &mesh)
Returns a writable view of a mesh facets in the form of an Eigen matrix.
Definition: views.cpp:162
Main namespace for Lagrange.
Definition: AABBIGL.h:30