UNPKG

1.76 kBTypeScriptView Raw
1import { BufferGeometry } from "../core/BufferGeometry.js";
2
3/**
4 * This can be used as a helper object to view the edges of a {@link THREE.BufferGeometry | geometry}.
5 * @example
6 * ```typescript
7 * const geometry = new THREE.BoxGeometry(100, 100, 100);
8 * const edges = new THREE.EdgesGeometry(geometry);
9 * const line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({
10 * color: 0xffffff
11 * }));
12 * scene.add(line);
13 * ```
14 * @see Example: {@link https://threejs.org/examples/#webgl_helpers | helpers}
15 * @see {@link https://threejs.org/docs/index.html#api/en/geometries/EdgesGeometry | Official Documentation}
16 * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/EdgesGeometry.js | Source}
17 */
18export class EdgesGeometry<TBufferGeometry extends BufferGeometry = BufferGeometry> extends BufferGeometry {
19 /**
20 * Create a new instance of {@link EdgesGeometry}
21 * @param geometry Any geometry object. Default `null`.
22 * @param thresholdAngle An edge is only rendered if the angle (in degrees) between the face normals of the adjoining faces exceeds this value. Expects a `Integer`. Default `1` _degree_.
23 */
24 constructor(geometry?: TBufferGeometry | null, thresholdAngle?: number);
25
26 /**
27 * A Read-only _string_ to check if `this` object type.
28 * @remarks Sub-classes will update this value.
29 * @defaultValue `EdgesGeometry`
30 */
31 override readonly type: string | "EdgesGeometry";
32
33 /**
34 * An object with a property for each of the constructor parameters.
35 * @remarks Any modification after instantiation does not change the geometry.
36 */
37 readonly parameters: {
38 readonly geometry: TBufferGeometry | null;
39 readonly thresholdAngle: number;
40 };
41}