UNPKG

@jscad/modeling

Version:

Constructive Solid Geometry (CSG) Library for JSCAD

19 lines (17 loc) 501 B
/** * Determine if the given object is a 3D geometry. * @param {Object} object - the object to interrogate * @returns {Boolean} true if the object matches a geom3 * @alias module:modeling/geometries/geom3.isA */ const isA = (object) => { if (object && typeof object === 'object') { if ('polygons' in object && 'transforms' in object) { if (Array.isArray(object.polygons) && 'length' in object.transforms) { return true } } } return false } module.exports = isA