Skip to content

Commit

Permalink
Deprecate legacy BufferGeometry nomenclature for built-in geometries (m…
Browse files Browse the repository at this point in the history
…rdoob#24352)

* Deprecate legacy nomenclature

* Update revision number
  • Loading branch information
WestLangley authored and abernier committed Sep 16, 2022
1 parent 9cec9c7 commit 0bc64a2
Show file tree
Hide file tree
Showing 39 changed files with 311 additions and 60 deletions.
269 changes: 269 additions & 0 deletions src/Three.Legacy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
import { DataArrayTexture } from './textures/DataArrayTexture.js';
import { Data3DTexture } from './textures/Data3DTexture.js';
import { BoxGeometry } from './geometries/BoxGeometry.js';
import { CapsuleGeometry } from './geometries/CapsuleGeometry.js';
import { CircleGeometry } from './geometries/CircleGeometry.js';
import { ConeGeometry } from './geometries/ConeGeometry.js';
import { CylinderGeometry } from './geometries/CylinderGeometry.js';
import { DodecahedronGeometry } from './geometries/DodecahedronGeometry.js';
import { ExtrudeGeometry } from './geometries/ExtrudeGeometry.js';
import { IcosahedronGeometry } from './geometries/IcosahedronGeometry.js';
import { LatheGeometry } from './geometries/LatheGeometry.js';
import { OctahedronGeometry } from './geometries/OctahedronGeometry.js';
import { PlaneGeometry } from './geometries/PlaneGeometry.js';
import { PolyhedronGeometry } from './geometries/PolyhedronGeometry.js';
import { RingGeometry } from './geometries/RingGeometry.js';
import { ShapeGeometry } from './geometries/ShapeGeometry.js';
import { SphereGeometry } from './geometries/SphereGeometry.js';
import { TetrahedronGeometry } from './geometries/TetrahedronGeometry.js';
import { TorusGeometry } from './geometries/TorusGeometry.js';
import { TorusKnotGeometry } from './geometries/TorusKnotGeometry.js';
import { TubeGeometry } from './geometries/TubeGeometry.js';

// r134, d65e0af06644fe5a84a6fc0e372f4318f95a04c0

Expand Down Expand Up @@ -49,3 +68,253 @@ export class DataTexture3D extends Data3DTexture {
}

}

// r144

export class BoxBufferGeometry extends BoxGeometry {

constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) {

console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' );
super( width, height, depth, widthSegments, heightSegments, depthSegments );


}

}

// r144

export class CapsuleBufferGeometry extends CapsuleGeometry {

constructor( radius, length, capSegments, radialSegments ) {

console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' );
super( radius, length, capSegments, radialSegments );

}

}

// r144

export class CircleBufferGeometry extends CircleGeometry {

constructor( radius, segments, thetaStart, thetaLength ) {

console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' );
super( radius, segments, thetaStart, thetaLength );

}

}

// r144

export class ConeBufferGeometry extends ConeGeometry {

constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {

console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' );
super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );

}

}

// r144

export class CylinderBufferGeometry extends CylinderGeometry {

constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {

console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' );
super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );

}

}

// r144

export class DodecahedronBufferGeometry extends DodecahedronGeometry {

constructor( radius, detail ) {

console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' );
super( radius, detail );

}

}

// r144

export class ExtrudeBufferGeometry extends ExtrudeGeometry {

constructor( shapes, options ) {

console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' );
super( shapes, options );

}

}

// r144

export class IcosahedronBufferGeometry extends IcosahedronGeometry {

constructor( radius, detail ) {

console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' );
super( radius, detail );

}

}

// r144

export class LatheBufferGeometry extends LatheGeometry {

constructor( points, segments, phiStart, phiLength ) {

console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' );
super( points, segments, phiStart, phiLength );

}

}

// r144

export class OctahedronBufferGeometry extends OctahedronGeometry {

constructor( radius, detail ) {

console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' );
super( radius, detail );

}

}

// r144

export class PlaneBufferGeometry extends PlaneGeometry {

constructor( width, height, widthSegments, heightSegments ) {

console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' );
super( width, height, widthSegments, heightSegments );

}

}

// r144

export class PolyhedronBufferGeometry extends PolyhedronGeometry {

constructor( vertices, indices, radius, detail ) {

console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' );
super( vertices, indices, radius, detail );

}

}

// r144

export class RingBufferGeometry extends RingGeometry {

constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {

console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' );
super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength );

}

}

// r144

export class ShapeBufferGeometry extends ShapeGeometry {

constructor( shapes, curveSegments ) {

console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' );
super( shapes, curveSegments );

}

}

// r144

export class SphereBufferGeometry extends SphereGeometry {

constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) {

console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' );
super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength );

}

}

// r144

export class TetrahedronBufferGeometry extends TetrahedronGeometry {

constructor( radius, detail ) {

console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' );
super( radius, detail );

}

}

// r144

export class TorusBufferGeometry extends TorusGeometry {

constructor( radius, tube, radialSegments, tubularSegments, arc ) {

console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' );
super( radius, tube, radialSegments, tubularSegments, arc );

}

}

// r144

export class TorusKnotBufferGeometry extends TorusKnotGeometry {

constructor( radius, tube, tubularSegments, radialSegments, p, q ) {

console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' );
super( radius, tube, tubularSegments, radialSegments, p, q );

}

}

// r144

export class TubeBufferGeometry extends TubeGeometry {

constructor( path, tubularSegments, radius, radialSegments, closed ) {

console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' );
super( path, tubularSegments, radius, radialSegments, closed );

}

}


2 changes: 1 addition & 1 deletion src/geometries/BoxGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ class BoxGeometry extends BufferGeometry {

}

export { BoxGeometry, BoxGeometry as BoxBufferGeometry };
export { BoxGeometry };
2 changes: 1 addition & 1 deletion src/geometries/CapsuleGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ class CapsuleGeometry extends LatheGeometry {

}

export { CapsuleGeometry, CapsuleGeometry as CapsuleBufferGeometry };
export { CapsuleGeometry };
2 changes: 1 addition & 1 deletion src/geometries/CircleGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ class CircleGeometry extends BufferGeometry {
}


export { CircleGeometry, CircleGeometry as CircleBufferGeometry };
export { CircleGeometry };
2 changes: 1 addition & 1 deletion src/geometries/ConeGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ class ConeGeometry extends CylinderGeometry {

}

export { ConeGeometry, ConeGeometry as ConeBufferGeometry };
export { ConeGeometry };
2 changes: 1 addition & 1 deletion src/geometries/CylinderGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,4 @@ class CylinderGeometry extends BufferGeometry {
}


export { CylinderGeometry, CylinderGeometry as CylinderBufferGeometry };
export { CylinderGeometry };
2 changes: 1 addition & 1 deletion src/geometries/DodecahedronGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ class DodecahedronGeometry extends PolyhedronGeometry {
}


export { DodecahedronGeometry, DodecahedronGeometry as DodecahedronBufferGeometry };
export { DodecahedronGeometry };
2 changes: 1 addition & 1 deletion src/geometries/ExtrudeGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -801,4 +801,4 @@ function toJSON( shapes, options, data ) {
}


export { ExtrudeGeometry, ExtrudeGeometry as ExtrudeBufferGeometry };
export { ExtrudeGeometry };
2 changes: 1 addition & 1 deletion src/geometries/IcosahedronGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ class IcosahedronGeometry extends PolyhedronGeometry {
}


export { IcosahedronGeometry, IcosahedronGeometry as IcosahedronBufferGeometry };
export { IcosahedronGeometry };
2 changes: 1 addition & 1 deletion src/geometries/LatheGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ class LatheGeometry extends BufferGeometry {
}


export { LatheGeometry, LatheGeometry as LatheBufferGeometry };
export { LatheGeometry };
2 changes: 1 addition & 1 deletion src/geometries/OctahedronGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ class OctahedronGeometry extends PolyhedronGeometry {

}

export { OctahedronGeometry, OctahedronGeometry as OctahedronBufferGeometry };
export { OctahedronGeometry };
2 changes: 1 addition & 1 deletion src/geometries/PlaneGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ class PlaneGeometry extends BufferGeometry {

}

export { PlaneGeometry, PlaneGeometry as PlaneBufferGeometry };
export { PlaneGeometry };
2 changes: 1 addition & 1 deletion src/geometries/PolyhedronGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,4 @@ class PolyhedronGeometry extends BufferGeometry {

}

export { PolyhedronGeometry, PolyhedronGeometry as PolyhedronBufferGeometry };
export { PolyhedronGeometry };
2 changes: 1 addition & 1 deletion src/geometries/RingGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ class RingGeometry extends BufferGeometry {
}


export { RingGeometry, RingGeometry as RingBufferGeometry };
export { RingGeometry };
2 changes: 1 addition & 1 deletion src/geometries/ShapeGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ function toJSON( shapes, data ) {

}

export { ShapeGeometry, ShapeGeometry as ShapeBufferGeometry };
export { ShapeGeometry };
2 changes: 1 addition & 1 deletion src/geometries/SphereGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ class SphereGeometry extends BufferGeometry {

}

export { SphereGeometry, SphereGeometry as SphereBufferGeometry };
export { SphereGeometry };
2 changes: 1 addition & 1 deletion src/geometries/TetrahedronGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ class TetrahedronGeometry extends PolyhedronGeometry {

}

export { TetrahedronGeometry, TetrahedronGeometry as TetrahedronBufferGeometry };
export { TetrahedronGeometry };
2 changes: 1 addition & 1 deletion src/geometries/TorusGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ class TorusGeometry extends BufferGeometry {

}

export { TorusGeometry, TorusGeometry as TorusBufferGeometry };
export { TorusGeometry };
2 changes: 1 addition & 1 deletion src/geometries/TorusKnotGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ class TorusKnotGeometry extends BufferGeometry {

}

export { TorusKnotGeometry, TorusKnotGeometry as TorusKnotBufferGeometry };
export { TorusKnotGeometry };
2 changes: 1 addition & 1 deletion src/geometries/TubeGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ class TubeGeometry extends BufferGeometry {
}


export { TubeGeometry, TubeGeometry as TubeBufferGeometry };
export { TubeGeometry };
Loading

0 comments on commit 0bc64a2

Please sign in to comment.