node-red-contrib-tak-registration 0.11.4 → 0.11.6

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.
Files changed (202) hide show
  1. package/node_modules/@types/node/README.md +1 -1
  2. package/node_modules/@types/node/buffer.d.ts +8 -7
  3. package/node_modules/@types/node/crypto.d.ts +38 -7
  4. package/node_modules/@types/node/dgram.d.ts +10 -0
  5. package/node_modules/@types/node/diagnostics_channel.d.ts +355 -1
  6. package/node_modules/@types/node/fs.d.ts +28 -8
  7. package/node_modules/@types/node/globals.d.ts +26 -0
  8. package/node_modules/@types/node/http.d.ts +6 -7
  9. package/node_modules/@types/node/module.d.ts +14 -0
  10. package/node_modules/@types/node/net.d.ts +8 -3
  11. package/node_modules/@types/node/package.json +3 -4
  12. package/node_modules/@types/node/perf_hooks.d.ts +12 -6
  13. package/node_modules/@types/node/process.d.ts +25 -3
  14. package/node_modules/@types/node/querystring.d.ts +3 -3
  15. package/node_modules/@types/node/stream/web.d.ts +17 -1
  16. package/node_modules/@types/node/string_decoder.d.ts +2 -2
  17. package/node_modules/@types/node/test.d.ts +98 -15
  18. package/node_modules/@types/node/tls.d.ts +1 -1
  19. package/node_modules/@types/node/ts4.8/buffer.d.ts +8 -7
  20. package/node_modules/@types/node/ts4.8/crypto.d.ts +41 -9
  21. package/node_modules/@types/node/ts4.8/dgram.d.ts +10 -0
  22. package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +355 -1
  23. package/node_modules/@types/node/ts4.8/fs.d.ts +28 -8
  24. package/node_modules/@types/node/ts4.8/globals.d.ts +26 -0
  25. package/node_modules/@types/node/ts4.8/http.d.ts +6 -7
  26. package/node_modules/@types/node/ts4.8/module.d.ts +14 -0
  27. package/node_modules/@types/node/ts4.8/net.d.ts +8 -3
  28. package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +13 -7
  29. package/node_modules/@types/node/ts4.8/process.d.ts +25 -3
  30. package/node_modules/@types/node/ts4.8/querystring.d.ts +3 -3
  31. package/node_modules/@types/node/ts4.8/stream/web.d.ts +17 -1
  32. package/node_modules/@types/node/ts4.8/string_decoder.d.ts +2 -2
  33. package/node_modules/@types/node/ts4.8/test.d.ts +98 -15
  34. package/node_modules/@types/node/ts4.8/tls.d.ts +1 -1
  35. package/node_modules/@types/node/ts4.8/url.d.ts +59 -42
  36. package/node_modules/@types/node/ts4.8/util.d.ts +1 -1
  37. package/node_modules/@types/node/ts4.8/v8.d.ts +134 -5
  38. package/node_modules/@types/node/ts4.8/wasi.d.ts +26 -5
  39. package/node_modules/@types/node/url.d.ts +59 -42
  40. package/node_modules/@types/node/v8.d.ts +134 -5
  41. package/node_modules/@types/node/wasi.d.ts +26 -5
  42. package/node_modules/axios/CHANGELOG.md +53 -0
  43. package/node_modules/axios/README.md +47 -5
  44. package/node_modules/axios/dist/axios.js +368 -4
  45. package/node_modules/axios/dist/axios.js.map +1 -1
  46. package/node_modules/axios/dist/axios.min.js +1 -1
  47. package/node_modules/axios/dist/axios.min.js.map +1 -1
  48. package/node_modules/axios/dist/browser/axios.cjs +28 -4
  49. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  50. package/node_modules/axios/dist/esm/axios.js +28 -4
  51. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  52. package/node_modules/axios/dist/esm/axios.min.js +1 -1
  53. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  54. package/node_modules/axios/dist/node/axios.cjs +34 -6
  55. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  56. package/node_modules/axios/index.d.cts +1 -1
  57. package/node_modules/axios/index.d.ts +1 -1
  58. package/node_modules/axios/lib/adapters/http.js +6 -2
  59. package/node_modules/axios/lib/core/Axios.js +22 -1
  60. package/node_modules/axios/lib/env/data.js +1 -1
  61. package/node_modules/axios/lib/helpers/combineURLs.js +1 -1
  62. package/node_modules/axios/lib/helpers/formDataToJSON.js +3 -0
  63. package/node_modules/axios/package.json +2 -2
  64. package/node_modules/call-bind/CHANGELOG.md +16 -0
  65. package/node_modules/call-bind/index.js +2 -11
  66. package/node_modules/call-bind/package.json +11 -6
  67. package/node_modules/define-data-property/CHANGELOG.md +29 -0
  68. package/node_modules/define-data-property/index.d.ts +12 -3
  69. package/node_modules/define-data-property/index.js +4 -16
  70. package/node_modules/define-data-property/package.json +26 -33
  71. package/node_modules/define-data-property/test/index.js +10 -10
  72. package/node_modules/es-define-property/.eslintrc +13 -0
  73. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  74. package/node_modules/es-define-property/.nycrc +9 -0
  75. package/node_modules/es-define-property/CHANGELOG.md +15 -0
  76. package/node_modules/es-define-property/LICENSE +21 -0
  77. package/node_modules/es-define-property/README.md +49 -0
  78. package/node_modules/es-define-property/index.d.ts +3 -0
  79. package/node_modules/es-define-property/index.js +16 -0
  80. package/node_modules/es-define-property/package.json +81 -0
  81. package/node_modules/es-define-property/test/index.js +55 -0
  82. package/node_modules/es-define-property/tsconfig.json +50 -0
  83. package/node_modules/es-errors/.eslintrc +5 -0
  84. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  85. package/node_modules/es-errors/CHANGELOG.md +40 -0
  86. package/node_modules/es-errors/LICENSE +21 -0
  87. package/node_modules/es-errors/README.md +55 -0
  88. package/node_modules/es-errors/eval.d.ts +3 -0
  89. package/node_modules/es-errors/eval.js +4 -0
  90. package/node_modules/es-errors/index.d.ts +3 -0
  91. package/node_modules/es-errors/index.js +4 -0
  92. package/node_modules/es-errors/package.json +80 -0
  93. package/node_modules/es-errors/range.d.ts +3 -0
  94. package/node_modules/es-errors/range.js +4 -0
  95. package/node_modules/es-errors/ref.d.ts +3 -0
  96. package/node_modules/es-errors/ref.js +4 -0
  97. package/node_modules/es-errors/syntax.d.ts +3 -0
  98. package/node_modules/es-errors/syntax.js +4 -0
  99. package/node_modules/es-errors/test/index.js +19 -0
  100. package/node_modules/es-errors/tsconfig.json +49 -0
  101. package/node_modules/es-errors/type.d.ts +3 -0
  102. package/node_modules/es-errors/type.js +4 -0
  103. package/node_modules/es-errors/uri.d.ts +3 -0
  104. package/node_modules/es-errors/uri.js +4 -0
  105. package/node_modules/fast-xml-parser/CHANGELOG.md +3 -0
  106. package/node_modules/fast-xml-parser/README.md +2 -1
  107. package/node_modules/fast-xml-parser/package.json +4 -1
  108. package/node_modules/fast-xml-parser/src/fxp.d.ts +363 -69
  109. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +5 -5
  110. package/node_modules/follow-redirects/index.js +114 -75
  111. package/node_modules/follow-redirects/package.json +1 -1
  112. package/node_modules/get-intrinsic/CHANGELOG.md +18 -0
  113. package/node_modules/get-intrinsic/index.js +15 -7
  114. package/node_modules/get-intrinsic/package.json +12 -12
  115. package/node_modules/has-property-descriptors/CHANGELOG.md +8 -0
  116. package/node_modules/has-property-descriptors/index.js +3 -14
  117. package/node_modules/has-property-descriptors/package.json +5 -5
  118. package/node_modules/has-proto/CHANGELOG.md +15 -0
  119. package/node_modules/has-proto/index.d.ts +3 -0
  120. package/node_modules/has-proto/index.js +5 -1
  121. package/node_modules/has-proto/package.json +9 -5
  122. package/node_modules/has-proto/tsconfig.json +49 -0
  123. package/node_modules/has-tostringtag/.eslintrc +0 -6
  124. package/node_modules/has-tostringtag/.nycrc +13 -0
  125. package/node_modules/has-tostringtag/CHANGELOG.md +22 -0
  126. package/node_modules/has-tostringtag/index.d.ts +3 -0
  127. package/node_modules/has-tostringtag/index.js +1 -0
  128. package/node_modules/has-tostringtag/package.json +37 -13
  129. package/node_modules/has-tostringtag/shams.d.ts +3 -0
  130. package/node_modules/has-tostringtag/shams.js +1 -0
  131. package/node_modules/has-tostringtag/test/shams/core-js.js +3 -0
  132. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +2 -0
  133. package/node_modules/has-tostringtag/test/tests.js +2 -1
  134. package/node_modules/has-tostringtag/tsconfig.json +49 -0
  135. package/node_modules/hasown/CHANGELOG.md +8 -0
  136. package/node_modules/hasown/index.d.ts +3 -3
  137. package/node_modules/hasown/index.js +1 -1
  138. package/node_modules/hasown/package.json +13 -15
  139. package/node_modules/polygon-clipping/README.md +29 -26
  140. package/node_modules/polygon-clipping/dist/polygon-clipping.cjs.js +1398 -1421
  141. package/node_modules/polygon-clipping/dist/polygon-clipping.d.ts +13 -10
  142. package/node_modules/polygon-clipping/dist/polygon-clipping.esm.js +1139 -1427
  143. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.js +1770 -1831
  144. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js +22 -8
  145. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js.map +1 -1
  146. package/node_modules/polygon-clipping/node_modules/robust-predicates/LICENSE +24 -0
  147. package/node_modules/polygon-clipping/node_modules/robust-predicates/README.md +82 -0
  148. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/incircle.js +765 -0
  149. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/insphere.js +766 -0
  150. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient2d.js +184 -0
  151. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient3d.js +462 -0
  152. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/util.js +138 -0
  153. package/node_modules/polygon-clipping/node_modules/robust-predicates/index.d.ts +49 -0
  154. package/node_modules/polygon-clipping/node_modules/robust-predicates/index.js +5 -0
  155. package/node_modules/polygon-clipping/node_modules/robust-predicates/package.json +75 -0
  156. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.js +908 -0
  157. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.min.js +1 -0
  158. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.js +914 -0
  159. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.min.js +1 -0
  160. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.js +280 -0
  161. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.min.js +1 -0
  162. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.js +601 -0
  163. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.min.js +1 -0
  164. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.js +2328 -0
  165. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.min.js +1 -0
  166. package/node_modules/polygon-clipping/package.json +30 -25
  167. package/node_modules/protobufjs/dist/light/protobuf.js +4 -4
  168. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  169. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  170. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  171. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  172. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  173. package/node_modules/protobufjs/dist/protobuf.js +4 -4
  174. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  175. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  176. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  177. package/node_modules/protobufjs/package.json +1 -1
  178. package/node_modules/protobufjs/src/root.js +2 -2
  179. package/node_modules/regexp.prototype.flags/CHANGELOG.md +13 -0
  180. package/node_modules/regexp.prototype.flags/implementation.js +2 -2
  181. package/node_modules/regexp.prototype.flags/package.json +11 -10
  182. package/node_modules/regexp.prototype.flags/test/tests.js +13 -13
  183. package/node_modules/set-function-length/CHANGELOG.md +18 -0
  184. package/node_modules/set-function-length/env.d.ts +6 -0
  185. package/node_modules/set-function-length/env.d.ts.map +1 -0
  186. package/node_modules/set-function-length/env.js +9 -4
  187. package/node_modules/set-function-length/index.d.ts +7 -0
  188. package/node_modules/set-function-length/index.d.ts.map +1 -0
  189. package/node_modules/set-function-length/index.js +6 -3
  190. package/node_modules/set-function-length/package.json +33 -13
  191. package/node_modules/set-function-length/tsconfig.json +59 -0
  192. package/node_modules/set-function-name/.eslintrc +1 -0
  193. package/node_modules/set-function-name/CHANGELOG.md +9 -0
  194. package/node_modules/set-function-name/index.d.ts +5 -0
  195. package/node_modules/set-function-name/index.js +4 -3
  196. package/node_modules/set-function-name/package.json +28 -9
  197. package/node_modules/set-function-name/tsconfig.json +59 -0
  198. package/package.json +4 -4
  199. package/tak-ingest.js +15 -7
  200. package/node_modules/define-data-property/index.d.ts.map +0 -1
  201. package/node_modules/hasown/index.d.ts.map +0 -1
  202. package/node_modules/polygon-clipping/CHANGELOG.md +0 -129
@@ -0,0 +1,184 @@
1
+ import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';
2
+
3
+ const ccwerrboundA = (3 + 16 * epsilon) * epsilon;
4
+ const ccwerrboundB = (2 + 12 * epsilon) * epsilon;
5
+ const ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;
6
+
7
+ const B = vec(4);
8
+ const C1 = vec(8);
9
+ const C2 = vec(12);
10
+ const D = vec(16);
11
+ const u = vec(4);
12
+
13
+ function orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {
14
+ let acxtail, acytail, bcxtail, bcytail;
15
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;
16
+
17
+ const acx = ax - cx;
18
+ const bcx = bx - cx;
19
+ const acy = ay - cy;
20
+ const bcy = by - cy;
21
+
22
+ s1 = acx * bcy;
23
+ c = splitter * acx;
24
+ ahi = c - (c - acx);
25
+ alo = acx - ahi;
26
+ c = splitter * bcy;
27
+ bhi = c - (c - bcy);
28
+ blo = bcy - bhi;
29
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
30
+ t1 = acy * bcx;
31
+ c = splitter * acy;
32
+ ahi = c - (c - acy);
33
+ alo = acy - ahi;
34
+ c = splitter * bcx;
35
+ bhi = c - (c - bcx);
36
+ blo = bcx - bhi;
37
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
38
+ _i = s0 - t0;
39
+ bvirt = s0 - _i;
40
+ B[0] = s0 - (_i + bvirt) + (bvirt - t0);
41
+ _j = s1 + _i;
42
+ bvirt = _j - s1;
43
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
44
+ _i = _0 - t1;
45
+ bvirt = _0 - _i;
46
+ B[1] = _0 - (_i + bvirt) + (bvirt - t1);
47
+ u3 = _j + _i;
48
+ bvirt = u3 - _j;
49
+ B[2] = _j - (u3 - bvirt) + (_i - bvirt);
50
+ B[3] = u3;
51
+
52
+ let det = estimate(4, B);
53
+ let errbound = ccwerrboundB * detsum;
54
+ if (det >= errbound || -det >= errbound) {
55
+ return det;
56
+ }
57
+
58
+ bvirt = ax - acx;
59
+ acxtail = ax - (acx + bvirt) + (bvirt - cx);
60
+ bvirt = bx - bcx;
61
+ bcxtail = bx - (bcx + bvirt) + (bvirt - cx);
62
+ bvirt = ay - acy;
63
+ acytail = ay - (acy + bvirt) + (bvirt - cy);
64
+ bvirt = by - bcy;
65
+ bcytail = by - (bcy + bvirt) + (bvirt - cy);
66
+
67
+ if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {
68
+ return det;
69
+ }
70
+
71
+ errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);
72
+ det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);
73
+ if (det >= errbound || -det >= errbound) return det;
74
+
75
+ s1 = acxtail * bcy;
76
+ c = splitter * acxtail;
77
+ ahi = c - (c - acxtail);
78
+ alo = acxtail - ahi;
79
+ c = splitter * bcy;
80
+ bhi = c - (c - bcy);
81
+ blo = bcy - bhi;
82
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
83
+ t1 = acytail * bcx;
84
+ c = splitter * acytail;
85
+ ahi = c - (c - acytail);
86
+ alo = acytail - ahi;
87
+ c = splitter * bcx;
88
+ bhi = c - (c - bcx);
89
+ blo = bcx - bhi;
90
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
91
+ _i = s0 - t0;
92
+ bvirt = s0 - _i;
93
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
94
+ _j = s1 + _i;
95
+ bvirt = _j - s1;
96
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
97
+ _i = _0 - t1;
98
+ bvirt = _0 - _i;
99
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
100
+ u3 = _j + _i;
101
+ bvirt = u3 - _j;
102
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
103
+ u[3] = u3;
104
+ const C1len = sum(4, B, 4, u, C1);
105
+
106
+ s1 = acx * bcytail;
107
+ c = splitter * acx;
108
+ ahi = c - (c - acx);
109
+ alo = acx - ahi;
110
+ c = splitter * bcytail;
111
+ bhi = c - (c - bcytail);
112
+ blo = bcytail - bhi;
113
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
114
+ t1 = acy * bcxtail;
115
+ c = splitter * acy;
116
+ ahi = c - (c - acy);
117
+ alo = acy - ahi;
118
+ c = splitter * bcxtail;
119
+ bhi = c - (c - bcxtail);
120
+ blo = bcxtail - bhi;
121
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
122
+ _i = s0 - t0;
123
+ bvirt = s0 - _i;
124
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
125
+ _j = s1 + _i;
126
+ bvirt = _j - s1;
127
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
128
+ _i = _0 - t1;
129
+ bvirt = _0 - _i;
130
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
131
+ u3 = _j + _i;
132
+ bvirt = u3 - _j;
133
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
134
+ u[3] = u3;
135
+ const C2len = sum(C1len, C1, 4, u, C2);
136
+
137
+ s1 = acxtail * bcytail;
138
+ c = splitter * acxtail;
139
+ ahi = c - (c - acxtail);
140
+ alo = acxtail - ahi;
141
+ c = splitter * bcytail;
142
+ bhi = c - (c - bcytail);
143
+ blo = bcytail - bhi;
144
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
145
+ t1 = acytail * bcxtail;
146
+ c = splitter * acytail;
147
+ ahi = c - (c - acytail);
148
+ alo = acytail - ahi;
149
+ c = splitter * bcxtail;
150
+ bhi = c - (c - bcxtail);
151
+ blo = bcxtail - bhi;
152
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
153
+ _i = s0 - t0;
154
+ bvirt = s0 - _i;
155
+ u[0] = s0 - (_i + bvirt) + (bvirt - t0);
156
+ _j = s1 + _i;
157
+ bvirt = _j - s1;
158
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
159
+ _i = _0 - t1;
160
+ bvirt = _0 - _i;
161
+ u[1] = _0 - (_i + bvirt) + (bvirt - t1);
162
+ u3 = _j + _i;
163
+ bvirt = u3 - _j;
164
+ u[2] = _j - (u3 - bvirt) + (_i - bvirt);
165
+ u[3] = u3;
166
+ const Dlen = sum(C2len, C2, 4, u, D);
167
+
168
+ return D[Dlen - 1];
169
+ }
170
+
171
+ export function orient2d(ax, ay, bx, by, cx, cy) {
172
+ const detleft = (ay - cy) * (bx - cx);
173
+ const detright = (ax - cx) * (by - cy);
174
+ const det = detleft - detright;
175
+
176
+ const detsum = Math.abs(detleft + detright);
177
+ if (Math.abs(det) >= ccwerrboundA * detsum) return det;
178
+
179
+ return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);
180
+ }
181
+
182
+ export function orient2dfast(ax, ay, bx, by, cx, cy) {
183
+ return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);
184
+ }
@@ -0,0 +1,462 @@
1
+ import {epsilon, splitter, resulterrbound, estimate, vec, sum, scale} from './util.js';
2
+
3
+ const o3derrboundA = (7 + 56 * epsilon) * epsilon;
4
+ const o3derrboundB = (3 + 28 * epsilon) * epsilon;
5
+ const o3derrboundC = (26 + 288 * epsilon) * epsilon * epsilon;
6
+
7
+ const bc = vec(4);
8
+ const ca = vec(4);
9
+ const ab = vec(4);
10
+ const at_b = vec(4);
11
+ const at_c = vec(4);
12
+ const bt_c = vec(4);
13
+ const bt_a = vec(4);
14
+ const ct_a = vec(4);
15
+ const ct_b = vec(4);
16
+ const bct = vec(8);
17
+ const cat = vec(8);
18
+ const abt = vec(8);
19
+ const u = vec(4);
20
+
21
+ const _8 = vec(8);
22
+ const _8b = vec(8);
23
+ const _16 = vec(8);
24
+ const _12 = vec(12);
25
+
26
+ let fin = vec(192);
27
+ let fin2 = vec(192);
28
+
29
+ function finadd(finlen, alen, a) {
30
+ finlen = sum(finlen, fin, alen, a, fin2);
31
+ const tmp = fin; fin = fin2; fin2 = tmp;
32
+ return finlen;
33
+ }
34
+
35
+ function tailinit(xtail, ytail, ax, ay, bx, by, a, b) {
36
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3, negate;
37
+ if (xtail === 0) {
38
+ if (ytail === 0) {
39
+ a[0] = 0;
40
+ b[0] = 0;
41
+ return 1;
42
+ } else {
43
+ negate = -ytail;
44
+ s1 = negate * ax;
45
+ c = splitter * negate;
46
+ ahi = c - (c - negate);
47
+ alo = negate - ahi;
48
+ c = splitter * ax;
49
+ bhi = c - (c - ax);
50
+ blo = ax - bhi;
51
+ a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
52
+ a[1] = s1;
53
+ s1 = ytail * bx;
54
+ c = splitter * ytail;
55
+ ahi = c - (c - ytail);
56
+ alo = ytail - ahi;
57
+ c = splitter * bx;
58
+ bhi = c - (c - bx);
59
+ blo = bx - bhi;
60
+ b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
61
+ b[1] = s1;
62
+ return 2;
63
+ }
64
+ } else {
65
+ if (ytail === 0) {
66
+ s1 = xtail * ay;
67
+ c = splitter * xtail;
68
+ ahi = c - (c - xtail);
69
+ alo = xtail - ahi;
70
+ c = splitter * ay;
71
+ bhi = c - (c - ay);
72
+ blo = ay - bhi;
73
+ a[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
74
+ a[1] = s1;
75
+ negate = -xtail;
76
+ s1 = negate * by;
77
+ c = splitter * negate;
78
+ ahi = c - (c - negate);
79
+ alo = negate - ahi;
80
+ c = splitter * by;
81
+ bhi = c - (c - by);
82
+ blo = by - bhi;
83
+ b[0] = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
84
+ b[1] = s1;
85
+ return 2;
86
+ } else {
87
+ s1 = xtail * ay;
88
+ c = splitter * xtail;
89
+ ahi = c - (c - xtail);
90
+ alo = xtail - ahi;
91
+ c = splitter * ay;
92
+ bhi = c - (c - ay);
93
+ blo = ay - bhi;
94
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
95
+ t1 = ytail * ax;
96
+ c = splitter * ytail;
97
+ ahi = c - (c - ytail);
98
+ alo = ytail - ahi;
99
+ c = splitter * ax;
100
+ bhi = c - (c - ax);
101
+ blo = ax - bhi;
102
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
103
+ _i = s0 - t0;
104
+ bvirt = s0 - _i;
105
+ a[0] = s0 - (_i + bvirt) + (bvirt - t0);
106
+ _j = s1 + _i;
107
+ bvirt = _j - s1;
108
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
109
+ _i = _0 - t1;
110
+ bvirt = _0 - _i;
111
+ a[1] = _0 - (_i + bvirt) + (bvirt - t1);
112
+ u3 = _j + _i;
113
+ bvirt = u3 - _j;
114
+ a[2] = _j - (u3 - bvirt) + (_i - bvirt);
115
+ a[3] = u3;
116
+ s1 = ytail * bx;
117
+ c = splitter * ytail;
118
+ ahi = c - (c - ytail);
119
+ alo = ytail - ahi;
120
+ c = splitter * bx;
121
+ bhi = c - (c - bx);
122
+ blo = bx - bhi;
123
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
124
+ t1 = xtail * by;
125
+ c = splitter * xtail;
126
+ ahi = c - (c - xtail);
127
+ alo = xtail - ahi;
128
+ c = splitter * by;
129
+ bhi = c - (c - by);
130
+ blo = by - bhi;
131
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
132
+ _i = s0 - t0;
133
+ bvirt = s0 - _i;
134
+ b[0] = s0 - (_i + bvirt) + (bvirt - t0);
135
+ _j = s1 + _i;
136
+ bvirt = _j - s1;
137
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
138
+ _i = _0 - t1;
139
+ bvirt = _0 - _i;
140
+ b[1] = _0 - (_i + bvirt) + (bvirt - t1);
141
+ u3 = _j + _i;
142
+ bvirt = u3 - _j;
143
+ b[2] = _j - (u3 - bvirt) + (_i - bvirt);
144
+ b[3] = u3;
145
+ return 4;
146
+ }
147
+ }
148
+ }
149
+
150
+ function tailadd(finlen, a, b, k, z) {
151
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, u3;
152
+ s1 = a * b;
153
+ c = splitter * a;
154
+ ahi = c - (c - a);
155
+ alo = a - ahi;
156
+ c = splitter * b;
157
+ bhi = c - (c - b);
158
+ blo = b - bhi;
159
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
160
+ c = splitter * k;
161
+ bhi = c - (c - k);
162
+ blo = k - bhi;
163
+ _i = s0 * k;
164
+ c = splitter * s0;
165
+ ahi = c - (c - s0);
166
+ alo = s0 - ahi;
167
+ u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);
168
+ _j = s1 * k;
169
+ c = splitter * s1;
170
+ ahi = c - (c - s1);
171
+ alo = s1 - ahi;
172
+ _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);
173
+ _k = _i + _0;
174
+ bvirt = _k - _i;
175
+ u[1] = _i - (_k - bvirt) + (_0 - bvirt);
176
+ u3 = _j + _k;
177
+ u[2] = _k - (u3 - _j);
178
+ u[3] = u3;
179
+ finlen = finadd(finlen, 4, u);
180
+ if (z !== 0) {
181
+ c = splitter * z;
182
+ bhi = c - (c - z);
183
+ blo = z - bhi;
184
+ _i = s0 * z;
185
+ c = splitter * s0;
186
+ ahi = c - (c - s0);
187
+ alo = s0 - ahi;
188
+ u[0] = alo * blo - (_i - ahi * bhi - alo * bhi - ahi * blo);
189
+ _j = s1 * z;
190
+ c = splitter * s1;
191
+ ahi = c - (c - s1);
192
+ alo = s1 - ahi;
193
+ _0 = alo * blo - (_j - ahi * bhi - alo * bhi - ahi * blo);
194
+ _k = _i + _0;
195
+ bvirt = _k - _i;
196
+ u[1] = _i - (_k - bvirt) + (_0 - bvirt);
197
+ u3 = _j + _k;
198
+ u[2] = _k - (u3 - _j);
199
+ u[3] = u3;
200
+ finlen = finadd(finlen, 4, u);
201
+ }
202
+ return finlen;
203
+ }
204
+
205
+ function orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent) {
206
+ let finlen;
207
+ let adxtail, bdxtail, cdxtail;
208
+ let adytail, bdytail, cdytail;
209
+ let adztail, bdztail, cdztail;
210
+ let bvirt, c, ahi, alo, bhi, blo, _i, _j, _k, _0, s1, s0, t1, t0, u3;
211
+
212
+ const adx = ax - dx;
213
+ const bdx = bx - dx;
214
+ const cdx = cx - dx;
215
+ const ady = ay - dy;
216
+ const bdy = by - dy;
217
+ const cdy = cy - dy;
218
+ const adz = az - dz;
219
+ const bdz = bz - dz;
220
+ const cdz = cz - dz;
221
+
222
+ s1 = bdx * cdy;
223
+ c = splitter * bdx;
224
+ ahi = c - (c - bdx);
225
+ alo = bdx - ahi;
226
+ c = splitter * cdy;
227
+ bhi = c - (c - cdy);
228
+ blo = cdy - bhi;
229
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
230
+ t1 = cdx * bdy;
231
+ c = splitter * cdx;
232
+ ahi = c - (c - cdx);
233
+ alo = cdx - ahi;
234
+ c = splitter * bdy;
235
+ bhi = c - (c - bdy);
236
+ blo = bdy - bhi;
237
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
238
+ _i = s0 - t0;
239
+ bvirt = s0 - _i;
240
+ bc[0] = s0 - (_i + bvirt) + (bvirt - t0);
241
+ _j = s1 + _i;
242
+ bvirt = _j - s1;
243
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
244
+ _i = _0 - t1;
245
+ bvirt = _0 - _i;
246
+ bc[1] = _0 - (_i + bvirt) + (bvirt - t1);
247
+ u3 = _j + _i;
248
+ bvirt = u3 - _j;
249
+ bc[2] = _j - (u3 - bvirt) + (_i - bvirt);
250
+ bc[3] = u3;
251
+ s1 = cdx * ady;
252
+ c = splitter * cdx;
253
+ ahi = c - (c - cdx);
254
+ alo = cdx - ahi;
255
+ c = splitter * ady;
256
+ bhi = c - (c - ady);
257
+ blo = ady - bhi;
258
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
259
+ t1 = adx * cdy;
260
+ c = splitter * adx;
261
+ ahi = c - (c - adx);
262
+ alo = adx - ahi;
263
+ c = splitter * cdy;
264
+ bhi = c - (c - cdy);
265
+ blo = cdy - bhi;
266
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
267
+ _i = s0 - t0;
268
+ bvirt = s0 - _i;
269
+ ca[0] = s0 - (_i + bvirt) + (bvirt - t0);
270
+ _j = s1 + _i;
271
+ bvirt = _j - s1;
272
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
273
+ _i = _0 - t1;
274
+ bvirt = _0 - _i;
275
+ ca[1] = _0 - (_i + bvirt) + (bvirt - t1);
276
+ u3 = _j + _i;
277
+ bvirt = u3 - _j;
278
+ ca[2] = _j - (u3 - bvirt) + (_i - bvirt);
279
+ ca[3] = u3;
280
+ s1 = adx * bdy;
281
+ c = splitter * adx;
282
+ ahi = c - (c - adx);
283
+ alo = adx - ahi;
284
+ c = splitter * bdy;
285
+ bhi = c - (c - bdy);
286
+ blo = bdy - bhi;
287
+ s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
288
+ t1 = bdx * ady;
289
+ c = splitter * bdx;
290
+ ahi = c - (c - bdx);
291
+ alo = bdx - ahi;
292
+ c = splitter * ady;
293
+ bhi = c - (c - ady);
294
+ blo = ady - bhi;
295
+ t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
296
+ _i = s0 - t0;
297
+ bvirt = s0 - _i;
298
+ ab[0] = s0 - (_i + bvirt) + (bvirt - t0);
299
+ _j = s1 + _i;
300
+ bvirt = _j - s1;
301
+ _0 = s1 - (_j - bvirt) + (_i - bvirt);
302
+ _i = _0 - t1;
303
+ bvirt = _0 - _i;
304
+ ab[1] = _0 - (_i + bvirt) + (bvirt - t1);
305
+ u3 = _j + _i;
306
+ bvirt = u3 - _j;
307
+ ab[2] = _j - (u3 - bvirt) + (_i - bvirt);
308
+ ab[3] = u3;
309
+
310
+ finlen = sum(
311
+ sum(
312
+ scale(4, bc, adz, _8), _8,
313
+ scale(4, ca, bdz, _8b), _8b, _16), _16,
314
+ scale(4, ab, cdz, _8), _8, fin);
315
+
316
+ let det = estimate(finlen, fin);
317
+ let errbound = o3derrboundB * permanent;
318
+ if (det >= errbound || -det >= errbound) {
319
+ return det;
320
+ }
321
+
322
+ bvirt = ax - adx;
323
+ adxtail = ax - (adx + bvirt) + (bvirt - dx);
324
+ bvirt = bx - bdx;
325
+ bdxtail = bx - (bdx + bvirt) + (bvirt - dx);
326
+ bvirt = cx - cdx;
327
+ cdxtail = cx - (cdx + bvirt) + (bvirt - dx);
328
+ bvirt = ay - ady;
329
+ adytail = ay - (ady + bvirt) + (bvirt - dy);
330
+ bvirt = by - bdy;
331
+ bdytail = by - (bdy + bvirt) + (bvirt - dy);
332
+ bvirt = cy - cdy;
333
+ cdytail = cy - (cdy + bvirt) + (bvirt - dy);
334
+ bvirt = az - adz;
335
+ adztail = az - (adz + bvirt) + (bvirt - dz);
336
+ bvirt = bz - bdz;
337
+ bdztail = bz - (bdz + bvirt) + (bvirt - dz);
338
+ bvirt = cz - cdz;
339
+ cdztail = cz - (cdz + bvirt) + (bvirt - dz);
340
+
341
+ if (adxtail === 0 && bdxtail === 0 && cdxtail === 0 &&
342
+ adytail === 0 && bdytail === 0 && cdytail === 0 &&
343
+ adztail === 0 && bdztail === 0 && cdztail === 0) {
344
+ return det;
345
+ }
346
+
347
+ errbound = o3derrboundC * permanent + resulterrbound * Math.abs(det);
348
+ det +=
349
+ adz * (bdx * cdytail + cdy * bdxtail - (bdy * cdxtail + cdx * bdytail)) + adztail * (bdx * cdy - bdy * cdx) +
350
+ bdz * (cdx * adytail + ady * cdxtail - (cdy * adxtail + adx * cdytail)) + bdztail * (cdx * ady - cdy * adx) +
351
+ cdz * (adx * bdytail + bdy * adxtail - (ady * bdxtail + bdx * adytail)) + cdztail * (adx * bdy - ady * bdx);
352
+ if (det >= errbound || -det >= errbound) {
353
+ return det;
354
+ }
355
+
356
+ const at_len = tailinit(adxtail, adytail, bdx, bdy, cdx, cdy, at_b, at_c);
357
+ const bt_len = tailinit(bdxtail, bdytail, cdx, cdy, adx, ady, bt_c, bt_a);
358
+ const ct_len = tailinit(cdxtail, cdytail, adx, ady, bdx, bdy, ct_a, ct_b);
359
+
360
+ const bctlen = sum(bt_len, bt_c, ct_len, ct_b, bct);
361
+ finlen = finadd(finlen, scale(bctlen, bct, adz, _16), _16);
362
+
363
+ const catlen = sum(ct_len, ct_a, at_len, at_c, cat);
364
+ finlen = finadd(finlen, scale(catlen, cat, bdz, _16), _16);
365
+
366
+ const abtlen = sum(at_len, at_b, bt_len, bt_a, abt);
367
+ finlen = finadd(finlen, scale(abtlen, abt, cdz, _16), _16);
368
+
369
+ if (adztail !== 0) {
370
+ finlen = finadd(finlen, scale(4, bc, adztail, _12), _12);
371
+ finlen = finadd(finlen, scale(bctlen, bct, adztail, _16), _16);
372
+ }
373
+ if (bdztail !== 0) {
374
+ finlen = finadd(finlen, scale(4, ca, bdztail, _12), _12);
375
+ finlen = finadd(finlen, scale(catlen, cat, bdztail, _16), _16);
376
+ }
377
+ if (cdztail !== 0) {
378
+ finlen = finadd(finlen, scale(4, ab, cdztail, _12), _12);
379
+ finlen = finadd(finlen, scale(abtlen, abt, cdztail, _16), _16);
380
+ }
381
+
382
+ if (adxtail !== 0) {
383
+ if (bdytail !== 0) {
384
+ finlen = tailadd(finlen, adxtail, bdytail, cdz, cdztail);
385
+ }
386
+ if (cdytail !== 0) {
387
+ finlen = tailadd(finlen, -adxtail, cdytail, bdz, bdztail);
388
+ }
389
+ }
390
+ if (bdxtail !== 0) {
391
+ if (cdytail !== 0) {
392
+ finlen = tailadd(finlen, bdxtail, cdytail, adz, adztail);
393
+ }
394
+ if (adytail !== 0) {
395
+ finlen = tailadd(finlen, -bdxtail, adytail, cdz, cdztail);
396
+ }
397
+ }
398
+ if (cdxtail !== 0) {
399
+ if (adytail !== 0) {
400
+ finlen = tailadd(finlen, cdxtail, adytail, bdz, bdztail);
401
+ }
402
+ if (bdytail !== 0) {
403
+ finlen = tailadd(finlen, -cdxtail, bdytail, adz, adztail);
404
+ }
405
+ }
406
+
407
+ return fin[finlen - 1];
408
+ }
409
+
410
+ export function orient3d(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {
411
+ const adx = ax - dx;
412
+ const bdx = bx - dx;
413
+ const cdx = cx - dx;
414
+ const ady = ay - dy;
415
+ const bdy = by - dy;
416
+ const cdy = cy - dy;
417
+ const adz = az - dz;
418
+ const bdz = bz - dz;
419
+ const cdz = cz - dz;
420
+
421
+ const bdxcdy = bdx * cdy;
422
+ const cdxbdy = cdx * bdy;
423
+
424
+ const cdxady = cdx * ady;
425
+ const adxcdy = adx * cdy;
426
+
427
+ const adxbdy = adx * bdy;
428
+ const bdxady = bdx * ady;
429
+
430
+ const det =
431
+ adz * (bdxcdy - cdxbdy) +
432
+ bdz * (cdxady - adxcdy) +
433
+ cdz * (adxbdy - bdxady);
434
+
435
+ const permanent =
436
+ (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * Math.abs(adz) +
437
+ (Math.abs(cdxady) + Math.abs(adxcdy)) * Math.abs(bdz) +
438
+ (Math.abs(adxbdy) + Math.abs(bdxady)) * Math.abs(cdz);
439
+
440
+ const errbound = o3derrboundA * permanent;
441
+ if (det > errbound || -det > errbound) {
442
+ return det;
443
+ }
444
+
445
+ return orient3dadapt(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz, permanent);
446
+ }
447
+
448
+ export function orient3dfast(ax, ay, az, bx, by, bz, cx, cy, cz, dx, dy, dz) {
449
+ const adx = ax - dx;
450
+ const bdx = bx - dx;
451
+ const cdx = cx - dx;
452
+ const ady = ay - dy;
453
+ const bdy = by - dy;
454
+ const cdy = cy - dy;
455
+ const adz = az - dz;
456
+ const bdz = bz - dz;
457
+ const cdz = cz - dz;
458
+
459
+ return adx * (bdy * cdz - bdz * cdy) +
460
+ bdx * (cdy * adz - cdz * ady) +
461
+ cdx * (ady * bdz - adz * bdy);
462
+ }