RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Debug DrawingGPU Mesh StructsImGui FFIMath Structs (FFI)FFI C DefinitionsPID ControllersCSV LibraryDelay LineDequeDevelopment UtilitiesEvent ReferenceExtension SystemSignal FiltersGraph PathfindingUI BridgeInput Filter Constants2D Bilinear InterpolationIntrospectionJBeam Pretty PrinterJSON AST ParserSJSON ParserJSON Debug ParserJSON Pretty PrinterK-D Tree (2D Boxes)K-D Tree (3D)K-D Tree (3D)Lua SerializerC++/Lua BindingLua CoreLua ProfilerMath LibraryParticlesQuadtreeSettingsTCP ServerTimer SchedulerUtility Library
Co-Simulation Channel Namestech/ - Co-simulation & Technical Interface ModulesPCD Point Cloud FilesTCP Tech CommunicationTech Utilities

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

PCD Point Cloud Files

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

See Also

  • tech/ - Co-simulation & Technical Interface Modules - Directory overview
  • cosimulationNames Reference - Related reference
  • techCommunication Reference - Related reference
  • techUtils Reference - Related reference
  • Common Libraries Overview - Guide

tech/ - Co-simulation & Technical Interface Modules

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

TCP Tech Communication

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 NotesSee Also