Metadata-Version: 2.1
Name: sparse-cubes
Version: 0.1.0
Summary: Marching cubes on sparse matrices
Home-page: https://github.com/navis-org/sparse-cubes
Author: Philipp Schlegel
Author-email: pms70@cam.ac.uk
License: GNU GPL V3
Keywords: marching cubes sparse matrix voxel
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# sparse-cubes
Marching cubes for sparse matrices - i.e. `(N, 3)` voxel data.

Running marching cubes directly on sparse voxels is faster and importantly much
more memory efficient than converting to a 3d matrix and using the implementation
in e.g. `sklearn`.

The only dependencies are `numpy` and `trimesh`. Will use `fastremap` if present.

## Install

```
pip3 install git+https://github.com/navis-org/sparse-cubes.git
```

## Usage

```python
>>> import sparsecubes as sc
>>> import numpy as np
>>> voxels = np.array([[0, 0, 0], [0, 0, 1]])
>>> m = sc.marching_cubes(voxels)
>>> m
<trimesh.Trimesh(vertices.shape=(12, 3), faces.shape=(20, 3))>
>>> m.is_winding_consistent
True
```

## Notes
- The mesh might have non-manifold edges. Trimesh will report these
  meshes as not watertight but in the very literal definition they do hold water.
- Currently only full edges.


