{"name":"Terrain Processor: Line: Random","title":"Terrain Processor: Line: Random","type":"topic","url":"https://community.bistudio.com/wiki/Terrain_Processor:_Line:_Random","revid":201598,"updated":"2021-01-17T20:16:02Z","aliases":[],"markdown":"#### Task details\n\n**Task name** : Line: Random\n\n**Dll plugin name** : BITasksPlugin.dll\n\n**Geometry type** : Polyline, PolylineM, PolylineZ\n\n**Heightmap** : No\n\n#### Description\n\nRandom placement of multiple objects on linear shapes specified in the given shapefile. Very easy, random positions only one condition - minimal distance from another objects.\n\n#### Task parameters\n\n- **RANDOM SEED** - number used to initialize pseudorandom number generator.\n- **MAXDISTANCE** - maximal object distance from centreline.\n- **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.\n- **Spline interpolation** - Use bezier spline instead of original polyline.\n\n#### Object prototype parameters\n\n- **OBJECT** - Object's prototype name\n- **PROB** - Object's probability\n- **MINHEIGHT** - Minimal size in %\n- **MAXHEIGHT** - Maximal size in %\n- **MINDIST** - Minimal distance in meters\n\n#### Usage\n\nVery 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).\n\n#### Algorithm\n\nFor each shape (linear) do :\n\n1. instances_count = shape_length * LDENSITY\n1. For instances_count try to find position :\n   1. Random parameter in range 0 ... shape_length\n   1. Compute real coordinate for parameter\n   1. Random distance from line in range 0 ... MAXDISTANCE\n   1. Random angle\n   1. newCoordinate = coordinate_on_line + angle * random_distance\n   1. If newCoordinate is in collision with other instances, go to a.\n   1. Insert newCoordinate with object prototype in output.","sections":[{"heading":"Task details","level":4,"markdown":"**Task name** : Line: Random\n\n**Dll plugin name** : BITasksPlugin.dll\n\n**Geometry type** : Polyline, PolylineM, PolylineZ\n\n**Heightmap** : No"},{"heading":"Description","level":4,"markdown":"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."},{"heading":"Task parameters","level":4,"markdown":"- **RANDOM SEED** - number used to initialize pseudorandom number generator.\n- **MAXDISTANCE** - maximal object distance from centreline.\n- **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.\n- **Spline interpolation** - Use bezier spline instead of original polyline."},{"heading":"Object prototype parameters","level":4,"markdown":"- **OBJECT** - Object's prototype name\n- **PROB** - Object's probability\n- **MINHEIGHT** - Minimal size in %\n- **MAXHEIGHT** - Maximal size in %\n- **MINDIST** - Minimal distance in meters"},{"heading":"Usage","level":4,"markdown":"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)."},{"heading":"Algorithm","level":4,"markdown":"For each shape (linear) do :\n\n1. instances_count = shape_length * LDENSITY\n1. For instances_count try to find position :\n   1. Random parameter in range 0 ... shape_length\n   1. Compute real coordinate for parameter\n   1. Random distance from line in range 0 ... MAXDISTANCE\n   1. Random angle\n   1. newCoordinate = coordinate_on_line + angle * random_distance\n   1. If newCoordinate is in collision with other instances, go to a.\n   1. Insert newCoordinate with object prototype in output."}],"categories":["Terrain Processor Manual"],"groups":["Tools and File Formats"]}