import { type CitySource, type Vec2 } from '../source'; import type { PropPrototype } from '../../cs2/propsPrototype'; import { type RoadMask } from './roadMask'; import { type OpenSeaProbe } from './openSea'; export declare const CITY_TREES_PROTOTYPES: readonly ["douglas-fir", "ponderosa-pine"]; export declare function defaultTreeCatalog(): string; export interface VegetationOptions { /** Where the placements bake (and its source) is written; must sit beside the terrain source folder. */ dir: string; terrainDir: string; heightAt: (x: number, z: number) => number; /** At most this many trees in the scene (the source's own trees first). */ maxTrees: number; /** Fill parks and forests as well as placing the source's own trees. */ fillAreas?: boolean; /** Plant the sidewalks of ground-level streets (default on): OpenStreetMap maps few street trees. */ streetTrees?: boolean; catalog?: string; /** * A CS2 map's own trees (`buildCs2TreeCatalog`): the source's trees are drawn as their own species (`prototypeOf[poi.tags.species]`), street * trees as `street`, park and forest fill as `fill`, all at the game's scale. Without it, the two stand-in conifers of `catalog`. */ species?: { catalog: string; prototypeOf: Record; street: string[]; fill: string[]; }; /** No tree stands within `[x, z, radius]` of these (the spawn). */ clearings?: Array<[number, number, number]>; /** * The road surface the scene draws (`surfaceRoadMask`): `all` is every up-facing road, sidewalk and median top, `drive` the carriageways alone. * Source trees and park fill keep off `all`, street trees (which stand on the sidewalk) off `drive`. The source graph's own corridors * are always kept clear too, so a road without geometry (roads disabled) is still not planted over. */ roadMasks?: { all: RoadMask; drive: RoadMask; }; /** * The open sea as `ocean.rgba` draws it (`cityOpenSea`). A tree whose base is a wet sample's ground under the surface is left out, * source trees, park fill and street trees alike, before the cap picks among the rest: CS2 saves hold trees on the sea floor. */ openSea?: OpenSeaProbe; /** Street props (Vault street-props kit) baked into the same placements as the trees: prototypes plus one record per prop. */ props?: { prototypes: PropPrototype[]; records: Array<{ id: string; prototype: string; position: [number, number, number]; rotation: [number, number, number, number]; scale: number; }>; }; log?: (line: string) => void; } export interface VegetationReport { enabled: boolean; instances?: number; prototypes?: number; fromSource?: number; fromStreets?: number; streetsByClass?: Record; fromAreas?: number; droppedInsideBuildings?: number; /** Trees (the source's own, park fill, street trees) left out because they stood on a road, a sidewalk or a junction. */ droppedOnRoads?: number; /** Trees (the source's own, park fill, street trees) left out because their base is under the open sea. */ droppedInSea?: number; impostors?: boolean; bytes?: number; note?: string; } export interface VegetationResult { placementsDir: string | null; report: VegetationReport; } export interface TreeSpot { id: string; x: number; z: number; origin: 'source' | 'street' | 'area'; species?: string; } /** The trees a source implies: its own tree points, then jittered fills of parks and forests clear of buildings and streets. */ export declare function planTrees(source: CitySource, bounds: [Vec2, Vec2], options: { fillAreas: boolean; streetTrees?: boolean; avoid?: Array<[number, number, number]>; clearings?: Array<[number, number, number]>; roadMasks?: { all: RoadMask; drive: RoadMask; }; heightAt?: (x: number, z: number) => number; /** The open sea as the ocean file draws it: no tree stands on a wet sample whose ground is under the surface (needs `heightAt`). */ openSea?: OpenSeaProbe; /** Measurement only: `false` plants as the generator did before roads were checked (buildings only). */ roadClearance?: boolean; }): { spots: TreeSpot[]; droppedInsideBuildings: number; droppedOnRoads: number; droppedInSea: number; streetsByClass?: Record; }; export declare function buildVegetation(source: CitySource, options: VegetationOptions): Promise;