Skip to main content

Draco compression/decompression for Python with I3S-friendly attribute decoding.

Project description

aldraco

aldraco is a Python library for Draco mesh/point-cloud compression and decompression, with robust I3S-friendly decoding of custom attributes such as uv-region and feature-index.

Install

pip install aldraco

Decode (one line)

import aldraco

result = aldraco.decode(draco_bytes)
points = result.points
faces = result.faces
uvr = result.uvr           # I3S uv-region, if present
feature_index = result.feature_index  # I3S feature-index, if present
feature_ids = result.feature_ids      # I3S feature-ids from metadata, if present
colors = result.colors     # if present

Decode bytes or .gz bytes (auto-detect)

import aldraco

# If `is_gzip=None`, bytes are treated as gzip when the magic header (1F 8B) is present.
result = aldraco.decode_bytes(maybe_gz_bytes, is_gzip=None)

Normalize to Draco bytes (I/O helpers)

import aldraco

# If input is gzip-wrapped Draco, this returns the raw Draco buffer.
draco_bytes = aldraco.decode_to_bytes(maybe_gz_bytes, is_gzip=None)

# Encode to raw Draco bytes (same as `encode(...)`).
draco_bytes2 = aldraco.encode_to_bytes(points, faces=faces)

Write Draco or .gz Draco to file

import aldraco

aldraco.encode_to_file("out.drc", points, faces=faces)

# If output_path does not end with .gz, `.gz` will be appended automatically.
aldraco.encode_to_gzip_file("out.drc", points, faces=faces)

Decode file (requires output_path)

from pathlib import Path
import aldraco

# Writes the Draco raw bytes (after optional gzip preprocessing) to output_path.
out_draco = Path("out.draco")
result = aldraco.decode_file("demo/datas/IntegratedMeshType/1.bin.gz", out_draco, is_gzip=None)

Gzip helpers (vendored zlib)

from pathlib import Path
import aldraco

gz_bytes = Path("1.bin.gz").read_bytes()

raw = aldraco.gzip_decompress_bytes(gz_bytes, is_gzip=None)
gz2 = aldraco.gzip_compress_bytes(raw, level=6, is_gzip=None)

# File helpers require output_path and overwrite if exists.
aldraco.gzip_decompress_file("1.bin.gz", "1.bin", is_gzip=None)
aldraco.gzip_compress_file("1.bin", "1.bin.gz", level=6, is_gzip=None)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aldraco-0.1.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (672.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

aldraco-0.1.1-cp313-cp313-win_amd64.whl (367.4 kB view details)

Uploaded CPython 3.13Windows x86-64

aldraco-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (671.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

aldraco-0.1.1-cp312-cp312-win_amd64.whl (367.4 kB view details)

Uploaded CPython 3.12Windows x86-64

aldraco-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (671.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

aldraco-0.1.1-cp311-cp311-win_amd64.whl (371.1 kB view details)

Uploaded CPython 3.11Windows x86-64

aldraco-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (683.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file aldraco-0.1.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aldraco-0.1.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 60f756eed9788f87a1adfb4cb4a782d243825227b3e4ca7df2b68bfa73d52e99
MD5 732791defd3239f28816eec38d5ba699
BLAKE2b-256 63a76e42515a9a7faa20f585446273f39b7a2c9c50fbb9f8b33c2cb951f71d90

See more details on using hashes here.

File details

Details for the file aldraco-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: aldraco-0.1.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 367.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for aldraco-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5f99f9a177e78a4b783996aad998a77515c32d92a7c8655f17e2ff2fd2e3c434
MD5 ab54e8c6dacd53c88e63747f565d7990
BLAKE2b-256 71c587e30de9cc75d066a9303301d8132fd1300c2ff8a483e29c4c1170de7c2c

See more details on using hashes here.

File details

Details for the file aldraco-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aldraco-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e3529f242d9a328c4a61a785c32501b052f4b731b6d55b89927cb97a16581a89
MD5 d8386a46cc38538b80ab0ece23f807be
BLAKE2b-256 c1214ccf24a313c7c420b66ccc2cfcbc0331be3b2070dd8decf6ea60e0f71987

See more details on using hashes here.

File details

Details for the file aldraco-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: aldraco-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 367.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for aldraco-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c4a0d893ff247b8a2422685089d7e042a713171f32614ee4e66ce338b80a20ff
MD5 b1e235a4d7de3cafe5f9394dca74156e
BLAKE2b-256 19d7752b25295cd107f23e46079bf8dc37f03b50d6ac571e7c448558c336c2c4

See more details on using hashes here.

File details

Details for the file aldraco-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aldraco-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f0ee283ed21237be5488ae66693a78a9220bbb225420e74acefaae7cb92ab170
MD5 92d5d03b03fcf8ce988d2d8567205995
BLAKE2b-256 cfe1f4fa68f7259741200c024762de332b9e819eb13a61e897ca5503ce4d7d0c

See more details on using hashes here.

File details

Details for the file aldraco-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: aldraco-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 371.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for aldraco-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 de9efdc672ace6cebc07ba8e3f04169f3c068832a091ef43f5c168628a6c13c5
MD5 f453405f465bcab4d57cb300c4e71c8f
BLAKE2b-256 b58cb1c26d841caa6ee8992e0a994e806598fd990d8b6c8d923f7aa8556878cb

See more details on using hashes here.

File details

Details for the file aldraco-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for aldraco-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5bdd384be0fa9677bd08f97144fa026e93a4f86f90aa6d5941c2169fa5b22f26
MD5 2bbcfbe1ea8130d98e8f088267c5c8b9
BLAKE2b-256 1b504a36503c56ae5f23544c2e81cebbc97672ab815409fad0f5bdbfb2668e1e

See more details on using hashes here.

Supported by

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