@types/three
Version:
TypeScript definitions for three
49 lines (44 loc) • 1.85 kB
TypeScript
import { BufferGeometry } from "../core/BufferGeometry.js";
/**
* A class for generating plane geometries.
* @example
* ```typescript
* const geometry = new THREE.PlaneGeometry(1, 1);
* const material = new THREE.MeshBasicMaterial({
* color: 0xffff00,
* side: THREE.DoubleSide
* });
* const plane = new THREE.Mesh(geometry, material);
* scene.add(plane);
* ```
* @see {@link https://threejs.org/docs/index.html#api/en/geometries/PlaneGeometry | Official Documentation}
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/geometries/PlaneGeometry.js | Source}
*/
export class PlaneGeometry extends BufferGeometry {
/**
* Create a new instance of {@link PlaneGeometry}
* @param width Width along the X axis. Expects a `Float`. Default `1`
* @param height Height along the Y axis. Expects a `Float`. Default `1`
* @param widthSegments Number of segmented faces along the width of the sides. Expects a `Integer`. Default `1`
* @param heightSegments Number of segmented faces along the height of the sides. Expects a `Integer`. Default `1`
*/
constructor(width?: number, height?: number, widthSegments?: number, heightSegments?: number);
/**
* A Read-only _string_ to check if `this` object type.
* @remarks Sub-classes will update this value.
* @defaultValue `PlaneGeometry`
*/
override readonly type: string | "PlaneGeometry";
/**
* An object with a property for each of the constructor parameters.
* @remarks Any modification after instantiation does not change the geometry.
*/
readonly parameters: {
readonly width: number;
readonly height: number;
readonly widthSegments: number;
readonly heightSegments: number;
};
/** @internal */
static fromJSON(data: {}): PlaneGeometry;
}