@types/three 0.150.0 → 0.150.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/controls/OrbitControls.d.ts +3 -3
  3. three/examples/jsm/controls/TrackballControls.d.ts +2 -2
  4. three/examples/jsm/controls/TransformControls.d.ts +2 -6
  5. three/examples/jsm/geometries/TextGeometry.d.ts +92 -15
  6. three/examples/jsm/loaders/EXRLoader.d.ts +3 -2
  7. three/examples/jsm/misc/GPUComputationRenderer.d.ts +4 -2
  8. three/package.json +2 -2
  9. three/src/audio/Audio.d.ts +184 -20
  10. three/src/audio/AudioAnalyser.d.ts +42 -4
  11. three/src/audio/AudioContext.d.ts +12 -1
  12. three/src/audio/AudioListener.d.ts +76 -8
  13. three/src/audio/PositionalAudio.d.ts +86 -5
  14. three/src/cameras/ArrayCamera.d.ts +23 -2
  15. three/src/cameras/Camera.d.ts +42 -13
  16. three/src/cameras/CubeCamera.d.ts +49 -1
  17. three/src/cameras/OrthographicCamera.d.ts +77 -25
  18. three/src/cameras/PerspectiveCamera.d.ts +132 -56
  19. three/src/cameras/StereoCamera.d.ts +29 -2
  20. three/src/constants.d.ts +431 -26
  21. three/src/core/BufferGeometry.d.ts +5 -3
  22. three/src/core/Object3D.d.ts +17 -13
  23. three/src/core/Raycaster.d.ts +1 -0
  24. three/src/geometries/BoxGeometry.d.ts +39 -16
  25. three/src/geometries/CapsuleGeometry.d.ts +35 -12
  26. three/src/geometries/CircleGeometry.d.ts +38 -12
  27. three/src/geometries/ConeGeometry.d.ts +45 -10
  28. three/src/geometries/CylinderGeometry.d.ts +41 -19
  29. three/src/geometries/DodecahedronGeometry.d.ts +14 -5
  30. three/src/geometries/EdgesGeometry.d.ts +30 -8
  31. three/src/geometries/ExtrudeGeometry.d.ts +93 -12
  32. three/src/geometries/IcosahedronGeometry.d.ts +15 -5
  33. three/src/geometries/LatheGeometry.d.ts +41 -12
  34. three/src/geometries/OctahedronGeometry.d.ts +14 -5
  35. three/src/geometries/PlaneGeometry.d.ts +35 -12
  36. three/src/geometries/PolyhedronGeometry.d.ts +41 -12
  37. three/src/geometries/RingGeometry.d.ts +39 -16
  38. three/src/geometries/ShapeGeometry.d.ts +44 -4
  39. three/src/geometries/SphereGeometry.d.ts +43 -21
  40. three/src/geometries/TetrahedronGeometry.d.ts +14 -5
  41. three/src/geometries/TorusGeometry.d.ts +35 -13
  42. three/src/geometries/TorusKnotGeometry.d.ts +39 -16
  43. three/src/geometries/TubeGeometry.d.ts +63 -15
  44. three/src/geometries/WireframeGeometry.d.ts +30 -4
  45. three/src/math/ColorManagement.d.ts +2 -2
  46. three/src/objects/Bone.d.ts +30 -3
  47. three/src/objects/Group.d.ts +37 -1
  48. three/src/objects/InstancedMesh.d.ts +122 -3
  49. three/src/objects/LOD.d.ts +62 -18
  50. three/src/objects/Line.d.ts +67 -4
  51. three/src/objects/LineLoop.d.ts +26 -1
  52. three/src/objects/LineSegments.d.ts +21 -9
  53. three/src/objects/Mesh.d.ts +60 -4
  54. three/src/objects/Points.d.ts +39 -8
  55. three/src/objects/Skeleton.d.ts +89 -3
  56. three/src/objects/SkinnedMesh.d.ts +122 -3
  57. three/src/objects/Sprite.d.ts +51 -4
  58. three/src/renderers/WebGLRenderTarget.d.ts +9 -3
  59. three/src/scenes/Fog.d.ts +59 -7
  60. three/src/scenes/FogExp2.d.ts +41 -6
  61. three/src/scenes/Scene.d.ts +45 -22
  62. three/src/textures/CanvasTexture.d.ts +35 -13
  63. three/src/textures/CompressedArrayTexture.d.ts +39 -5
  64. three/src/textures/CompressedTexture.d.ts +49 -20
  65. three/src/textures/CubeTexture.d.ts +71 -18
  66. three/src/textures/Data3DTexture.d.ts +74 -10
  67. three/src/textures/DataArrayTexture.d.ts +83 -9
  68. three/src/textures/DataTexture.d.ts +81 -26
  69. three/src/textures/DepthTexture.d.ts +71 -15
  70. three/src/textures/FramebufferTexture.d.ts +57 -2
  71. three/src/textures/Source.d.ts +23 -13
  72. three/src/textures/Texture.d.ts +289 -73
  73. three/src/textures/VideoTexture.d.ts +69 -13
  74. three/src/textures/types.d.ts +9 -0
@@ -28,7 +28,14 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
28
28
  constructor();
29
29
 
30
30
  /**
31
- * Unique number for this object instance.
31
+ * Flag to check if a given object is of type {@link Object3D}.
32
+ * @remarks This is a _constant_ value
33
+ * @defaultValue `true`
34
+ */
35
+ readonly isObject3D: true;
36
+
37
+ /**
38
+ * Unique number for this {@link Object3D} instance.
32
39
  * @remarks Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
33
40
  * @remarks Expects a `Integer`
34
41
  */
@@ -41,15 +48,19 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
41
48
  uuid: string;
42
49
 
43
50
  /**
44
- * Optional name of the object (doesn't need to be unique).
45
- * @defaultValue `''`
51
+ * Optional name of the object
52
+ * @remarks _(doesn't need to be unique)_.
53
+ * @defaultValue `""`
46
54
  */
47
55
  name: string;
48
56
 
49
57
  /**
58
+ * A Read-only _string_ to check `this` object type.
59
+ * @remarks This can be used to find a specific type of Object3D in a scene.
60
+ * @remarks Sub-classes will update this value.
50
61
  * @defaultValue `Object3D`
51
62
  */
52
- type: string; // TODO Replace for "Object3D" // TODO add readonly
63
+ readonly type: string | 'Object3D';
53
64
 
54
65
  /**
55
66
  * Object's parent in the {@link https://en.wikipedia.org/wiki/Scene_graph | scene graph}.
@@ -209,13 +220,6 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
209
220
  */
210
221
  customDistanceMaterial?: Material | undefined;
211
222
 
212
- /**
213
- * Flag to check if a given object is of type {@link Object3D}.
214
- * @remarks This is a _constant_ value
215
- * @defaultValue `true`
216
- */
217
- readonly isObject3D: true;
218
-
219
223
  /**
220
224
  * An optional callback that is executed immediately before a 3D object is rendered.
221
225
  * @remarks This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
@@ -551,7 +555,7 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
551
555
  toJSON(meta?: { geometries: any; materials: any; textures: any; images: any }): any;
552
556
 
553
557
  /**
554
- * Returns a clone of this object and optionally all descendants.
558
+ * Returns a clone of `this` object and optionally all descendants.
555
559
  * @param recursive If true, descendants of the object are also cloned. Default `true`
556
560
  */
557
561
  clone(recursive?: boolean): this;
@@ -562,5 +566,5 @@ export class Object3D<E extends BaseEvent = Event> extends EventDispatcher<E> {
562
566
  * @param source
563
567
  * @param recursive If true, descendants of the object are also copied. Default `true`
564
568
  */
565
- copy(source: Object3D, recursive?: boolean): this;
569
+ copy(source: this, recursive?: boolean): this;
566
570
  }
@@ -35,6 +35,7 @@ export interface Intersection<TIntersected extends Object3D = Object3D> {
35
35
  export interface RaycasterParameters {
36
36
  Mesh?: any;
37
37
  Line?: { threshold: number } | undefined;
38
+ Line2?: { threshold: number } | undefined;
38
39
  LOD?: any;
39
40
  Points?: { threshold: number } | undefined;
40
41
  Sprite?: any;
@@ -1,13 +1,29 @@
1
1
  import { BufferGeometry } from '../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * {@link BoxGeometry} is a geometry class for a rectangular cuboid with a given 'width', 'height', and 'depth'
5
+ * @remarks On creation, the cuboid is centred on the origin, with each edge parallel to one of the axes.
6
+ * @example
7
+ * ```typescript
8
+ * const geometry = new THREE.BoxGeometry(1, 1, 1);
9
+ * const material = new THREE.MeshBasicMaterial({
10
+ * color: 0x00ff00
11
+ * });
12
+ * const cube = new THREE.Mesh(geometry, material);
13
+ * scene.add(cube);
14
+ * ```
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/BoxGeometry | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/BoxGeometry.js | Source}
17
+ */
3
18
  export class BoxGeometry extends BufferGeometry {
4
19
  /**
5
- * @param [width=1] Width of the sides on the X axis.
6
- * @param [height=1] Height of the sides on the Y axis.
7
- * @param [depth=1] Depth of the sides on the Z axis.
8
- * @param [widthSegments=1] Number of segmented faces along the width of the sides.
9
- * @param [heightSegments=1] Number of segmented faces along the height of the sides.
10
- * @param [depthSegments=1] Number of segmented faces along the depth of the sides.
20
+ * Create a new instance of {@link BoxGeometry}
21
+ * @param width Width; that is, the length of the edges parallel to the X axis. Optional; Expects a `Float`. Default `1`
22
+ * @param height Height; that is, the length of the edges parallel to the Y axis. Optional; Expects a `Float`. Default `1`
23
+ * @param depth Depth; that is, the length of the edges parallel to the Z axis. Optional; Expects a `Float`. Default `1`
24
+ * @param widthSegments Number of segmented rectangular faces along the width of the sides. Optional; Expects a `Integer`. Default `1`
25
+ * @param heightSegments Number of segmented rectangular faces along the height of the sides. Optional; Expects a `Integer`. Default `1`
26
+ * @param depthSegments Number of segmented rectangular faces along the depth of the sides. Optional; Expects a `Integer`. Default `1`
11
27
  */
12
28
  constructor(
13
29
  width?: number,
@@ -19,18 +35,25 @@ export class BoxGeometry extends BufferGeometry {
19
35
  );
20
36
 
21
37
  /**
22
- * @default 'BoxGeometry'
38
+ * A Read-only _string_ to check if `this` object type.
39
+ * @remarks Sub-classes will update this value.
40
+ * @defaultValue `BoxGeometry`
23
41
  */
24
- type: string;
42
+ override readonly type: string | 'BoxGeometry';
25
43
 
26
- parameters: {
27
- width: number;
28
- height: number;
29
- depth: number;
30
- widthSegments: number;
31
- heightSegments: number;
32
- depthSegments: number;
44
+ /**
45
+ * An object with a property for each of the constructor parameters.
46
+ * @remarks Any modification after instantiation does not change the geometry.
47
+ */
48
+ readonly parameters: {
49
+ readonly width: number;
50
+ readonly height: number;
51
+ readonly depth: number;
52
+ readonly widthSegments: number;
53
+ readonly heightSegments: number;
54
+ readonly depthSegments: number;
33
55
  };
34
56
 
35
- static fromJSON(data: any): BoxGeometry;
57
+ /** @internal */
58
+ static fromJSON(data: {}): BoxGeometry;
36
59
  }
@@ -1,25 +1,48 @@
1
1
  import { BufferGeometry } from '../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * {@link CapsuleGeometry} is a geometry class for a capsule with given radii and height
5
+ * @remarks It is constructed using a lathe.
6
+ * @example
7
+ * ```typescript
8
+ * const geometry = new THREE.CapsuleGeometry(1, 1, 4, 8);
9
+ * const material = new THREE.MeshBasicMaterial({
10
+ * color: 0x00ff00
11
+ * });
12
+ * const capsule = new THREE.Mesh(geometry, material);
13
+ * scene.add(capsule);
14
+ * ```
15
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/CapsuleGeometry | Official Documentation}
16
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/CapsuleGeometry.js | Source}
17
+ */
3
18
  export class CapsuleGeometry extends BufferGeometry {
4
19
  /**
5
- * @param [radius=1] Radius of the capsule.
6
- * @param [length=1] Length of the middle section.
7
- * @param [capSegments=4] Number of curve segments used to build the caps.
8
- * @param [radialSegments=8] Number of segmented faces around the circumference of the capsule.
20
+ * Create a new instance of {@link CapsuleGeometry}
21
+ * @param radius Radius of the capsule. Expects a `Float`. Default `1`
22
+ * @param length Length of the middle section. Expects a `Float`. Default `1`
23
+ * @param capSubdivisions Number of curve segments used to build the caps. Expects a `Integer`. Default `4`
24
+ * @param radialSegments Number of segmented faces around the circumference of the capsule. Expects a `Integer`. Default `8`
9
25
  */
10
26
  constructor(radius?: number, length?: number, capSegments?: number, radialSegments?: number);
11
27
 
12
28
  /**
13
- * @default 'CapsuleGeometry'
29
+ * A Read-only _string_ to check if `this` object type.
30
+ * @remarks Sub-classes will update this value.
31
+ * @defaultValue `CapsuleGeometry`
14
32
  */
15
- type: string;
33
+ override readonly type: string | 'CapsuleGeometry';
16
34
 
17
- parameters: {
18
- radius: number;
19
- length: number;
20
- capSegments: number;
21
- radialSegments: number;
35
+ /**
36
+ * An object with a property for each of the constructor parameters.
37
+ * @remarks Any modification after instantiation does not change the geometry.
38
+ */
39
+ readonly parameters: {
40
+ readonly radius: number;
41
+ readonly length: number;
42
+ readonly capSegments: number;
43
+ readonly radialSegments: number;
22
44
  };
23
45
 
24
- static fromJSON(data: any): CapsuleGeometry;
46
+ /** @internal */
47
+ static fromJSON(data: {}): CapsuleGeometry;
25
48
  }
@@ -1,25 +1,51 @@
1
1
  import { BufferGeometry } from '../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * {@link CircleGeometry} is a simple shape of Euclidean geometry
5
+ * @remarks
6
+ * It is constructed from a number of triangular segments that are oriented around a central point and extend as far out as a given radius
7
+ * It is built counter-clockwise from a start angle and a given central angle
8
+ * It can also be used to create regular polygons, where the number of segments determines the number of sides.
9
+ * @example
10
+ * ```typescript
11
+ * const geometry = new THREE.CircleGeometry(5, 32);
12
+ * const material = new THREE.MeshBasicMaterial({
13
+ * color: 0xffff00
14
+ * });
15
+ * const circle = new THREE.Mesh(geometry, material);
16
+ * scene.add(circle);
17
+ * ```
18
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/CircleGeometry | Official Documentation}
19
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/CircleGeometry.js | Source}
20
+ */
3
21
  export class CircleGeometry extends BufferGeometry {
4
22
  /**
5
- * @param radius - Radius of the circle, default = 1.
6
- * @param segments - Number of segments (triangles), minimum = 3, default = 32.
7
- * @param thetaStart - Start angle for first segment, default = 0 (three o'clock position).
8
- * @param thetaLength - The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete circle.
23
+ * Create a new instance of {@link CircleGeometry}
24
+ * @param radius Radius of the circle. Expects a `Float`. Default `1`
25
+ * @param segments Number of segments (triangles). Expects a `Integer`. Minimum `3`. Default `32`
26
+ * @param thetaStart Start angle for first segment. Expects a `Float`. Default `0`, _(three o'clock position)_.
27
+ * @param thetaLength The central angle, often called theta, of the circular sector. Expects a `Float`. Default `Math.PI * 2`, _which makes for a complete circle_.
9
28
  */
10
29
  constructor(radius?: number, segments?: number, thetaStart?: number, thetaLength?: number);
11
30
 
12
31
  /**
13
- * @default 'CircleGeometry'
32
+ * A Read-only _string_ to check if `this` object type.
33
+ * @remarks Sub-classes will update this value.
34
+ * @defaultValue `CircleGeometry`
14
35
  */
15
- type: string;
36
+ override readonly type: string | 'CircleGeometry';
16
37
 
17
- parameters: {
18
- radius: number;
19
- segments: number;
20
- thetaStart: number;
21
- thetaLength: number;
38
+ /**
39
+ * An object with a property for each of the constructor parameters.
40
+ * @remarks Any modification after instantiation does not change the geometry.
41
+ */
42
+ readonly parameters: {
43
+ readonly radius: number;
44
+ readonly segments: number;
45
+ readonly thetaStart: number;
46
+ readonly thetaLength: number;
22
47
  };
23
48
 
24
- static fromJSON(data: any): CircleGeometry;
49
+ /** @internal */
50
+ static fromJSON(data: {}): CircleGeometry;
25
51
  }
@@ -1,14 +1,29 @@
1
1
  import { CylinderGeometry } from './CylinderGeometry';
2
2
 
3
+ /**
4
+ * A class for generating cone geometries.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.ConeGeometry(5, 20, 32);
8
+ * const material = new THREE.MeshBasicMaterial({
9
+ * color: 0xffff00
10
+ * });
11
+ * const cone = new THREE.Mesh(geometry, material);
12
+ * scene.add(cone);
13
+ * ```
14
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/ConeGeometry | Official Documentation}
15
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/ConeGeometry.js | Source}
16
+ */
3
17
  export class ConeGeometry extends CylinderGeometry {
4
18
  /**
5
- * @param radius - Radius of the cone base. Default is 1.
6
- * @param height - Height of the cone. Default is 1.
7
- * @param radialSegments - Number of segmented faces around the circumference of the cone. Default is 32
8
- * @param heightSegments - Number of rows of faces along the height of the cone. Default is 1.
9
- * @param openEnded - A Boolean indicating whether the base of the cone is open or capped. Default is false, meaning capped.
10
- * @param thetaStart - Start angle for first segment, default = 0 (three o'clock position).
11
- * @param thetaLength - The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cone.
19
+ * Create a new instance of {@link ConeGeometry}
20
+ * @param radius Radius of the cone base. Expects a `Float`. Default `1`
21
+ * @param height Height of the cone. Expects a `Float`. Default `1`
22
+ * @param radialSegments Number of segmented faces around the circumference of the cone. Expects a `Integer`. Default `32`
23
+ * @param heightSegments Number of rows of faces along the height of the cone. Expects a `Integer`. Default `1`
24
+ * @param openEnded A Boolean indicating whether the base of the cone is open or capped. Default `false`, _meaning capped_.
25
+ * @param thetaStart Start angle for first segment. Expects a `Float`. Default `0`, _(three o'clock position)_.
26
+ * @param thetaLength The central angle, often called theta, of the circular sector. Expects a `Float`. Default `Math.PI * 2`, _which makes for a complete cone_.
12
27
  */
13
28
  constructor(
14
29
  radius?: number,
@@ -21,9 +36,29 @@ export class ConeGeometry extends CylinderGeometry {
21
36
  );
22
37
 
23
38
  /**
24
- * @default 'ConeGeometry'
39
+ * A Read-only _string_ to check if `this` object type.
40
+ * @remarks Sub-classes will update this value.
41
+ * @defaultValue `ConeGeometry`
25
42
  */
26
- type: string;
43
+ override readonly type: string | 'ConeGeometry';
27
44
 
28
- static fromJSON(data: any): ConeGeometry;
45
+ /**
46
+ * An object with a property for each of the constructor parameters.
47
+ * @remarks {@link radiusTop} and {@link radiusBottom} are from base {@link THREE.CylinderGeometry} class.
48
+ * @remarks Any modification after instantiation does not change the geometry.
49
+ */
50
+ override readonly parameters: {
51
+ readonly radius: number;
52
+ readonly radiusTop: number;
53
+ readonly radiusBottom: number;
54
+ readonly height: number;
55
+ readonly radialSegments: number;
56
+ readonly heightSegments: number;
57
+ readonly openEnded: boolean;
58
+ readonly thetaStart: number;
59
+ readonly thetaLength: number;
60
+ };
61
+
62
+ /** @internal */
63
+ static fromJSON(data: {}): ConeGeometry;
29
64
  }
@@ -1,15 +1,30 @@
1
1
  import { BufferGeometry } from '../core/BufferGeometry';
2
2
 
3
+ /**
4
+ * A class for generating cylinder geometries.
5
+ * @example
6
+ * ```typescript
7
+ * const geometry = new THREE.CylinderGeometry(5, 5, 20, 32);
8
+ * const material = new THREE.MeshBasicMaterial({
9
+ * color: 0xffff00
10
+ * });
11
+ * const cylinder = new THREE.Mesh(geometry, material);
12
+ * scene.add(cylinder);
13
+ * ```
14
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/CylinderGeometry | Official Documentation}
15
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/CylinderGeometry.js | Source}
16
+ */
3
17
  export class CylinderGeometry extends BufferGeometry {
4
18
  /**
5
- * @param radiusTop - Radius of the cylinder at the top. Default is 1.
6
- * @param radiusBottom - Radius of the cylinder at the bottom. Default is 1.
7
- * @param height - Height of the cylinder. Default is 1.
8
- * @param radialSegments - Number of segmented faces around the circumference of the cylinder. Default is 32
9
- * @param heightSegments - Number of rows of faces along the height of the cylinder. Default is 1.
10
- * @param openEnded - A Boolean indicating whether the ends of the cylinder are open or capped. Default is false, meaning capped.
11
- * @param thetaStart - Start angle for first segment, default = 0 (three o'clock position).
12
- * @param thetaLength - The central angle, often called theta, of the circular sector. The default is 2*Pi, which makes for a complete cylinder.
19
+ * Create a new instance of {@link CylinderGeometry}
20
+ * @param radiusTop Radius of the cylinder at the top. Default `1`
21
+ * @param radiusBottom Radius of the cylinder at the bottom. Default `1`
22
+ * @param height Height of the cylinder. Default `1`
23
+ * @param radialSegments Number of segmented faces around the circumference of the cylinder. Default `32`
24
+ * @param heightSegments Number of rows of faces along the height of the cylinder. Expects a `Integer`. Default `1`
25
+ * @param openEnded A Boolean indicating whether the ends of the cylinder are open or capped. Default `false`, _meaning capped_.
26
+ * @param thetaStart Start angle for first segment. Default `0`, _(three o'clock position)_.
27
+ * @param thetaLength The central angle, often called theta, of the circular sector. Default `Math.PI * 2`, _which makes for a complete cylinder.
13
28
  */
14
29
  constructor(
15
30
  radiusTop?: number,
@@ -23,20 +38,27 @@ export class CylinderGeometry extends BufferGeometry {
23
38
  );
24
39
 
25
40
  /**
26
- * @default 'CylinderGeometry'
41
+ * A Read-only _string_ to check if `this` object type.
42
+ * @remarks Sub-classes will update this value.
43
+ * @defaultValue `CylinderGeometry`
27
44
  */
28
- type: string;
45
+ override readonly type: string | 'CylinderGeometry';
29
46
 
30
- parameters: {
31
- radiusTop: number;
32
- radiusBottom: number;
33
- height: number;
34
- radialSegments: number;
35
- heightSegments: number;
36
- openEnded: boolean;
37
- thetaStart: number;
38
- thetaLength: number;
47
+ /**
48
+ * An object with a property for each of the constructor parameters.
49
+ * @remarks Any modification after instantiation does not change the geometry.
50
+ */
51
+ readonly parameters: {
52
+ readonly radiusTop: number;
53
+ readonly radiusBottom: number;
54
+ readonly height: number;
55
+ readonly radialSegments: number;
56
+ readonly heightSegments: number;
57
+ readonly openEnded: boolean;
58
+ readonly thetaStart: number;
59
+ readonly thetaLength: number;
39
60
  };
40
61
 
62
+ /** @internal */
41
63
  static fromJSON(data: any): CylinderGeometry;
42
64
  }
@@ -1,16 +1,25 @@
1
1
  import { PolyhedronGeometry } from './PolyhedronGeometry';
2
2
 
3
+ /**
4
+ * A class for generating a dodecahedron geometries.
5
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/DodecahedronGeometry | Official Documentation}
6
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/DodecahedronGeometry.js | Source}
7
+ */
3
8
  export class DodecahedronGeometry extends PolyhedronGeometry {
4
9
  /**
5
- * @param [radius=1]
6
- * @param [detail=0]
10
+ * Create a new instance of {@link DodecahedronGeometry}
11
+ * @param radius Radius of the dodecahedron. Expects a `Float`. Default `1`
12
+ * @param detail Setting this to a value greater than 0 adds vertices making it no longer a dodecahedron. Expects a `Integer`. Default `0`
7
13
  */
8
14
  constructor(radius?: number, detail?: number);
9
15
 
10
16
  /**
11
- * @default 'DodecahedronGeometry'
17
+ * A Read-only _string_ to check if `this` object type.
18
+ * @remarks Sub-classes will update this value.
19
+ * @defaultValue `DodecahedronGeometry`
12
20
  */
13
- type: string;
21
+ override readonly type: string | 'DodecahedronGeometry';
14
22
 
15
- static fromJSON(data: any): DodecahedronGeometry;
23
+ /** @internal */
24
+ static fromJSON(data: {}): DodecahedronGeometry;
16
25
  }
@@ -1,19 +1,41 @@
1
1
  import { BufferGeometry } from '../core/BufferGeometry';
2
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
+ */
3
18
  export class EdgesGeometry<TBufferGeometry extends BufferGeometry = BufferGeometry> extends BufferGeometry {
4
19
  /**
5
- * @param geometry
6
- * @param [thresholdAngle=1]
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_.
7
23
  */
8
- constructor(geometry?: TBufferGeometry, thresholdAngle?: number);
24
+ constructor(geometry?: TBufferGeometry | null, thresholdAngle?: number);
9
25
 
10
26
  /**
11
- * @default 'EdgesGeometry'
27
+ * A Read-only _string_ to check if `this` object type.
28
+ * @remarks Sub-classes will update this value.
29
+ * @defaultValue `EdgesGeometry`
12
30
  */
13
- type: string;
31
+ override readonly type: string | 'EdgesGeometry';
14
32
 
15
- parameters: {
16
- geometry: TBufferGeometry;
17
- thresholdAngle: number;
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;
18
40
  };
19
41
  }
@@ -6,35 +6,67 @@ import { BufferGeometry } from './../core/BufferGeometry';
6
6
 
7
7
  export interface ExtrudeGeometryOptions {
8
8
  /**
9
- * @default 12
9
+ * Number of points on the curves.
10
+ * Expects a `Integer`.
11
+ * @defaultValue `12`
10
12
  */
11
13
  curveSegments?: number | undefined;
14
+
12
15
  /**
13
- * @default 1
16
+ * Number of points used for subdividing segments along the depth of the extruded spline.
17
+ * @defaultValue `1`
14
18
  */
15
19
  steps?: number | undefined;
20
+
16
21
  /**
17
- * @default 100
22
+ * Depth to extrude the shape.
23
+ * @defaultValue `1`
18
24
  */
19
25
  depth?: number | undefined;
26
+
20
27
  /**
21
- * @default true
28
+ * Turn on bevel. Applying beveling to the shape.
29
+ * @defaultValue `true`
22
30
  */
23
31
  bevelEnabled?: boolean | undefined;
32
+
24
33
  /**
25
- * @default 6
34
+ * How deep into the original shape the bevel goes.
35
+ * Expects a `Float`.
36
+ * @defaultValue `0.2`
26
37
  */
27
38
  bevelThickness?: number | undefined;
39
+
40
+ /**
41
+ * Distance from the shape outline that the bevel extends
42
+ * Expects a `Float`.
43
+ * @defaultValue `bevelThickness - 0.1`
44
+ */
28
45
  bevelSize?: number | undefined;
46
+
29
47
  /**
30
- * @default 0
48
+ * Distance from the shape outline that the bevel starts.
49
+ * Expects a `Float`.
50
+ * @defaultValue `0`
31
51
  */
32
52
  bevelOffset?: number | undefined;
53
+
33
54
  /**
34
- * @default 3
55
+ * Number of bevel layers/segments.
56
+ * Expects a `Integer`.
57
+ * @defaultValue `3`
35
58
  */
36
59
  bevelSegments?: number | undefined;
60
+
61
+ /**
62
+ * A 3D spline path along which the shape should be extruded.
63
+ * @remarks Bevels not supported for path extrusion.
64
+ */
37
65
  extrudePath?: Curve<Vector3> | undefined;
66
+
67
+ /**
68
+ * A object that provides UV generator functions.
69
+ */
38
70
  UVGenerator?: UVGenerator | undefined;
39
71
  }
40
72
 
@@ -56,16 +88,65 @@ export interface UVGenerator {
56
88
  ): Vector2[];
57
89
  }
58
90
 
91
+ /**
92
+ * Creates extruded geometry from a path shape.
93
+ * @remarks This object extrudes a 2D shape to a 3D geometry.
94
+ * @remarks When creating a Mesh with this geometry, if you'd like to have a separate material used for its face and its extruded sides, you can use an array of materials
95
+ * @remarks The first material will be applied to the face; the second material will be applied to the sides.
96
+ * @example
97
+ * ```typescript
98
+ * const length = 12, width = 8;
99
+ * const shape = new THREE.Shape();
100
+ * shape.moveTo(0, 0);
101
+ * shape.lineTo(0, width);
102
+ * shape.lineTo(length, width);
103
+ * shape.lineTo(length, 0);
104
+ * shape.lineTo(0, 0);
105
+ * const extrudeSettings = {
106
+ * steps: 2,
107
+ * depth: 16,
108
+ * bevelEnabled: true,
109
+ * bevelThickness: 1,
110
+ * bevelSize: 1,
111
+ * bevelOffset: 0,
112
+ * bevelSegments: 1
113
+ * };
114
+ * const geometry = new THREE.ExtrudeGeometry(shape, extrudeSettings);
115
+ * const material = new THREE.MeshBasicMaterial({
116
+ * color: 0x00ff00
117
+ * });
118
+ * const mesh = new THREE.Mesh(geometry, material);
119
+ * scene.add(mesh);
120
+ * ```
121
+ * @see {@link https://threejs.org/docs/index.html#api/en/geometries/ExtrudeGeometry | Official Documentation}
122
+ * @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/ExtrudeGeometry.js | Source}
123
+ */
59
124
  export class ExtrudeGeometry extends BufferGeometry {
125
+ /**
126
+ * Create a new instance of {@link ExtrudeGeometry}
127
+ * @param shapes Shape or an array of shapes. Default `new Shape([new Vector2(0.5, 0.5), new Vector2(-0.5, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)])`.
128
+ * @param options Object that can contain the following parameters. @see {@link ExtrudeGeometryOptions} for defaults.
129
+ */
60
130
  constructor(shapes?: Shape | Shape[], options?: ExtrudeGeometryOptions);
61
131
 
62
132
  /**
63
- * @default 'ExtrudeGeometry'
133
+ * A Read-only _string_ to check if `this` object type.
134
+ * @remarks Sub-classes will update this value.
135
+ * @defaultValue `ExtrudeGeometry`
136
+ */
137
+ override readonly type: string | 'ExtrudeGeometry';
138
+
139
+ /**
140
+ * An object with a property for each of the constructor parameters.
141
+ * @remarks Any modification after instantiation does not change the geometry.
64
142
  */
65
- type: string;
143
+ readonly parameters: {
144
+ readonly shapes: Shape | Shape[];
145
+ readonly options: ExtrudeGeometryOptions;
146
+ };
66
147
 
67
- addShapeList(shapes: Shape[], options?: any): void;
68
- addShape(shape: Shape, options?: any): void;
148
+ addShape(shape: Shape): void;
69
149
 
70
- static fromJSON(data: any): ExtrudeGeometry;
150
+ /** @internal */
151
+ static fromJSON(data: {}, shapes: unknown): ExtrudeGeometry;
71
152
  }