@dra2020/baseclient 1.0.18 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4587,6 +4587,7 @@ __exportStar(__webpack_require__(/*! ./polyround */ "./lib/poly/polyround.ts"),
4587
4587
  __exportStar(__webpack_require__(/*! ./topo */ "./lib/poly/topo.ts"), exports);
4588
4588
  __exportStar(__webpack_require__(/*! ./selfintersect */ "./lib/poly/selfintersect.ts"), exports);
4589
4589
  __exportStar(__webpack_require__(/*! ./shamos */ "./lib/poly/shamos.ts"), exports);
4590
+ __exportStar(__webpack_require__(/*! ./pointinpoly */ "./lib/poly/pointinpoly.ts"), exports);
4590
4591
 
4591
4592
 
4592
4593
  /***/ }),
@@ -5668,6 +5669,66 @@ export function minimumBoundingRectangle(poly: any): any
5668
5669
  */
5669
5670
 
5670
5671
 
5672
+ /***/ }),
5673
+
5674
+ /***/ "./lib/poly/pointinpoly.ts":
5675
+ /*!*********************************!*\
5676
+ !*** ./lib/poly/pointinpoly.ts ***!
5677
+ \*********************************/
5678
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5679
+
5680
+
5681
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5682
+ if (k2 === undefined) k2 = k;
5683
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5684
+ }) : (function(o, m, k, k2) {
5685
+ if (k2 === undefined) k2 = k;
5686
+ o[k2] = m[k];
5687
+ }));
5688
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
5689
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
5690
+ }) : function(o, v) {
5691
+ o["default"] = v;
5692
+ });
5693
+ var __importStar = (this && this.__importStar) || function (mod) {
5694
+ if (mod && mod.__esModule) return mod;
5695
+ var result = {};
5696
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
5697
+ __setModuleDefault(result, mod);
5698
+ return result;
5699
+ };
5700
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
5701
+ exports.polyContainsPoint = void 0;
5702
+ const PP = __importStar(__webpack_require__(/*! ./polypack */ "./lib/poly/polypack.ts"));
5703
+ function polyContainsPoint(poly, x, y) {
5704
+ let pp = PP.polyPack(poly);
5705
+ if (pp == null)
5706
+ return false;
5707
+ let bFound = false;
5708
+ let bInside = false;
5709
+ PP.polyPackEachRing(pp, (b, iPoly, iRing, iOffset, nPoints) => {
5710
+ if (bFound)
5711
+ return;
5712
+ let inside = false;
5713
+ let iEnd = iOffset + (nPoints - 1) * 2;
5714
+ for (let i = iOffset, j = iEnd; i < iEnd; j = i, i += 2) {
5715
+ let xi = b[i], yi = b[i + 1];
5716
+ let xj = b[j], yj = b[j + 1];
5717
+ let intersect = ((yi > y) !== (yj > y))
5718
+ && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);
5719
+ if (intersect)
5720
+ inside = !inside;
5721
+ }
5722
+ if (inside) {
5723
+ bFound = iRing > 0; // if inside a hole, don't need to process further
5724
+ bInside = iRing == 0; // not inside if inside a hole
5725
+ }
5726
+ });
5727
+ return bInside;
5728
+ }
5729
+ exports.polyContainsPoint = polyContainsPoint;
5730
+
5731
+
5671
5732
  /***/ }),
5672
5733
 
5673
5734
  /***/ "./lib/poly/poly.ts":