UNPKG

@orca-fe/x-map

Version:
48 lines (47 loc) 1.95 kB
import { Color, Mesh, MeshBasicMaterial, MeshBasicMaterialParameters, MeshStandardMaterial, Shape, Texture } from 'three'; import { MultiPolygon, Polygon } from '@turf/turf'; import { ExtrudeGeometryOptions } from 'three/src/geometries/ExtrudeGeometry'; import { MeshStandardMaterialParameters } from 'three/src/materials/MeshStandardMaterial'; import ThreeObject, { ThreeObjectOptions } from './ThreeObject'; interface WallOptions { height?: number; texture?: Texture; opacity?: number; } export interface ExtrudePolygonParams extends ThreeObjectOptions { polygonGeoJson?: MultiPolygon | Polygon; border?: MeshBasicMaterialParameters; fill?: { color: Color | string | number; opacity?: number; }; polygonMaterialParameters?: MeshStandardMaterialParameters; polygonSideMaterialParameters?: MeshStandardMaterialParameters; extrudeOptions?: ExtrudeGeometryOptions; wall?: WallOptions; } export default class ExtrudePolygonObject extends ThreeObject<ExtrudePolygonParams> { protected readonly polygonFaceMaterial: MeshStandardMaterial; protected readonly polygonSideMaterial: MeshBasicMaterial; protected polygonGeoJson?: MultiPolygon | Polygon; object3D: Mesh<import("three").BufferGeometry, import("three").Material | import("three").Material[]>; constructor(options?: ExtrudePolygonParams); protected createNormalPolygonShape(polygonJson: Polygon): { shape: Shape; positions?: undefined; } | { shape: Shape; positions: [number, number, number][]; }; createObject(): void; setPolygon(polygon: ExtrudePolygonParams['polygonGeoJson']): void; updatePosition(): void; updateFill(fill: { color: Color | string | number; opacity: number; }, sideFill?: { color: Color | string | number; opacity: number; }): void; } export {};