Skip to main content

Fileloader plugin for CST SLIM (.slm/.slim) mesh files

Project description

vcti-fileloader-slim

Fileloader plugin for CST SLIM (.slm/.slim) mesh files.

Overview

vcti-fileloader-slim reads the SLIM mesh files written by CST Studio Suite (3d.slm, .slim) into a mesh-schema DataNode subtree. SLIM is a PLY-derived binary format; SlimLoader (built on vcti-fileloader-mesh) parses it directly in pure numpy — no CST DLL — and reads the edgeless hex 3d.slm files that CST's own SlimMeshReader rejects. Every fixed-width element (node, edge, triangle, tetrahedron, ...) becomes one lazy structured-array block whose shape and record dtype come from the header, so a mesh is browsable without reading a byte of body; block reads are zero-copy views into the file buffer. Point rows keep file order, so a point's row index is its SLIM node index — the global_index CST result readers use.

Installation

pip install vcti-fileloader-slim

In requirements.txt

vcti-fileloader-slim>=1.0.0

In pyproject.toml dependencies

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

Quick Start

from pathlib import Path
from vcti.fileloader.core import DataNode
from vcti.fileloader.slim import SlimLoader
from vcti.tree.core import DictTree

loader = SlimLoader()
tree = DictTree(root_data=DataNode())

with loader.open(Path("3d.slm")) as handle:
    mesh_root = loader.populate(handle, tree, tree.root_handle)
    # blocks are lazy — materialise what you touch, inside the open()
    for h in tree.children(mesh_root):
        p = tree.payload(h)
        print(p.name, p.shape, p.dtype)      # header facts, nothing read

The subtree conforms to the mesh schema, so its accessors apply directly:

from vcti.mesh.schema import connectivity, coordinates, load_mesh_blocks

with loader.open(Path("3d.slm")) as handle:
    mesh_root = loader.populate(handle, tree, tree.root_handle)
    blocks = load_mesh_blocks(tree, mesh_root)   # materialises the blocks

xyz = coordinates(blocks["node"])                # (N, 3) float64
tri = connectivity(blocks["triangle"])           # (M, 3) int64
uid = blocks["node"]["uid"]                      # per-node id, row-aligned

Register it like any fileloader plugin:

from vcti.fileloader.slim import get_loader_descriptor

registry.register(get_loader_descriptor())       # id: slim-numpy-loader

For header inspection without touching the body:

from vcti.fileloader.slim import parse_header

header = parse_header(Path("3d.slm").read_bytes())
[(e.name, e.count) for e in header.elements]     # element inventory

What it reads

SLIM element Becomes Notes
node node block x, y, z + uid; file order = node index
edge / triangle / tetrahedron cell blocks node_index* connectivity + uid
identification, other fixed blocks (ignored by schema) attached, browsable
list ... (feature maps, curvature) not parsed names in the root's unparsed_elements

See docs/slim-format.md for the format reference and docs/design.md for the design.


Dependencies

  • vcti-fileloader-mesh — mesh loader base and schema (brings vcti-fileloader and vcti-mesh-schema).
  • numpy — header-driven structured-array decoding.

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_fileloader_slim-1.0.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

vcti_fileloader_slim-1.0.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file vcti_fileloader_slim-1.0.0.tar.gz.

File metadata

  • Download URL: vcti_fileloader_slim-1.0.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vcti_fileloader_slim-1.0.0.tar.gz
Algorithm Hash digest
SHA256 aff932907638335c315b6332393428af33965f535d2d0912c2ad4e3a1b48a0f2
MD5 efaeed0f60da3930500f8ad7ef97e094
BLAKE2b-256 bdaa65251d6d226609eba92b8c39cf0b615dbf05ec51c388377d2860f4e17fdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for vcti_fileloader_slim-1.0.0.tar.gz:

Publisher: release.yml on vcollab/vcti-python-fileloader-slim

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_fileloader_slim-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vcti_fileloader_slim-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f6881147c1c1aff6d4e83ff86e49cddf796cb74322ebc61d1f8cec6b2236a74
MD5 f221f8ff5596ec2943a37283a0356b14
BLAKE2b-256 2244d5be2682b41bbcb27d0f6a80076b5cbde49ef8bb3d0cabdadc3dd5762b8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vcti_fileloader_slim-1.0.0-py3-none-any.whl:

Publisher: release.yml on vcollab/vcti-python-fileloader-slim

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