Skip to content

Commit 94e18a3

Browse files
jo-chemlam-mohr
andauthored
Replace deprecated geofox.ai with NASA-AMMOS 3DTilesRendererJS (#565)
* Replace deprecated geofox.ai with NASA-AMMOS 3DTilesRendererJS * Add ThreePipe viewer for 3d static meshes via url threepipe.org/examples/tweakpane-editor?model=URL --------- Co-authored-by: Matthias Mohr <matthias@mohr.ws>
1 parent 0095a2c commit 94e18a3

File tree

6 files changed

+64
-27
lines changed

6 files changed

+64
-27
lines changed

assetActions.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
import Cesium from './src/actions/assets/Cesium.js';
33
import CopcViewer from './src/actions/assets/CopcViewer.js';
44
import F3D from './src/actions/assets/F3D.js';
5+
import ThreePipe from './src/actions/assets/ThreePipe.js';
56
import GeoJsonIo from './src/actions/assets/GeoJsonIo.js';
6-
// import Geofox from './src/actions/assets/Geofox.js';
7+
// import NASA_AMMOS_3DTiles from './src/actions/assets/NASA_AMMOS_3DTiles.js';
8+
// import Geoparquet from './src/actions/assets/Geoparquet.js';
79
// import Potree from './src/actions/assets/Potree.js';
810
import Protomaps from './src/actions/assets/Protomaps.js';
911

@@ -12,6 +14,7 @@ export default {
1214
Cesium,
1315
CopcViewer,
1416
F3D,
17+
ThreePipe,
1518
GeoJsonIo,
1619
// Potree,
1720
Protomaps,

linkActions.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// import Felt from './src/actions/links/Felt.js';
2-
// import Geofox from './src/actions/links/Geofox.js';
2+
// import NASA_AMMOS_3DTiles from './src/actions/links/NASA_AMMOS_3DTiles.js';
33
import Cesium from './src/actions/links/Cesium.js';
44
import Protomaps from './src/actions/links/Protomaps.js';
55

src/actions/assets/Geofox.js renamed to src/actions/assets/NASA_AMMOS_3DTiles.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ const OGC3DTILES_SUPPORTED_TYPES = [
99
'application/3dtiles+json',
1010
];
1111

12-
export default class Geofox extends AssetActionPlugin {
12+
export default class NASA_AMMOS_3DTiles extends AssetActionPlugin {
1313

1414
get show() {
1515
return this.component.isBrowserProtocol && OGC3DTILES_SUPPORTED_TYPES.includes(this.asset.type);
1616
}
1717

1818
get uri() {
19-
let uri = new URI("https://viewer.geofox.ai/");
20-
uri.addQuery('tileset', this.component.href);
19+
let uri = new URI("https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/index.html");
20+
uri.hash(this.link.href);
2121
return uri;
2222
}
2323

2424
get text() {
25-
return i18n.t('actions.openIn', {service: 'Geofox.ai'});
25+
return i18n.t('actions.openIn', {service: 'NASA-AMMOS 3DTilesRendererJS'});
2626
}
2727

2828
}

src/actions/assets/ThreePipe.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import AssetActionPlugin from "../AssetActionPlugin";
2+
import URI from 'urijs';
3+
import i18n from "../../i18n";
4+
5+
// obj & ply files are usually with mime-type text/plain
6+
const THREEPIPE_SUPPORTED_TYPES = [
7+
'model/gltf-binary',
8+
'model/gltf+json',
9+
'application/fbx',
10+
];
11+
// below is usually text/plain
12+
const THREEPIPE_SUPPORTED_FILEEXTS = ['obj', 'ply', 'fbx', 'glb', 'gltf', 'stl', 'usdz'];
13+
export default class ThreePipe extends AssetActionPlugin {
14+
15+
get show() {
16+
const suffix = URI(this.asset.href).suffix();
17+
return this.component.isBrowserProtocol && (
18+
THREEPIPE_SUPPORTED_TYPES.includes(this.asset.type)
19+
|| THREEPIPE_SUPPORTED_FILEEXTS.some(ext => (suffix === ext))
20+
);
21+
}
22+
23+
get uri() {
24+
let uri = new URI("https://threepipe.org/examples/tweakpane-editor");
25+
uri.addQuery("model", this.component.href);
26+
return uri;
27+
}
28+
29+
30+
get text() {
31+
return i18n.t('actions.openIn', {service: 'ThreePipe'});
32+
}
33+
34+
}

src/actions/links/Geofox.js

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import LinkActionPlugin from "../LinkActionPlugin";
2+
import URI from 'urijs';
3+
import i18n from "../../i18n";
4+
5+
export default class NASA_AMMOS_3DTiles extends LinkActionPlugin {
6+
7+
get show() {
8+
return this.link.rel === '3d-tiles';
9+
}
10+
11+
get uri() {
12+
let uri = new URI("https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/index.html");
13+
uri.hash(this.link.href);
14+
return uri;
15+
}
16+
17+
get text() {
18+
return i18n.t('actions.openIn', {service: 'NASA-AMMOS 3DTilesRendererJS'});
19+
}
20+
21+
}

0 commit comments

Comments
 (0)