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

Uploaded CPython 3.14Windows x86-64

aldraco-0.1.2-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.2-cp313-cp313-win_amd64.whl (370.5 kB view details)

Uploaded CPython 3.13Windows x86-64

aldraco-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (671.6 kB view details)

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

aldraco-0.1.2-cp312-cp312-win_amd64.whl (370.7 kB view details)

Uploaded CPython 3.12Windows x86-64

aldraco-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (671.8 kB view details)

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

aldraco-0.1.2-cp311-cp311-win_amd64.whl (374.6 kB view details)

Uploaded CPython 3.11Windows x86-64

aldraco-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (683.5 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.2-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: aldraco-0.1.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 380.4 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.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d942f7d4f6a28ff60261d7a6e4298bfd7d58429e2e1836feaf9a7c7446c45913
MD5 f994259648fcbd3ef75e412d12f8e38f
BLAKE2b-256 c9d0259f9a5fd51a53444605141a74eb8cd1417eb32920b070500f4c9e6ef4ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 26b11bca8e2b2a3519049587e5fd3fc1d5a7839958cd6825dd79946c152f3aaa
MD5 e38c655dc58e563a1dbd82564fe5b429
BLAKE2b-256 1029e77d832cc634edb115c9c460425dbc355a0c4a4d57c13cea55d8ead03c48

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 370.5 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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fd0a65063b91caaccb9ccdedacdbb72bbd691f1762081a2265d2e2881088f21e
MD5 edcdf0d622b9fa6a750c1aae5b8bccd9
BLAKE2b-256 b053bebcbddb1096a4f3dfa487663e9e512b683e1cc2fb9d033324ab5b9d0e17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 57ed2ef2734b9fba39abf5f27337bae6f7ee677c49fb0d51fd791a224bdcbb5b
MD5 c60e95c7100b77875ac91a23d8e1156a
BLAKE2b-256 82f67d6472386adfdad1972146bf7f05c80573f091f41b2faed43395e5e3ce5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 370.7 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9bb80635f7832beaef8b1d5b18850bf53bcd6062126ae96766e2410c3dcb31bf
MD5 d39ca879ca95720c4bcb37fef17ce29f
BLAKE2b-256 cad023f4cdef7dd848a4118e2dfc30ca8a59043938b95a1fc262ee7706a026c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8d4454279028412ab2ed23b5cecee4fba87b726cc4addc3d8cc10839b680701
MD5 4793efc72b79e5f41b3f96939cd1d8d0
BLAKE2b-256 94abe92c83aef7aa8222d770799328a7c956f7e82981786021a2b3453e31fef4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aldraco-0.1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 374.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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 50748bed6ea7d69aa9f143e2679023e1d00f0fe95a8aea4bfb56fb5b2567ca77
MD5 ef614cf89b4b28916a30fb8fb937d92d
BLAKE2b-256 2517df5ff69c148e7f32f42711623013c6de20577b499905247bdbd086a62979

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aldraco-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4efb68dd1612ff09b6da625b999ade150bc8568d071a5739ede9020b10123718
MD5 fb852ced5f8810bde49ea2fd5f2e19fd
BLAKE2b-256 ce5f1b9b195cdc34b0e5c10b59302390dc57d494aa3825b9269a9a639469213a

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