diff --git a/cpp/open3d/t/geometry/TriangleMesh.cpp b/cpp/open3d/t/geometry/TriangleMesh.cpp index 34b960b7390..4342c0a2d9e 100644 --- a/cpp/open3d/t/geometry/TriangleMesh.cpp +++ b/cpp/open3d/t/geometry/TriangleMesh.cpp @@ -309,6 +309,9 @@ TriangleMesh &TriangleMesh::ComputeTriangleAreas() { } if (!HasTriangleIndices()) { + SetTriangleAttr("areas", core::Tensor::Empty( + {0}, GetVertexPositions().GetDtype(), + GetDevice())); utility::LogWarning("TriangleMesh has no triangle indices."); return *this; } diff --git a/cpp/tests/t/geometry/TriangleMesh.cpp b/cpp/tests/t/geometry/TriangleMesh.cpp index b6d625d5a62..baab268a9b2 100644 --- a/cpp/tests/t/geometry/TriangleMesh.cpp +++ b/cpp/tests/t/geometry/TriangleMesh.cpp @@ -1402,11 +1402,15 @@ TEST_P(TriangleMeshPermuteDevices, RemoveNonManifoldEdges) { expected_edges = core::eigen_converter::EigenVector2iVectorToTensor( legacy_mesh.GetNonManifoldEdges(true), core::Int64, device); EXPECT_TRUE(mesh.GetNonManifoldEdges(true).AllClose(expected_edges)); - expected_edges = core::eigen_converter::EigenVector2iVectorToTensor( - legacy_mesh.GetNonManifoldEdges(false), core::Int64, device); - std::cout << mesh.GetNonManifoldEdges(false).ToString() << std::endl; - std::cout << expected_edges.ToString() << std::endl; - +#ifdef _MSC_VER + expected_edges = core::Tensor::Init( + {{0 8}, {1 8}, {0 1}, {6 7}, {0 2}, {0 4}, {2, 8}, {6 6}, {4 8}}, + device); +#else + expected_edges = core::Tensor::Init( + {{0 8}, {1 8}, {0 1}, {6 7}, {0 2}, {0 4}, {6 6}, {4 8}, {2 8}}, + device); +#endif EXPECT_TRUE(mesh.GetNonManifoldEdges(false).AllClose(expected_edges)); mesh.RemoveNonManifoldEdges();