RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager
Tool Utilities - Fit PolylineEditor Tool Utilities – GeometryEditor Tool Utilities – GizmoEditor Tool Utilities – Material Selection ManagerEditor Tool Utilities – Mesh Audition ManagerEditor Tool Utilities – Perlin NoiseEditor Tool Utilities – Polygon DrawingEditor Tool Utilities – Ramer-Douglas-PeuckerEditor RenderingEditor Tool Utilities – Ribbon InputEditor Tool Utilities – Riverbed TerraformingEditor Tool Utilities – Road Design StandardsEditor Tool Utilities – Simplex NoiseEditor Tool Utilities – Skeleton (Image Vectorisation)Editor Tool Utilities – Spline InputEditor Tool Utilities – Spline Mask ExportEditor Tool Utilities – StyleEditor Tool Utilities – Terrain PainterEditor Tool Utilities – Util

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 ReferenceGE ExtensionseditortoolUtilities

Editor Tool Utilities – Skeleton (Image Vectorisation)

Suite for converting PNG bitmap images to vectorised polylines. Pipeline: bitmap → binary mask → Guo-Hall skeletonisation → keypoint detection → path extraction → join/filter → width estimation → RDP

Suite for converting PNG bitmap images to vectorised polylines. Pipeline: bitmap → binary mask → Guo-Hall skeletonisation → keypoint detection → path extraction → join/filter → width estimation → RDP simplification.


Public API

FunctionSignatureDescription
M.skeletonise(mask) → maskApplies Guo-Hall thinning algorithm to reduce a binary mask to 1-pixel-wide skeleton (in-place)
M.extractPaths(mask) → tableExtracts paths from a skeletonised mask via DFS traversal from endpoints/junctions
M.estimateWidths(paths, mask) → tableEstimates widths at each path point by walking along binormals in the original mask
M.getPathsFromPng`(filepath) → tablenil`

Code Examples

local skeleton = require('editor/toolUtilities/skeleton')

-- Full pipeline: PNG to vectorised polylines with widths
local paths = skeleton.getPathsFromPng('/art/masks/road_network.png')
if paths then
  for i, path in ipairs(paths) do
    local points = path.points  -- array of vec3 (x, y pixel coords)
    local widths = path.widths  -- array of numbers (pixel widths)
    log('I', 'skel', string.format('Path %d: %d points', i, #points))
    -- Convert pixel coords to world space and create splines
  end
end

-- Low-level: skeletonise a mask manually
local mask = {}  -- 2D array of 0s and 1s, mask[y][x]
skeleton.skeletonise(mask)  -- modifies in-place to 1-pixel skeleton

-- Extract paths from skeleton
local rawPaths = skeleton.extractPaths(mask)

-- Estimate widths from original (non-skeletonised) mask
local widths = skeleton.estimateWidths(rawPaths, originalMask)

-- The pipeline internally:
-- 1. Loads PNG via GBitmap, flips Y
-- 2. Converts to binary mask with dynamic normalisation
-- 3. Dilates mask by radius 3 to thicken thin features
-- 4. Guo-Hall iterative thinning (two-phase deletion)
-- 5. Detects endpoints (1 neighbour) and junctions (3+ transitions)
-- 6. Walks arms between keypoints to extract path segments
-- 7. Filters short paths (< 20 pixels), joins close endpoints (< 40 px)
-- 8. Estimates widths by walking binormals in the original mask
-- 9. Tapers/smooths/clamps widths to reduce artifacts
-- 10. RDP simplification with tolerance 6.0

See Also

  • Tool Utilities - Fit Polyline - Related reference
  • Editor Tool Utilities – Geometry - Related reference
  • Editor Tool Utilities – Gizmo - Related reference
  • World Editor Guide - Guide

Editor Tool Utilities – Simplex Noise

2D Simplex noise implementation with a static permutation table. Provides smoother, less grid-aligned noise compared to Perlin noise, with O(n²) complexity for n dimensions.

Editor Tool Utilities – Spline Input

Central input handler for spline-editing tools. Manages mouse/keyboard events for adding, inserting, dragging, and deleting spline nodes. Supports rib (width) and bar (velocity/height) handle dragging

On this page

Public APICode ExamplesSee Also