threepipe
Version:
A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.
46 lines • 2.04 kB
TypeScript
import { BufferAttribute, BufferGeometry } from 'three';
import { Class } from 'ts-browser-helpers';
import { UiObjectConfig } from 'uiconfig.js';
import { IGeometry } from '../../core/IGeometry';
import { IMaterial } from '../../core/IMaterial';
import { IObject3D } from '../../core/IObject';
import { BufferGeometry2 } from '../../core/geometry/BufferGeometry2';
export interface GeometryGenerator<T = any> {
generate(g?: IGeometry, parameters?: T): IGeometry;
createUiConfig?(geometry: IGeometry): UiObjectConfig[];
}
export declare function updateUi(geometry: BufferGeometry, childrenUi: () => UiObjectConfig[]): void;
export declare function removeUi(geometry: BufferGeometry): void;
/**
* Abstract base class for geometry generators.
*
* Provides the framework for generating parametric geometries with automatic
* UI configuration and buffer management. Subclasses implement {@link _generateData}
* to define the actual vertex/index data for a specific geometry type.
*
* @category Plugins
*/
export declare abstract class AGeometryGenerator<Tp extends object = any, Tt extends string = string> implements GeometryGenerator<Tp> {
type: Tt;
constructor(type: Tt);
abstract defaultParams: Tp;
defaultMeshClass: () => Class<IObject3D>;
defaultMaterialClass?: () => Class<IMaterial>;
defaultGeometryClass?: () => Class<IGeometry>;
createUiConfig(geometry: IGeometry): UiObjectConfig[];
protected abstract _generateData(params: Tp): {
indices?: number[] | BufferAttribute;
vertices: number[] | BufferAttribute;
normals?: number[] | BufferAttribute;
uvs?: number[] | BufferAttribute;
groups?: {
start: number;
count: number;
materialIndex?: number;
}[];
positions?: number[];
};
generate(g?: IGeometry, parameters?: Partial<Tp>): IGeometry | BufferGeometry2;
setDefaultParams(params: Partial<Tp>): this;
}
//# sourceMappingURL=../../src/plugins/geometry/AGeometryGenerator.d.ts.map