Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/cdbharath/Open3D into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cdbharath committed Jun 13, 2024
2 parents babe594 + 551a91d commit 468e9b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- Fix mis-configured application .desktop link for the Open3D viewer when installing to a custom path (PR #6599)
- Fix regression in printing cuda tensor from PR #6444 🐛
- Add Python pathlib support for file IO (PR #6619)

- Fix log error message for `probability` argument validation in `PointCloud::SegmentPlane` (PR #6622)
- Fix macOS arm64 builds, add CI runner for macOS arm64 (PR #6695)
- Fix KDTreeFlann possibly using a dangling pointer instead of internal storage and simplified its members (PR #6734)
Expand Down
8 changes: 5 additions & 3 deletions cpp/open3d/geometry/TriangleMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ TriangleMesh &TriangleMesh::Rotate(const Eigen::Matrix3d &R,

TriangleMesh &TriangleMesh::operator+=(const TriangleMesh &mesh) {
if (mesh.IsEmpty()) return (*this);
bool is_empty = IsEmpty();
size_t old_vert_num = vertices_.size();
MeshBase::operator+=(mesh);
size_t old_tri_num = triangles_.size();
Expand All @@ -74,21 +75,22 @@ TriangleMesh &TriangleMesh::operator+=(const TriangleMesh &mesh) {
if (HasAdjacencyList()) {
ComputeAdjacencyList();
}
if (mesh.HasTriangleUvs()) {
if (mesh.HasTriangleUvs() && (HasTriangleUvs() || is_empty)) {
size_t old_tri_uv_num = triangle_uvs_.size();
triangle_uvs_.resize(old_tri_uv_num + mesh.triangle_uvs_.size());
for (size_t i = 0; i < mesh.triangle_uvs_.size(); i++) {
triangle_uvs_[old_tri_uv_num + i] = mesh.triangle_uvs_[i];
}
}
if (mesh.HasTextures()) {
if (mesh.HasTextures() && (HasTextures() || is_empty)) {
size_t old_tex_num = textures_.size();
textures_.resize(old_tex_num + mesh.textures_.size());
for (size_t i = 0; i < mesh.textures_.size(); i++) {
textures_[old_tex_num + i] = mesh.textures_[i];
}
}
if (mesh.HasTriangleMaterialIds()) {
if (mesh.HasTriangleMaterialIds() &&
(HasTriangleMaterialIds() || is_empty)) {
size_t old_tex_num = textures_.size();
size_t old_mat_id_num = triangle_material_ids_.size();
triangle_material_ids_.resize(old_mat_id_num +
Expand Down

0 comments on commit 468e9b6

Please sign in to comment.