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.4-cp314-cp314-win_amd64.whl (379.1 kB view details)

Uploaded CPython 3.14Windows x86-64

aldraco-0.1.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (675.1 kB view details)

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

aldraco-0.1.4-cp313-cp313-win_amd64.whl (369.4 kB view details)

Uploaded CPython 3.13Windows x86-64

aldraco-0.1.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (674.7 kB view details)

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

aldraco-0.1.4-cp312-cp312-win_amd64.whl (369.4 kB view details)

Uploaded CPython 3.12Windows x86-64

aldraco-0.1.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (674.8 kB view details)

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

aldraco-0.1.4-cp311-cp311-win_amd64.whl (372.7 kB view details)

Uploaded CPython 3.11Windows x86-64

aldraco-0.1.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (685.1 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.4-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: aldraco-0.1.4-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 379.1 kB
  • Tags: CPython 3.14, 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.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d5338fb707b14bc2c2825b074d60c23d99350f327a35f7bac7e017ef01a9d7a3
MD5 9d24b523a0bfbe42bb320c0c655d2e01
BLAKE2b-256 9f4af689c2b8ea1f51170c6d278508edaade0767dc32f269b15e65e83b213b3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38cadceb2cd7e43c1b1a957071f933252109fc3466d8b99f1a83792ed54e6ab6
MD5 11258ae61b6c7c62c807c807b440b33d
BLAKE2b-256 abafad5e5c9ac3f0b947c6bec5eeedf1506de402f9ff7cf47d9931d3b7f97a0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 369.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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ea7684389677e2e8a93266f24853e9b10d9e9a83143167ac891036a39d654226
MD5 f0466c2864aeb32d20181db1530e7de4
BLAKE2b-256 df65978930f6a87332959908a3ef52ab28222416246eab74cab9eeab1191a3ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f1d74d0083ef35b060da645ae09c1759ce9f1879d25ba7d476fab73b6a781799
MD5 3cbde92c2956dd131f74a368c433e758
BLAKE2b-256 4fbdcf38f8b0a59f277ce624faf4e9713dd442c9d1234dfe6cf8ccacf1f713a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 369.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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4bf352bbd539887a6186f41368ec1b7f2a20b7d3f2d7d10a9b0e89658982b6b1
MD5 779266df6a28db3c638ca5f9035366d7
BLAKE2b-256 7bb989a01feac6c84f4990d32eba8a927efbef7aec5117c821f724249da25560

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef4d15b79f10d71ef24d3b83bc63d58b44ecc8220483a55c7c93ce0886b2023b
MD5 e098fbc103a680cbe832baf92d4a88f8
BLAKE2b-256 9805be98d530213e0d356f3691f20ecfdbdeef45ddfa6a6122b4ca6b9ed080e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 372.7 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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 62ac595f172e62220dc226bbc896c1ab3f5223895adc874d7fc1f84a24f247b1
MD5 b0cf0850a85b0ec72be0ed3e6479a8cb
BLAKE2b-256 54dfb929c832cd78ee0811021ff155fc9470f0679cf4ec73bf6c50141e1e9742

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 db31edb7103676a0dad107f6b9bebfa65159698826726c0f779dea2829e3bf64
MD5 9a79d404929353601aaeb7b60f732a0a
BLAKE2b-256 fabce4589ccc80b18f27e53723e0e3a5ba19cc3f24e5b613a2c3efd037c4fa16

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