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

Enable python copy&deepcopy for tensor geometry #5709

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/pybind/t/geometry/boundingvolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ tensor, which must be on the same device and have the same data type.)");
"Upper bounds of the bounding box for all axes. Tensor with {3,} "
"shape, and type float32 or float64"}});

py::detail::bind_copy_functions<AxisAlignedBoundingBox>(aabb);
aabb.def("__repr__", &AxisAlignedBoundingBox::ToString);
aabb.def(
"__add__",
Expand Down
1 change: 1 addition & 0 deletions cpp/pybind/t/geometry/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void pybind_image(py::module &m) {
"tensor"_a);
docstring::ClassMethodDocInject(m, "Image", "__init__",
map_shared_argument_docstrings);
py::detail::bind_copy_functions<Image>(image);

// Pickle support.
image.def(py::pickle(
Expand Down
1 change: 1 addition & 0 deletions cpp/pybind/t/geometry/lineset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ and ``device`` as the tensor. The device for ``point_positions`` must be consist
{"line_indices",
"A tensor with element shape (2,) and Int dtype."}});

py::detail::bind_copy_functions<LineSet>(line_set);
// Pickling support.
line_set.def(py::pickle(
[](const LineSet& line_set) {
Expand Down
2 changes: 2 additions & 0 deletions cpp/pybind/t/geometry/pointcloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ The attributes of the point cloud have different levels::
"map_keys_to_tensors"_a)
.def("__repr__", &PointCloud::ToString);

py::detail::bind_copy_functions<PointCloud>(pointcloud);

// Pickle support.
pointcloud.def(py::pickle(
[](const PointCloud& pcd) {
Expand Down
1 change: 1 addition & 0 deletions cpp/pybind/t/geometry/trianglemesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ The attributes of the triangle mesh have different levels::
"vertex_positions"_a, "triangle_indices"_a)
.def("__repr__", &TriangleMesh::ToString);

py::detail::bind_copy_functions<TriangleMesh>(triangle_mesh);
// Pickle support.
triangle_mesh.def(py::pickle(
[](const TriangleMesh& mesh) {
Expand Down