UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

28 lines (27 loc) 1.02 kB
/** * Returns the centroid of a geometry, or the component of the centroid. * * @remarks * It takes 1 or 2 arguments. * * `centroid(input_index_or_node_path, vector_component)` * * - `input_index_or_node_path` is a number or a string * - `vector_component` is a string, either 'x', 'y' or 'z' * * ## Usage * * - `centroid(0)` - returns the centroid of the input node, as a THREE.Box3 * - `centroid('/geo1/box')` - returns the centroid of the node /geo1/box, as a THREE.Box3 * - `centroid('/geo1/box', 'x')` - returns the x component of centroid of the bbox, as a number * */ import { BaseMethodFindDependencyArgs } from './_Base'; import { BaseMethod } from './_Base'; import { MethodDependency } from '../MethodDependency'; import { Vector3 } from 'three'; export declare class CentroidExpression extends BaseMethod { static requiredArguments(): string[][]; findDependency(args: BaseMethodFindDependencyArgs): MethodDependency | null; processArguments(args: any[]): Promise<number | Vector3>; }