@cesium/engine 3.0.1 → 4.0.0
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/Build/ThirdParty/Workers/pako_deflate.min.js +605 -0
- package/Build/ThirdParty/Workers/pako_inflate.min.js +800 -0
- package/Build/ThirdParty/Workers/z-worker-pako.js +502 -0
- package/Build/Workers/chunk-27R2KRIK.js +634 -0
- package/Build/Workers/chunk-2C65EKYA.js +55 -0
- package/Build/Workers/chunk-2NLMZNJI.js +138 -0
- package/Build/Workers/chunk-4V6RCTVH.js +289 -0
- package/Build/Workers/chunk-4VWUFKYW.js +368 -0
- package/Build/Workers/chunk-527JG4D7.js +629 -0
- package/Build/Workers/chunk-5U4UHRZ2.js +8644 -0
- package/Build/Workers/chunk-7CZEWQWE.js +353 -0
- package/Build/Workers/chunk-7IMAWM6A.js +842 -0
- package/Build/Workers/{package.js → chunk-A6EA6KIE.js} +13 -2
- package/Build/Workers/chunk-AXGQUPXA.js +1075 -0
- package/Build/Workers/chunk-BT6YIL2N.js +39 -0
- package/Build/Workers/chunk-C6MRR5YL.js +476 -0
- package/Build/Workers/chunk-DJUTBX6A.js +1860 -0
- package/Build/Workers/chunk-EQ6ZAP37.js +218 -0
- package/Build/Workers/chunk-F7P2HCYZ.js +73 -0
- package/Build/Workers/chunk-FE2XG3SS.js +73 -0
- package/Build/Workers/chunk-FKHRSGKP.js +781 -0
- package/Build/Workers/chunk-FVDTKX3F.js +58 -0
- package/Build/Workers/chunk-FYHCAKU6.js +684 -0
- package/Build/Workers/chunk-G3MOT7BZ.js +157 -0
- package/Build/Workers/chunk-H52L6U76.js +421 -0
- package/Build/Workers/chunk-H6MBQ4W4.js +305 -0
- package/Build/Workers/chunk-HCZR75II.js +2716 -0
- package/Build/Workers/chunk-I5MQWHBR.js +102 -0
- package/Build/Workers/chunk-KAFF2QX3.js +258 -0
- package/Build/Workers/chunk-LGSGX2RH.js +757 -0
- package/Build/Workers/chunk-LQRFWCNX.js +124 -0
- package/Build/Workers/chunk-N5MMDSD2.js +44 -0
- package/Build/Workers/chunk-NRETMGYL.js +390 -0
- package/Build/Workers/chunk-P4M4QUNQ.js +196 -0
- package/Build/Workers/chunk-P7PWX5HR.js +430 -0
- package/Build/Workers/chunk-PGB3EFR7.js +171 -0
- package/Build/Workers/chunk-PW5CA4MJ.js +3273 -0
- package/Build/Workers/chunk-PWDYKCNC.js +501 -0
- package/Build/Workers/chunk-QIS3NB7U.js +1258 -0
- package/Build/Workers/chunk-QVJ6IRKV.js +77 -0
- package/Build/Workers/chunk-RDCDRNJ7.js +117 -0
- package/Build/Workers/chunk-RDM3BKNC.js +1009 -0
- package/Build/Workers/chunk-RRUPTJ6P.js +452 -0
- package/Build/Workers/chunk-SGRWJKNO.js +400 -0
- package/Build/Workers/chunk-TF5D2H7B.js +138 -0
- package/Build/Workers/chunk-TVYIHH4V.js +513 -0
- package/Build/Workers/chunk-U5LKG6LX.js +101 -0
- package/Build/Workers/chunk-UGZGTV5K.js +302 -0
- package/Build/Workers/chunk-UN7AK64D.js +163 -0
- package/Build/Workers/chunk-V2LKNJGT.js +59 -0
- package/Build/Workers/chunk-VSCXSFHE.js +1477 -0
- package/Build/Workers/chunk-XJCTFTBM.js +2041 -0
- package/Build/Workers/chunk-XZVQMPWG.js +100 -0
- package/Build/Workers/chunk-YLAFWVOW.js +834 -0
- package/Build/Workers/chunk-YLS3FX3U.js +236 -0
- package/Build/Workers/chunk-YMJPANZZ.js +693 -0
- package/Build/Workers/combineGeometry.js +65 -15
- package/Build/Workers/createBoxGeometry.js +55 -10
- package/Build/Workers/createBoxOutlineGeometry.js +231 -310
- package/Build/Workers/createCircleGeometry.js +185 -202
- package/Build/Workers/createCircleOutlineGeometry.js +141 -155
- package/Build/Workers/createCoplanarPolygonGeometry.js +477 -557
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
- package/Build/Workers/createCorridorGeometry.js +1162 -1307
- package/Build/Workers/createCorridorOutlineGeometry.js +533 -569
- package/Build/Workers/createCylinderGeometry.js +57 -10
- package/Build/Workers/createCylinderOutlineGeometry.js +224 -258
- package/Build/Workers/createEllipseGeometry.js +68 -12
- package/Build/Workers/createEllipseOutlineGeometry.js +61 -12
- package/Build/Workers/createEllipsoidGeometry.js +56 -10
- package/Build/Workers/createEllipsoidOutlineGeometry.js +58 -13
- package/Build/Workers/createFrustumGeometry.js +55 -10
- package/Build/Workers/createFrustumOutlineGeometry.js +226 -243
- package/Build/Workers/createGeometry.js +143 -48
- package/Build/Workers/createGroundPolylineGeometry.js +1484 -2011
- package/Build/Workers/createPlaneGeometry.js +216 -243
- package/Build/Workers/createPlaneOutlineGeometry.js +121 -113
- package/Build/Workers/createPolygonGeometry.js +1041 -1327
- package/Build/Workers/createPolygonOutlineGeometry.js +516 -657
- package/Build/Workers/createPolylineGeometry.js +471 -547
- package/Build/Workers/createPolylineVolumeGeometry.js +352 -384
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +271 -295
- package/Build/Workers/createRectangleGeometry.js +1128 -1331
- package/Build/Workers/createRectangleOutlineGeometry.js +445 -500
- package/Build/Workers/createSimplePolylineGeometry.js +381 -440
- package/Build/Workers/createSphereGeometry.js +112 -118
- package/Build/Workers/createSphereOutlineGeometry.js +112 -121
- package/Build/Workers/createTaskProcessorWorker.js +32 -127
- package/Build/Workers/createVectorTileClampedPolylines.js +462 -505
- package/Build/Workers/createVectorTileGeometries.js +377 -436
- package/Build/Workers/createVectorTilePoints.js +110 -77
- package/Build/Workers/createVectorTilePolygons.js +369 -391
- package/Build/Workers/createVectorTilePolylines.js +252 -244
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
- package/Build/Workers/createVerticesFromHeightmap.js +2244 -2677
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -904
- package/Build/Workers/createWallGeometry.js +459 -593
- package/Build/Workers/createWallOutlineGeometry.js +324 -419
- package/Build/Workers/decodeDraco.js +327 -347
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
- package/Build/Workers/decodeI3S.js +765 -970
- package/Build/Workers/transcodeKTX2.js +3353 -1464
- package/Build/Workers/transferTypedArrayTest.js +3 -4
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +748 -953
- package/LICENSE.md +0 -12
- package/Source/Core/FeatureDetection.js +9 -0
- package/Source/Core/GoogleMaps.js +1 -1
- package/Source/Core/GroundPolylineGeometry.js +3 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/KTX2Transcoder.js +7 -3
- package/Source/Core/RequestScheduler.js +1 -0
- package/Source/Core/TaskProcessor.js +150 -146
- package/Source/Core/Transforms.js +2 -2
- package/Source/Core/buildModuleUrl.js +6 -5
- package/Source/DataSources/CzmlDataSource.js +6 -4
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/DracoLoader.js +26 -3
- package/Source/Scene/GltfLoaderUtil.js +1 -7
- package/Source/Scene/I3SDataProvider.js +0 -27
- package/Source/Scene/I3SDecoder.js +127 -0
- package/Source/Scene/I3SNode.js +32 -110
- package/Source/Scene/ImageryLayer.js +2 -2
- package/Source/Scene/Implicit3DTileContent.js +13 -0
- package/Source/Scene/ImplicitTileset.js +5 -0
- package/Source/Scene/Model/I3dmLoader.js +5 -1
- package/Source/Scene/Model/Model.js +4 -1
- package/Source/Scene/OpenStreetMapImageryProvider.js +7 -4
- package/Source/Scene/SingleTileImageryProvider.js +4 -2
- package/Source/ThirdParty/Workers/basis_transcoder.js +1 -1
- package/Source/{WorkersES6 → Workers}/createGeometry.js +11 -12
- package/Source/{WorkersES6 → Workers}/createTaskProcessorWorker.js +43 -59
- package/Source/{WorkersES6 → Workers}/decodeDraco.js +19 -25
- package/Source/{WorkersES6 → Workers}/decodeI3S.js +18 -32
- package/Source/{WorkersES6 → Workers}/transcodeKTX2.js +19 -26
- package/Source/Workers/transferTypedArrayTest.js +0 -6
- package/index.d.ts +20 -11
- package/index.js +170 -169
- package/package.json +3 -2
- package/Build/Workers/ArcType-2d9abbbc.js +0 -37
- package/Build/Workers/AttributeCompression-f9f6c717.js +0 -716
- package/Build/Workers/AxisAlignedBoundingBox-4bfd84f3.js +0 -258
- package/Build/Workers/BoundingRectangle-5fd6403a.js +0 -369
- package/Build/Workers/BoxGeometry-7aa4ce7f.js +0 -884
- package/Build/Workers/Check-6ede7e26.js +0 -290
- package/Build/Workers/Color-8e135f71.js +0 -2262
- package/Build/Workers/ComponentDatatype-cf1fa08e.js +0 -341
- package/Build/Workers/CoplanarPolygonGeometryLibrary-59c69b0a.js +0 -132
- package/Build/Workers/CorridorGeometryLibrary-63907365.js +0 -498
- package/Build/Workers/CylinderGeometry-8fc7c44b.js +0 -467
- package/Build/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
- package/Build/Workers/EllipseGeometry-16b3736a.js +0 -1304
- package/Build/Workers/EllipseGeometryLibrary-21262a28.js +0 -366
- package/Build/Workers/EllipseOutlineGeometry-05d35d18.js +0 -443
- package/Build/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
- package/Build/Workers/EllipsoidGeometry-a503d1d6.js +0 -637
- package/Build/Workers/EllipsoidOutlineGeometry-7b09f24d.js +0 -454
- package/Build/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
- package/Build/Workers/EllipsoidTangentPlane-546c0d5e.js +0 -373
- package/Build/Workers/EncodedCartesian3-57415c8a.js +0 -171
- package/Build/Workers/FrustumGeometry-87ce8622.js +0 -2540
- package/Build/Workers/GeometryAttribute-8fcff0d5.js +0 -619
- package/Build/Workers/GeometryAttributes-ad136444.js +0 -91
- package/Build/Workers/GeometryInstance-34d9e21e.js +0 -121
- package/Build/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
- package/Build/Workers/GeometryPipeline-70d69a43.js +0 -3690
- package/Build/Workers/IndexDatatype-2643aa47.js +0 -200
- package/Build/Workers/IntersectionTests-85350792.js +0 -1836
- package/Build/Workers/Math-0a2ac845.js +0 -1340
- package/Build/Workers/Matrix2-e1298525.js +0 -7086
- package/Build/Workers/Matrix3-41c58dde.js +0 -4283
- package/Build/Workers/OrientedBoundingBox-29fb0fcd.js +0 -1259
- package/Build/Workers/Plane-4c3d403b.js +0 -309
- package/Build/Workers/PolygonGeometryLibrary-bad6329a.js +0 -1074
- package/Build/Workers/PolygonPipeline-dd13ee78.js +0 -1344
- package/Build/Workers/PolylinePipeline-7119eb3f.js +0 -573
- package/Build/Workers/PolylineVolumeGeometryLibrary-d25f0050.js +0 -781
- package/Build/Workers/PrimitivePipeline-111ee29f.js +0 -966
- package/Build/Workers/RectangleGeometryLibrary-bb378fb6.js +0 -280
- package/Build/Workers/RuntimeError-ef395448.js +0 -68
- package/Build/Workers/TerrainEncoding-c8e029a2.js +0 -1227
- package/Build/Workers/Transforms-e2d4a55a.js +0 -14713
- package/Build/Workers/VertexFormat-030f11ff.js +0 -312
- package/Build/Workers/WallGeometryLibrary-3e0819ec.js +0 -211
- package/Build/Workers/WebGLConstants-0b1ce7ba.js +0 -620
- package/Build/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
- package/Build/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
- package/Build/Workers/cesiumWorkerBootstrapper.js +0 -1363
- package/Build/Workers/combine-d9581036.js +0 -82
- package/Build/Workers/defaultValue-fe22d8c0.js +0 -51
- package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
- package/Source/Workers/cesiumWorkerBootstrapper.js +0 -2290
- package/Source/Workers/package.json +0 -1
- /package/Source/{WorkersES6 → Workers}/combineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createBoxGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createBoxOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCircleGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCircleOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCorridorGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCorridorOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCylinderGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCylinderOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipseGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipseOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipsoidGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipsoidOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createFrustumGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createFrustumOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createGroundPolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPlaneGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPlaneOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolygonGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolygonOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineVolumeGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineVolumeOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createRectangleGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createRectangleOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSimplePolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSphereGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSphereOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTileClampedPolylines.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTileGeometries.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePoints.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePolygons.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePolylines.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromHeightmap.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromQuantizedTerrainMesh.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createWallGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createWallOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/decodeGoogleEarthEnterprisePacket.js +0 -0
- /package/Source/{WorkersES6 → Workers}/upsampleQuantizedTerrainMesh.js +0 -0
|
@@ -1,781 +0,0 @@
|
|
|
1
|
-
define(['exports', './Matrix2-e1298525', './Matrix3-41c58dde', './EllipsoidTangentPlane-546c0d5e', './Math-0a2ac845', './PolylinePipeline-7119eb3f', './Transforms-e2d4a55a', './defaultValue-fe22d8c0', './Check-6ede7e26'], (function (exports, Matrix2, Matrix3, EllipsoidTangentPlane, Math$1, PolylinePipeline, Transforms, defaultValue, Check) { 'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Style options for corners.
|
|
5
|
-
*
|
|
6
|
-
* @demo The {@link https://sandcastle.cesium.com/index.html?src=Corridor.html&label=Geometries|Corridor Demo}
|
|
7
|
-
* demonstrates the three corner types, as used by {@link CorridorGraphics}.
|
|
8
|
-
*
|
|
9
|
-
* @enum {number}
|
|
10
|
-
*/
|
|
11
|
-
const CornerType = {
|
|
12
|
-
/**
|
|
13
|
-
* <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" />
|
|
14
|
-
*
|
|
15
|
-
* Corner has a smooth edge.
|
|
16
|
-
* @type {number}
|
|
17
|
-
* @constant
|
|
18
|
-
*/
|
|
19
|
-
ROUNDED: 0,
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" />
|
|
23
|
-
*
|
|
24
|
-
* Corner point is the intersection of adjacent edges.
|
|
25
|
-
* @type {number}
|
|
26
|
-
* @constant
|
|
27
|
-
*/
|
|
28
|
-
MITERED: 1,
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" />
|
|
32
|
-
*
|
|
33
|
-
* Corner is clipped.
|
|
34
|
-
* @type {number}
|
|
35
|
-
* @constant
|
|
36
|
-
*/
|
|
37
|
-
BEVELED: 2,
|
|
38
|
-
};
|
|
39
|
-
var CornerType$1 = Object.freeze(CornerType);
|
|
40
|
-
|
|
41
|
-
const warnings = {};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Logs a one time message to the console. Use this function instead of
|
|
45
|
-
* <code>console.log</code> directly since this does not log duplicate messages
|
|
46
|
-
* unless it is called from multiple workers.
|
|
47
|
-
*
|
|
48
|
-
* @function oneTimeWarning
|
|
49
|
-
*
|
|
50
|
-
* @param {string} identifier The unique identifier for this warning.
|
|
51
|
-
* @param {string} [message=identifier] The message to log to the console.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* for(let i=0;i<foo.length;++i) {
|
|
55
|
-
* if (!defined(foo[i].bar)) {
|
|
56
|
-
* // Something that can be recovered from but may happen a lot
|
|
57
|
-
* oneTimeWarning('foo.bar undefined', 'foo.bar is undefined. Setting to 0.');
|
|
58
|
-
* foo[i].bar = 0;
|
|
59
|
-
* // ...
|
|
60
|
-
* }
|
|
61
|
-
* }
|
|
62
|
-
*
|
|
63
|
-
* @private
|
|
64
|
-
*/
|
|
65
|
-
function oneTimeWarning(identifier, message) {
|
|
66
|
-
//>>includeStart('debug', pragmas.debug);
|
|
67
|
-
if (!defaultValue.defined(identifier)) {
|
|
68
|
-
throw new Check.DeveloperError("identifier is required.");
|
|
69
|
-
}
|
|
70
|
-
//>>includeEnd('debug');
|
|
71
|
-
|
|
72
|
-
if (!defaultValue.defined(warnings[identifier])) {
|
|
73
|
-
warnings[identifier] = true;
|
|
74
|
-
console.warn(defaultValue.defaultValue(message, identifier));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
oneTimeWarning.geometryOutlines =
|
|
79
|
-
"Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";
|
|
80
|
-
|
|
81
|
-
oneTimeWarning.geometryZIndex =
|
|
82
|
-
"Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";
|
|
83
|
-
|
|
84
|
-
oneTimeWarning.geometryHeightReference =
|
|
85
|
-
"Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";
|
|
86
|
-
oneTimeWarning.geometryExtrudedHeightReference =
|
|
87
|
-
"Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";
|
|
88
|
-
|
|
89
|
-
const scratch2Array = [new Matrix3.Cartesian3(), new Matrix3.Cartesian3()];
|
|
90
|
-
const scratchCartesian1 = new Matrix3.Cartesian3();
|
|
91
|
-
const scratchCartesian2 = new Matrix3.Cartesian3();
|
|
92
|
-
const scratchCartesian3 = new Matrix3.Cartesian3();
|
|
93
|
-
const scratchCartesian4 = new Matrix3.Cartesian3();
|
|
94
|
-
const scratchCartesian5 = new Matrix3.Cartesian3();
|
|
95
|
-
const scratchCartesian6 = new Matrix3.Cartesian3();
|
|
96
|
-
const scratchCartesian7 = new Matrix3.Cartesian3();
|
|
97
|
-
const scratchCartesian8 = new Matrix3.Cartesian3();
|
|
98
|
-
const scratchCartesian9 = new Matrix3.Cartesian3();
|
|
99
|
-
|
|
100
|
-
const scratch1 = new Matrix3.Cartesian3();
|
|
101
|
-
const scratch2 = new Matrix3.Cartesian3();
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @private
|
|
105
|
-
*/
|
|
106
|
-
const PolylineVolumeGeometryLibrary = {};
|
|
107
|
-
|
|
108
|
-
let cartographic = new Matrix3.Cartographic();
|
|
109
|
-
function scaleToSurface(positions, ellipsoid) {
|
|
110
|
-
const heights = new Array(positions.length);
|
|
111
|
-
for (let i = 0; i < positions.length; i++) {
|
|
112
|
-
const pos = positions[i];
|
|
113
|
-
cartographic = ellipsoid.cartesianToCartographic(pos, cartographic);
|
|
114
|
-
heights[i] = cartographic.height;
|
|
115
|
-
positions[i] = ellipsoid.scaleToGeodeticSurface(pos, pos);
|
|
116
|
-
}
|
|
117
|
-
return heights;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function subdivideHeights(points, h0, h1, granularity) {
|
|
121
|
-
const p0 = points[0];
|
|
122
|
-
const p1 = points[1];
|
|
123
|
-
const angleBetween = Matrix3.Cartesian3.angleBetween(p0, p1);
|
|
124
|
-
const numPoints = Math.ceil(angleBetween / granularity);
|
|
125
|
-
const heights = new Array(numPoints);
|
|
126
|
-
let i;
|
|
127
|
-
if (h0 === h1) {
|
|
128
|
-
for (i = 0; i < numPoints; i++) {
|
|
129
|
-
heights[i] = h0;
|
|
130
|
-
}
|
|
131
|
-
heights.push(h1);
|
|
132
|
-
return heights;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const dHeight = h1 - h0;
|
|
136
|
-
const heightPerVertex = dHeight / numPoints;
|
|
137
|
-
|
|
138
|
-
for (i = 1; i < numPoints; i++) {
|
|
139
|
-
const h = h0 + i * heightPerVertex;
|
|
140
|
-
heights[i] = h;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
heights[0] = h0;
|
|
144
|
-
heights.push(h1);
|
|
145
|
-
return heights;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const nextScratch = new Matrix3.Cartesian3();
|
|
149
|
-
const prevScratch = new Matrix3.Cartesian3();
|
|
150
|
-
|
|
151
|
-
function computeRotationAngle(start, end, position, ellipsoid) {
|
|
152
|
-
const tangentPlane = new EllipsoidTangentPlane.EllipsoidTangentPlane(position, ellipsoid);
|
|
153
|
-
const next = tangentPlane.projectPointOntoPlane(
|
|
154
|
-
Matrix3.Cartesian3.add(position, start, nextScratch),
|
|
155
|
-
nextScratch
|
|
156
|
-
);
|
|
157
|
-
const prev = tangentPlane.projectPointOntoPlane(
|
|
158
|
-
Matrix3.Cartesian3.add(position, end, prevScratch),
|
|
159
|
-
prevScratch
|
|
160
|
-
);
|
|
161
|
-
const angle = Matrix2.Cartesian2.angleBetween(next, prev);
|
|
162
|
-
|
|
163
|
-
return prev.x * next.y - prev.y * next.x >= 0.0 ? -angle : angle;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const negativeX = new Matrix3.Cartesian3(-1, 0, 0);
|
|
167
|
-
let transform = new Matrix2.Matrix4();
|
|
168
|
-
const translation = new Matrix2.Matrix4();
|
|
169
|
-
let rotationZ = new Matrix3.Matrix3();
|
|
170
|
-
const scaleMatrix = Matrix3.Matrix3.IDENTITY.clone();
|
|
171
|
-
const westScratch = new Matrix3.Cartesian3();
|
|
172
|
-
const finalPosScratch = new Matrix2.Cartesian4();
|
|
173
|
-
const heightCartesian = new Matrix3.Cartesian3();
|
|
174
|
-
function addPosition(
|
|
175
|
-
center,
|
|
176
|
-
left,
|
|
177
|
-
shape,
|
|
178
|
-
finalPositions,
|
|
179
|
-
ellipsoid,
|
|
180
|
-
height,
|
|
181
|
-
xScalar,
|
|
182
|
-
repeat
|
|
183
|
-
) {
|
|
184
|
-
let west = westScratch;
|
|
185
|
-
let finalPosition = finalPosScratch;
|
|
186
|
-
transform = Transforms.Transforms.eastNorthUpToFixedFrame(center, ellipsoid, transform);
|
|
187
|
-
|
|
188
|
-
west = Matrix2.Matrix4.multiplyByPointAsVector(transform, negativeX, west);
|
|
189
|
-
west = Matrix3.Cartesian3.normalize(west, west);
|
|
190
|
-
const angle = computeRotationAngle(west, left, center, ellipsoid);
|
|
191
|
-
rotationZ = Matrix3.Matrix3.fromRotationZ(angle, rotationZ);
|
|
192
|
-
|
|
193
|
-
heightCartesian.z = height;
|
|
194
|
-
transform = Matrix2.Matrix4.multiplyTransformation(
|
|
195
|
-
transform,
|
|
196
|
-
Matrix2.Matrix4.fromRotationTranslation(rotationZ, heightCartesian, translation),
|
|
197
|
-
transform
|
|
198
|
-
);
|
|
199
|
-
const scale = scaleMatrix;
|
|
200
|
-
scale[0] = xScalar;
|
|
201
|
-
|
|
202
|
-
for (let j = 0; j < repeat; j++) {
|
|
203
|
-
for (let i = 0; i < shape.length; i += 3) {
|
|
204
|
-
finalPosition = Matrix3.Cartesian3.fromArray(shape, i, finalPosition);
|
|
205
|
-
finalPosition = Matrix3.Matrix3.multiplyByVector(
|
|
206
|
-
scale,
|
|
207
|
-
finalPosition,
|
|
208
|
-
finalPosition
|
|
209
|
-
);
|
|
210
|
-
finalPosition = Matrix2.Matrix4.multiplyByPoint(
|
|
211
|
-
transform,
|
|
212
|
-
finalPosition,
|
|
213
|
-
finalPosition
|
|
214
|
-
);
|
|
215
|
-
finalPositions.push(finalPosition.x, finalPosition.y, finalPosition.z);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
return finalPositions;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
const centerScratch = new Matrix3.Cartesian3();
|
|
223
|
-
function addPositions(
|
|
224
|
-
centers,
|
|
225
|
-
left,
|
|
226
|
-
shape,
|
|
227
|
-
finalPositions,
|
|
228
|
-
ellipsoid,
|
|
229
|
-
heights,
|
|
230
|
-
xScalar
|
|
231
|
-
) {
|
|
232
|
-
for (let i = 0; i < centers.length; i += 3) {
|
|
233
|
-
const center = Matrix3.Cartesian3.fromArray(centers, i, centerScratch);
|
|
234
|
-
finalPositions = addPosition(
|
|
235
|
-
center,
|
|
236
|
-
left,
|
|
237
|
-
shape,
|
|
238
|
-
finalPositions,
|
|
239
|
-
ellipsoid,
|
|
240
|
-
heights[i / 3],
|
|
241
|
-
xScalar,
|
|
242
|
-
1
|
|
243
|
-
);
|
|
244
|
-
}
|
|
245
|
-
return finalPositions;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function convertShapeTo3DDuplicate(shape2D, boundingRectangle) {
|
|
249
|
-
//orientate 2D shape to XZ plane center at (0, 0, 0), duplicate points
|
|
250
|
-
const length = shape2D.length;
|
|
251
|
-
const shape = new Array(length * 6);
|
|
252
|
-
let index = 0;
|
|
253
|
-
const xOffset = boundingRectangle.x + boundingRectangle.width / 2;
|
|
254
|
-
const yOffset = boundingRectangle.y + boundingRectangle.height / 2;
|
|
255
|
-
|
|
256
|
-
let point = shape2D[0];
|
|
257
|
-
shape[index++] = point.x - xOffset;
|
|
258
|
-
shape[index++] = 0.0;
|
|
259
|
-
shape[index++] = point.y - yOffset;
|
|
260
|
-
for (let i = 1; i < length; i++) {
|
|
261
|
-
point = shape2D[i];
|
|
262
|
-
const x = point.x - xOffset;
|
|
263
|
-
const z = point.y - yOffset;
|
|
264
|
-
shape[index++] = x;
|
|
265
|
-
shape[index++] = 0.0;
|
|
266
|
-
shape[index++] = z;
|
|
267
|
-
|
|
268
|
-
shape[index++] = x;
|
|
269
|
-
shape[index++] = 0.0;
|
|
270
|
-
shape[index++] = z;
|
|
271
|
-
}
|
|
272
|
-
point = shape2D[0];
|
|
273
|
-
shape[index++] = point.x - xOffset;
|
|
274
|
-
shape[index++] = 0.0;
|
|
275
|
-
shape[index++] = point.y - yOffset;
|
|
276
|
-
|
|
277
|
-
return shape;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function convertShapeTo3D(shape2D, boundingRectangle) {
|
|
281
|
-
//orientate 2D shape to XZ plane center at (0, 0, 0)
|
|
282
|
-
const length = shape2D.length;
|
|
283
|
-
const shape = new Array(length * 3);
|
|
284
|
-
let index = 0;
|
|
285
|
-
const xOffset = boundingRectangle.x + boundingRectangle.width / 2;
|
|
286
|
-
const yOffset = boundingRectangle.y + boundingRectangle.height / 2;
|
|
287
|
-
|
|
288
|
-
for (let i = 0; i < length; i++) {
|
|
289
|
-
shape[index++] = shape2D[i].x - xOffset;
|
|
290
|
-
shape[index++] = 0;
|
|
291
|
-
shape[index++] = shape2D[i].y - yOffset;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return shape;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const quaterion = new Transforms.Quaternion();
|
|
298
|
-
const startPointScratch = new Matrix3.Cartesian3();
|
|
299
|
-
const rotMatrix = new Matrix3.Matrix3();
|
|
300
|
-
function computeRoundCorner(
|
|
301
|
-
pivot,
|
|
302
|
-
startPoint,
|
|
303
|
-
endPoint,
|
|
304
|
-
cornerType,
|
|
305
|
-
leftIsOutside,
|
|
306
|
-
ellipsoid,
|
|
307
|
-
finalPositions,
|
|
308
|
-
shape,
|
|
309
|
-
height,
|
|
310
|
-
duplicatePoints
|
|
311
|
-
) {
|
|
312
|
-
const angle = Matrix3.Cartesian3.angleBetween(
|
|
313
|
-
Matrix3.Cartesian3.subtract(startPoint, pivot, scratch1),
|
|
314
|
-
Matrix3.Cartesian3.subtract(endPoint, pivot, scratch2)
|
|
315
|
-
);
|
|
316
|
-
const granularity =
|
|
317
|
-
cornerType === CornerType$1.BEVELED
|
|
318
|
-
? 0
|
|
319
|
-
: Math.ceil(angle / Math$1.CesiumMath.toRadians(5));
|
|
320
|
-
|
|
321
|
-
let m;
|
|
322
|
-
if (leftIsOutside) {
|
|
323
|
-
m = Matrix3.Matrix3.fromQuaternion(
|
|
324
|
-
Transforms.Quaternion.fromAxisAngle(
|
|
325
|
-
Matrix3.Cartesian3.negate(pivot, scratch1),
|
|
326
|
-
angle / (granularity + 1),
|
|
327
|
-
quaterion
|
|
328
|
-
),
|
|
329
|
-
rotMatrix
|
|
330
|
-
);
|
|
331
|
-
} else {
|
|
332
|
-
m = Matrix3.Matrix3.fromQuaternion(
|
|
333
|
-
Transforms.Quaternion.fromAxisAngle(pivot, angle / (granularity + 1), quaterion),
|
|
334
|
-
rotMatrix
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
let left;
|
|
339
|
-
let surfacePoint;
|
|
340
|
-
startPoint = Matrix3.Cartesian3.clone(startPoint, startPointScratch);
|
|
341
|
-
if (granularity > 0) {
|
|
342
|
-
const repeat = duplicatePoints ? 2 : 1;
|
|
343
|
-
for (let i = 0; i < granularity; i++) {
|
|
344
|
-
startPoint = Matrix3.Matrix3.multiplyByVector(m, startPoint, startPoint);
|
|
345
|
-
left = Matrix3.Cartesian3.subtract(startPoint, pivot, scratch1);
|
|
346
|
-
left = Matrix3.Cartesian3.normalize(left, left);
|
|
347
|
-
if (!leftIsOutside) {
|
|
348
|
-
left = Matrix3.Cartesian3.negate(left, left);
|
|
349
|
-
}
|
|
350
|
-
surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);
|
|
351
|
-
finalPositions = addPosition(
|
|
352
|
-
surfacePoint,
|
|
353
|
-
left,
|
|
354
|
-
shape,
|
|
355
|
-
finalPositions,
|
|
356
|
-
ellipsoid,
|
|
357
|
-
height,
|
|
358
|
-
1,
|
|
359
|
-
repeat
|
|
360
|
-
);
|
|
361
|
-
}
|
|
362
|
-
} else {
|
|
363
|
-
left = Matrix3.Cartesian3.subtract(startPoint, pivot, scratch1);
|
|
364
|
-
left = Matrix3.Cartesian3.normalize(left, left);
|
|
365
|
-
if (!leftIsOutside) {
|
|
366
|
-
left = Matrix3.Cartesian3.negate(left, left);
|
|
367
|
-
}
|
|
368
|
-
surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);
|
|
369
|
-
finalPositions = addPosition(
|
|
370
|
-
surfacePoint,
|
|
371
|
-
left,
|
|
372
|
-
shape,
|
|
373
|
-
finalPositions,
|
|
374
|
-
ellipsoid,
|
|
375
|
-
height,
|
|
376
|
-
1,
|
|
377
|
-
1
|
|
378
|
-
);
|
|
379
|
-
|
|
380
|
-
endPoint = Matrix3.Cartesian3.clone(endPoint, startPointScratch);
|
|
381
|
-
left = Matrix3.Cartesian3.subtract(endPoint, pivot, scratch1);
|
|
382
|
-
left = Matrix3.Cartesian3.normalize(left, left);
|
|
383
|
-
if (!leftIsOutside) {
|
|
384
|
-
left = Matrix3.Cartesian3.negate(left, left);
|
|
385
|
-
}
|
|
386
|
-
surfacePoint = ellipsoid.scaleToGeodeticSurface(endPoint, scratch2);
|
|
387
|
-
finalPositions = addPosition(
|
|
388
|
-
surfacePoint,
|
|
389
|
-
left,
|
|
390
|
-
shape,
|
|
391
|
-
finalPositions,
|
|
392
|
-
ellipsoid,
|
|
393
|
-
height,
|
|
394
|
-
1,
|
|
395
|
-
1
|
|
396
|
-
);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
return finalPositions;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
PolylineVolumeGeometryLibrary.removeDuplicatesFromShape = function (
|
|
403
|
-
shapePositions
|
|
404
|
-
) {
|
|
405
|
-
const length = shapePositions.length;
|
|
406
|
-
const cleanedPositions = [];
|
|
407
|
-
for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {
|
|
408
|
-
const v0 = shapePositions[i0];
|
|
409
|
-
const v1 = shapePositions[i1];
|
|
410
|
-
|
|
411
|
-
if (!Matrix2.Cartesian2.equals(v0, v1)) {
|
|
412
|
-
cleanedPositions.push(v1); // Shallow copy!
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
return cleanedPositions;
|
|
417
|
-
};
|
|
418
|
-
|
|
419
|
-
PolylineVolumeGeometryLibrary.angleIsGreaterThanPi = function (
|
|
420
|
-
forward,
|
|
421
|
-
backward,
|
|
422
|
-
position,
|
|
423
|
-
ellipsoid
|
|
424
|
-
) {
|
|
425
|
-
const tangentPlane = new EllipsoidTangentPlane.EllipsoidTangentPlane(position, ellipsoid);
|
|
426
|
-
const next = tangentPlane.projectPointOntoPlane(
|
|
427
|
-
Matrix3.Cartesian3.add(position, forward, nextScratch),
|
|
428
|
-
nextScratch
|
|
429
|
-
);
|
|
430
|
-
const prev = tangentPlane.projectPointOntoPlane(
|
|
431
|
-
Matrix3.Cartesian3.add(position, backward, prevScratch),
|
|
432
|
-
prevScratch
|
|
433
|
-
);
|
|
434
|
-
|
|
435
|
-
return prev.x * next.y - prev.y * next.x >= 0.0;
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
const scratchForwardProjection = new Matrix3.Cartesian3();
|
|
439
|
-
const scratchBackwardProjection = new Matrix3.Cartesian3();
|
|
440
|
-
|
|
441
|
-
PolylineVolumeGeometryLibrary.computePositions = function (
|
|
442
|
-
positions,
|
|
443
|
-
shape2D,
|
|
444
|
-
boundingRectangle,
|
|
445
|
-
geometry,
|
|
446
|
-
duplicatePoints
|
|
447
|
-
) {
|
|
448
|
-
const ellipsoid = geometry._ellipsoid;
|
|
449
|
-
const heights = scaleToSurface(positions, ellipsoid);
|
|
450
|
-
const granularity = geometry._granularity;
|
|
451
|
-
const cornerType = geometry._cornerType;
|
|
452
|
-
const shapeForSides = duplicatePoints
|
|
453
|
-
? convertShapeTo3DDuplicate(shape2D, boundingRectangle)
|
|
454
|
-
: convertShapeTo3D(shape2D, boundingRectangle);
|
|
455
|
-
const shapeForEnds = duplicatePoints
|
|
456
|
-
? convertShapeTo3D(shape2D, boundingRectangle)
|
|
457
|
-
: undefined;
|
|
458
|
-
const heightOffset = boundingRectangle.height / 2;
|
|
459
|
-
const width = boundingRectangle.width / 2;
|
|
460
|
-
let length = positions.length;
|
|
461
|
-
let finalPositions = [];
|
|
462
|
-
let ends = duplicatePoints ? [] : undefined;
|
|
463
|
-
|
|
464
|
-
let forward = scratchCartesian1;
|
|
465
|
-
let backward = scratchCartesian2;
|
|
466
|
-
let cornerDirection = scratchCartesian3;
|
|
467
|
-
let surfaceNormal = scratchCartesian4;
|
|
468
|
-
let pivot = scratchCartesian5;
|
|
469
|
-
let start = scratchCartesian6;
|
|
470
|
-
let end = scratchCartesian7;
|
|
471
|
-
let left = scratchCartesian8;
|
|
472
|
-
let previousPosition = scratchCartesian9;
|
|
473
|
-
|
|
474
|
-
let position = positions[0];
|
|
475
|
-
let nextPosition = positions[1];
|
|
476
|
-
surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);
|
|
477
|
-
forward = Matrix3.Cartesian3.subtract(nextPosition, position, forward);
|
|
478
|
-
forward = Matrix3.Cartesian3.normalize(forward, forward);
|
|
479
|
-
left = Matrix3.Cartesian3.cross(surfaceNormal, forward, left);
|
|
480
|
-
left = Matrix3.Cartesian3.normalize(left, left);
|
|
481
|
-
let h0 = heights[0];
|
|
482
|
-
let h1 = heights[1];
|
|
483
|
-
if (duplicatePoints) {
|
|
484
|
-
ends = addPosition(
|
|
485
|
-
position,
|
|
486
|
-
left,
|
|
487
|
-
shapeForEnds,
|
|
488
|
-
ends,
|
|
489
|
-
ellipsoid,
|
|
490
|
-
h0 + heightOffset,
|
|
491
|
-
1,
|
|
492
|
-
1
|
|
493
|
-
);
|
|
494
|
-
}
|
|
495
|
-
previousPosition = Matrix3.Cartesian3.clone(position, previousPosition);
|
|
496
|
-
position = nextPosition;
|
|
497
|
-
backward = Matrix3.Cartesian3.negate(forward, backward);
|
|
498
|
-
let subdividedHeights;
|
|
499
|
-
let subdividedPositions;
|
|
500
|
-
for (let i = 1; i < length - 1; i++) {
|
|
501
|
-
const repeat = duplicatePoints ? 2 : 1;
|
|
502
|
-
nextPosition = positions[i + 1];
|
|
503
|
-
if (position.equals(nextPosition)) {
|
|
504
|
-
oneTimeWarning(
|
|
505
|
-
"Positions are too close and are considered equivalent with rounding error."
|
|
506
|
-
);
|
|
507
|
-
continue;
|
|
508
|
-
}
|
|
509
|
-
forward = Matrix3.Cartesian3.subtract(nextPosition, position, forward);
|
|
510
|
-
forward = Matrix3.Cartesian3.normalize(forward, forward);
|
|
511
|
-
cornerDirection = Matrix3.Cartesian3.add(forward, backward, cornerDirection);
|
|
512
|
-
cornerDirection = Matrix3.Cartesian3.normalize(cornerDirection, cornerDirection);
|
|
513
|
-
surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);
|
|
514
|
-
|
|
515
|
-
const forwardProjection = Matrix3.Cartesian3.multiplyByScalar(
|
|
516
|
-
surfaceNormal,
|
|
517
|
-
Matrix3.Cartesian3.dot(forward, surfaceNormal),
|
|
518
|
-
scratchForwardProjection
|
|
519
|
-
);
|
|
520
|
-
Matrix3.Cartesian3.subtract(forward, forwardProjection, forwardProjection);
|
|
521
|
-
Matrix3.Cartesian3.normalize(forwardProjection, forwardProjection);
|
|
522
|
-
|
|
523
|
-
const backwardProjection = Matrix3.Cartesian3.multiplyByScalar(
|
|
524
|
-
surfaceNormal,
|
|
525
|
-
Matrix3.Cartesian3.dot(backward, surfaceNormal),
|
|
526
|
-
scratchBackwardProjection
|
|
527
|
-
);
|
|
528
|
-
Matrix3.Cartesian3.subtract(backward, backwardProjection, backwardProjection);
|
|
529
|
-
Matrix3.Cartesian3.normalize(backwardProjection, backwardProjection);
|
|
530
|
-
|
|
531
|
-
const doCorner = !Math$1.CesiumMath.equalsEpsilon(
|
|
532
|
-
Math.abs(Matrix3.Cartesian3.dot(forwardProjection, backwardProjection)),
|
|
533
|
-
1.0,
|
|
534
|
-
Math$1.CesiumMath.EPSILON7
|
|
535
|
-
);
|
|
536
|
-
|
|
537
|
-
if (doCorner) {
|
|
538
|
-
cornerDirection = Matrix3.Cartesian3.cross(
|
|
539
|
-
cornerDirection,
|
|
540
|
-
surfaceNormal,
|
|
541
|
-
cornerDirection
|
|
542
|
-
);
|
|
543
|
-
cornerDirection = Matrix3.Cartesian3.cross(
|
|
544
|
-
surfaceNormal,
|
|
545
|
-
cornerDirection,
|
|
546
|
-
cornerDirection
|
|
547
|
-
);
|
|
548
|
-
cornerDirection = Matrix3.Cartesian3.normalize(cornerDirection, cornerDirection);
|
|
549
|
-
const scalar =
|
|
550
|
-
1 /
|
|
551
|
-
Math.max(
|
|
552
|
-
0.25,
|
|
553
|
-
Matrix3.Cartesian3.magnitude(
|
|
554
|
-
Matrix3.Cartesian3.cross(cornerDirection, backward, scratch1)
|
|
555
|
-
)
|
|
556
|
-
);
|
|
557
|
-
const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(
|
|
558
|
-
forward,
|
|
559
|
-
backward,
|
|
560
|
-
position,
|
|
561
|
-
ellipsoid
|
|
562
|
-
);
|
|
563
|
-
if (leftIsOutside) {
|
|
564
|
-
pivot = Matrix3.Cartesian3.add(
|
|
565
|
-
position,
|
|
566
|
-
Matrix3.Cartesian3.multiplyByScalar(
|
|
567
|
-
cornerDirection,
|
|
568
|
-
scalar * width,
|
|
569
|
-
cornerDirection
|
|
570
|
-
),
|
|
571
|
-
pivot
|
|
572
|
-
);
|
|
573
|
-
start = Matrix3.Cartesian3.add(
|
|
574
|
-
pivot,
|
|
575
|
-
Matrix3.Cartesian3.multiplyByScalar(left, width, start),
|
|
576
|
-
start
|
|
577
|
-
);
|
|
578
|
-
scratch2Array[0] = Matrix3.Cartesian3.clone(previousPosition, scratch2Array[0]);
|
|
579
|
-
scratch2Array[1] = Matrix3.Cartesian3.clone(start, scratch2Array[1]);
|
|
580
|
-
subdividedHeights = subdivideHeights(
|
|
581
|
-
scratch2Array,
|
|
582
|
-
h0 + heightOffset,
|
|
583
|
-
h1 + heightOffset,
|
|
584
|
-
granularity
|
|
585
|
-
);
|
|
586
|
-
subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
|
|
587
|
-
positions: scratch2Array,
|
|
588
|
-
granularity: granularity,
|
|
589
|
-
ellipsoid: ellipsoid,
|
|
590
|
-
});
|
|
591
|
-
finalPositions = addPositions(
|
|
592
|
-
subdividedPositions,
|
|
593
|
-
left,
|
|
594
|
-
shapeForSides,
|
|
595
|
-
finalPositions,
|
|
596
|
-
ellipsoid,
|
|
597
|
-
subdividedHeights,
|
|
598
|
-
1
|
|
599
|
-
);
|
|
600
|
-
left = Matrix3.Cartesian3.cross(surfaceNormal, forward, left);
|
|
601
|
-
left = Matrix3.Cartesian3.normalize(left, left);
|
|
602
|
-
end = Matrix3.Cartesian3.add(
|
|
603
|
-
pivot,
|
|
604
|
-
Matrix3.Cartesian3.multiplyByScalar(left, width, end),
|
|
605
|
-
end
|
|
606
|
-
);
|
|
607
|
-
if (
|
|
608
|
-
cornerType === CornerType$1.ROUNDED ||
|
|
609
|
-
cornerType === CornerType$1.BEVELED
|
|
610
|
-
) {
|
|
611
|
-
computeRoundCorner(
|
|
612
|
-
pivot,
|
|
613
|
-
start,
|
|
614
|
-
end,
|
|
615
|
-
cornerType,
|
|
616
|
-
leftIsOutside,
|
|
617
|
-
ellipsoid,
|
|
618
|
-
finalPositions,
|
|
619
|
-
shapeForSides,
|
|
620
|
-
h1 + heightOffset,
|
|
621
|
-
duplicatePoints
|
|
622
|
-
);
|
|
623
|
-
} else {
|
|
624
|
-
cornerDirection = Matrix3.Cartesian3.negate(cornerDirection, cornerDirection);
|
|
625
|
-
finalPositions = addPosition(
|
|
626
|
-
position,
|
|
627
|
-
cornerDirection,
|
|
628
|
-
shapeForSides,
|
|
629
|
-
finalPositions,
|
|
630
|
-
ellipsoid,
|
|
631
|
-
h1 + heightOffset,
|
|
632
|
-
scalar,
|
|
633
|
-
repeat
|
|
634
|
-
);
|
|
635
|
-
}
|
|
636
|
-
previousPosition = Matrix3.Cartesian3.clone(end, previousPosition);
|
|
637
|
-
} else {
|
|
638
|
-
pivot = Matrix3.Cartesian3.add(
|
|
639
|
-
position,
|
|
640
|
-
Matrix3.Cartesian3.multiplyByScalar(
|
|
641
|
-
cornerDirection,
|
|
642
|
-
scalar * width,
|
|
643
|
-
cornerDirection
|
|
644
|
-
),
|
|
645
|
-
pivot
|
|
646
|
-
);
|
|
647
|
-
start = Matrix3.Cartesian3.add(
|
|
648
|
-
pivot,
|
|
649
|
-
Matrix3.Cartesian3.multiplyByScalar(left, -width, start),
|
|
650
|
-
start
|
|
651
|
-
);
|
|
652
|
-
scratch2Array[0] = Matrix3.Cartesian3.clone(previousPosition, scratch2Array[0]);
|
|
653
|
-
scratch2Array[1] = Matrix3.Cartesian3.clone(start, scratch2Array[1]);
|
|
654
|
-
subdividedHeights = subdivideHeights(
|
|
655
|
-
scratch2Array,
|
|
656
|
-
h0 + heightOffset,
|
|
657
|
-
h1 + heightOffset,
|
|
658
|
-
granularity
|
|
659
|
-
);
|
|
660
|
-
subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
|
|
661
|
-
positions: scratch2Array,
|
|
662
|
-
granularity: granularity,
|
|
663
|
-
ellipsoid: ellipsoid,
|
|
664
|
-
});
|
|
665
|
-
finalPositions = addPositions(
|
|
666
|
-
subdividedPositions,
|
|
667
|
-
left,
|
|
668
|
-
shapeForSides,
|
|
669
|
-
finalPositions,
|
|
670
|
-
ellipsoid,
|
|
671
|
-
subdividedHeights,
|
|
672
|
-
1
|
|
673
|
-
);
|
|
674
|
-
left = Matrix3.Cartesian3.cross(surfaceNormal, forward, left);
|
|
675
|
-
left = Matrix3.Cartesian3.normalize(left, left);
|
|
676
|
-
end = Matrix3.Cartesian3.add(
|
|
677
|
-
pivot,
|
|
678
|
-
Matrix3.Cartesian3.multiplyByScalar(left, -width, end),
|
|
679
|
-
end
|
|
680
|
-
);
|
|
681
|
-
if (
|
|
682
|
-
cornerType === CornerType$1.ROUNDED ||
|
|
683
|
-
cornerType === CornerType$1.BEVELED
|
|
684
|
-
) {
|
|
685
|
-
computeRoundCorner(
|
|
686
|
-
pivot,
|
|
687
|
-
start,
|
|
688
|
-
end,
|
|
689
|
-
cornerType,
|
|
690
|
-
leftIsOutside,
|
|
691
|
-
ellipsoid,
|
|
692
|
-
finalPositions,
|
|
693
|
-
shapeForSides,
|
|
694
|
-
h1 + heightOffset,
|
|
695
|
-
duplicatePoints
|
|
696
|
-
);
|
|
697
|
-
} else {
|
|
698
|
-
finalPositions = addPosition(
|
|
699
|
-
position,
|
|
700
|
-
cornerDirection,
|
|
701
|
-
shapeForSides,
|
|
702
|
-
finalPositions,
|
|
703
|
-
ellipsoid,
|
|
704
|
-
h1 + heightOffset,
|
|
705
|
-
scalar,
|
|
706
|
-
repeat
|
|
707
|
-
);
|
|
708
|
-
}
|
|
709
|
-
previousPosition = Matrix3.Cartesian3.clone(end, previousPosition);
|
|
710
|
-
}
|
|
711
|
-
backward = Matrix3.Cartesian3.negate(forward, backward);
|
|
712
|
-
} else {
|
|
713
|
-
finalPositions = addPosition(
|
|
714
|
-
previousPosition,
|
|
715
|
-
left,
|
|
716
|
-
shapeForSides,
|
|
717
|
-
finalPositions,
|
|
718
|
-
ellipsoid,
|
|
719
|
-
h0 + heightOffset,
|
|
720
|
-
1,
|
|
721
|
-
1
|
|
722
|
-
);
|
|
723
|
-
previousPosition = position;
|
|
724
|
-
}
|
|
725
|
-
h0 = h1;
|
|
726
|
-
h1 = heights[i + 1];
|
|
727
|
-
position = nextPosition;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
scratch2Array[0] = Matrix3.Cartesian3.clone(previousPosition, scratch2Array[0]);
|
|
731
|
-
scratch2Array[1] = Matrix3.Cartesian3.clone(position, scratch2Array[1]);
|
|
732
|
-
subdividedHeights = subdivideHeights(
|
|
733
|
-
scratch2Array,
|
|
734
|
-
h0 + heightOffset,
|
|
735
|
-
h1 + heightOffset,
|
|
736
|
-
granularity
|
|
737
|
-
);
|
|
738
|
-
subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
|
|
739
|
-
positions: scratch2Array,
|
|
740
|
-
granularity: granularity,
|
|
741
|
-
ellipsoid: ellipsoid,
|
|
742
|
-
});
|
|
743
|
-
finalPositions = addPositions(
|
|
744
|
-
subdividedPositions,
|
|
745
|
-
left,
|
|
746
|
-
shapeForSides,
|
|
747
|
-
finalPositions,
|
|
748
|
-
ellipsoid,
|
|
749
|
-
subdividedHeights,
|
|
750
|
-
1
|
|
751
|
-
);
|
|
752
|
-
if (duplicatePoints) {
|
|
753
|
-
ends = addPosition(
|
|
754
|
-
position,
|
|
755
|
-
left,
|
|
756
|
-
shapeForEnds,
|
|
757
|
-
ends,
|
|
758
|
-
ellipsoid,
|
|
759
|
-
h1 + heightOffset,
|
|
760
|
-
1,
|
|
761
|
-
1
|
|
762
|
-
);
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
length = finalPositions.length;
|
|
766
|
-
const posLength = duplicatePoints ? length + ends.length : length;
|
|
767
|
-
const combinedPositions = new Float64Array(posLength);
|
|
768
|
-
combinedPositions.set(finalPositions);
|
|
769
|
-
if (duplicatePoints) {
|
|
770
|
-
combinedPositions.set(ends, length);
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
return combinedPositions;
|
|
774
|
-
};
|
|
775
|
-
var PolylineVolumeGeometryLibrary$1 = PolylineVolumeGeometryLibrary;
|
|
776
|
-
|
|
777
|
-
exports.CornerType = CornerType$1;
|
|
778
|
-
exports.PolylineVolumeGeometryLibrary = PolylineVolumeGeometryLibrary$1;
|
|
779
|
-
exports.oneTimeWarning = oneTimeWarning;
|
|
780
|
-
|
|
781
|
-
}));
|