Intro
Demonstration
Manual Method
Automatic Method
Options for Polyline Editing
Advanced Settings
Ending
Hello everyone,
In this video I'd like to present the completely reimagined version of my Curbstone Extraction script for Leica Cyclone 3DR.
The new version introduces multiple curb detection algorithms, automatic trajectory tracking, intelligent recovery mechanisms, and most importantly, a full set of editing tools that allow you to build, repair, modify, and finalize curb lines directly inside Cyclone 3DR.
The goal was simple:
Reduce the time required to extract curb lines while giving users full control whenever automation is not enough.
Before we start the workflow, let’s get the script installed.
Download & Extract: Click the link below to get the script - Download Script. Download the archive and unzip its contents into a dedicated empty folder on your drive.
Add to Leica Cyclone 3DR: Open Leica Cyclone 3DR and go to the Script Toolbar. Click on Settings, then select 'Favorite Script'.
Link the File: In the pop-up window, choose 'Add favorite from disk' and navigate to the folder you just created. Select the Curbstone.js file.
Rename it: Double-click the name of the new tool in the list and type 'Curbstone New'.
Add an Icon: Double-click the default icon to change it. Navigate back to your script folder and select the Curbstone.png file.
And that’s it! If you check your Script Menu now, you’ll see the new tool is ready to use.
The script allows you to extract features using two methods: Manual and Automatic. Let's first take a look at the Manual Extraction method.
Step 1
Launch the script and choose:
Sphere Radius - 0.3m
Follow Trajectory option is OFF
For most projects, the default radius works very well.
Step 2
Start clicking near the curb. You don't need to click exactly on the edge. Simply click approximately near the curb location.The script will analyze the surrounding geometry and calculate both curb lines automatically.
You'll immediately see:
Top curb points 🔵
Bottom curb points 🟠
Connected polylines
Step 3
Continue placing points along the curb. As additional points are added, the curb lines grow automatically.
The workflow is very simple: just continue clicking points in the areas where extraction is required. This method is suitable for scenarios where there are many curb transitions within a small area, such as traffic islands, parking areas, and similar features.
The second method is Automatic Extraction, and it includes my favorite addition: Trajectory Mode. When enabled, the script learns the direction of the curb. After several successful detections it starts predicting where the next curb position should be located. Instead of requiring a new click for every point, the script can continue automatically.
Just activate the Follow Trajectory option in the main script menu, in the next window script will ask you how many curbs you would like to extract simultaneously, choose 1 for the first test and perform the same few clicks as we did before with the Manual Extraction method. You'll see how polylines will grow automatically.
This is especially useful for:
Long roads
Highway curbs
Large infrastructure projects
For future projects, try extracting multiple curbs simultaneously. To do this, enter 2-3 in the Multiple Curbs dialog window. The curb selection workflow remains the same: first, select a set of points for the first curb, then select a set of points for the next curb. Once all curbs have been defined, the extraction process will start automatically.
Now let's discuss another enhancement. Extraction is only half of the workflow. Editing is where most users spend their time. This version includes several tools specifically designed to reduce manual cleanup.
You have different options to switch to Edit Mode:
While using the curb extraction mode, whether in Manual or Automatic mode, if the script cannot detect the next pair of points, it will ask you to define them manually. In this case, you can press the Esc key to cancel the extraction process and switch to Edit Mode.
Another option is to select an existing line and then run the script. After the main menu appears, the script will automatically transfer you directly to Edit Mode.
You can select previously generated curb lines and launch the script again.
The script automatically:
Loads the existing geometry
Restores the editing state
Allows additional extraction
Allows further editing
This means you can stop working today and continue exactly where you left off tomorrow.
Mistakes happen.
The Undo option removes the last extracted point pair and rebuilds the curb lines automatically. No need to restart the extraction.
Curb segments are not always extracted in a single pass. The Connect function allows you to merge separate curb sections.
There are two methods available:
Connect by Session
Automatically connect to the previous curb segment.
Connect by Picking - Click near an existing curb line and the script finds the closest matching segment automatically. A transition point is generated and the lines are merged together.
Projects often contain multiple disconnected curb sections.
The Start New Line function creates a completely new curb session while preserving all previously extracted lines.
This keeps large projects organized and manageable.
This option allows you to manually define:
Top curb point
Bottom curb point
Use this when automatic extraction cannot determine the curb correctly.
Examples include:
Missing curb sections
Heavy vegetation
Construction zones
Incomplete scans
The selected points are immediately integrated into the existing line.
This feature is ideal for:
Traffic islands
Simply click the closing location. The script creates a preview and allows confirmation before finalizing the loop. Both curb lines meet at the selected point and the extraction session is completed.
Sometimes a curb point is detected correctly except for one vertex. Instead of recreating the line, simply:
Choose Edit Vertex.
Select the line.
Click near the vertex you want to modify.
Pick a new location.
The line updates instantly. This makes local corrections very easy.
Creates an offset line from either the top or bottom curb line. This can be useful when the curb needs to be represented by three lines instead of two, or when creating an additional line for road markings located close to the curb.
Select Create Offset Line.
Choose which line should be offset: 🔵Top Line or 🟠Bottom Line
Specify the offset distance.
Click on either side of the selected line to define the direction of the offset.
The offset line will then be created at the specified distance on the selected side.
For most projects I recommend:
Start with default settings.
Extract several initial points manually.
Enable trajectory following.
Let the script continue automatically.
Use Edit Vertex for small corrections.
Use Manual 2 Points only where automation struggles.
Connect segments when necessary.
Close loops for islands and closed curb structures.
Once the full line is completed, use the Offset option to generate additional lines based on it.
This workflow provides the best balance between speed and accuracy.
For most projects, the default settings should be all you need. The extraction workflow has been designed to work out of the box on the majority of curb and sidewalk datasets without requiring any parameter tuning.
However, every project is different. Point density, scanner type, curb geometry, noise levels, vegetation, parked vehicles, and surface conditions can all affect the extraction process. For these situations, you can switch to Advanced Extraction Settings.
Here you'll find a collection of parameters that allow you to fine-tune the extraction behavior by adjusting thresholds, tolerances, search distances, clustering parameters, slope analysis settings, and other advanced controls.
I'm not going to explain every parameter in this video because that would easily turn into a one-hour tutorial. The goal of this video is to show the workflow, not to dive into every technical detail.
If you'd like to learn more about a specific setting, there are two easy options:
Simply hover your mouse over any parameter to read the built-in tooltip and quick explanation.
Visit https://www.unsurveyed.xyz where you'll find additional documentation
For most users, I would recommend starting with the default settings and only moving to the advanced options when working with particularly challenging datasets or when you need to optimize the extraction for a specific type of curb geometry.
The Advanced Extraction Settings are intended for difficult datasets where the default settings may not produce reliable curb detection. In most cases, the default values work well and should only be adjusted if you encounter specific issues.
Default: 0.01 m
What it does:
Controls the height resolution used when creating the Z-value histogram during the primary height-based detection method. The script analyzes point elevations and tries to identify two dominant height plateaus:
Road surface
Top curb surface
A smaller bin size creates a more detailed histogram.
Increase it when:
Data is noisy
Point density is low
Histogram becomes unstable.
Decrease it when
Working with high-density scans
Small curb heights need to be detected
Typical values
Standard mobile mapping 0.01
High density scanner data 0.005
Noisy datasets 0.02
Default: 0.01 m
What it does:
Defines the minimum vertical difference required between the lower and upper surfaces to be considered a valid curb. The script rejects detections where the road and top surfaces are too close together.
Increase it when
Many false detections occur
Pavement texture is misidentified as a curb
Decrease it when
Detecting very small curbs
Working with wheelchair ramps or shallow edges
Default: 0.015 m
What it does:
Determines how aggressively points are assigned to:
Road layer. Points near detected road height become road points.
Top layer. Points near top surface height become top points.
Wall layer. Everything in between becomes wall points.
Increase it when:
Point cloud is noisy
Surfaces are rough
Decrease it when
Road and sidewalk are close together
Small curbs need better separation
Default: 35°
What it does:
Defines how vertical the curb face must be. The script fits a plane to the curb wall and checks whether that plane is sufficiently vertical.
Increase it when
Curbs are heavily damaged
Sloped retaining edges exist
Scan noise affects plane fitting
Decrease it when
Accuracy is more important
Many false positives appear
Default: 25°
What it does:
Used only for the slope-based fallback method. Separates points into:
Flat surfaces
Steep surfaces
Flat surfaces become road and sidewalk candidates. Steep surfaces become curb-face candidates.
Increase it when
Sloped roads exist
Sidewalks are uneven
Decrease it when
Small vertical details are being missed
Flat surfaces are classified incorrectly
Default: 0 (Auto)
What it does:
Controls the neighborhood size used to calculate local slope. The software estimates local surface normals using nearby points.
Value = 0 is Automatic calculation. Recommended in most situations.
Larger values create smoother slope estimation.
Useful for:
Noisy datasets
Sparse mobile mapping
Smaller values capture finer details.
Useful for:
Dense scanner data
Small curbs
Default: 0.03 m
What it does:
Used during slope fallback. The wall layer is split into connected clusters. This parameter defines how far apart points can be before becoming separate clusters.
Increase it when
Wall points are fragmented
Sparse scans exist
Decrease it when
Nearby objects merge with the curb
Vegetation causes incorrect clusters
Default: 20 points
What it does:
Filters noise from wall clusters. Any wall cluster smaller than this value is deleted.
Increase it when
Noise creates many small clusters
Decrease it when
Point density is low
Small curb sections disappear
Default: 0.03 m
What it does:
Similar to Wall Cluster Max Distance, but applied to flat regions. Used when separating:
Road surface
Sidewalk surface
Increase it when
Flat surfaces break into multiple clusters
Decrease it when
Road and sidewalk merge together
Default: 20 points
What it does:
Removes tiny flat clusters generated by noise.
Increase it when
Noise is creating false surfaces
Decrease it when
Working with sparse point clouds
Default: 0.005 m
What it does:
Used only by the fallback method. Sometimes the road and sidewalk become a single cluster. In that case the script performs a second height-based split. This parameter controls the histogram resolution used during that process.
Lower values
More precise
More sensitive
Higher values
More robust
Less sensitive
Default: 0.01 m
What it does:
Defines the minimum difference between two height plateaus before the fallback height split is accepted.
Increase it when
False separations occur
Decrease it when
Detecting very low curbs
Default: 5
What it does:
Defines how many points are required inside a histogram peak before it is considered a valid surface.
Increase it when
Noise creates false peaks
Decrease it when
Working with sparse data
What it does:
Enables access to advanced automatic tracking parameters. These settings become available only when:
Follow Trajectory = ON
Trajectory Settings = Advanced
If disabled, the script uses safe default trajectory values.
Real datasets are never perfect. Sometimes the curb disappears because of:
Shadows
Occlusions
Vehicles
Missing scans
When this happens the script doesn't stop immediately. It automatically searches around the expected position using adaptive offsets. If no valid solution is found, control returns to the user. Once several new manual points are added, automatic tracking resumes again.
Default: Off
What it does:
Stores every extraction attempt inside a structured debug hierarchy. Instead of showing only the final successful result, the script keeps:
Search spheres
Layer clouds
Plane fits
Failed attempts
Successful attempts
Radius tests
Default method results
Slope fallback results
When to use it:
Troubleshooting
Developing new settings
Understanding failed detections
Comparing detection methods
Warning:
Debug mode can generate a very large number of temporary objects on long projects and should normally remain disabled.
With this new version I tried transform the Curbstone Script from a simple extraction tool into a complete curb creation and editing environment inside Leica Cyclone 3DR.
With multiple extraction algorithms and advanced editing tools it reduces the effort required to generate accurate curb geometry from point clouds.
I hope this updated workflow saves you time and makes curb extraction much easier on your real-world projects.
If you find the script useful, don't forget to like the video, leave your feedback in the comments, and subscribe for more Leica Cyclone 3DR automation tutorials.
Thanks for watching, and see you in the next video. 🚀