-
Notifications
You must be signed in to change notification settings - Fork 87
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
Why does the tesseract_geometry::mesh constructor take an Eigen::VectorXi for the triangles? #920
Comments
A triangle mesh is a special case for a polygon mesh which it inherits from reducing code duplication. |
To clarify, I think both @AlexGisi and I are confused about the input structure of the face integers. It seems like the constructor for the polygon mesh currently takes an I think what @AlexGisi is suggesting is that we:
|
I don't have any objections to this.
I would need to verify, but I am almost certain that the data types were specifically used because they are directly compatible with components which consume or produce the object to avoid type conversions. If this is the case, I would be against changing the storage type. |
Sounds good to me too. Could we maybe also derive SDFMesh from TriangleMesh instead of PolygonMesh, as it currently duplicates the check for triangularity?
This type of storage is compatible with PCL: 1) a list of vertices and 2) a polygon list consisting of each time a size (number of vertices of the polygon) followed by the specified number of indices into the vertex list. Not very logical, I agree. I'm not sure if the way it is used currently indeed has efficiency benefits, that should be investigated indeed. Or you could simply add another constructor with the std::vectorEigen::VectorXi datatype and convert. |
The mesh constructor takes an integer vector of variable length (
triangles
) to represent the mesh's triangles. The constructor describes this asThe constructor then checks that the mesh is triangular. Combining this with the fact
triangles
is suggestively named, would it be more intuitive and efficient to store thetriangles
in astd::vector<Eigen::3i>>
, analogous to the vertices?The text was updated successfully, but these errors were encountered: