-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OGC 3D Tiles support #497
Comments
The first task is to load files with the extension b3dm into Blender. There is no built-in importer for them in Blender. Google 3D Tiles use files with the externsion glb which can be loaded by Blender's built-in glTF importer. An example b3dm file from the Aarhus data set: Tile_69_L18_00110.zip. Unzip it first. |
Quick comment, CesiumGS/3d-tiles-tools and donmccurdy/glTF-Transform are useful tooling to convert and A long discussion here discusses whether the portion to merge tiles of a tileset to a single mesh should be part of 3d-tiles-tools or belong somewhere else. Also, donmccurdy was thinking about integrating 3d-tiles IO tooling to gltf-transform, see discussion here. Hope this is useful! |
Batched 3D Model (b3dm) was deprecated in 3D Tiles 1.1. See b3dm migration guide. From here. |
The following code does convert the attached file The package
from pathlib import Path
from py3dtiles.tileset.content import read_binary_tile_content
# input file
b3dmFile = "Tile_69_L18_00110.b3dm"
# output file
glbFile = "Tile_69_L18_00110.glb"
b3dm = read_binary_tile_content(Path(b3dmFile))
gltf = b3dm.body.gltf
with Path(glbFile).open('wb') as f:
f.write(gltf.to_array()) |
Neither |
That code generates a glb file positioned at the origin. However it must be positioned somewhere on the Earth surface as it is the case with the Google 3D Tiles in the glb format. I've found how to achieve that, so 3D tiles in both glb and b3dm formats can be processed in the same way by the Blosm addon. from pathlib import Path
from py3dtiles.tileset.content import read_binary_tile_content
# input file
b3dmFile = Tile_69_L18_00110.b3dm"
# output file
glbFile = b3dmFile[:-4] + "glb"
b3dm = read_binary_tile_content(Path(b3dmFile))
gltf = b3dm.body.gltf
rtc_center = b3dm.body.feature_table.header.data.get("RTC_CENTER")
if rtc_center:
gltf.header["nodes"] = [
{'mesh': 0, 'translation': [rtc_center[0], rtc_center[2], -rtc_center[1]]}
]
with Path(glbFile).open('wb') as f:
f.write(gltf.to_array()) |
I added a stripped off package Below is the description of what was modified in the package
|
Nice to see that custom tileset url within the UI! Will this work - in the end - only with version 1.0 3D-tiles tilesets (with tiles stored as b3dm) or also with 1.1 3D-Tiles (where tiles are actually glb)? |
Both glb and b3dm tiles will be supported, as long as the resulting glb files can be imported by Blender's glTF importer. |
I was able to import some data sets:
I've been relying on the parameter The bounding volume is defined by a box in the Google 3D Tiles, while it's defined by a sphere in the above data sets. The intersection test of a box and a sphere also needs more attention. |
I'm trying to import NASA AMMOS's b3dm tile "https://raw.githubusercontent.com/NASA-AMMOS/3DTilesSampleData/master/msl-dingo-gap/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize/0528_0260184_to_s64o256_colorize_tileset.json", but I'm getting the error 'BaseManager' object has no attribute 'setGeometricErrorRange'. Do you know how can I approach this problem? |
Hi @luccagandra Import OGC is not yet available in the release version of the Blosm addon. The remaining think is implement checking if a sphere and a box intersect. What is that data about? |
The scale of the geometric error is different from the one in Google 3D Tiles. I ended up entering it as a number. The smaller the geometric error, the more detailed the imported scene will be. The first tile in the tileset's tree of tiles with the geometric error equal or less than the given one, will be imported. To get a more detailed scene, the current value of the geometric error can be divided by two. |
It's a pity that only 2 public data sets (Aarhus and Helsinki) are known at the moment. The data sets by Aerometrex are for a demonstration and of a low resolution. |
🚀 Impressive feature to allow importing of arbitrary tileset! Just added a few more open-data tileset.json to the other thread in case you want to try them out. |
The Blosm can not import any of them due to some features of the 3D Tiles specification that are not present in Google 3D Tiles and other data sets tested so far. Namely:
The task for now is to implement those missing features. |
The whole 3D-tiles spec is pretty complex, these are probably additions that you can bring forward in future iterations of your implementation:
|
Really impressive work, congrats on your implementation! Also looks like this is laying groundwork for a potential real-time implementation, like domlysz/BlenderGIS does for 2d tiles tms streaming In that event, 3DTilesRendererJS, loadersgl and cesiumjs are great reference js implementations for selection of which tiles to load given a viewport. |
The current implementation is now released publicly. Install the version 2.7.9 of the addon. |
This issue is used to track everything related to OGC 3D Tiles support in Blender.
A table with existing OGC 3D Tiles data sets is maintained at #498.
The text was updated successfully, but these errors were encountered: