visualdynamics.io.sdynpy_npz¶
sdynpy_npz
¶
Importer for sdynpy native geometry files (.npz).
The format is a numpy .npz archive with four structured arrays. Field layout (np.lib.format is self-describing; read with np.load):
- node: id, coordinate (3,), color, def_cs, disp_cs
- coordinate_system: id, name, color, cs_type, matrix (4, 3) — rows 0-2 are the rotation, row 3 the origin (length units)
- traceline: id, color, description, connectivity (object: node id array)
- element: id, type (UFF 2412 descriptor code), color, connectivity (object)
The file carries no units. length_unit may be given to declare them at
import; otherwise the geometry arrives unit-less.
Functions:
| Name | Description |
|---|---|
load |
sdynpy geometry files carry no units; without |
save |
Write a geometry in sdynpy's own .npz layout. |
Classes¶
Functions:¶
load
¶
load(path: str | PathLike, length_unit: str | None = None) -> Geometry
sdynpy geometry files carry no units; without length_unit the
geometry imports with its raw coordinates for the user to define later.
Source code in src/visualdynamics/io/sdynpy_npz.py
save
¶
save(geometry: Geometry, path: str | PathLike, unit_system: UnitSystem | None = None) -> None
Write a geometry in sdynpy's own .npz layout.
Coordinates go out in unit_system, or as stored without one. The
format records no units either way, so whoever reads it has to be told
— which is what "consistent units" means in this corner of the world.