simworld.citygen.element package
Submodules
simworld.citygen.element.element_generator module
Element generation module for the city simulation.
This module provides functionality for generating various elements in the city, such as trees, street furniture, and other objects around buildings and roads.
- class simworld.citygen.element.element_generator.ElementGenerator(config, element_types, map_element_offsets)
Bases:
objectGenerator for placing elements in the city environment.
This class is responsible for creating and placing elements such as trees, street furniture, and other decorative objects around buildings and along roads.
- filter_elements_by_buildings(building_quadtree: QuadTree[Building])
Filter out elements that overlap with buildings.
- Args:
building_quadtree: Quadtree containing all buildings for efficient spatial querying.
- generate_elements_around_building(building: Building)
Generate and add elements around a single building.
- Args:
building: The building to place elements around.
simworld.citygen.element.element_manager module
Element manager module for managing elements in the city.
This module provides functionality to add, remove, and check for collisions with existing elements in the city’s quadtree structure.
- class simworld.citygen.element.element_manager.ElementManager(config)
Bases:
objectManage elements for the city.
- add_element(element: Element)
Add a element to the quadtree and list.
- Args:
element: Element to add.
- can_place_element(bounds: Bounds, buffer: float | None = None) bool
Check if a element can be placed at the specified location.
- Args:
bounds: Bounds of the element. buffer: Buffer distance.
- Returns:
True if the element can be placed, False otherwise.
- rebuild_quadtree()
Rebuild the quadtree.
Module contents
Element module for managing elements in the city.
This module provides functionality to add, remove, and check for collisions with existing elements in the city’s quadtree structure.