---
name: "Terrain Processor: Line: Random"
type: topic
source: https://community.bistudio.com/wiki/Terrain_Processor:_Line:_Random
revid: 201598
updated: 2021-01-17T20:16:02Z
---

# Terrain Processor: Line: Random

#### Task details

**Task name** : Line: Random

**Dll plugin name** : BITasksPlugin.dll

**Geometry type** : Polyline, PolylineM, PolylineZ

**Heightmap** : No

#### Description

Random placement of multiple objects on linear shapes specified in the given shapefile. Very easy, random positions only one condition - minimal distance from another objects.

#### Task parameters

- **RANDOM SEED** - number used to initialize pseudorandom number generator.
- **MAXDISTANCE** - maximal object distance from centreline.
- **DENSHA** - The density of the filling in number of objects for hectare. For example 100 objects for hectare means an average distance of about 10 meters between objects.
- **Spline interpolation** - Use bezier spline instead of original polyline.

#### Object prototype parameters

- **OBJECT** - Object's prototype name
- **PROB** - Object's probability
- **MINHEIGHT** - Minimal size in %
- **MAXHEIGHT** - Maximal size in %
- **MINDIST** - Minimal distance in meters

#### Usage

Very simple algorithm, it places objects randomly on linear shape. Can be used for sparse positioning of trees along a line, or for creating random strings of bushes (e.g. in the forests).

#### Algorithm

For each shape (linear) do :

1. instances_count = shape_length * LDENSITY
1. For instances_count try to find position :
   1. Random parameter in range 0 ... shape_length
   1. Compute real coordinate for parameter
   1. Random distance from line in range 0 ... MAXDISTANCE
   1. Random angle
   1. newCoordinate = coordinate_on_line + angle * random_distance
   1. If newCoordinate is in collision with other instances, go to a.
   1. Insert newCoordinate with object prototype in output.

<sub>Source: [BI Community Wiki — Terrain Processor: Line: Random](https://community.bistudio.com/wiki/Terrain_Processor:_Line:_Random) (revision 201598).</sub>
