Here is a minimal example.
#include <igl/opengl/glfw/Viewer.h>
#include <igl/isolines.h>
int main(int argc, char *argv[])
{
// Inline mesh of a cube
const Eigen::MatrixXd V= (Eigen::MatrixXd(8,3)<<
0.0,0.0,0.0,
0.0,0.0,1.0,
0.0,1.0,0.0,
0.0,1.0,1.0,
1.0,0.0,0.0,
1.0,0.0,1.0,
1.0,1.0,0.0,
1.0,1.0,1.0).finished();
const Eigen::MatrixXi F = (Eigen::MatrixXi(12,3)<<
1,7,5,
1,3,7,
1,4,3,
1,2,4,
3,8,7,
3,4,8,
5,7,8,
5,8,6,
1,5,6,
1,6,2,
2,6,8,
2,8,4).finished().array()-1;
Eigen::VectorXd f(8);
Eigen::Vector3d dir(1.0,1.0,1.0);
for(int i=0; i<8; i++)
{
f[i] = V.row(i).dot(dir);
}
Eigen::MatrixXd isoV;
Eigen::MatrixXi isoE;
igl::isolines(V, F, f, 1, isoV, isoE);
Eigen::MatrixXd C(isoE.rows(), 3);
C.col(0).setConstant(1.0);
C.col(1).setZero();
C.col(2).setZero();
std::cout << "Isoline vertices: " << isoV << std::endl;
std::cout << "Isoline edges: " << isoE << std::endl;
// Plot the mesh
igl::opengl::glfw::Viewer viewer;
viewer.data().set_mesh(V, F);
viewer.data().set_face_based(true);
viewer.data().set_edges(isoV, isoE, C);
viewer.launch();
}
Describe your issue
There are several issues with std::isolines:
Here is a minimal example.
Expected behavior: either
Observed behavior:
Check all that apply (change to
[x])devbranch and the problem persistsSee https://libigl.github.io/CONTRIBUTING/#bugreport for more tips.