UNPKG

@mlightcad/geometry-engine

Version:

The geometry-engine package provides comprehensive geometric entities, mathematical operations, and transformations for 2D and 3D space. This package mimics AutoCAD ObjectARX's AcGe (Geometry) classes and provides the mathematical foundation for CAD opera

43 lines 1.81 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { AcGeVector3d } from '../math/AcGeVector3d'; /** * The class representing a point in 3-dimensional space. */ var AcGePoint3d = /** @class */ (function (_super) { __extends(AcGePoint3d, _super); function AcGePoint3d() { return _super !== null && _super.apply(this, arguments) || this; } /** * Convert one point array to one number array * @param array Input one point array * @param includeZ Include z cooridinate in returned number array if it is true. * @returns Return converted number array */ AcGePoint3d.pointArrayToNumberArray = function (array, includeZ) { if (includeZ === void 0) { includeZ = true; } var dimension = includeZ ? 3 : 2; var numberArray = new Array(array.length * dimension); array.forEach(function (item, index) { item.toArray(numberArray, index * dimension); }); return numberArray; }; return AcGePoint3d; }(AcGeVector3d)); export { AcGePoint3d }; //# sourceMappingURL=AcGePoint3d.js.map