3D Terrain from QGIS

Not sure if I should create a new topic for QGIS everytime - let me know.

Just tried to send a raster layer to spk. Worked great! This is coming from an .asc file and was wondering if you were considering generating a mesh out of it as well - differentiated with the height values (I am assuming this feature doesn’t exist, if it does… :exploding_head:)

FYI I then tried to send that over to Rhino and the latter crashed

2 Likes

Hey @pauldotnet, I moved it to a new topic for simplicity.

So that raster layer crashes Rhino every single time? Could you send us either the original raster, or share the stream you sent it to?

1 Like

Hey @AlanRynne,
Finally got it working, I guess the first try Rhino didn’t like it :stuck_out_tongue:

Also managed to process it as a 3D mesh but there are some inconsistencies with image flip/vertices ordering - one of the issues I found is that the vertices count is not the same for Band 1_values (z values) and the display value mesh. Attached you will find the GH def.

Stream is the following : e29df9ca43

unnamed2.gh (19.5 KB)

PS : this raster asc file is close to the sea, explaining the big mesh gap at the bottom

3 Likes

Oh thanks for getting back with this! I’ll add this to my todo list :wink:

I opened issues for this in both QGIS and speckle-sharp bc I suspect it may need changes in both sides

Pinging @Kateryna too on this! :smiley:

1 Like

Hi Paul! Generating a 3d mesh with the values from 1 of the bands is entirely feasible! The data is there, color values are being assigned point by point, so adding an extra z-value wouldn’t be hard:) The bigger issue is that, to my knowledge, Speckle connectors are not really doing any geometry transformations in native software, just sending and receiving. So the best guest for solving this, is to advance the connector for QGIS mesh support - the meshes have very straightforward 3d configuration and the export in 3d should be straightforward as well:

And regarding the misplaced values: technically the idea was to have the mesh as a direct representation of Raster from QGIS, and the rest of parameters as well, to be able to recreate the mesh (e.g. in Grasshopper) with any modifications. So you can recreate it as in the screenshot below. The values need to be flipped once though, because QGIS is recording band values horizontally, and Grasshopper is creating grid rows ordered vertically:

Disclaimer about this method: if your selected projection distorts the raster so it’s not orthogonal anymore, it might require a different approach to recreate it in Gh.

Disclaimer #2: “resolution X and Y” parameters of raster are being recorded in the units of selected CRS (by default, meters). But Rhino project can be set to different units, and the “resolution” parameter wouldn’t “know” about it. So you might need to add a scale factor to the resolution. Yes, this is not super convenient approach by now :nerd_face:

5 Likes

uuuuh nice I was missing that one :slight_smile:, thanks!

Your method allows for the grid rectangles to be adjusted according to the height - I thought the height values were corresponding the to vertices and not the quad - so I got their centroids to generate a mesh from points. And got the respective colors following this method.

The path mapper allows to flip the matrix for multiple tree branches so that it can work for multiple tiles at once:

QGIS

SPECKLE

RHINO

Zooming closer to a zone between two tiles, we notice a gap, because I used the quad centroids to move according to the height value. Not sure how to do it better, if you have any tips…!

2 Likes

The quickest could be merging rasters in QGIS:) Or creating an extra “bonding” mesh from the border rows of both

3 Likes

Great news are coming in 2.14!

Terrain_mesh_demo_very_small

6 Likes

Hey @Kateryna, do you have a stream example showcasing a 3D terrain textured with orthophotos and buildings with custom heights on top? Is the texture kept if sent over to Rhino?

1 Like

https://speckle.xyz/streams/5feae56049/commits/b5f4cc5f3b
of course, it is, in fact, transformed to a colored 3d mesh, so it’s not treated as a texture per se

2 Likes

Nice! is there any doc/video explaining the process of getting such coloured mesh from QGIS?

Tutorial is coming! Meanwhile, here are some notes: QGIS | Speckle Docs

3 Likes

Thanks! I’ll give it a try as soon as I get the time to

2 Likes

@Kateryna finally got the time to try it.
I’m trying to select the satellite layer as texture (streams from google satellite btw) but I’m unable to select it from the list. Not sure what’s going wrong…

1 Like

ok got it, I had to export a tiff from the google satellite stream, and now I can select it.

1 Like

Ok, now I’m trying to send the thing.
When pressing send, the plug-in is greyed out. I’ve been waiting for a few minutes and nothing happens. I’ve attached the mesh I’m trying to send. For now I’m just trying to get it as a 3D mesh without texture.
RGEALTI_FXX_0607_6876_MNT_LAMB93_IGN69.asc (5.7 MB)

Well… I just had to be patient. Worked well, awesome!
https://speckle.xyz/streams/c8c1e034b8/commits/083a993fbd?c=[608199.02651,6875265.78063,537.22012,607499.5,6875500.5,44.3916,0,1]
A progress bar would be a nice add-on to let the user know everything is fine :slight_smile:

1 Like

Finally, I’ve made a last test with the texture (“Set Raster as a Texture for the Elevation Layer”)
Unfortunately, the result is still “black and white”, see the same stream posted above.
Am I missing something? see the screenshot below…
Is there a size limit for the raster? My Tiff is 234MB

Hi Paul! Just make sure that you are sending the actual texture layer, not the elevation one (I can see that the elevation layer is selected in the Layers panel)

2 Likes

Hi Kateryna, oh I see, right! I’m currently redoing a test where both are selected. Is that fine, or should ONLY the texture layer be selected? I’ve been already waiting 10minutes for the thing to be sent so I’m wondering if I should really break it or not :sweat_smile:

1 Like