Metadata-Version: 2.4
Name: cq-jt
Version: 0.3.0
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
License-File: licenses/adler2-2.0.1-LICENSE-MIT.txt
License-File: licenses/block-buffer-0.10.4-LICENSE-MIT.txt
License-File: licenses/cfg-if-1.0.5-LICENSE-MIT.txt
License-File: licenses/cpufeatures-0.2.17-LICENSE-MIT.txt
License-File: licenses/crc32fast-1.5.0-LICENSE-MIT.txt
License-File: licenses/crypto-common-0.1.7-LICENSE-MIT.txt
License-File: licenses/digest-0.10.7-LICENSE-MIT.txt
License-File: licenses/flate2-1.1.10-LICENSE-MIT.txt
License-File: licenses/generic-array-0.14.7-LICENSE.txt
License-File: licenses/heck-0.5.0-LICENSE-MIT.txt
License-File: licenses/itoa-1.0.18-LICENSE-MIT.txt
License-File: licenses/libc-0.2.191-LICENSE-MIT.txt
License-File: licenses/lzma-rust2-0.15.8-LICENSE.txt
License-File: licenses/memchr-2.8.3-LICENSE-MIT.txt
License-File: licenses/miniz_oxide-0.9.1-LICENSE-MIT.txt
License-File: licenses/once_cell-1.21.4-LICENSE-MIT.txt
License-File: licenses/portable-atomic-1.15.0-LICENSE-MIT.txt
License-File: licenses/proc-macro2-1.0.107-LICENSE-MIT.txt
License-File: licenses/pyo3-0.29.2-LICENSE-MIT.txt
License-File: licenses/pyo3-build-config-0.29.2-LICENSE-MIT.txt
License-File: licenses/pyo3-ffi-0.29.2-LICENSE-MIT.txt
License-File: licenses/pyo3-macros-0.29.2-LICENSE-MIT.txt
License-File: licenses/pyo3-macros-backend-0.29.2-LICENSE-MIT.txt
License-File: licenses/quote-1.0.47-LICENSE-MIT.txt
License-File: licenses/serde-1.0.229-LICENSE-MIT.txt
License-File: licenses/serde_core-1.0.229-LICENSE-MIT.txt
License-File: licenses/serde_derive-1.0.229-LICENSE-MIT.txt
License-File: licenses/serde_json-1.0.154-LICENSE-MIT.txt
License-File: licenses/sha2-0.10.9-LICENSE-MIT.txt
License-File: licenses/simd-adler32-0.3.10-LICENSE.txt
License-File: licenses/syn-2.0.119-LICENSE-MIT.txt
License-File: licenses/syn-3.0.9-LICENSE-MIT.txt
License-File: licenses/target-lexicon-0.13.5-LICENSE.txt
License-File: licenses/typenum-1.20.1-LICENSE-MIT.txt
License-File: licenses/unicode-ident-1.0.27-LICENSE-MIT.txt
License-File: licenses/unicode-ident-1.0.27-LICENSE-UNICODE.txt
License-File: licenses/version_check-0.9.5-LICENSE-MIT.txt
License-File: licenses/zmij-1.0.23-LICENSE-MIT.txt
License-File: licenses/manifest.json
Summary: Bounded JT reading and GLB export with a Rust core and Python bindings
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# cq-jt

A JT reader and GLB exporter with a Python-independent Rust core and thin Python bindings.

Read product structure, part placements, materials and selected triangle meshes from **JT 9.5, 10.0 and 10.3**. Inspect container boundaries, decode ZLIB/XZ streams, resolve local external JT references, and retain source information and opaque data.

JT 10.6 is available as an **explicit experimental opt-in**. Compatibility with native JT 10.6 exports has not been verified. See [compatibility and limitations](docs/compatibility.md).

## Requirements and installation

Python 3.11 or later is required. This project is under development and has not been published to PyPI.

To build from a source checkout, install Rust 1.83 or later and [uv](https://docs.astral.sh/uv/), then run:

```bash
uv sync --locked --group dev
uv run python -m cq_jt --help
```

To install a locally built wheel, use `python -m pip install /path/to/cq_jt-<version>-<tags>.whl`. Wheel users do not need Rust, CadQuery, NumPy, Java, .NET or a CAD application. Locally verified wheel environments are Linux x86_64 with CPython 3.11–3.14; other platforms are not yet verified.

## Quick start

```python
import cq_jt as jt

scene = jt.read("assembly.jt")
print(scene.complete, len(scene.meshes), len(scene.instances))

buffers = scene.mesh_buffers(0)  # Explicit packed-array copies
print(buffers.positions.dtype, buffers.positions.shape)
print(buffers.triangles.dtype, buffers.triangles.shape)

report = jt.export_glb(scene, "assembly.glb")
print(report.instance_count, report.placed_triangle_count)

# Read and export in one call:
# report = jt.convert("assembly.jt", "another.glb")
```

File reads resolve external Partition references within the input file's parent directory by default. Use `ResolverOptions(root=...)` to select another allowed root, or `enabled=False` to disable external reads. Bytes-based and structure-only APIs do not open external files.

Missing units or colors require explicit supplements. Partial scenes require explicit export permission. Existing output files are protected by default. GLB output contains display triangles and approximate PBR materials; precise geometry, PMI interpretation and CAD editing history are outside the supported profile.

## Command line

```bash
python -m cq_jt inspect part.jt --json
python -m cq_jt decode part.jt --json
python -m cq_jt structure part.jt --json
python -m cq_jt mesh part.jt --lod highest --json
python -m cq_jt convert part.jt part.glb --json
```

## Documentation

- [Documentation index](docs/README.md)
- [API guide](docs/model-api.md): reading, arrays, units, external references, export and errors
- [Compatibility](docs/compatibility.md): supported profiles and experimental JT 10.6
- [Conversion example](examples/README.md)
- [Rust core](crates/jt-core/README.md)

## Development

```bash
uv run pytest
cargo test -p jt-core --locked --features glb
uv run python scripts/build_python_release.py
python scripts/check_publication.py
```

The included tests and fixtures can run from a public checkout without acquired CAD data or proprietary tools.

## License

MIT. Dependency licenses, Siemens format notices and other attributions are included in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) and [licenses/](licenses/).

