From 07a159e553a93411d023aba00277920beb307fdf Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sat, 16 May 2026 13:42:29 -0700 Subject: [PATCH] docs: fix marching_cubes return type (unique vertex indices, not normals) Fixes #422 Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> --- fvdb/functional/_meshing.py | 7 +++++-- fvdb/grid.py | 4 ++-- fvdb/grid_batch.py | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/fvdb/functional/_meshing.py b/fvdb/functional/_meshing.py index 286ddee03..3affc03f2 100644 --- a/fvdb/functional/_meshing.py +++ b/fvdb/functional/_meshing.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # """Functional API for meshing and TSDF integration on sparse grids.""" + from __future__ import annotations from typing import TYPE_CHECKING @@ -36,7 +37,8 @@ def marching_cubes_batch( Returns: vertices (JaggedTensor): Mesh vertex positions, shape ``(B, -1, 3)``. faces (JaggedTensor): Triangle face indices. - normals (JaggedTensor): Per-vertex normals. + unique_vertex_ids (JaggedTensor): Unique vertex IDs with int64 values, + shape ``(B, -1, 3)``. .. seealso:: :func:`marching_cubes_single` """ @@ -60,7 +62,8 @@ def marching_cubes_single( Returns: vertices (torch.Tensor): Mesh vertex positions, shape ``(N, 3)``. faces (torch.Tensor): Triangle face indices. - normals (torch.Tensor): Per-vertex normals. + unique_vertex_ids (torch.Tensor): Unique vertex IDs with dtype ``torch.int64``, + shape ``(N, 3)``. .. seealso:: :func:`marching_cubes_batch` """ diff --git a/fvdb/grid.py b/fvdb/grid.py index 8623a205c..ab2efff4c 100644 --- a/fvdb/grid.py +++ b/fvdb/grid.py @@ -1470,8 +1470,8 @@ def marching_cubes( ``(num_vertices, 3)``. faces (torch.Tensor): Triangle face indices of shape ``(num_faces, 3)``. - normals (torch.Tensor): Vertex normals of shape - ``(num_vertices, 3)``. + unique_vertex_ids (torch.Tensor): Unique vertex IDs of shape + ``(num_vertices, 3)`` and dtype ``torch.int64``. """ from . import functional diff --git a/fvdb/grid_batch.py b/fvdb/grid_batch.py index 06858bbcb..0d89969c4 100644 --- a/fvdb/grid_batch.py +++ b/fvdb/grid_batch.py @@ -1020,7 +1020,8 @@ def marching_cubes( Returns: vertex_positions (JaggedTensor): Mesh vertex positions. Shape: ``(batch_size, num_vertices_for_grid_b, 3)``. face_indices (JaggedTensor): Triangle face indices. Shape: ``(batch_size, num_faces_for_grid_b, 3)``. - vertex_normals (JaggedTensor): Vertex normals. Shape: ``(batch_size, num_vertices_for_grid_b, 3)``. + unique_vertex_ids (JaggedTensor): Unique vertex IDs with int64 values. + Shape: ``(batch_size, num_vertices_for_grid_b, 3)``. .. seealso:: :meth:`Grid.marching_cubes` """