The Polyline_Stairs tool helps generate 3D stair geometry from manually drawn polylines representing stair edges. The process includes creating step contours, assigning heights, and generating a 3D mesh for straight or curved stairs.
Requirements:
2 separate Polylines representing the left and right edges of the stair
Select multiple polylines before running the script
Steps:
Draw manually two separate polylines representing the left and right edges of the stair (use the standard Draw Polyline tool)
Split the polylines based on the location of steps. It's mandatory to use the same direction of segmentation for both polylines
Select all polyline segments and run the Polyline_Stairs script. It includes 3 main steps:
A) Create Steps - generating a closed contour for each stair step
B) Define Heights - assign the right elevation value for each stair step
C) Create Straight/Curved Stair - create a 3D mesh of a straight or curved stair, based on the selected option.
A) Create Steps Parameters:
Input: Select all polyline segments for both left and right stair edges.
The script automatically detects matching pairs and offers to create closed contours for each step.
Adjustable parameters:
Max Connection Distance – Controls how far segments can be to be considered part of the same step.
Accuracy – Defines the precision of contour detection.
Options:
Closed Contour – Creates a closed polyline for each step.
Remove Originals – Deletes the original segments after contour creation.
Extract Vertices – Creates a point at each vertex of the polyline.
B) Define Heigths Parameters:
Input: Select the closed contours created in Step A.
Assign elevation values to each stair step using one of two modes:
Interpolation Mode – Select two reference points (lowest and highest steps). The script interpolates heights for the rest. You can review and adjust each height afterward.
Manual Mode – Select a point with the correct elevation for each step individually.
C) Create Straight/Curved Stair Parameters:
Input: Select all closed contours from Step B.
Choose between Straight or Curved stair generation.
The script creates a 3D mesh based on the selected type.
Additional Options:
Move Polyline – Define the lower edge of the stair. You can:
Enter a custom distance from the top points.
Measure it manually.
Use the Update button to preview.
Click Move when the lower edge aligns with the point cloud.
Extend Polyline – Extend the lower edge to better represent the stair base. You can:
Enter a custom extension distance.
Measure it manually.
Use the Update button to preview.
Click Extend when the extension aligns with the point cloud.
Notes:
Before running it, split your stairs to Straight and Curved segment. And run separate functions for each segment.
Ensure both left and right edge polylines are segmented in the same direction (e.g., bottom to top). Mismatched directions may result in incorrect step pairing.
When using Interpolation Mode in the Define Heights step, choose reference points carefully to ensure a realistic height distribution.
The Move and Extend functions are designed to help align the stair mesh with the point cloud. Use the Update button frequently to preview changes before applying them.
The tool is optimized for regular staircases. For spiral or irregular stairs, manual adjustments may be required after mesh generation.