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

Uploaded CPython 3.14Windows x86-64

aldraco-0.1.3-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.3-cp313-cp313-win_amd64.whl (369.4 kB view details)

Uploaded CPython 3.13Windows x86-64

aldraco-0.1.3-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.3-cp312-cp312-win_amd64.whl (369.4 kB view details)

Uploaded CPython 3.12Windows x86-64

aldraco-0.1.3-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.3-cp311-cp311-win_amd64.whl (372.6 kB view details)

Uploaded CPython 3.11Windows x86-64

aldraco-0.1.3-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.3-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: aldraco-0.1.3-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.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 f1e0860558116cd619ff4ba7069a4c67c4d03ff558f8d07df314bd55570623c2
MD5 9ab1e9566271b3288e8ff0217cd5eaea
BLAKE2b-256 7d4a7cc68ab35cd2ec594e1a9e554676cb6339dfbe2db8a874c1c63241568962

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.3-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a5cad3064ecbfdf95b0579632a03820052c3b48ad7ff383e2dcbfe9484da875d
MD5 eef64581316e97de4d5d6b9dc9c08386
BLAKE2b-256 cb433a90a1b8887b23bc71ff4bc64b710e1003948ff1289571acc37ab9f0c10b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.3-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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7d731fede6f9435ffe70e651d6a33db7eeece6a1d180d98c4e1ceb04e84026b2
MD5 87e17325767397b300265b58e45a0042
BLAKE2b-256 de53c9afd93d21673d522bcb588f62fe6036a024f964faa8f319759bf1d9a061

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bbfde037791aa53010a8e21ad840092b1a9009ee405001f90be5b4163952be2e
MD5 0df4ee960fbabe1842aa72476fa35469
BLAKE2b-256 6a2377d1b45bfc2a06d0995f65538e24cab02e97719b8e570af3fb3a4e8f659f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 4d9ad167cd5a700fef517c6a5035137cc5ba4d6d3d18ff5bf74ce878d35a4576
MD5 66205eca6f82a07d336537ee68d61e8c
BLAKE2b-256 b15bd336d430635c1cc3b1748a6081f4912bb68db3b86c8c1105c497d6bd3d9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c53546407fbb5b8e9a8f5b090c042eb26166ce043c75befda2326c505aaf009a
MD5 1dab1bea95fd8158b1729543b3cb752d
BLAKE2b-256 1811bf5db8d069cfdf1424878bc1f7d6918cc161cc2360b3d88efa5ef80944b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 372.6 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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0a8a1b4d4f14c83b80f08d8a9373c3b0eb0e7f813f1cb3e2ce48ce5df8c0f7a5
MD5 646835c7210105291d2208001ae6d500
BLAKE2b-256 1dbe338aac76f3670f0047f09f5653661becee2636a0207e88bfc47190a6ab96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 75072bdb6d78df6696f1c2c64f859392fc5e1c69d58ff55ba45ce5a4c644d600
MD5 b87b21b21c5ef9d239c5e4ead30bd84e
BLAKE2b-256 079bfe49fcf6b32ce3cad3041890eccdb012afb89bfa7b5aef59a7484cd576b2

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