minorua / Qgis2threejs

3D map visualization and web export plugin for QGIS
http://minorua.github.io/Qgis2threejs/docs/
507 stars 92 forks source link

Distance measuring tool #259

Closed aeduard closed 2 years ago

aeduard commented 2 years ago

A simple distance measurement tools was created together with a friend. It is based on this discussion: link.

If someone wants to use it the following steps should be followed:

  1. You have to make the export to web with 3D Viewer with dat-gui panel template.
  2. Create/download measureTool.js file (remove txt extension), put near index.html: measureTool.js.txt
  3. Add line to head section of the index.html
  4. Add the following lines to Qgis2threejs.js after the following block // get layerId of clicked object if (typeof measureTool != 'undefined' && measureTool.is_active === true) { if (measureTool.initialized === false) { measureTool.init(app, Q3D.Config); } measureTool.setPoint(obj); }

To use it should be activated from dat-gui pane (controls pane) -> Tools group -> Measure distance. Than you have to click on 2 points on the model. The distance will appear as an alert message. While Measure distance tool is checked, it will measure distance between consecutive 2 clicks. Not working with point clouds.

It is tested on EPSG:3844 CRS, with Qgis2threejs v. 2.5 qgis plugin (v2.6 is buggy for me, not relating to this tool).

Any enhancement, feedback is welcome. It would be nice to implement (a refined version) in a future Qgis2threejs version.

minorua commented 2 years ago

@aeduard Good job! I'll implement this feature in the next version. Thanks!

minorua commented 2 years ago

@aeduard Thanks for your prototype. It encouraged me to go ahead.

aeduard commented 2 years ago

@minorua If you need help for testing the plugin before publishing, I would like to get involved. I'm using Qgis2threejs on a regular basis, so it would be pretty convenient for me to do some testing.