UNPKG

@polygonjs/polygonjs

Version:

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

26 lines (25 loc) 675 B
"use strict"; import { BaseMethod } from "./_Base"; export class PointsCountExpression extends BaseMethod { // npoints(0) // npoints('../REF_bbox') static requiredArguments() { return [["string", "path to node"]]; } findDependency(args) { return this.createDependencyFromIndexOrPath(args); } async processArguments(args) { if (args.length == 1) { const indexOrPath = args[0]; const container = await this.getReferencedNodeContainer(indexOrPath); if (container) { const coreContent = container.coreContent(); if (coreContent) { return coreContent.pointsCount(); } } } return 0; } }