Module axis

Module axis 

Source
Expand description

The ONE definition of the server wire’s axis convention (issue #1841).

IFC is Z-up; WebGL/glTF (and every ifc-lite client) is Y-up. Every server transport therefore emits Y-up metres, and this module is the single place that conversion is defined.

It used to be open-coded inline in each parquet serializer and simply MISSING from the JSON route, so POST /api/v1/parse shipped raw IFC Z-up while the parquet endpoints shipped Y-up — the same class of silent per-transport drift as the dropped origin. Keep every transport routed through these helpers so the frame can never diverge again.

Functions§

mesh_to_yup_in_place
Rewrite a mesh into the Y-up wire frame in place: positions, normals, and the per-mesh origin together, so the mesh stays internally consistent.
zup_to_yup
Convert one position/normal triplet from IFC Z-up to WebGL Y-up: X stays, new Y = old Z (vertical), new Z = -old Y (depth).
zup_to_yup_f64
The same swap for an f64 triplet — used for the per-mesh origin, which must land in the SAME frame as the positions it offsets (the swap is linear, so swap(origin + position) == swap(origin) + swap(position)).