Tree exporter plugins for mesh-schema DataNode trees: PLY, OBJ, and STL writers
Project description
vcti-tree-exporter-mesh
Tree exporter plugins for mesh-schema DataNode trees: PLY, OBJ, and STL writers.
Overview
vcti-tree-exporter-mesh is the write side of the mesh package family.
It ships three exporters satisfying the
vcti-tree-exporter
Exporter protocol — PlyExporter (binary little-endian), ObjExporter
(text), StlExporter (binary) — that consume a
mesh-schema subtree from
any tree (typically one a mesh loader such as
vcti-fileloader-slim
populated) and write its points and triangles to disk. The three formats
live in one package deliberately: all are zero-dependency and
schema-bound; a format earns its own package only when it brings a heavy
dependency.
Installation
pip install vcti-tree-exporter-mesh
In requirements.txt
vcti-tree-exporter-mesh>=1.0.0
In pyproject.toml dependencies
dependencies = [
"vcti-tree-exporter-mesh>=1.0.0",
]
Quick Start
Convert a SLIM mesh to STL — loader in, exporter out, the mesh subtree as the hand-off:
from pathlib import Path
from vcti.fileloader.core import DataNode
from vcti.fileloader.slim import SlimLoader
from vcti.tree.core import DictTree
from vcti.tree.exporter.mesh import StlExporter
loader, tree = SlimLoader(), DictTree(root_data=DataNode())
with loader.open(Path("3d.slm")) as handle:
loader.populate(handle, tree, tree.root_handle)
StlExporter().export(tree, Path("3d.stl"))
Each exporter finds the tree's (single) mesh subtree by itself; pass
root= when the tree holds several. Through the registry, resolution
works by id or attribute lookup like the rest of the exporter family:
from vcti.tree.exporter.core import build_registry, get_exporter
from vcti.tree.exporter.mesh import get_exporter_descriptors
registry = build_registry(get_exporter_descriptors())
get_exporter(registry, "ply").export(tree, Path("mesh.ply"), overwrite=True)
The three formats
| Exporter | id | Output | Notes |
|---|---|---|---|
PlyExporter |
ply |
binary little-endian PLY | float32 vertices; vertex-only meshes allowed |
ObjExporter |
obj |
Wavefront OBJ text | 1-based faces; \n line endings on all platforms |
StlExporter |
stl |
binary STL | computed facet normals; requires a non-empty triangle block |
Common behavior: the mesh subtree is validated against the schema before
writing (violations raise ExportError with context, never raw numpy
errors); 2-D meshes are padded with z = 0; existing files raise
FileExistsError unless overwrite=True.
See docs/design.md for the model and boundaries.
Dependencies
- vcti-tree-exporter — the
Exporterprotocol and descriptor/registry helpers. - vcti-mesh-schema — the mesh block schema the writers consume.
- numpy — binary encoding of blocks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vcti_tree_exporter_mesh-1.0.0.tar.gz.
File metadata
- Download URL: vcti_tree_exporter_mesh-1.0.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
569a348170896b1c5b458f308bef8d17af74fbb810fdb7241e719912135eb6f8
|
|
| MD5 |
e78c9ce2cf299af93589c9cd1a457f5d
|
|
| BLAKE2b-256 |
8f993a5e99f572813515104e393581dc18118ce604bafbcdce8f8624ad39b5af
|
Provenance
The following attestation bundles were made for vcti_tree_exporter_mesh-1.0.0.tar.gz:
Publisher:
release.yml on vcollab/vcti-python-tree-exporter-mesh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vcti_tree_exporter_mesh-1.0.0.tar.gz -
Subject digest:
569a348170896b1c5b458f308bef8d17af74fbb810fdb7241e719912135eb6f8 - Sigstore transparency entry: 2188205483
- Sigstore integration time:
-
Permalink:
vcollab/vcti-python-tree-exporter-mesh@e136a471fda520b1d9ab4a5c33530f707504db98 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/vcollab
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e136a471fda520b1d9ab4a5c33530f707504db98 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vcti_tree_exporter_mesh-1.0.0-py3-none-any.whl.
File metadata
- Download URL: vcti_tree_exporter_mesh-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
690b30253379b8ff7e0ab552d8b43a195159351947a5d725569f9786060aad23
|
|
| MD5 |
6398234ad2c97625f0df9ea39b8ae7df
|
|
| BLAKE2b-256 |
2fc11fdf89fb8dc65cf932dbfbc20f0e9353da8dc93ea5046af928f37228b476
|
Provenance
The following attestation bundles were made for vcti_tree_exporter_mesh-1.0.0-py3-none-any.whl:
Publisher:
release.yml on vcollab/vcti-python-tree-exporter-mesh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vcti_tree_exporter_mesh-1.0.0-py3-none-any.whl -
Subject digest:
690b30253379b8ff7e0ab552d8b43a195159351947a5d725569f9786060aad23 - Sigstore transparency entry: 2188205489
- Sigstore integration time:
-
Permalink:
vcollab/vcti-python-tree-exporter-mesh@e136a471fda520b1d9ab4a5c33530f707504db98 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/vcollab
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e136a471fda520b1d9ab4a5c33530f707504db98 -
Trigger Event:
push
-
Statement type: