Skip to content

Commit 2cbc7af

Browse files
authored
New Docs: Added redirects for old docs URL (#31986)
* New Docs: Added redirects for old docs URL. * Removed docs_new from gitignore. * Clean up.
1 parent 169d4e1 commit 2cbc7af

File tree

5 files changed

+78
-5
lines changed

5 files changed

+78
-5
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ test/treeshake/index.webgpu.nodes.bundle.min.js
1717
test/e2e/chromium
1818
test/e2e/output-screenshots
1919

20-
**/node_modules
21-
**/docs_new
20+
**/node_modules

src/extras/Earcut.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import earcut from './lib/earcut.js';
22

3+
/**
4+
* An implementation of the earcut polygon triangulation algorithm.
5+
* The code is a port of [mapbox/earcut](https://github.com/mapbox/earcut).
6+
*
7+
* @see https://github.com/mapbox/earcut
8+
*/
39
class Earcut {
410

511
/**

src/extras/core/Interpolations.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
// Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve
1+
/**
2+
* Interpolations contains spline and Bézier functions internally used by concrete curve classes.
3+
*
4+
* Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve
5+
*
6+
* @module Interpolations
7+
*/
28

39
/**
410
* Computes a point on a Catmull-Rom spline.

src/renderers/shaders/UniformsUtils.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
import { ColorManagement } from '../../math/ColorManagement.js';
22
import { warn } from '../../utils.js';
33

4-
// Uniform Utilities
5-
4+
/**
5+
* Provides utility functions for managing uniforms.
6+
*
7+
* @module UniformsUtils
8+
*/
9+
10+
/**
11+
* Clones the given uniform definitions by performing a deep-copy. That means
12+
* if the value of a uniform refers to an object like a Vector3 or Texture,
13+
* the cloned uniform will refer to a new object reference.
14+
*
15+
* @param {Object} src - An object representing uniform definitions.
16+
* @return {Object} The cloned uniforms.
17+
*/
618
export function cloneUniforms( src ) {
719

820
const dst = {};
@@ -49,6 +61,14 @@ export function cloneUniforms( src ) {
4961

5062
}
5163

64+
/**
65+
* Merges the given uniform definitions into a single object. Since the
66+
* method internally uses cloneUniforms(), it performs a deep-copy when
67+
* producing the merged uniform definitions.
68+
*
69+
* @param {Array} uniforms - An array of objects containing uniform definitions.
70+
* @return {Object} The merged uniforms.
71+
*/
5272
export function mergeUniforms( uniforms ) {
5373

5474
const merged = {};

utils/docs/template/static/scripts/page.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
( function handleLegacyURLs() {
2+
3+
const hash = window.location.hash;
4+
5+
if ( hash.startsWith( '#api/' ) || hash.startsWith( '#examples/' ) ) {
6+
7+
const mappings = {
8+
9+
'3DMLoader': 'Rhino3dmLoader',
10+
11+
'BufferGeometryUtils': 'module-BufferGeometryUtils',
12+
'CameraUtils': 'module-CameraUtils',
13+
'SceneUtils': 'module-SceneUtils',
14+
'SkeletonUtils': 'module-SkeletonUtils',
15+
'UniformsUtils': 'module-UniformsUtils',
16+
17+
'DefaultLoadingManager': 'LoadingManager',
18+
'Interpolations': 'module-Interpolations',
19+
20+
'Animation': 'global',
21+
'BufferAttributeUsage': 'global',
22+
'Core': 'global',
23+
'CustomBlendingEquations': 'global',
24+
'Materials': 'global',
25+
'Textures': 'global'
26+
};
27+
28+
const parts = hash.split( '/' );
29+
let className = parts[ parts.length - 1 ];
30+
31+
if ( className ) {
32+
33+
if ( className in mappings ) className = mappings[ className ];
34+
35+
window.location.href = `${className}.html`;
36+
37+
}
38+
39+
}
40+
41+
} )();
42+
143
const panel = document.getElementById( 'panel' );
244
const panelScrim = document.getElementById( 'panelScrim' );
345
const expandButton = document.getElementById( 'expandButton' );

0 commit comments

Comments
 (0)