Skip to content

Commit ef26844

Browse files
authored
Merge pull request #7522 from AnalyticalGraphicsInc/sandcastle-poly-3dtiles
Add polylines on 3D Tiles Sandcastle Example
2 parents 00cdeef + 22c5e99 commit ef26844

File tree

3 files changed

+127
-0
lines changed

3 files changed

+127
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
7+
<meta name="description" content="Display polylines on BIM and Photogrammetry 3D Tiles">
8+
<meta name="cesium-sandcastle-labels" content="3D Tiles">
9+
<title>Cesium Demo</title>
10+
<script type="text/javascript" src="../Sandcastle-header.js"></script>
11+
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
12+
<script type="text/javascript">
13+
if(typeof require === 'function') {
14+
require.config({
15+
baseUrl : '../../../Source',
16+
waitSeconds : 120
17+
});
18+
}
19+
</script>
20+
</head>
21+
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
22+
<style>
23+
@import url(../templates/bucket.css);
24+
</style>
25+
<div id="cesiumContainer" class="fullSize"></div>
26+
<div id="loadingOverlay"><h1>Loading...</h1></div>
27+
<div id="toolbar"></div>
28+
<script id="cesium_sandcastle_script">
29+
function startup(Cesium) {
30+
'use strict';
31+
//Sandcastle_Begin
32+
// Power Plant design model provided by Bentley Systems
33+
var viewer = new Cesium.Viewer('cesiumContainer');
34+
var scene = viewer.scene;
35+
36+
var powerplant = scene.primitives.add(
37+
new Cesium.Cesium3DTileset({
38+
url: Cesium.IonResource.fromAssetId(8564),
39+
show: false
40+
})
41+
);
42+
var pipes = viewer.entities.add({
43+
polyline : {
44+
positions : Cesium.Cartesian3.fromDegreesArray([
45+
-76.36053390920833, 34.949935893493596,
46+
-76.36055481641581, 34.94993589886988,
47+
-76.36055477047704, 34.94992280693651
48+
]),
49+
width : 6,
50+
material : new Cesium.PolylineDashMaterialProperty({
51+
color : Cesium.Color.YELLOW,
52+
dashLength: 20.0
53+
}),
54+
show: false,
55+
clampToGround : true,
56+
classificationType: Cesium.ClassificationType.CESIUM_3D_TILE
57+
}
58+
});
59+
60+
var building = viewer.scene.primitives.add(
61+
new Cesium.Cesium3DTileset({
62+
url: Cesium.IonResource.fromAssetId(6074)
63+
})
64+
);
65+
var route = viewer.entities.add({
66+
polyline : {
67+
positions : Cesium.Cartesian3.fromDegreesArray([
68+
-75.59604807301078, 40.03948512841901,
69+
-75.59644577413066, 40.039316280505446,
70+
-75.59584544997564, 40.03846271524258,
71+
-75.59661425371488, 40.03814087821916,
72+
-75.59664726332451, 40.03818297772907
73+
]),
74+
width : 6,
75+
material : new Cesium.PolylineDashMaterialProperty({
76+
color : Cesium.Color.YELLOW
77+
}),
78+
show: false,
79+
clampToGround : true,
80+
classificationType: Cesium.ClassificationType.CESIUM_3D_TILE
81+
}
82+
});
83+
84+
Sandcastle.addToolbarMenu([{
85+
text : 'BIM',
86+
onselect : function() {
87+
building.show = false;
88+
route.polyline.show = false;
89+
powerplant.show = true;
90+
pipes.polyline.show = true;
91+
scene.camera.setView({
92+
destination: new Cesium.Cartesian3(1234151.4883992162, -5086036.79436967, 3633328.4278331124),
93+
orientation: {
94+
heading: 5.593695742186853,
95+
pitch: -1.0786797635545216,
96+
roll: 6.27892466154778
97+
}
98+
});
99+
}
100+
}, {
101+
text : 'Photogrammetry',
102+
onselect : function() {
103+
building.show = true;
104+
route.polyline.show = true;
105+
powerplant.show = false;
106+
pipes.polyline.show = false;
107+
scene.camera.setView({
108+
destination: new Cesium.Cartesian3(1216596.5376729995, -4736445.416889214, 4081406.990364228),
109+
orientation: {
110+
heading: 5.153176564030707,
111+
pitch: -0.9701972964526693,
112+
roll: 6.277883257569513
113+
}
114+
});
115+
}
116+
}]);//Sandcastle_End
117+
Sandcastle.finishedLoading();
118+
}
119+
if (typeof Cesium !== 'undefined') {
120+
startup(Cesium);
121+
} else if (typeof require === 'function') {
122+
require(['Cesium'], startup);
123+
}
124+
</script>
125+
</body>
126+
</html>
Loading

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Change Log
1919
* Added `classificationType` property to `PolylineGraphics` and `GroundPolylinePrimitive` which specifies whether a polyline clamped to ground should be clamped to terrain, 3D Tiles, or both. [#7437](https://github.com/AnalyticalGraphicsInc/cesium/pull/7437)
2020
* Added the ability to specify the width of the intersection volume for `Scene.sampleHeight`, `Scene.clampToHeight`, `Scene.sampleHeightMostDetailed`, and `Scene.clampToHeightMostDetailed`. [#7287](https://github.com/AnalyticalGraphicsInc/cesium/pull/7287)
2121
* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Time%20Dynamic%20Wheels.html) on using `nodeTransformations` to rotate a model's wheels based on its velocity. [#7361](https://github.com/AnalyticalGraphicsInc/cesium/pull/7361)
22+
* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Polylines%20on%203D%20Tiles.html) for drawing polylines on 3D Tiles [#7522](https://github.com/AnalyticalGraphicsInc/cesium/pull/7522)
2223
* Added `EllipsoidRhumbLine` class as a rhumb line counterpart to `EllipsoidGeodesic`. [#7484](https://github.com/AnalyticalGraphicsInc/cesium/pull/7484)
2324
* Added rhumb line support to `PolygonGeometry`, `PolygonOutlineGeometry`, `PolylineGeometry`, `GroundPolylineGeometry`, and `SimplePolylineGeometry`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492)
2425
* When using Cesium in Node.js, we now use the combined and minified version for improved performance unless `NODE_ENV` is specifically set to `development`.

0 commit comments

Comments
 (0)