UNPKG

@three3d/tools

Version:

@three3d/tools 提供了 ThreeJS 常用的工具库

56 lines 1.87 kB
import type { ColorRepresentation, Curve, Material, Vector2 } from "three"; import { Vector3, BufferGeometry, Line } from "three"; import { type SampleOptions } from "./curve"; /** * 创建折线线几何体的选项 */ export interface CreatePolylineBufferGeometryOptions { /** * 每个顶点的曲线长度列表 * @remarks * 用于节约计算资源,如果没有提供,将会自动计算 */ lengths?: number[]; /** * 线的颜色 * @remarks * 顶点颜色 */ color?: ColorRepresentation | null; /** * 开始处的颜色 */ startColor?: ColorRepresentation | null; /** * 终点处的颜色 */ endColor?: ColorRepresentation | null; } /** * 创建曲线几何体的选项 */ export type CreateCurveBufferGeometryOptions = CreatePolylineBufferGeometryOptions & SampleOptions; /** * 创建曲线几何体 * @param options - 选项 * @returns */ export declare function createCurveBufferGeometry<T extends Vector2 | Vector3>(curve: Curve<T>, options?: CreateCurveBufferGeometryOptions | null): BufferGeometry<import("three").NormalBufferAttributes>; /** * 创建曲线几何体 * @param options - 选项 * @returns */ export declare function createPolylineBufferGeometry(points: Vector3[], options?: CreatePolylineBufferGeometryOptions | null): BufferGeometry<import("three").NormalBufferAttributes>; export interface CurveHelperOptions extends CreateCurveBufferGeometryOptions { /** * 线的材质 */ material: Material; /** * 线宽 */ linewidth?: number; } export declare function createLineSegmentsByCurve<T extends Vector2 | Vector3>(curve: Vector3[] | Curve<T>, options?: CurveHelperOptions | null): Line<BufferGeometry<import("three").NormalBufferAttributes>, Material>; //# sourceMappingURL=lineSegmentsGeometry.d.ts.map