RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

cdefDebugDraw ReferencecdefGpuMesh ReferencecdefImgui ReferencecdefMath Referencecdefs ReferencecontrolSystems Referencecsvlib ReferencedelayLine Referencedequeue ReferencedevUtils ReferenceEvent Referenceextensions Referencefilters Referencegraphpath Referenceguihooks ReferenceinputFilters ReferenceinterpolatedMap Referenceintrospection ReferencejbeamWriter Referencejson-ast Referencejson ReferencejsonDebug ReferencejsonPrettyEncoderCustom Referencekdtreebox2d Referencekdtreebox3d Referencekdtreepoint3d Referencelpack ReferenceluaBinding ReferenceluaCore ReferenceluaProfiler Referencemathlib Referenceparticles Referencequadtree Referencesettings ReferencetcpServer ReferencetimeEvents Referenceutils Reference
cosimulationNames Referencetech/ - Co-simulation & Technical Interface ModulespcdLib ReferencetechCommunication ReferencetechUtils Reference

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API Referencecommontech

pcdLib Reference

Module defined in `lua/common/tech/pcdLib.lua`. Creates PCD (Point Cloud Data) files - the standard format for lidar, radar, and other point cloud sensor data.

Module defined in lua/common/tech/pcdLib.lua. Creates PCD (Point Cloud Data) files - the standard format for lidar, radar, and other point cloud sensor data.


Exports

Functions

M.newPcd()

Create a new PCD file writer instance.

  • Returns: Pcd - A new point cloud data object

Pcd Object Methods

pcd:addField(name, size, type)

Add a field definition to the point cloud schema.

  • Parameters:
    • name - string - Field name (e.g., "x", "y", "z", "intensity")
    • size - number - Byte size per element (1, 2, 4, 8)
    • type - string - Data type: "F" (float), "U" (unsigned), "I" (signed)

pcd:setViewpoint(pos, rotQuat)

Set the sensor viewpoint for this cloud.

  • Parameters:
    • pos - vec3 - Sensor position
    • rotQuat - quat - Sensor rotation quaternion

pcd:setData(data, bytes)

Set the raw binary payload data.

  • Parameters:
    • data - cdata/string - Raw point data
    • bytes - number - Byte length

pcd:save(filename)

Write the PCD file to disk (header + binary payload).

  • Parameters:
    • filename - string - Output file path
  • Returns: boolean|nil - false on error

pcd:writeHeader(file)

Write only the PCD header to an open file handle.

  • Parameters:
    • file - file - Open file handle

Internal Notes

  • PCD version 0.7 format
  • Binary data mode (not ASCII)
  • Point count auto-calculated from payload size / point size
  • Height always 1 (unorganized dataset)
  • Uses string.buffer for efficient binary payload accumulation

tech/ - Co-simulation & Technical Interface Modules

Core modules for BeamNG's tech layer - external tool integration, sensor data, and co-simulation communication.

techCommunication Reference

Module defined in `lua/common/tech/techCommunication.lua`. TCP socket communication layer for BeamNG's tech/co-simulation interface. Handles client connections, MessagePack-encoded message exchange, a

On this page

ExportsFunctionsM.newPcd()Pcd Object Methodspcd:addField(name, size, type)pcd:setViewpoint(pos, rotQuat)pcd:setData(data, bytes)pcd:save(filename)pcd:writeHeader(file)Internal Notes