import type { ObstructionId, SpaceId } from '../types/core.js'; import type { Position } from '../types/geojson.js'; /** * How a texture should be placed on a Component. */ export type TextureRepeat = { u: number; v: number; }; /** * A reference to an image texture and how it should be applied to a Component. */ export type Texture = { /** * The path to this asset, relative to the MVF's images folder. * @minLength 1 */ path: string; repeat?: TextureRepeat; }; /** * The color and/or texture that should be applied to an instance of a Shape. * * If both a color and a texture are provided, the color will be applied to the texture * via a multiply operation. If neither are provided, the shape will be white. */ export type Material = { /** * The color of this mateial as a hex code. * @pattern ^#[0-9a-fA-F]{6}$ */ color?: string; texture?: Texture; }; /** * A position for a local coordinate system, measured in metres. */ export type LocalPosition = [number, number]; /** * A three-number tuple. */ export type Vector3 = [number, number, number]; /** * A simple shape for part of a complex polygon * @minItems 3 */ export type Ring = LocalPosition[]; /** * A single extruded 2D polygon. */ export type ShapeComponent = { /** * Can contain holes, like GeoJSON. * @minItems 1 */ geometry: Ring[]; /** * In metres. */ altitude: number; /** * In metres. * @exclusiveMinimum 0 */ height: number; }; /** * A 3D object made from extruded 2D polygons, that can be rendered to the map as a ShapeInstance. * @minItems 1 */ export type Shape = ShapeComponent[]; /** * Common properties for all Decoration instances. */ type DecorationInstance = { /** * The long/lat point that the Decoration's origin point correponds to. */ position: Position; /** * The distance above ground, in metres, where this Decoration's origin point should be placed. */ altitude: number; /** * The rotation, in Euler angles in XYZ order, that will be applied to this Decoration. */ rotation: Vector3; /** * The X, Y and Z scale that will be applied to this Decoration. */ scale: Vector3; }; /** * An instance of a Shape. */ export type ShapeInstance = DecorationInstance & { /** * The identifier of the Shape to be placed. */ id: ShapeId; /** * The color and/or texture to apply to this shape instance. */ material: Material; }; /** * An instance of a 3D model. */ export type ModelInstance = DecorationInstance & { /** * The path to this asset, relative to the MVF's models folder. Supports GLTF and OBJ. * @minLength 1 */ path: string; }; /** * **Important**: While the suffix can be any length, it is strongly recommended to use * suffixes of at least 8 characters to ensure uniqueness and avoid collisions. * * @pattern ^sh_[A-Za-z0-9_-]+$ */ export type ShapeId = string; /** * A group of Shapes, without any information as to how they will be placed in a scene. */ export type ShapeCollection = Record; /** * A map of shape instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon. */ export type ShapeInstanceCollection = { [polygonId: SpaceId | ObstructionId]: ShapeInstance; }; /** * A map of model instances, where keys are valid polygon or obstruction IDs. Replaces the specified polygon. */ export type ModelInstanceCollection = { [polygonId: SpaceId | ObstructionId]: ModelInstance; }; export {}; //# sourceMappingURL=aesthetics.d.ts.map