Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ Coding Example Usage? #2

Open
samsonsite1 opened this issue Jan 9, 2024 · 1 comment
Open

C++ Coding Example Usage? #2

samsonsite1 opened this issue Jan 9, 2024 · 1 comment

Comments

@samsonsite1
Copy link

samsonsite1 commented Jan 9, 2024

I'm interested in calling this code from C++ code.

Could you please show a C++ coding example how to manually set and fill the vertices and faces variables?
I'm unfamiliar with Eigen library and how to initialize them remains unclear.

btw, this is a very obtuse way of storing and passing simple vector data.

 Eigen::MatrixX3d vertices;
 Eigen::MatrixX3i faces;
 
 // how to fill vertices ??
 // how to fill faces ??

 vector<Eigen::VectorXi> boundary_loops;
 boundary_loops = hole_filling_liepa::find_boundary_loops(faces);

 Eigen::MatrixX3i area_patch;
 area_patch = hole_filling_liepa::fill_hole_liepa(vertices, faces, boundary_loops[0], "area" );
@samsonsite1
Copy link
Author

samsonsite1 commented Jan 9, 2024

For simplicity sake, let's say I have a list of vertices and faces in this format:

class Vector3 {
public:
    double x;
    double y;
    double z;
};

class Vertex {
public:
   Vector3 point;
};

class Face {
public:
    int i1, i2, i3;
};

std::vector<Vertex> vertices;
std::vector<Face>   faces;

How to load this into Eigen::MatrixX3d and Eigen::MatrixX3i ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant