Wheels Reference
Module defined in `lua/common/jbeam/sections/wheels.lua`. Constructs wheel geometry (nodes and beams) from JBeam wheel definitions. The largest file in the jbeam subsystem (~2000 lines).
Module defined in lua/common/jbeam/sections/wheels.lua. Constructs wheel geometry (nodes and beams) from JBeam wheel definitions. The largest file in the jbeam subsystem (~2000 lines).
Exports
Functions
M.processWheels(vehicle)
Processes all wheel types defined in the vehicle data. Iterates wheel sections (wheels, monoHubWheels, hubWheelsTSV, hubWheelsTSI, hubWheels, pressureWheels, hubWheelsPressure), constructing node/beam geometry for each wheel type. Handles tire/hub separation, pressure beams, reinforcement beams, and tread patterns.
- Parameters:
vehicle- table - Assembled vehicle data with wheel sections
- Returns: boolean -
trueon success
M.processRotators(vehicle)
Processes the rotators section, calling jbeamUtils.addRotator for each rotator entry to set up powered wheel hubs with their associated node groups.
- Parameters:
vehicle- table - Assembled vehicle data withrotatorssection
- Returns:
self(module table, for chaining)
Internal Notes
- Wheel types (in order of complexity):
addWheel: Basic wheel - single ring of nodes around axleaddMonoHubWheel: Mono-hub - hub and tire share node ringaddHubWheelTSV: Hub wheel with tire-side vertices - separate hub and tire ringsaddHubWheelTSI: Hub wheel with tire-side inner - more complex tire geometryaddHubWheel: Full hub wheel - separate hub, tire inner, tire outer rings
- Each wheel type creates:
- Spoke nodes around the axle axis
- Hub beams (connecting hub nodes)
- Side beams (connecting to axle nodes)
- Tire beams (connecting tire nodes)
- Reinforcement beams (structural integrity)
- Pressure beams (for pressured tires)
- Tread nodes (contact surface)
- Pressure wheels: use
BEAM_PRESSUREDtype for tire volume beams withpressurePSI/pressureGroupconfiguration - Support beams:
BEAM_SUPPORTtype used for certain structural beams cleanupWheelOptionsandcleanupBeamOptionsremove wheel-specific properties from beam/node options to prevent leaking into subsequent elements- Wheel data stored in
vehicle.wheelswith properties:node1,node2,nodeArm,radius,wheelDir,numRays, plus arrays of beam/node references addPressTricreates pressured triangles for tire surfaces- All geometry uses
jbeamUtils.addNodeWithOptions/addBeamWithOptionsfor construction