Skip to content

Commit

Permalink
clarify input (take 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed May 12, 2022
1 parent f58f230 commit 65d56ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# sparse-cubes
Marching cubes for `(N, 3)` voxel coordinates - i.e. the equivalent of a 3D
Marching cubes for `(N, 3)` voxel indices - i.e. the equivalent of a 3D
sparse matrix in COOrdinate format.

Running marching cubes directly on sparse voxels is faster and importantly much
Expand Down Expand Up @@ -27,8 +27,10 @@ pip3 install git+https://github.com/navis-org/sparse-cubes.git
```python
>>> import sparsecubes as sc
>>> import numpy as np
>>> # Indices for two adjacent voxels
>>> voxel_xyz = np.array([[0, 0, 0],
... [0, 0, 1]])
... [0, 0, 1]],
... dtype='uint32')
>>> m = sc.marching_cubes(voxel_xyz)
>>> m
<trimesh.Trimesh(vertices.shape=(12, 3), faces.shape=(20, 3))>
Expand Down
10 changes: 5 additions & 5 deletions sparsecubes/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def marching_cubes(voxels, spacing=None, step_size=1):
Parameters
----------
voxels : (N, 3) array
XYZ voxel coordinates to find isosurfaces for. The data type
should carry over to the mesh vertices - i.e. if `voxels` are
unsigned 32-bit integers, the mesh vertex coordinates should
also end up being unsigned 32-bit integers.
voxels : (N, 3) array of integers
XYZ voxel coordinates (indices) to find isosurfaces for. The
data type should carry over to the mesh vertices - i.e. if
`voxels` are unsigned 32-bit integers, the mesh vertex
coordinates should also end up being unsigned 32-bit integers.
spacing : length-3 tuple of floats, optional
Voxel spacing in spatial dimensions corresponding to numpy array
indexing dimensions as in `voxels`.
Expand Down

0 comments on commit 65d56ea

Please sign in to comment.