-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Enable attributes in vtk wrapper functions #5347
Conversation
-fix segfault for converting empty vtkPolyData to geometry
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
-fix conversion for empty triangle indices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 5 files reviewed, 2 unresolved discussions (waiting on @benjaminum and @yxlao)
cpp/open3d/t/geometry/VtkUtils.cpp
line 306 at r2 (raw file):
/// \param copy If true always create a copy for attribute arrays. /// \param include A set of keys to select which attributes should be added. /// The special key "*" includes all attributes.
"*" may hint that globbing / regexp is supported. Perhaps use a special constant (e.g.: TensorMap::ALL_KEYS) instead?
Also. document precedence of include and exclude. From code below, looks like exclude has precedence over include. i.e. if include = {"colors"} and exclude = {"colors'} then "colors" is excluded. Or should this be an error?
cpp/open3d/t/geometry/VtkUtils.cpp
line 340 at r2 (raw file):
"Ignoring attribute '{}' for TensorMap with primary key " "'{}'", key_tensor.first, tmap.GetPrimaryKey());
We shouldn't need a LogWarning
for doing what the user asked us to do, i.e. if they explicitly asked to exclude "colors", no need to warn them about this.
@@ -140,6 +140,9 @@ class TriangleMesh : public Geometry, public DrawableGeometry { | |||
/// Getter for vertex_attr_ TensorMap. Used in Pybind. | |||
const TensorMap &GetVertexAttr() const { return vertex_attr_; } | |||
|
|||
/// Getter for vertex_attr_ TensorMap. | |||
TensorMap &GetVertexAttr() { return vertex_attr_; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yxlao I added another getter without const
to simplify some conversion code. Is there a reason for just having the const
version? Same for TriangleAttr and in PointCloud.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 7 files reviewed, 3 unresolved discussions (waiting on @ssheorey and @yxlao)
cpp/open3d/t/geometry/VtkUtils.cpp
line 306 at r2 (raw file):
Previously, ssheorey (Sameer Sheorey) wrote…
"*" may hint that globbing / regexp is supported. Perhaps use a special constant (e.g.: TensorMap::ALL_KEYS) instead?
Also. document precedence of include and exclude. From code below, looks like exclude has precedence over include. i.e. if include = {"colors"} and exclude = {"colors'} then "colors" is excluded. Or should this be an error?
Done. I changed to signature to avoid the special "*" element and improved the docstring.
cpp/open3d/t/geometry/VtkUtils.cpp
line 340 at r2 (raw file):
Previously, ssheorey (Sameer Sheorey) wrote…
We shouldn't need a
LogWarning
for doing what the user asked us to do, i.e. if they explicitly asked to exclude "colors", no need to warn them about this.
The function is not really meant to be directly used by the user and we decide which attributes to keep/exclude based on the algorithm we want to use.
However, if a user wants to combine o3d and vtk in C++ they can use the function; we don't hide the functionality.
This PR
This change is