Skip to content

Commit

Permalink
apply style
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminum committed Dec 12, 2023
1 parent 1f69e62 commit cd85e3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions cpp/open3d/t/geometry/TriangleMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,12 @@ double TriangleMesh::GetSurfaceArea() const {

if (IsCPU()) {
kernel::trianglemesh::ComputeTriangleAreasCPU(
GetVertexPositions().Contiguous(), GetTriangleIndices().Contiguous(), triangle_areas);
GetVertexPositions().Contiguous(),
GetTriangleIndices().Contiguous(), triangle_areas);
} else if (IsCUDA()) {
CUDA_CALL(kernel::trianglemesh::ComputeTriangleAreasCUDA,
GetVertexPositions().Contiguous(), GetTriangleIndices().Contiguous(), triangle_areas);
GetVertexPositions().Contiguous(),
GetTriangleIndices().Contiguous(), triangle_areas);
} else {
utility::LogError("Unimplemented device");
}
Expand Down
10 changes: 5 additions & 5 deletions python/test/t/geometry/test_trianglemesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,16 +422,17 @@ def test_pickle(device):
@pytest.mark.parametrize("device", list_devices())
def test_get_surface_area(device):
# Test with custom parameters.
cube = o3d.t.geometry.TriangleMesh.create_box(
float_dtype=o3c.float64, int_dtype=o3c.int32, device=device)
cube = o3d.t.geometry.TriangleMesh.create_box(float_dtype=o3c.float64,
int_dtype=o3c.int32,
device=device)
np.testing.assert_equal(cube.get_surface_area(), 6)

empty = o3d.t.geometry.TriangleMesh(device=device)
empty.get_surface_area()
np.testing.assert_equal(empty.get_surface_area(), 0)

# test noncontiguous
sphere =o3d.t.geometry.TriangleMesh.create_sphere(device=device)
# test noncontiguous
sphere = o3d.t.geometry.TriangleMesh.create_sphere(device=device)
area1 = sphere.get_surface_area()
sphere.vertex.positions = sphere.vertex.positions.T().contiguous().T()
sphere.triangle.indices = sphere.triangle.indices.T().contiguous().T()
Expand Down Expand Up @@ -659,4 +660,3 @@ def test_select_by_index_64(device):
untouched_sphere.vertex.positions)
assert sphere_custom.triangle.indices.allclose(
untouched_sphere.triangle.indices)

0 comments on commit cd85e3f

Please sign in to comment.