Skip to main content

Marching cubes on sparse matrices

Project description

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

>>> 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparse-cubes-0.1.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

sparse_cubes-0.1.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file sparse-cubes-0.1.0.tar.gz.

File metadata

  • Download URL: sparse-cubes-0.1.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for sparse-cubes-0.1.0.tar.gz
Algorithm Hash digest
SHA256 effd416e51c65c607d874bc57b6a660e0d325845402226aba1ad788ac2b68ac1
MD5 031e4a169c2ce25c63212393fcce6720
BLAKE2b-256 485511e97c5f27fcbe3dd0e4ea3e015cb74ac6ef110f16a67170731254660732

See more details on using hashes here.

File details

Details for the file sparse_cubes-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sparse_cubes-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for sparse_cubes-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45e10479de70ecfe02a0449f131d92c58a06da2119c07dfc716d20b04a179604
MD5 4450b74b52d847eaa54c8a1f64dd122f
BLAKE2b-256 b2385677bd83792e6fb4fbe2964e774fe4c12bf6a748e600ee060e1675f7b61d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page