Skip to main content

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vcti_tree_exporter_mesh-1.0.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vcti_tree_exporter_mesh-1.0.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

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

Hashes for vcti_tree_exporter_mesh-1.0.0.tar.gz
Algorithm Hash digest
SHA256 569a348170896b1c5b458f308bef8d17af74fbb810fdb7241e719912135eb6f8
MD5 e78c9ce2cf299af93589c9cd1a457f5d
BLAKE2b-256 8f993a5e99f572813515104e393581dc18118ce604bafbcdce8f8624ad39b5af

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vcti_tree_exporter_mesh-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vcti_tree_exporter_mesh-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 690b30253379b8ff7e0ab552d8b43a195159351947a5d725569f9786060aad23
MD5 6398234ad2c97625f0df9ea39b8ae7df
BLAKE2b-256 2fc11fdf89fb8dc65cf932dbfbc20f0e9353da8dc93ea5046af928f37228b476

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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