{"name":"Terrain Processor: Area: Random","title":"Terrain Processor: Area: Random","type":"topic","url":"https://community.bistudio.com/wiki/Terrain_Processor:_Area:_Random","revid":201444,"updated":"2021-01-17T20:09:46Z","aliases":[],"markdown":"#### Task details\n\n**Task name** : Area: Random\n\n**Dll plugin name** : BITasksPlugin.dll\n\n**Geometry type** : Polygon, PolygonM, PolygonZ\n\n**Heightmap** : No\n\n#### Description\n\nRandom placement of multiple objects inside the polygons specified in the given shapefile. Very easy, random positions only two conditions - probability and minimal distance from another objects.\n\n#### Task parameters\n\n- **RANDOM SEED** - number used to initialize pseudorandom number generator.\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\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\nThis algorithm is very simple, it generates random positions in area with given density. You can use it for forests with clustering or stones in open terrain.\n\n#### Algorithm\n\nFor each shape (areal) do :\n\n1. instances_count = HECTARES * DENSHA\n1. For instances_count try to find position :\n   1. Random position in bounding box.\n   1. If position is inside shape, continue to c. else a.\n   1. Test with objects if minimal distance is ok then add new random prototype instance in output and a else a.\n\nIf this loop a <-> c has no new output for last 100 attempts, area is full and iteration of this shape will end.","sections":[{"heading":"Task details","level":4,"markdown":"**Task name** : Area: Random\n\n**Dll plugin name** : BITasksPlugin.dll\n\n**Geometry type** : Polygon, PolygonM, PolygonZ\n\n**Heightmap** : No"},{"heading":"Description","level":4,"markdown":"Random placement of multiple objects inside the polygons specified in the given shapefile. Very easy, random positions only two conditions - probability and minimal distance from another objects."},{"heading":"Task parameters","level":4,"markdown":"- **RANDOM SEED** - number used to initialize pseudorandom number generator.\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."},{"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":"This algorithm is very simple, it generates random positions in area with given density. You can use it for forests with clustering or stones in open terrain."},{"heading":"Algorithm","level":4,"markdown":"For each shape (areal) do :\n\n1. instances_count = HECTARES * DENSHA\n1. For instances_count try to find position :\n   1. Random position in bounding box.\n   1. If position is inside shape, continue to c. else a.\n   1. Test with objects if minimal distance is ok then add new random prototype instance in output and a else a.\n\nIf this loop a <-> c has no new output for last 100 attempts, area is full and iteration of this shape will end."}],"categories":["Terrain Processor Manual"],"groups":["Tools and File Formats"]}