Metadata-Version: 2.2
Name: DracoPy
Version: 1.5.0
Summary: Python wrapper for Google's Draco Mesh Compression Library
Home-page: https://github.com/seung-lab/DracoPy
Author: Manuel Castro, William Silversmith :: Contributors :: Fatih Erol, Faru Nuri Sonmez, Zeyu Zhao, Denis Riviere
Author-email: macastro@princeton.edu, ws9@princeton.edu
License: License :: OSI Approved :: Apache Software License
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: summary

[![PyPI version](https://badge.fury.io/py/DracoPy.svg)](https://badge.fury.io/py/DracoPy)

# DracoPy

```python
import os
import DracoPy

with open('bunny.drc', 'rb') as draco_file:
  mesh = DracoPy.decode(draco_file.read())

print(f"number of points: {len(mesh.points)}")
print(f"number of faces: {len(mesh.faces)}")
print(f"number of normals: {len(mesh.normals)}")

# Note: If mesh.points is an integer numpy array,
# it will be encoded as an integer attribute. Otherwise,
# it will be encoded as floating point.
binary = DracoPy.encode(mesh.points, mesh.faces)
with open('bunny_test.drc', 'wb') as test_file:
  test_file.write(encoding_test)

# If faces is omitted, DracoPy will encode a point cloud
binary = Dracopy.encode(mesh.points)

# Options for encoding:
binary = Dracopy.encode(
  mesh.points, faces=mesh.faces,
  quantization_bits=14, compression_level=1,
  quantization_range=-1, quantization_origin=None,
  create_metadata=False, preserve_order=False,
  colors=mesh.colors
)

```

DracoPy is a Python wrapper for Google's Draco mesh compression library.

## Installation

Binary wheels are available for users with Python >= 3.6 and pip >= 20.

Installation from source requires Python >= 3.6, pip >= 10, and a C++ compiler that is fully compatible with C++11.

It supports Linux, OS X, and Windows. Numpy is required.

```bash
pip install DracoPy
```

## Acknowledgements

We graciously thank The Stanford 3D Scanning Repository for providing the Stanford Bunny test model.

https://graphics.stanford.edu/data/3Dscanrep/
