UNPKG

@polygonjs/polygonjs

Version:

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

20 lines (19 loc) 506 B
"use strict"; import { CadLoaderSync } from "./CadLoaderSync"; import { CadPrimitive } from "./CadPrimitive"; import { traverseFaces } from "./CadTraverse"; export class CadPrimitiveSolid extends CadPrimitive { static primitiveName() { return "face"; } static entitiesCount(object) { const oc = CadLoaderSync.oc(); const cadOobject = object; let count = 0; const shape = cadOobject.geometry; traverseFaces(oc, shape, (face) => { count++; }); return count; } }