UNPKG

gs-json

Version:

gs-JSON is a domain agnostic unifying 3D file format for geometric and semantic modelling (hence the 'gs').

62 lines (49 loc) 2.98 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Polymesh = undefined; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _entity_obj = require("./entity_obj"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** * Class Polymesh. * A polymesh is defined by a set of polygonal faces. * These faces may have arbitrary number of vertices, * may be concave or convex, and may be planar or non-planar. * All faces are expected to be connected to one anoter, so that there are no disjoint parts. * The polymesh will have closed wires along all its naked edges. * The polymesh may include one or more holes. * The holes will result in additional naked edges, each with their own wire. * A polymesh may be part of a group and may have attributes. */ var Polymesh = exports.Polymesh = function (_Obj) { _inherits(Polymesh, _Obj); function Polymesh() { _classCallCheck(this, Polymesh); return _possibleConstructorReturn(this, (Polymesh.__proto__ || Object.getPrototypeOf(Polymesh)).apply(this, arguments)); } _createClass(Polymesh, [{ key: "getObjType", /** * Get the object type: "polymesh". * @return The polymesh object type. */ value: function getObjType() { return 200 /* polymesh */; } /** * Checks if the polymesh is closed. * @return Return true if the polymesh is closed. */ }, { key: "isClosed", value: function isClosed() { return this.numWires() === 0; } }]); return Polymesh; }(_entity_obj.Obj); //# sourceMappingURL=entity_obj_polymesh.js.map