Module src.utils.joint_layout

JointLayout helper for toroidal joint placement and billboarding.

Computes 12 joint positions on a torus, four triangle centroids, and the yaw angle needed to billboard a label toward the camera.

Functions

JointLayout.getJointPositions () Get positions of all 12 joints on the torus.
JointLayout.getTriangleCenters () Get centroids of four triangular faces on the torus.
JointLayout.getBillboardYaw (labelPos, cameraPos) Compute world-Y yaw angle for a billboard to face the camera.


Functions

JointLayout.getJointPositions ()
Get positions of all 12 joints on the torus. Joints are indexed 0–11 around the torus circle.

Returns:

    table {number,number,number}>
    Map from joint index → 3‐element position array {x, y, z}
JointLayout.getTriangleCenters ()
Get centroids of four triangular faces on the torus. Triangles defined by joint triplets (0,8,4), (1,9,5), (2,10,6), (3,11,7).

Returns:

    table {number,number,number}>
    Array of 4 centroids, each a 3‐element {x, y, z} array
JointLayout.getBillboardYaw (labelPos, cameraPos)
Compute world-Y yaw angle for a billboard to face the camera.

Parameters:

  • labelPos {number,number,number} 3-element array {x, y, z}
  • cameraPos table Table with fields x, y, z

Returns:

    number Yaw angle in radians around the world-Y axis
generated by LDoc 1.5.0 Last updated 2025-09-04 12:20:37