@pggis/pg-sdk 3.3.10 → 4.3.3
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.
- package/README.md +8 -8
- package/dist/index.js +1966 -4
- package/dist/pggis.min.css +1 -1
- package/dist/pggis.min.js +10980 -7539
- package/dist/resources/ThirdParty/Workers/pako_deflate.min.js +1 -2
- package/dist/resources/ThirdParty/Workers/pako_inflate.min.js +1 -2
- package/dist/resources/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/dist/resources/ThirdParty/google-earth-dbroot-parser.js +1 -8337
- package/dist/resources/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/dist/resources/Workers/chunk-35SHYARM.js +26 -0
- package/dist/resources/Workers/chunk-37F5JSTI.js +26 -0
- package/dist/resources/Workers/chunk-3SSKC3VN.js +26 -0
- package/dist/resources/Workers/chunk-3W4GT7KQ.js +26 -0
- package/dist/resources/Workers/chunk-4IW2T6GF.js +26 -0
- package/dist/resources/Workers/chunk-5YEWO3HT.js +26 -0
- package/dist/resources/Workers/chunk-64RSHJUE.js +28 -0
- package/dist/resources/Workers/chunk-77IHZJJ3.js +26 -0
- package/dist/resources/Workers/chunk-7HTKERZY.js +26 -0
- package/dist/resources/Workers/{chunk-F3YA3Y2Z.js → chunk-A56XVLQR.js} +2 -13
- package/dist/resources/Workers/chunk-AJYK4IVJ.js +26 -0
- package/dist/resources/Workers/{chunk-EHWHNOEX.js → chunk-ARG42DC4.js} +2 -31
- package/dist/resources/Workers/chunk-AU7IKHOH.js +26 -0
- package/dist/resources/Workers/chunk-B4AA3ARO.js +26 -0
- package/dist/resources/Workers/chunk-CNCV5UL7.js +26 -0
- package/dist/resources/Workers/chunk-CYCB63OH.js +26 -0
- package/dist/resources/Workers/{chunk-4H7PY4U5.js → chunk-D6AA5QVT.js} +2 -20
- package/dist/resources/Workers/chunk-D6C66QON.js +26 -0
- package/dist/resources/Workers/chunk-DEPHB2WM.js +26 -0
- package/dist/resources/Workers/chunk-DMEY62ID.js +26 -0
- package/dist/resources/Workers/chunk-DQQ63PYM.js +26 -0
- package/dist/resources/Workers/chunk-ED5JPB3S.js +27 -0
- package/dist/resources/Workers/chunk-EZUYS2JF.js +26 -0
- package/dist/resources/Workers/chunk-FEVXJ54I.js +26 -0
- package/dist/resources/Workers/chunk-G5AGHVVC.js +26 -0
- package/dist/resources/Workers/{chunk-BBWDMCVU.js → chunk-GBYLG25F.js} +2 -15
- package/dist/resources/Workers/chunk-GILIDQNQ.js +26 -0
- package/dist/resources/Workers/chunk-HMIYSTF6.js +26 -0
- package/dist/resources/Workers/chunk-HTFSEEMT.js +26 -0
- package/dist/resources/Workers/chunk-HWXX4CWK.js +26 -0
- package/dist/resources/Workers/chunk-IYTZ52EY.js +26 -0
- package/dist/resources/Workers/chunk-J6UP6FLE.js +26 -0
- package/dist/resources/Workers/chunk-LEYMRMBK.js +27 -0
- package/dist/resources/Workers/chunk-M3MGYQSL.js +26 -0
- package/dist/resources/Workers/chunk-N4VJKXZS.js +26 -0
- package/dist/resources/Workers/chunk-NB3ML6JO.js +26 -0
- package/dist/resources/Workers/chunk-OFUUQVMR.js +26 -0
- package/dist/resources/Workers/chunk-OSW76XDF.js +26 -0
- package/dist/resources/Workers/chunk-PSPPBZWI.js +66 -0
- package/dist/resources/Workers/chunk-QN3VOORQ.js +26 -0
- package/dist/resources/Workers/chunk-QOUAJ6TL.js +26 -0
- package/dist/resources/Workers/chunk-RCV6KWXS.js +26 -0
- package/dist/resources/Workers/chunk-TCGIRNHN.js +26 -0
- package/dist/resources/Workers/chunk-U4IEOH5K.js +26 -0
- package/dist/resources/Workers/chunk-UP6I5URU.js +26 -0
- package/dist/resources/Workers/chunk-VTAIKJXX.js +26 -0
- package/dist/resources/Workers/chunk-VTBDSFTG.js +26 -0
- package/dist/resources/Workers/chunk-VW6VD53G.js +26 -0
- package/dist/resources/Workers/chunk-WGGIH7QW.js +26 -0
- package/dist/resources/Workers/chunk-WWA5PL4H.js +26 -0
- package/dist/resources/Workers/chunk-WZDE3RYP.js +28 -0
- package/dist/resources/Workers/chunk-XRL4AVS5.js +26 -0
- package/dist/resources/Workers/combineGeometry.js +2 -44
- package/dist/resources/Workers/createBoxGeometry.js +2 -34
- package/dist/resources/Workers/createBoxOutlineGeometry.js +2 -211
- package/dist/resources/Workers/createCircleGeometry.js +2 -173
- package/dist/resources/Workers/createCircleOutlineGeometry.js +2 -123
- package/dist/resources/Workers/createCoplanarPolygonGeometry.js +2 -482
- package/dist/resources/Workers/createCoplanarPolygonOutlineGeometry.js +2 -201
- package/dist/resources/Workers/createCorridorGeometry.js +2 -1239
- package/dist/resources/Workers/createCorridorOutlineGeometry.js +2 -544
- package/dist/resources/Workers/createCylinderGeometry.js +2 -36
- package/dist/resources/Workers/createCylinderOutlineGeometry.js +2 -207
- package/dist/resources/Workers/createEllipseGeometry.js +2 -47
- package/dist/resources/Workers/createEllipseOutlineGeometry.js +2 -40
- package/dist/resources/Workers/createEllipsoidGeometry.js +2 -35
- package/dist/resources/Workers/createEllipsoidOutlineGeometry.js +2 -37
- package/dist/resources/Workers/createFrustumGeometry.js +2 -34
- package/dist/resources/Workers/createFrustumOutlineGeometry.js +2 -211
- package/dist/resources/Workers/createGeometry.js +2 -147
- package/dist/resources/Workers/createGroundPolylineGeometry.js +2 -1584
- package/dist/resources/Workers/createPlaneGeometry.js +2 -200
- package/dist/resources/Workers/createPlaneOutlineGeometry.js +2 -100
- package/dist/resources/Workers/createPolygonGeometry.js +2 -1387
- package/dist/resources/Workers/createPolygonOutlineGeometry.js +2 -519
- package/dist/resources/Workers/createPolylineGeometry.js +2 -472
- package/dist/resources/Workers/createPolylineVolumeGeometry.js +2 -355
- package/dist/resources/Workers/createPolylineVolumeOutlineGeometry.js +2 -253
- package/dist/resources/Workers/createRectangleGeometry.js +2 -1250
- package/dist/resources/Workers/createRectangleOutlineGeometry.js +2 -455
- package/dist/resources/Workers/createSimplePolylineGeometry.js +2 -376
- package/dist/resources/Workers/createSphereGeometry.js +2 -94
- package/dist/resources/Workers/createSphereOutlineGeometry.js +2 -94
- package/dist/resources/Workers/createTaskProcessorWorker.js +2 -8
- package/dist/resources/Workers/createVectorTileClampedPolylines.js +2 -468
- package/dist/resources/Workers/createVectorTileGeometries.js +2 -363
- package/dist/resources/Workers/createVectorTilePoints.js +2 -88
- package/dist/resources/Workers/createVectorTilePolygons.js +2 -361
- package/dist/resources/Workers/createVectorTilePolylines.js +2 -238
- package/dist/resources/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -545
- package/dist/resources/Workers/createVerticesFromHeightmap.js +2 -2254
- package/dist/resources/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -722
- package/dist/resources/Workers/createWallGeometry.js +2 -466
- package/dist/resources/Workers/createWallOutlineGeometry.js +2 -314
- package/dist/resources/Workers/decodeDraco.js +2 -345
- package/dist/resources/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2626
- package/dist/resources/Workers/decodeI3S.js +2 -1320
- package/dist/resources/Workers/gaussianSplatSorter.js +26 -0
- package/dist/resources/Workers/gaussianSplatTextureGenerator.js +26 -0
- package/dist/resources/Workers/transcodeKTX2.js +29 -3398
- package/dist/resources/Workers/transferTypedArrayTest.js +2 -17
- package/dist/resources/Workers/upsampleQuantizedTerrainMesh.js +2 -795
- package/package.json +9 -8
- package/dist/resources/ThirdParty/Workers/basis_transcoder.js +0 -21
- package/dist/resources/Workers/chunk-23UFSGND.js +0 -236
- package/dist/resources/Workers/chunk-2A75IWRS.js +0 -218
- package/dist/resources/Workers/chunk-2FRVPMCS.js +0 -1258
- package/dist/resources/Workers/chunk-2FWRMUTY.js +0 -138
- package/dist/resources/Workers/chunk-2UPKWTMJ.js +0 -117
- package/dist/resources/Workers/chunk-34FXV7D7.js +0 -73
- package/dist/resources/Workers/chunk-3VAZEH7M.js +0 -101
- package/dist/resources/Workers/chunk-4DO5W5XZ.js +0 -196
- package/dist/resources/Workers/chunk-5QULIR53.js +0 -501
- package/dist/resources/Workers/chunk-7TC63SJW.js +0 -302
- package/dist/resources/Workers/chunk-7ZFGPDJA.js +0 -122
- package/dist/resources/Workers/chunk-A5DWLWCY.js +0 -834
- package/dist/resources/Workers/chunk-BG4UCVXN.js +0 -73
- package/dist/resources/Workers/chunk-BIKA3NRA.js +0 -59
- package/dist/resources/Workers/chunk-BROJAZRZ.js +0 -390
- package/dist/resources/Workers/chunk-DDUQAJ4P.js +0 -476
- package/dist/resources/Workers/chunk-EERJKOAF.js +0 -305
- package/dist/resources/Workers/chunk-EG6PTBY2.js +0 -2716
- package/dist/resources/Workers/chunk-F4HFJMGM.js +0 -353
- package/dist/resources/Workers/chunk-FJKNFAKQ.js +0 -8219
- package/dist/resources/Workers/chunk-FNIRWHJB.js +0 -289
- package/dist/resources/Workers/chunk-FZRIVR7Y.js +0 -100
- package/dist/resources/Workers/chunk-G43QFN4Q.js +0 -157
- package/dist/resources/Workers/chunk-GATZHF3K.js +0 -1860
- package/dist/resources/Workers/chunk-GRC2ZTAF.js +0 -398
- package/dist/resources/Workers/chunk-HU6N6EXB.js +0 -767
- package/dist/resources/Workers/chunk-I46ZRR5W.js +0 -1052
- package/dist/resources/Workers/chunk-JURN7NPV.js +0 -1075
- package/dist/resources/Workers/chunk-KKCR2YOP.js +0 -421
- package/dist/resources/Workers/chunk-LPR3YNP2.js +0 -138
- package/dist/resources/Workers/chunk-M7ERACJJ.js +0 -511
- package/dist/resources/Workers/chunk-MDWEGWPA.js +0 -1007
- package/dist/resources/Workers/chunk-OGXZVPPM.js +0 -2365
- package/dist/resources/Workers/chunk-PGSJK77E.js +0 -634
- package/dist/resources/Workers/chunk-PPH7OFP3.js +0 -258
- package/dist/resources/Workers/chunk-SH5USDPI.js +0 -456
- package/dist/resources/Workers/chunk-SOWMRMWA.js +0 -629
- package/dist/resources/Workers/chunk-STW2DGFI.js +0 -58
- package/dist/resources/Workers/chunk-T3XIFPYR.js +0 -1477
- package/dist/resources/Workers/chunk-TTUZP4BO.js +0 -501
- package/dist/resources/Workers/chunk-UEXTBDBE.js +0 -693
- package/dist/resources/Workers/chunk-VOXYEYJT.js +0 -684
- package/dist/resources/Workers/chunk-X4356LRH.js +0 -368
- package/dist/resources/Workers/chunk-XGI5BXZY.js +0 -163
- package/dist/resources/Workers/chunk-Y2ME2IJV.js +0 -781
- package/dist/resources/Workers/chunk-Y5UQJLYE.js +0 -171
- package/dist/resources/Workers/chunk-YJEBABKH.js +0 -2977
- package/dist/resources/Workers/chunk-YWTJ2B4B.js +0 -77
- package/dist/resources/Workers/chunk-Z3TIFFGF.js +0 -430
- package/dist/resources/Workers/chunk-ZT7KWISZ.js +0 -102
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
-
* Version 1.
|
|
4
|
+
* Version 1.132
|
|
5
5
|
*
|
|
6
6
|
* Copyright 2011-2022 Cesium Contributors
|
|
7
7
|
*
|
|
@@ -23,357 +23,4 @@
|
|
|
23
23
|
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import {
|
|
27
|
-
BoundingRectangle_default
|
|
28
|
-
} from "./chunk-2A75IWRS.js";
|
|
29
|
-
import {
|
|
30
|
-
GeometryPipeline_default
|
|
31
|
-
} from "./chunk-EG6PTBY2.js";
|
|
32
|
-
import "./chunk-Z3TIFFGF.js";
|
|
33
|
-
import "./chunk-ZT7KWISZ.js";
|
|
34
|
-
import {
|
|
35
|
-
CornerType_default,
|
|
36
|
-
PolylineVolumeGeometryLibrary_default,
|
|
37
|
-
oneTimeWarning_default
|
|
38
|
-
} from "./chunk-UEXTBDBE.js";
|
|
39
|
-
import "./chunk-KKCR2YOP.js";
|
|
40
|
-
import "./chunk-F4HFJMGM.js";
|
|
41
|
-
import {
|
|
42
|
-
VertexFormat_default
|
|
43
|
-
} from "./chunk-2FWRMUTY.js";
|
|
44
|
-
import "./chunk-FNIRWHJB.js";
|
|
45
|
-
import "./chunk-G43QFN4Q.js";
|
|
46
|
-
import {
|
|
47
|
-
PolygonPipeline_default,
|
|
48
|
-
WindingOrder_default
|
|
49
|
-
} from "./chunk-MDWEGWPA.js";
|
|
50
|
-
import {
|
|
51
|
-
arrayRemoveDuplicates_default
|
|
52
|
-
} from "./chunk-FZRIVR7Y.js";
|
|
53
|
-
import "./chunk-SH5USDPI.js";
|
|
54
|
-
import "./chunk-2FRVPMCS.js";
|
|
55
|
-
import "./chunk-Y5UQJLYE.js";
|
|
56
|
-
import {
|
|
57
|
-
IndexDatatype_default
|
|
58
|
-
} from "./chunk-LPR3YNP2.js";
|
|
59
|
-
import {
|
|
60
|
-
GeometryAttributes_default
|
|
61
|
-
} from "./chunk-4H7PY4U5.js";
|
|
62
|
-
import {
|
|
63
|
-
GeometryAttribute_default,
|
|
64
|
-
Geometry_default,
|
|
65
|
-
PrimitiveType_default
|
|
66
|
-
} from "./chunk-7TC63SJW.js";
|
|
67
|
-
import {
|
|
68
|
-
BoundingSphere_default
|
|
69
|
-
} from "./chunk-FJKNFAKQ.js";
|
|
70
|
-
import "./chunk-TTUZP4BO.js";
|
|
71
|
-
import "./chunk-BG4UCVXN.js";
|
|
72
|
-
import "./chunk-YJEBABKH.js";
|
|
73
|
-
import {
|
|
74
|
-
ComponentDatatype_default
|
|
75
|
-
} from "./chunk-PPH7OFP3.js";
|
|
76
|
-
import {
|
|
77
|
-
Cartesian2_default,
|
|
78
|
-
Cartesian3_default,
|
|
79
|
-
Ellipsoid_default
|
|
80
|
-
} from "./chunk-OGXZVPPM.js";
|
|
81
|
-
import {
|
|
82
|
-
Math_default
|
|
83
|
-
} from "./chunk-5QULIR53.js";
|
|
84
|
-
import "./chunk-SOWMRMWA.js";
|
|
85
|
-
import "./chunk-STW2DGFI.js";
|
|
86
|
-
import {
|
|
87
|
-
defaultValue_default
|
|
88
|
-
} from "./chunk-BBWDMCVU.js";
|
|
89
|
-
import {
|
|
90
|
-
DeveloperError_default
|
|
91
|
-
} from "./chunk-XGI5BXZY.js";
|
|
92
|
-
import {
|
|
93
|
-
defined_default
|
|
94
|
-
} from "./chunk-YWTJ2B4B.js";
|
|
95
|
-
|
|
96
|
-
// packages/engine/Source/Core/PolylineVolumeGeometry.js
|
|
97
|
-
function computeAttributes(combinedPositions, shape, boundingRectangle, vertexFormat) {
|
|
98
|
-
const attributes = new GeometryAttributes_default();
|
|
99
|
-
if (vertexFormat.position) {
|
|
100
|
-
attributes.position = new GeometryAttribute_default({
|
|
101
|
-
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
102
|
-
componentsPerAttribute: 3,
|
|
103
|
-
values: combinedPositions
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
const shapeLength = shape.length;
|
|
107
|
-
const vertexCount = combinedPositions.length / 3;
|
|
108
|
-
const length = (vertexCount - shapeLength * 2) / (shapeLength * 2);
|
|
109
|
-
const firstEndIndices = PolygonPipeline_default.triangulate(shape);
|
|
110
|
-
const indicesCount = (length - 1) * shapeLength * 6 + firstEndIndices.length * 2;
|
|
111
|
-
const indices = IndexDatatype_default.createTypedArray(vertexCount, indicesCount);
|
|
112
|
-
let i, j;
|
|
113
|
-
let ll, ul, ur, lr;
|
|
114
|
-
const offset = shapeLength * 2;
|
|
115
|
-
let index = 0;
|
|
116
|
-
for (i = 0; i < length - 1; i++) {
|
|
117
|
-
for (j = 0; j < shapeLength - 1; j++) {
|
|
118
|
-
ll = j * 2 + i * shapeLength * 2;
|
|
119
|
-
lr = ll + offset;
|
|
120
|
-
ul = ll + 1;
|
|
121
|
-
ur = ul + offset;
|
|
122
|
-
indices[index++] = ul;
|
|
123
|
-
indices[index++] = ll;
|
|
124
|
-
indices[index++] = ur;
|
|
125
|
-
indices[index++] = ur;
|
|
126
|
-
indices[index++] = ll;
|
|
127
|
-
indices[index++] = lr;
|
|
128
|
-
}
|
|
129
|
-
ll = shapeLength * 2 - 2 + i * shapeLength * 2;
|
|
130
|
-
ul = ll + 1;
|
|
131
|
-
ur = ul + offset;
|
|
132
|
-
lr = ll + offset;
|
|
133
|
-
indices[index++] = ul;
|
|
134
|
-
indices[index++] = ll;
|
|
135
|
-
indices[index++] = ur;
|
|
136
|
-
indices[index++] = ur;
|
|
137
|
-
indices[index++] = ll;
|
|
138
|
-
indices[index++] = lr;
|
|
139
|
-
}
|
|
140
|
-
if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) {
|
|
141
|
-
const st = new Float32Array(vertexCount * 2);
|
|
142
|
-
const lengthSt = 1 / (length - 1);
|
|
143
|
-
const heightSt = 1 / boundingRectangle.height;
|
|
144
|
-
const heightOffset = boundingRectangle.height / 2;
|
|
145
|
-
let s, t;
|
|
146
|
-
let stindex = 0;
|
|
147
|
-
for (i = 0; i < length; i++) {
|
|
148
|
-
s = i * lengthSt;
|
|
149
|
-
t = heightSt * (shape[0].y + heightOffset);
|
|
150
|
-
st[stindex++] = s;
|
|
151
|
-
st[stindex++] = t;
|
|
152
|
-
for (j = 1; j < shapeLength; j++) {
|
|
153
|
-
t = heightSt * (shape[j].y + heightOffset);
|
|
154
|
-
st[stindex++] = s;
|
|
155
|
-
st[stindex++] = t;
|
|
156
|
-
st[stindex++] = s;
|
|
157
|
-
st[stindex++] = t;
|
|
158
|
-
}
|
|
159
|
-
t = heightSt * (shape[0].y + heightOffset);
|
|
160
|
-
st[stindex++] = s;
|
|
161
|
-
st[stindex++] = t;
|
|
162
|
-
}
|
|
163
|
-
for (j = 0; j < shapeLength; j++) {
|
|
164
|
-
s = 0;
|
|
165
|
-
t = heightSt * (shape[j].y + heightOffset);
|
|
166
|
-
st[stindex++] = s;
|
|
167
|
-
st[stindex++] = t;
|
|
168
|
-
}
|
|
169
|
-
for (j = 0; j < shapeLength; j++) {
|
|
170
|
-
s = (length - 1) * lengthSt;
|
|
171
|
-
t = heightSt * (shape[j].y + heightOffset);
|
|
172
|
-
st[stindex++] = s;
|
|
173
|
-
st[stindex++] = t;
|
|
174
|
-
}
|
|
175
|
-
attributes.st = new GeometryAttribute_default({
|
|
176
|
-
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
177
|
-
componentsPerAttribute: 2,
|
|
178
|
-
values: new Float32Array(st)
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
const endOffset = vertexCount - shapeLength * 2;
|
|
182
|
-
for (i = 0; i < firstEndIndices.length; i += 3) {
|
|
183
|
-
const v0 = firstEndIndices[i] + endOffset;
|
|
184
|
-
const v1 = firstEndIndices[i + 1] + endOffset;
|
|
185
|
-
const v2 = firstEndIndices[i + 2] + endOffset;
|
|
186
|
-
indices[index++] = v0;
|
|
187
|
-
indices[index++] = v1;
|
|
188
|
-
indices[index++] = v2;
|
|
189
|
-
indices[index++] = v2 + shapeLength;
|
|
190
|
-
indices[index++] = v1 + shapeLength;
|
|
191
|
-
indices[index++] = v0 + shapeLength;
|
|
192
|
-
}
|
|
193
|
-
let geometry = new Geometry_default({
|
|
194
|
-
attributes,
|
|
195
|
-
indices,
|
|
196
|
-
boundingSphere: BoundingSphere_default.fromVertices(combinedPositions),
|
|
197
|
-
primitiveType: PrimitiveType_default.TRIANGLES
|
|
198
|
-
});
|
|
199
|
-
if (vertexFormat.normal) {
|
|
200
|
-
geometry = GeometryPipeline_default.computeNormal(geometry);
|
|
201
|
-
}
|
|
202
|
-
if (vertexFormat.tangent || vertexFormat.bitangent) {
|
|
203
|
-
try {
|
|
204
|
-
geometry = GeometryPipeline_default.computeTangentAndBitangent(geometry);
|
|
205
|
-
} catch (e) {
|
|
206
|
-
oneTimeWarning_default(
|
|
207
|
-
"polyline-volume-tangent-bitangent",
|
|
208
|
-
"Unable to compute tangents and bitangents for polyline volume geometry"
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
if (!vertexFormat.tangent) {
|
|
212
|
-
geometry.attributes.tangent = void 0;
|
|
213
|
-
}
|
|
214
|
-
if (!vertexFormat.bitangent) {
|
|
215
|
-
geometry.attributes.bitangent = void 0;
|
|
216
|
-
}
|
|
217
|
-
if (!vertexFormat.st) {
|
|
218
|
-
geometry.attributes.st = void 0;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return geometry;
|
|
222
|
-
}
|
|
223
|
-
function PolylineVolumeGeometry(options) {
|
|
224
|
-
options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
|
|
225
|
-
const positions = options.polylinePositions;
|
|
226
|
-
const shape = options.shapePositions;
|
|
227
|
-
if (!defined_default(positions)) {
|
|
228
|
-
throw new DeveloperError_default("options.polylinePositions is required.");
|
|
229
|
-
}
|
|
230
|
-
if (!defined_default(shape)) {
|
|
231
|
-
throw new DeveloperError_default("options.shapePositions is required.");
|
|
232
|
-
}
|
|
233
|
-
this._positions = positions;
|
|
234
|
-
this._shape = shape;
|
|
235
|
-
this._ellipsoid = Ellipsoid_default.clone(
|
|
236
|
-
defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
|
|
237
|
-
);
|
|
238
|
-
this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
|
|
239
|
-
this._vertexFormat = VertexFormat_default.clone(
|
|
240
|
-
defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
|
|
241
|
-
);
|
|
242
|
-
this._granularity = defaultValue_default(
|
|
243
|
-
options.granularity,
|
|
244
|
-
Math_default.RADIANS_PER_DEGREE
|
|
245
|
-
);
|
|
246
|
-
this._workerName = "createPolylineVolumeGeometry";
|
|
247
|
-
let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
|
|
248
|
-
numComponents += 1 + shape.length * Cartesian2_default.packedLength;
|
|
249
|
-
this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 2;
|
|
250
|
-
}
|
|
251
|
-
PolylineVolumeGeometry.pack = function(value, array, startingIndex) {
|
|
252
|
-
if (!defined_default(value)) {
|
|
253
|
-
throw new DeveloperError_default("value is required");
|
|
254
|
-
}
|
|
255
|
-
if (!defined_default(array)) {
|
|
256
|
-
throw new DeveloperError_default("array is required");
|
|
257
|
-
}
|
|
258
|
-
startingIndex = defaultValue_default(startingIndex, 0);
|
|
259
|
-
let i;
|
|
260
|
-
const positions = value._positions;
|
|
261
|
-
let length = positions.length;
|
|
262
|
-
array[startingIndex++] = length;
|
|
263
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
|
|
264
|
-
Cartesian3_default.pack(positions[i], array, startingIndex);
|
|
265
|
-
}
|
|
266
|
-
const shape = value._shape;
|
|
267
|
-
length = shape.length;
|
|
268
|
-
array[startingIndex++] = length;
|
|
269
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian2_default.packedLength) {
|
|
270
|
-
Cartesian2_default.pack(shape[i], array, startingIndex);
|
|
271
|
-
}
|
|
272
|
-
Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
|
|
273
|
-
startingIndex += Ellipsoid_default.packedLength;
|
|
274
|
-
VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
|
|
275
|
-
startingIndex += VertexFormat_default.packedLength;
|
|
276
|
-
array[startingIndex++] = value._cornerType;
|
|
277
|
-
array[startingIndex] = value._granularity;
|
|
278
|
-
return array;
|
|
279
|
-
};
|
|
280
|
-
var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
|
|
281
|
-
var scratchVertexFormat = new VertexFormat_default();
|
|
282
|
-
var scratchOptions = {
|
|
283
|
-
polylinePositions: void 0,
|
|
284
|
-
shapePositions: void 0,
|
|
285
|
-
ellipsoid: scratchEllipsoid,
|
|
286
|
-
vertexFormat: scratchVertexFormat,
|
|
287
|
-
cornerType: void 0,
|
|
288
|
-
granularity: void 0
|
|
289
|
-
};
|
|
290
|
-
PolylineVolumeGeometry.unpack = function(array, startingIndex, result) {
|
|
291
|
-
if (!defined_default(array)) {
|
|
292
|
-
throw new DeveloperError_default("array is required");
|
|
293
|
-
}
|
|
294
|
-
startingIndex = defaultValue_default(startingIndex, 0);
|
|
295
|
-
let i;
|
|
296
|
-
let length = array[startingIndex++];
|
|
297
|
-
const positions = new Array(length);
|
|
298
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
|
|
299
|
-
positions[i] = Cartesian3_default.unpack(array, startingIndex);
|
|
300
|
-
}
|
|
301
|
-
length = array[startingIndex++];
|
|
302
|
-
const shape = new Array(length);
|
|
303
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian2_default.packedLength) {
|
|
304
|
-
shape[i] = Cartesian2_default.unpack(array, startingIndex);
|
|
305
|
-
}
|
|
306
|
-
const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
|
|
307
|
-
startingIndex += Ellipsoid_default.packedLength;
|
|
308
|
-
const vertexFormat = VertexFormat_default.unpack(
|
|
309
|
-
array,
|
|
310
|
-
startingIndex,
|
|
311
|
-
scratchVertexFormat
|
|
312
|
-
);
|
|
313
|
-
startingIndex += VertexFormat_default.packedLength;
|
|
314
|
-
const cornerType = array[startingIndex++];
|
|
315
|
-
const granularity = array[startingIndex];
|
|
316
|
-
if (!defined_default(result)) {
|
|
317
|
-
scratchOptions.polylinePositions = positions;
|
|
318
|
-
scratchOptions.shapePositions = shape;
|
|
319
|
-
scratchOptions.cornerType = cornerType;
|
|
320
|
-
scratchOptions.granularity = granularity;
|
|
321
|
-
return new PolylineVolumeGeometry(scratchOptions);
|
|
322
|
-
}
|
|
323
|
-
result._positions = positions;
|
|
324
|
-
result._shape = shape;
|
|
325
|
-
result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
|
|
326
|
-
result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
|
|
327
|
-
result._cornerType = cornerType;
|
|
328
|
-
result._granularity = granularity;
|
|
329
|
-
return result;
|
|
330
|
-
};
|
|
331
|
-
var brScratch = new BoundingRectangle_default();
|
|
332
|
-
PolylineVolumeGeometry.createGeometry = function(polylineVolumeGeometry) {
|
|
333
|
-
const positions = polylineVolumeGeometry._positions;
|
|
334
|
-
const cleanPositions = arrayRemoveDuplicates_default(
|
|
335
|
-
positions,
|
|
336
|
-
Cartesian3_default.equalsEpsilon
|
|
337
|
-
);
|
|
338
|
-
let shape2D = polylineVolumeGeometry._shape;
|
|
339
|
-
shape2D = PolylineVolumeGeometryLibrary_default.removeDuplicatesFromShape(shape2D);
|
|
340
|
-
if (cleanPositions.length < 2 || shape2D.length < 3) {
|
|
341
|
-
return void 0;
|
|
342
|
-
}
|
|
343
|
-
if (PolygonPipeline_default.computeWindingOrder2D(shape2D) === WindingOrder_default.CLOCKWISE) {
|
|
344
|
-
shape2D.reverse();
|
|
345
|
-
}
|
|
346
|
-
const boundingRectangle = BoundingRectangle_default.fromPoints(shape2D, brScratch);
|
|
347
|
-
const computedPositions = PolylineVolumeGeometryLibrary_default.computePositions(
|
|
348
|
-
cleanPositions,
|
|
349
|
-
shape2D,
|
|
350
|
-
boundingRectangle,
|
|
351
|
-
polylineVolumeGeometry,
|
|
352
|
-
true
|
|
353
|
-
);
|
|
354
|
-
return computeAttributes(
|
|
355
|
-
computedPositions,
|
|
356
|
-
shape2D,
|
|
357
|
-
boundingRectangle,
|
|
358
|
-
polylineVolumeGeometry._vertexFormat
|
|
359
|
-
);
|
|
360
|
-
};
|
|
361
|
-
var PolylineVolumeGeometry_default = PolylineVolumeGeometry;
|
|
362
|
-
|
|
363
|
-
// packages/engine/Source/Workers/createPolylineVolumeGeometry.js
|
|
364
|
-
function createPolylineVolumeGeometry(polylineVolumeGeometry, offset) {
|
|
365
|
-
if (defined_default(offset)) {
|
|
366
|
-
polylineVolumeGeometry = PolylineVolumeGeometry_default.unpack(
|
|
367
|
-
polylineVolumeGeometry,
|
|
368
|
-
offset
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
polylineVolumeGeometry._ellipsoid = Ellipsoid_default.clone(
|
|
372
|
-
polylineVolumeGeometry._ellipsoid
|
|
373
|
-
);
|
|
374
|
-
return PolylineVolumeGeometry_default.createGeometry(polylineVolumeGeometry);
|
|
375
|
-
}
|
|
376
|
-
var createPolylineVolumeGeometry_default = createPolylineVolumeGeometry;
|
|
377
|
-
export {
|
|
378
|
-
createPolylineVolumeGeometry_default as default
|
|
379
|
-
};
|
|
26
|
+
import{a as W}from"./chunk-WGGIH7QW.js";import{a as U}from"./chunk-VW6VD53G.js";import"./chunk-DEPHB2WM.js";import"./chunk-QOUAJ6TL.js";import{a as x,b as I,c as j}from"./chunk-B4AA3ARO.js";import"./chunk-XRL4AVS5.js";import"./chunk-U4IEOH5K.js";import{a as g}from"./chunk-CYCB63OH.js";import"./chunk-TCGIRNHN.js";import"./chunk-N4VJKXZS.js";import{a as $,b as M}from"./chunk-77IHZJJ3.js";import{a as Z}from"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as X}from"./chunk-OFUUQVMR.js";import{a as Q}from"./chunk-A56XVLQR.js";import{b as V,c as Y,d as B}from"./chunk-RCV6KWXS.js";import{d as K}from"./chunk-4IW2T6GF.js";import"./chunk-PSPPBZWI.js";import{a as N}from"./chunk-AU7IKHOH.js";import{a as E,c as D,d as f,f as J}from"./chunk-64RSHJUE.js";import{a as H}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a as A}from"./chunk-LEYMRMBK.js";import{e as _}from"./chunk-VTAIKJXX.js";function oe(t,e,n,o){let m=new Q;o.position&&(m.position=new B({componentDatatype:N.DOUBLE,componentsPerAttribute:3,values:t}));let i=e.length,u=t.length/3,w=(u-i*2)/(i*2),L=M.triangulate(e),R=(w-1)*i*6+L.length*2,r=X.createTypedArray(u,R),l,s,d,T,b,F,q=i*2,p=0;for(l=0;l<w-1;l++){for(s=0;s<i-1;s++)d=s*2+l*i*2,F=d+q,T=d+1,b=T+q,r[p++]=T,r[p++]=d,r[p++]=b,r[p++]=b,r[p++]=d,r[p++]=F;d=i*2-2+l*i*2,T=d+1,b=T+q,F=d+q,r[p++]=T,r[p++]=d,r[p++]=b,r[p++]=b,r[p++]=d,r[p++]=F}if(o.st||o.tangent||o.bitangent){let c=new Float32Array(u*2),C=1/(w-1),P=1/n.height,O=n.height/2,y,a,h=0;for(l=0;l<w;l++){for(y=l*C,a=P*(e[0].y+O),c[h++]=y,c[h++]=a,s=1;s<i;s++)a=P*(e[s].y+O),c[h++]=y,c[h++]=a,c[h++]=y,c[h++]=a;a=P*(e[0].y+O),c[h++]=y,c[h++]=a}for(s=0;s<i;s++)y=0,a=P*(e[s].y+O),c[h++]=y,c[h++]=a;for(s=0;s<i;s++)y=(w-1)*C,a=P*(e[s].y+O),c[h++]=y,c[h++]=a;m.st=new B({componentDatatype:N.FLOAT,componentsPerAttribute:2,values:new Float32Array(c)})}let G=u-i*2;for(l=0;l<L.length;l+=3){let c=L[l]+G,C=L[l+1]+G,P=L[l+2]+G;r[p++]=c,r[p++]=C,r[p++]=P,r[p++]=P+i,r[p++]=C+i,r[p++]=c+i}let k=new Y({attributes:m,indices:r,boundingSphere:K.fromVertices(t),primitiveType:V.TRIANGLES});if(o.normal&&(k=U.computeNormal(k)),o.tangent||o.bitangent){try{k=U.computeTangentAndBitangent(k)}catch{I("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}o.tangent||(k.attributes.tangent=void 0),o.bitangent||(k.attributes.bitangent=void 0),o.st||(k.attributes.st=void 0)}return k}function v(t){t=t??J.EMPTY_OBJECT;let e=t.polylinePositions,n=t.shapePositions;if(!_(e))throw new A("options.polylinePositions is required.");if(!_(n))throw new A("options.shapePositions is required.");this._positions=e,this._shape=n,this._ellipsoid=f.clone(t.ellipsoid??f.default),this._cornerType=t.cornerType??x.ROUNDED,this._vertexFormat=g.clone(t.vertexFormat??g.DEFAULT),this._granularity=t.granularity??H.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let o=1+e.length*E.packedLength;o+=1+n.length*D.packedLength,this.packedLength=o+f.packedLength+g.packedLength+2}v.pack=function(t,e,n){if(!_(t))throw new A("value is required");if(!_(e))throw new A("array is required");n=n??0;let o,m=t._positions,i=m.length;for(e[n++]=i,o=0;o<i;++o,n+=E.packedLength)E.pack(m[o],e,n);let u=t._shape;for(i=u.length,e[n++]=i,o=0;o<i;++o,n+=D.packedLength)D.pack(u[o],e,n);return f.pack(t._ellipsoid,e,n),n+=f.packedLength,g.pack(t._vertexFormat,e,n),n+=g.packedLength,e[n++]=t._cornerType,e[n]=t._granularity,e};var ee=f.clone(f.UNIT_SPHERE),te=new g,S={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ee,vertexFormat:te,cornerType:void 0,granularity:void 0};v.unpack=function(t,e,n){if(!_(t))throw new A("array is required");e=e??0;let o,m=t[e++],i=new Array(m);for(o=0;o<m;++o,e+=E.packedLength)i[o]=E.unpack(t,e);m=t[e++];let u=new Array(m);for(o=0;o<m;++o,e+=D.packedLength)u[o]=D.unpack(t,e);let w=f.unpack(t,e,ee);e+=f.packedLength;let L=g.unpack(t,e,te);e+=g.packedLength;let R=t[e++],r=t[e];return _(n)?(n._positions=i,n._shape=u,n._ellipsoid=f.clone(w,n._ellipsoid),n._vertexFormat=g.clone(L,n._vertexFormat),n._cornerType=R,n._granularity=r,n):(S.polylinePositions=i,S.shapePositions=u,S.cornerType=R,S.granularity=r,new v(S))};var ne=new W;v.createGeometry=function(t){let e=t._positions,n=Z(e,E.equalsEpsilon),o=t._shape;if(o=j.removeDuplicatesFromShape(o),n.length<2||o.length<3)return;M.computeWindingOrder2D(o)===$.CLOCKWISE&&o.reverse();let m=W.fromPoints(o,ne),i=j.computePositions(n,o,m,t,!0);return oe(i,o,m,t._vertexFormat)};var z=v;function ie(t,e){return _(e)&&(t=z.unpack(t,e)),t._ellipsoid=f.clone(t._ellipsoid),z.createGeometry(t)}var Re=ie;export{Re as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
-
* Version 1.
|
|
4
|
+
* Version 1.132
|
|
5
5
|
*
|
|
6
6
|
* Copyright 2011-2022 Cesium Contributors
|
|
7
7
|
*
|
|
@@ -23,255 +23,4 @@
|
|
|
23
23
|
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import {
|
|
27
|
-
BoundingRectangle_default
|
|
28
|
-
} from "./chunk-2A75IWRS.js";
|
|
29
|
-
import {
|
|
30
|
-
CornerType_default,
|
|
31
|
-
PolylineVolumeGeometryLibrary_default
|
|
32
|
-
} from "./chunk-UEXTBDBE.js";
|
|
33
|
-
import "./chunk-KKCR2YOP.js";
|
|
34
|
-
import "./chunk-F4HFJMGM.js";
|
|
35
|
-
import "./chunk-FNIRWHJB.js";
|
|
36
|
-
import "./chunk-G43QFN4Q.js";
|
|
37
|
-
import {
|
|
38
|
-
PolygonPipeline_default,
|
|
39
|
-
WindingOrder_default
|
|
40
|
-
} from "./chunk-MDWEGWPA.js";
|
|
41
|
-
import {
|
|
42
|
-
arrayRemoveDuplicates_default
|
|
43
|
-
} from "./chunk-FZRIVR7Y.js";
|
|
44
|
-
import "./chunk-SH5USDPI.js";
|
|
45
|
-
import "./chunk-2FRVPMCS.js";
|
|
46
|
-
import "./chunk-Y5UQJLYE.js";
|
|
47
|
-
import {
|
|
48
|
-
IndexDatatype_default
|
|
49
|
-
} from "./chunk-LPR3YNP2.js";
|
|
50
|
-
import {
|
|
51
|
-
GeometryAttributes_default
|
|
52
|
-
} from "./chunk-4H7PY4U5.js";
|
|
53
|
-
import {
|
|
54
|
-
GeometryAttribute_default,
|
|
55
|
-
Geometry_default,
|
|
56
|
-
PrimitiveType_default
|
|
57
|
-
} from "./chunk-7TC63SJW.js";
|
|
58
|
-
import {
|
|
59
|
-
BoundingSphere_default
|
|
60
|
-
} from "./chunk-FJKNFAKQ.js";
|
|
61
|
-
import "./chunk-TTUZP4BO.js";
|
|
62
|
-
import "./chunk-BG4UCVXN.js";
|
|
63
|
-
import "./chunk-YJEBABKH.js";
|
|
64
|
-
import {
|
|
65
|
-
ComponentDatatype_default
|
|
66
|
-
} from "./chunk-PPH7OFP3.js";
|
|
67
|
-
import {
|
|
68
|
-
Cartesian2_default,
|
|
69
|
-
Cartesian3_default,
|
|
70
|
-
Ellipsoid_default
|
|
71
|
-
} from "./chunk-OGXZVPPM.js";
|
|
72
|
-
import {
|
|
73
|
-
Math_default
|
|
74
|
-
} from "./chunk-5QULIR53.js";
|
|
75
|
-
import "./chunk-SOWMRMWA.js";
|
|
76
|
-
import "./chunk-STW2DGFI.js";
|
|
77
|
-
import {
|
|
78
|
-
defaultValue_default
|
|
79
|
-
} from "./chunk-BBWDMCVU.js";
|
|
80
|
-
import {
|
|
81
|
-
DeveloperError_default
|
|
82
|
-
} from "./chunk-XGI5BXZY.js";
|
|
83
|
-
import {
|
|
84
|
-
defined_default
|
|
85
|
-
} from "./chunk-YWTJ2B4B.js";
|
|
86
|
-
|
|
87
|
-
// packages/engine/Source/Core/PolylineVolumeOutlineGeometry.js
|
|
88
|
-
function computeAttributes(positions, shape) {
|
|
89
|
-
const attributes = new GeometryAttributes_default();
|
|
90
|
-
attributes.position = new GeometryAttribute_default({
|
|
91
|
-
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
92
|
-
componentsPerAttribute: 3,
|
|
93
|
-
values: positions
|
|
94
|
-
});
|
|
95
|
-
const shapeLength = shape.length;
|
|
96
|
-
const vertexCount = attributes.position.values.length / 3;
|
|
97
|
-
const positionLength = positions.length / 3;
|
|
98
|
-
const shapeCount = positionLength / shapeLength;
|
|
99
|
-
const indices = IndexDatatype_default.createTypedArray(
|
|
100
|
-
vertexCount,
|
|
101
|
-
2 * shapeLength * (shapeCount + 1)
|
|
102
|
-
);
|
|
103
|
-
let i, j;
|
|
104
|
-
let index = 0;
|
|
105
|
-
i = 0;
|
|
106
|
-
let offset = i * shapeLength;
|
|
107
|
-
for (j = 0; j < shapeLength - 1; j++) {
|
|
108
|
-
indices[index++] = j + offset;
|
|
109
|
-
indices[index++] = j + offset + 1;
|
|
110
|
-
}
|
|
111
|
-
indices[index++] = shapeLength - 1 + offset;
|
|
112
|
-
indices[index++] = offset;
|
|
113
|
-
i = shapeCount - 1;
|
|
114
|
-
offset = i * shapeLength;
|
|
115
|
-
for (j = 0; j < shapeLength - 1; j++) {
|
|
116
|
-
indices[index++] = j + offset;
|
|
117
|
-
indices[index++] = j + offset + 1;
|
|
118
|
-
}
|
|
119
|
-
indices[index++] = shapeLength - 1 + offset;
|
|
120
|
-
indices[index++] = offset;
|
|
121
|
-
for (i = 0; i < shapeCount - 1; i++) {
|
|
122
|
-
const firstOffset = shapeLength * i;
|
|
123
|
-
const secondOffset = firstOffset + shapeLength;
|
|
124
|
-
for (j = 0; j < shapeLength; j++) {
|
|
125
|
-
indices[index++] = j + firstOffset;
|
|
126
|
-
indices[index++] = j + secondOffset;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
const geometry = new Geometry_default({
|
|
130
|
-
attributes,
|
|
131
|
-
indices: IndexDatatype_default.createTypedArray(vertexCount, indices),
|
|
132
|
-
boundingSphere: BoundingSphere_default.fromVertices(positions),
|
|
133
|
-
primitiveType: PrimitiveType_default.LINES
|
|
134
|
-
});
|
|
135
|
-
return geometry;
|
|
136
|
-
}
|
|
137
|
-
function PolylineVolumeOutlineGeometry(options) {
|
|
138
|
-
options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
|
|
139
|
-
const positions = options.polylinePositions;
|
|
140
|
-
const shape = options.shapePositions;
|
|
141
|
-
if (!defined_default(positions)) {
|
|
142
|
-
throw new DeveloperError_default("options.polylinePositions is required.");
|
|
143
|
-
}
|
|
144
|
-
if (!defined_default(shape)) {
|
|
145
|
-
throw new DeveloperError_default("options.shapePositions is required.");
|
|
146
|
-
}
|
|
147
|
-
this._positions = positions;
|
|
148
|
-
this._shape = shape;
|
|
149
|
-
this._ellipsoid = Ellipsoid_default.clone(
|
|
150
|
-
defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
|
|
151
|
-
);
|
|
152
|
-
this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
|
|
153
|
-
this._granularity = defaultValue_default(
|
|
154
|
-
options.granularity,
|
|
155
|
-
Math_default.RADIANS_PER_DEGREE
|
|
156
|
-
);
|
|
157
|
-
this._workerName = "createPolylineVolumeOutlineGeometry";
|
|
158
|
-
let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
|
|
159
|
-
numComponents += 1 + shape.length * Cartesian2_default.packedLength;
|
|
160
|
-
this.packedLength = numComponents + Ellipsoid_default.packedLength + 2;
|
|
161
|
-
}
|
|
162
|
-
PolylineVolumeOutlineGeometry.pack = function(value, array, startingIndex) {
|
|
163
|
-
if (!defined_default(value)) {
|
|
164
|
-
throw new DeveloperError_default("value is required");
|
|
165
|
-
}
|
|
166
|
-
if (!defined_default(array)) {
|
|
167
|
-
throw new DeveloperError_default("array is required");
|
|
168
|
-
}
|
|
169
|
-
startingIndex = defaultValue_default(startingIndex, 0);
|
|
170
|
-
let i;
|
|
171
|
-
const positions = value._positions;
|
|
172
|
-
let length = positions.length;
|
|
173
|
-
array[startingIndex++] = length;
|
|
174
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
|
|
175
|
-
Cartesian3_default.pack(positions[i], array, startingIndex);
|
|
176
|
-
}
|
|
177
|
-
const shape = value._shape;
|
|
178
|
-
length = shape.length;
|
|
179
|
-
array[startingIndex++] = length;
|
|
180
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian2_default.packedLength) {
|
|
181
|
-
Cartesian2_default.pack(shape[i], array, startingIndex);
|
|
182
|
-
}
|
|
183
|
-
Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
|
|
184
|
-
startingIndex += Ellipsoid_default.packedLength;
|
|
185
|
-
array[startingIndex++] = value._cornerType;
|
|
186
|
-
array[startingIndex] = value._granularity;
|
|
187
|
-
return array;
|
|
188
|
-
};
|
|
189
|
-
var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
|
|
190
|
-
var scratchOptions = {
|
|
191
|
-
polylinePositions: void 0,
|
|
192
|
-
shapePositions: void 0,
|
|
193
|
-
ellipsoid: scratchEllipsoid,
|
|
194
|
-
height: void 0,
|
|
195
|
-
cornerType: void 0,
|
|
196
|
-
granularity: void 0
|
|
197
|
-
};
|
|
198
|
-
PolylineVolumeOutlineGeometry.unpack = function(array, startingIndex, result) {
|
|
199
|
-
if (!defined_default(array)) {
|
|
200
|
-
throw new DeveloperError_default("array is required");
|
|
201
|
-
}
|
|
202
|
-
startingIndex = defaultValue_default(startingIndex, 0);
|
|
203
|
-
let i;
|
|
204
|
-
let length = array[startingIndex++];
|
|
205
|
-
const positions = new Array(length);
|
|
206
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
|
|
207
|
-
positions[i] = Cartesian3_default.unpack(array, startingIndex);
|
|
208
|
-
}
|
|
209
|
-
length = array[startingIndex++];
|
|
210
|
-
const shape = new Array(length);
|
|
211
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian2_default.packedLength) {
|
|
212
|
-
shape[i] = Cartesian2_default.unpack(array, startingIndex);
|
|
213
|
-
}
|
|
214
|
-
const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
|
|
215
|
-
startingIndex += Ellipsoid_default.packedLength;
|
|
216
|
-
const cornerType = array[startingIndex++];
|
|
217
|
-
const granularity = array[startingIndex];
|
|
218
|
-
if (!defined_default(result)) {
|
|
219
|
-
scratchOptions.polylinePositions = positions;
|
|
220
|
-
scratchOptions.shapePositions = shape;
|
|
221
|
-
scratchOptions.cornerType = cornerType;
|
|
222
|
-
scratchOptions.granularity = granularity;
|
|
223
|
-
return new PolylineVolumeOutlineGeometry(scratchOptions);
|
|
224
|
-
}
|
|
225
|
-
result._positions = positions;
|
|
226
|
-
result._shape = shape;
|
|
227
|
-
result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
|
|
228
|
-
result._cornerType = cornerType;
|
|
229
|
-
result._granularity = granularity;
|
|
230
|
-
return result;
|
|
231
|
-
};
|
|
232
|
-
var brScratch = new BoundingRectangle_default();
|
|
233
|
-
PolylineVolumeOutlineGeometry.createGeometry = function(polylineVolumeOutlineGeometry) {
|
|
234
|
-
const positions = polylineVolumeOutlineGeometry._positions;
|
|
235
|
-
const cleanPositions = arrayRemoveDuplicates_default(
|
|
236
|
-
positions,
|
|
237
|
-
Cartesian3_default.equalsEpsilon
|
|
238
|
-
);
|
|
239
|
-
let shape2D = polylineVolumeOutlineGeometry._shape;
|
|
240
|
-
shape2D = PolylineVolumeGeometryLibrary_default.removeDuplicatesFromShape(shape2D);
|
|
241
|
-
if (cleanPositions.length < 2 || shape2D.length < 3) {
|
|
242
|
-
return void 0;
|
|
243
|
-
}
|
|
244
|
-
if (PolygonPipeline_default.computeWindingOrder2D(shape2D) === WindingOrder_default.CLOCKWISE) {
|
|
245
|
-
shape2D.reverse();
|
|
246
|
-
}
|
|
247
|
-
const boundingRectangle = BoundingRectangle_default.fromPoints(shape2D, brScratch);
|
|
248
|
-
const computedPositions = PolylineVolumeGeometryLibrary_default.computePositions(
|
|
249
|
-
cleanPositions,
|
|
250
|
-
shape2D,
|
|
251
|
-
boundingRectangle,
|
|
252
|
-
polylineVolumeOutlineGeometry,
|
|
253
|
-
false
|
|
254
|
-
);
|
|
255
|
-
return computeAttributes(computedPositions, shape2D);
|
|
256
|
-
};
|
|
257
|
-
var PolylineVolumeOutlineGeometry_default = PolylineVolumeOutlineGeometry;
|
|
258
|
-
|
|
259
|
-
// packages/engine/Source/Workers/createPolylineVolumeOutlineGeometry.js
|
|
260
|
-
function createPolylineVolumeOutlineGeometry(polylineVolumeOutlineGeometry, offset) {
|
|
261
|
-
if (defined_default(offset)) {
|
|
262
|
-
polylineVolumeOutlineGeometry = PolylineVolumeOutlineGeometry_default.unpack(
|
|
263
|
-
polylineVolumeOutlineGeometry,
|
|
264
|
-
offset
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
polylineVolumeOutlineGeometry._ellipsoid = Ellipsoid_default.clone(
|
|
268
|
-
polylineVolumeOutlineGeometry._ellipsoid
|
|
269
|
-
);
|
|
270
|
-
return PolylineVolumeOutlineGeometry_default.createGeometry(
|
|
271
|
-
polylineVolumeOutlineGeometry
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
var createPolylineVolumeOutlineGeometry_default = createPolylineVolumeOutlineGeometry;
|
|
275
|
-
export {
|
|
276
|
-
createPolylineVolumeOutlineGeometry_default as default
|
|
277
|
-
};
|
|
26
|
+
import{a as k}from"./chunk-WGGIH7QW.js";import{a as N,c as w}from"./chunk-B4AA3ARO.js";import"./chunk-XRL4AVS5.js";import"./chunk-U4IEOH5K.js";import"./chunk-TCGIRNHN.js";import"./chunk-N4VJKXZS.js";import{a as v,b as G}from"./chunk-77IHZJJ3.js";import{a as q}from"./chunk-3W4GT7KQ.js";import"./chunk-G5AGHVVC.js";import"./chunk-DMEY62ID.js";import"./chunk-HTFSEEMT.js";import{a as g}from"./chunk-OFUUQVMR.js";import{a as O}from"./chunk-A56XVLQR.js";import{b as A,c as R,d as S}from"./chunk-RCV6KWXS.js";import{d as C}from"./chunk-4IW2T6GF.js";import"./chunk-PSPPBZWI.js";import{a as b}from"./chunk-AU7IKHOH.js";import{a as d,c as y,d as s,f as D}from"./chunk-64RSHJUE.js";import{a as T}from"./chunk-3SSKC3VN.js";import"./chunk-OSW76XDF.js";import"./chunk-ED5JPB3S.js";import{a}from"./chunk-LEYMRMBK.js";import{e as u}from"./chunk-VTAIKJXX.js";function W(o,i){let t=new O;t.position=new S({componentDatatype:b.DOUBLE,componentsPerAttribute:3,values:o});let e=i.length,r=t.position.values.length/3,f=o.length/3/e,p=g.createTypedArray(r,2*e*(f+1)),m,n,l=0;m=0;let h=m*e;for(n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=f-1,h=m*e,n=0;n<e-1;n++)p[l++]=n+h,p[l++]=n+h+1;for(p[l++]=e-1+h,p[l++]=h,m=0;m<f-1;m++){let L=e*m,U=L+e;for(n=0;n<e;n++)p[l++]=n+L,p[l++]=n+U}return new R({attributes:t,indices:g.createTypedArray(r,p),boundingSphere:C.fromVertices(o),primitiveType:A.LINES})}function P(o){o=o??D.EMPTY_OBJECT;let i=o.polylinePositions,t=o.shapePositions;if(!u(i))throw new a("options.polylinePositions is required.");if(!u(t))throw new a("options.shapePositions is required.");this._positions=i,this._shape=t,this._ellipsoid=s.clone(o.ellipsoid??s.default),this._cornerType=o.cornerType??N.ROUNDED,this._granularity=o.granularity??T.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let e=1+i.length*d.packedLength;e+=1+t.length*y.packedLength,this.packedLength=e+s.packedLength+2}P.pack=function(o,i,t){if(!u(o))throw new a("value is required");if(!u(i))throw new a("array is required");t=t??0;let e,r=o._positions,c=r.length;for(i[t++]=c,e=0;e<c;++e,t+=d.packedLength)d.pack(r[e],i,t);let f=o._shape;for(c=f.length,i[t++]=c,e=0;e<c;++e,t+=y.packedLength)y.pack(f[e],i,t);return s.pack(o._ellipsoid,i,t),t+=s.packedLength,i[t++]=o._cornerType,i[t]=o._granularity,i};var B=s.clone(s.UNIT_SPHERE),_={polylinePositions:void 0,shapePositions:void 0,ellipsoid:B,height:void 0,cornerType:void 0,granularity:void 0};P.unpack=function(o,i,t){if(!u(o))throw new a("array is required");i=i??0;let e,r=o[i++],c=new Array(r);for(e=0;e<r;++e,i+=d.packedLength)c[e]=d.unpack(o,i);r=o[i++];let f=new Array(r);for(e=0;e<r;++e,i+=y.packedLength)f[e]=y.unpack(o,i);let p=s.unpack(o,i,B);i+=s.packedLength;let m=o[i++],n=o[i];return u(t)?(t._positions=c,t._shape=f,t._ellipsoid=s.clone(p,t._ellipsoid),t._cornerType=m,t._granularity=n,t):(_.polylinePositions=c,_.shapePositions=f,_.cornerType=m,_.granularity=n,new P(_))};var F=new k;P.createGeometry=function(o){let i=o._positions,t=q(i,d.equalsEpsilon),e=o._shape;if(e=w.removeDuplicatesFromShape(e),t.length<2||e.length<3)return;G.computeWindingOrder2D(e)===v.CLOCKWISE&&e.reverse();let r=k.fromPoints(e,F),c=w.computePositions(t,e,r,o,!1);return W(c,e)};var E=P;function M(o,i){return u(i)&&(o=E.unpack(o,i)),o._ellipsoid=s.clone(o._ellipsoid),E.createGeometry(o)}var he=M;export{he as default};
|