From 8c8988cde0c46edd3af1b1577dde23bfa038318b Mon Sep 17 00:00:00 2001 From: Jonathan Chemla Date: Tue, 11 Feb 2025 17:55:35 +0100 Subject: [PATCH 1/2] Replace deprecated geofox.ai with NASA-AMMOS 3DTilesRendererJS --- assetActions.config.js | 2 +- linkActions.config.js | 2 +- .../{Geofox.js => NASA_AMMOS_3DTiles.js} | 8 +++---- src/actions/links/Geofox.js | 21 ------------------- src/actions/links/NASA_AMMOS_3DTiles.js | 21 +++++++++++++++++++ 5 files changed, 27 insertions(+), 27 deletions(-) rename src/actions/assets/{Geofox.js => NASA_AMMOS_3DTiles.js} (64%) delete mode 100644 src/actions/links/Geofox.js create mode 100644 src/actions/links/NASA_AMMOS_3DTiles.js diff --git a/assetActions.config.js b/assetActions.config.js index 555ed2a43..a99796eac 100644 --- a/assetActions.config.js +++ b/assetActions.config.js @@ -3,7 +3,7 @@ import Cesium from './src/actions/assets/Cesium.js'; import CopcViewer from './src/actions/assets/CopcViewer.js'; import F3D from './src/actions/assets/F3D.js'; import GeoJsonIo from './src/actions/assets/GeoJsonIo.js'; -// import Geofox from './src/actions/assets/Geofox.js'; +// import NASA_AMMOS_3DTiles from './src/actions/assets/NASA_AMMOS_3DTiles.js'; // import Geoparquet from './src/actions/assets/Geoparquet.js'; // import Potree from './src/actions/assets/Potree.js'; import Protomaps from './src/actions/assets/Protomaps.js'; diff --git a/linkActions.config.js b/linkActions.config.js index 44ed63380..9c9d3cfa7 100644 --- a/linkActions.config.js +++ b/linkActions.config.js @@ -1,5 +1,5 @@ // import Felt from './src/actions/links/Felt.js'; -// import Geofox from './src/actions/links/Geofox.js'; +// import NASA_AMMOS_3DTiles from './src/actions/links/NASA_AMMOS_3DTiles.js'; import Cesium from './src/actions/links/Cesium.js'; import Protomaps from './src/actions/links/Protomaps.js'; diff --git a/src/actions/assets/Geofox.js b/src/actions/assets/NASA_AMMOS_3DTiles.js similarity index 64% rename from src/actions/assets/Geofox.js rename to src/actions/assets/NASA_AMMOS_3DTiles.js index 79aa59abb..7b5dbe0fb 100644 --- a/src/actions/assets/Geofox.js +++ b/src/actions/assets/NASA_AMMOS_3DTiles.js @@ -9,20 +9,20 @@ const OGC3DTILES_SUPPORTED_TYPES = [ 'application/3dtiles+json', ]; -export default class Geofox extends AssetActionPlugin { +export default class NASA_AMMOS_3DTiles extends AssetActionPlugin { get show() { return this.component.isBrowserProtocol && OGC3DTILES_SUPPORTED_TYPES.includes(this.asset.type); } get uri() { - let uri = new URI("https://viewer.geofox.ai/"); - uri.addQuery('tileset', this.component.href); + let uri = new URI("https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/index.html"); + uri.hash(this.link.href); return uri; } get text() { - return i18n.t('actions.openIn', {service: 'Geofox.ai'}); + return i18n.t('actions.openIn', {service: 'NASA-AMMOS 3DTilesRendererJS'}); } } \ No newline at end of file diff --git a/src/actions/links/Geofox.js b/src/actions/links/Geofox.js deleted file mode 100644 index c93bd0607..000000000 --- a/src/actions/links/Geofox.js +++ /dev/null @@ -1,21 +0,0 @@ -import LinkActionPlugin from "../LinkActionPlugin"; -import URI from 'urijs'; -import i18n from "../../i18n"; - -export default class Geofox extends LinkActionPlugin { - - get show() { - return this.link.rel === '3d-tiles'; - } - - get uri() { - let uri = new URI("https://viewer.geofox.ai/"); - uri.addQuery('tileset', this.link.href); - return uri; - } - - get text() { - return i18n.t('actions.openIn', {service: 'Geofox.ai'}); - } - -} \ No newline at end of file diff --git a/src/actions/links/NASA_AMMOS_3DTiles.js b/src/actions/links/NASA_AMMOS_3DTiles.js new file mode 100644 index 000000000..fb084a450 --- /dev/null +++ b/src/actions/links/NASA_AMMOS_3DTiles.js @@ -0,0 +1,21 @@ +import LinkActionPlugin from "../LinkActionPlugin"; +import URI from 'urijs'; +import i18n from "../../i18n"; + +export default class NASA_AMMOS_3DTiles extends LinkActionPlugin { + + get show() { + return this.link.rel === '3d-tiles'; + } + + get uri() { + let uri = new URI("https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/index.html"); + uri.hash(this.link.href); + return uri; + } + + get text() { + return i18n.t('actions.openIn', {service: 'NASA-AMMOS 3DTilesRendererJS'}); + } + +} \ No newline at end of file From 63991cfc54e9a047255e799dd44838e2ff5017c4 Mon Sep 17 00:00:00 2001 From: Jonathan Chemla Date: Tue, 15 Apr 2025 16:41:22 +0200 Subject: [PATCH 2/2] Add ThreePipe viewer for 3d static meshes via url threepipe.org/examples/tweakpane-editor?model=URL --- assetActions.config.js | 2 ++ src/actions/assets/ThreePipe.js | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/actions/assets/ThreePipe.js diff --git a/assetActions.config.js b/assetActions.config.js index a99796eac..661eb4c0e 100644 --- a/assetActions.config.js +++ b/assetActions.config.js @@ -2,6 +2,7 @@ import Cesium from './src/actions/assets/Cesium.js'; import CopcViewer from './src/actions/assets/CopcViewer.js'; import F3D from './src/actions/assets/F3D.js'; +import ThreePipe from './src/actions/assets/ThreePipe.js'; import GeoJsonIo from './src/actions/assets/GeoJsonIo.js'; // import NASA_AMMOS_3DTiles from './src/actions/assets/NASA_AMMOS_3DTiles.js'; // import Geoparquet from './src/actions/assets/Geoparquet.js'; @@ -13,6 +14,7 @@ export default { Cesium, CopcViewer, F3D, + ThreePipe, GeoJsonIo, // Geoparquet, // not ready yet // Potree, diff --git a/src/actions/assets/ThreePipe.js b/src/actions/assets/ThreePipe.js new file mode 100644 index 000000000..5de500449 --- /dev/null +++ b/src/actions/assets/ThreePipe.js @@ -0,0 +1,34 @@ +import AssetActionPlugin from "../AssetActionPlugin"; +import URI from 'urijs'; +import i18n from "../../i18n"; + +// obj & ply files are usually with mime-type text/plain +const THREEPIPE_SUPPORTED_TYPES = [ + 'model/gltf-binary', + 'model/gltf+json', + 'application/fbx', +]; +// below is usually text/plain +const THREEPIPE_SUPPORTED_FILEEXTS = ['obj', 'ply', 'fbx', 'glb', 'gltf', 'stl', 'usdz']; +export default class ThreePipe extends AssetActionPlugin { + + get show() { + const suffix = URI(this.asset.href).suffix(); + return this.component.isBrowserProtocol && ( + THREEPIPE_SUPPORTED_TYPES.includes(this.asset.type) + || THREEPIPE_SUPPORTED_FILEEXTS.some(ext => (suffix === ext)) + ); + } + + get uri() { + let uri = new URI("https://threepipe.org/examples/tweakpane-editor"); + uri.addQuery("model", this.component.href); + return uri; + } + + + get text() { + return i18n.t('actions.openIn', {service: 'ThreePipe'}); + } + +} \ No newline at end of file