Skip to content

Commit

Permalink
add python binding get_surface_area for Tensor TriangleMesh
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminum committed Nov 21, 2023
1 parent e354f13 commit 4928a5a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cpp/pybind/t/geometry/trianglemesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,20 @@ The attributes of the triangle mesh have different levels::
"before rendering.",
"normalized"_a = true);

triangle_mesh.def(
"get_surface_area", &TriangleMesh::GetSurfaceArea,
R"(Computes the surface area of the mesh, i.e., the sum of the individual triangle surfaces.
Example:
This computes the surface area of the Stanford Bunny::
bunny = o3d.data.BunnyMesh()
mesh = o3d.t.io.read_triangle_mesh(bunny.path)
print('The surface area is', mesh.get_surface_area())
Returns:
A scalar describing the surface area of the mesh.
)");

triangle_mesh.def(
"compute_convex_hull", &TriangleMesh::ComputeConvexHull,
"joggle_inputs"_a = false,
Expand Down

0 comments on commit 4928a5a

Please sign in to comment.