@speckle/viewer
Version:
A 3d viewer for Speckle, based on threejs.
41 lines (40 loc) • 1.52 kB
TypeScript
import { Box3, Camera, Group, Plane, Quaternion, Raycaster, Vector3, type Intersection } from 'three';
import { LineSegments2 } from 'three/examples/jsm/lines/LineSegments2.js';
export interface MeasurementPointGizmoStyle {
fixedSize?: number | boolean;
dashedLine?: boolean;
discColor?: number;
discOpacity?: number;
lineColor?: number;
lineOpacity?: number;
pointColor?: number;
pointOpacity?: number;
textColor?: number;
textOpacity?: number;
textPixelHeight?: number;
pointPixelHeight?: number;
}
export declare class MeasurementPointGizmo extends Group {
private disc;
line: LineSegments2;
private point;
private text;
private _style;
private static vecBuff0;
set style(value: MeasurementPointGizmoStyle);
set highlight(value: boolean);
private getDiscMaterial;
private getLineMaterial;
private getPointMaterial;
private getTextMaterial;
constructor(style?: MeasurementPointGizmoStyle);
enable(disc: boolean, line: boolean, point: boolean, text: boolean): void;
frameUpdate(camera: Camera, bounds: Box3): void;
updateDisc(position: Vector3, normal: Vector3): void;
updatePoint(position: Vector3): void;
updateLine(points: Vector3[]): void;
updateText(value: string, position?: Vector3, quaternion?: Quaternion, scale?: Vector3): Promise<void>;
updateStyle(): void;
raycast(raycaster: Raycaster, intersects: Array<Intersection>): void;
updateClippingPlanes(planes: Plane[]): void;
}