Skip to main content

vcti-fileloader-mesh

Base classes for mesh fileloader plugins producing mesh-schema DataNode trees.

Overview

vcti-fileloader-mesh is the shared base of the mesh loader family. A mesh format loader (SLIM, PLY, ...) differs from its siblings only in how it opens a file and enumerates its blocks; everything else — the subtree transaction, lazy-vs-eager attachment, schema guarantees, locking, and rollback — is identical. MeshLoaderBase implements that shared part once: subclasses provide can_load / load / unload plus a block_specs() that yields one MeshBlockSpec per block, and inherit a populate() that grafts a locked, mesh-schema-conforming subtree into any LockableTree. The result satisfies the vcti.fileloader.core.Loader protocol, so mesh loaders register and dispatch like every other fileloader plugin.

Installation

pip install vcti-fileloader-mesh

In requirements.txt

vcti-fileloader-mesh>=1.0.0

In pyproject.toml dependencies

dependencies = [
    "vcti-fileloader-mesh>=1.0.0",
]

Quick Start

A complete mesh format loader is the format-specific part only:

from pathlib import Path
from typing import Any

from vcti.fileloader.mesh import MeshBlockSpec, MeshLoaderBase

class MyMeshLoader(MeshLoaderBase):
    id = "mymesh-numpy-loader"

    def can_load(self, path: Path) -> bool:
        return path.suffix.lower() == ".mymesh"

    def load(self, path: Path, **options: Any):
        return open_my_format(path)          # opaque handle

    def unload(self, handle) -> None:
        handle.close()                        # idempotent

    def block_specs(self, handle, **options):
        for element in handle.header:         # cheap metadata only
            yield MeshBlockSpec(
                name=element.name,            # "node", "triangle", ...
                count=element.count,
                dtype=element.record_dtype,
                read=lambda e=element: handle.read_block(e),
            )

Using it is the standard fileloader lifecycle:

from vcti.fileloader.core import DataNode
from vcti.tree.core import DictTree

loader = MyMeshLoader()
tree = DictTree(root_data=DataNode())
with loader.open(Path("part.mymesh")) as handle:
    mesh_root = loader.populate(handle, tree, tree.root_handle)

Blocks attach lazily — nothing is read until a block's .load() — and the subtree is guaranteed to conform to the mesh schema's structure, so vcti.mesh.schema accessors and the mesh exporters consume it directly.


API surface

Name Kind Purpose
MeshLoaderBase ABC populate() template; subclasses add can_load/load/unload/block_specs
MeshLoaderBase.populate(handle, tree, parent, *, before_lock, lazy) method Attach a locked mesh subtree (lazy blocks by default)
MeshLoaderBase.root_attributes(handle) hook File-native attributes for the mesh root (default: none)
MeshLoaderBase.open(path) context manager load()/unload() pairing
MeshBlockSpec dataclass One block: name, count, dtype, read callable, attributes

See docs/design.md for the model and docs/extending.md for the full guide to writing a format loader.


Dependencies

Release files for vcti-fileloader-mesh 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vcti-fileloader-mesh 1.0.0
File Size Uploaded
vcti_fileloader_mesh-1.0.0.tar.gz 9.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vcti-fileloader-mesh 1.0.0
File Interpreter ABI Platform
vcti_fileloader_mesh-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.0 kB

Release files / vcti_fileloader_mesh-1.0.0.tar.gz

Download URL vcti_fileloader_mesh-1.0.0.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c065b2f7e102e71f559ec8661651f027ad21357673709d8710cddf56b64b93e6
BLAKE2b-256 checksum
How to use checksums
8e434beb77dac18ea34ebc1a06a3898e805f087b033a7df61ea202189c21a0aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release files / vcti_fileloader_mesh-1.0.0-py3-none-any.whl

Download URL vcti_fileloader_mesh-1.0.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbe5feffb9adb199b1816b82c520860e8e273518c481d002d01034b1dc42413e
BLAKE2b-256 checksum
How to use checksums
c5a12a8e9aa0de359e66155688d151a83cc5ede9792ac6ebfd5be5a5b7ecefc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page