qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

Unable to move mesh elements #50062

Closed DelazJ closed 12 months ago

DelazJ commented 2 years ago

What is the bug or the crash?

I'm hardly trying to move mesh elements and I fail every time. The elements are supposed to become green so that I could release them at their new location, but they stay red. Considering that https://github.com/qgis/QGIS/pull/44037#issue-936039124 shows mesh elements being moved, this is a regression.

Steps to reproduce the issue

Capture vidéo du 01-09-2022 23:26:17.webm

Versions

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

QGIS version | 3.27.0-Master | QGIS code revision | fb97c10d00 -- | -- | -- | -- Qt version | 5.15.3 Python version | 3.10.4 GDAL/OGR version | 3.4.1 PROJ version | 8.2.1 EPSG Registry database version | v10.041 (2021-12-03) GEOS version | 3.10.2-CAPI-1.16.0 SQLite version | 3.37.2 PostgreSQL client version | unknown SpatiaLite version | 5.0.1 QWT version | 6.1.4 QScintilla2 version | 2.11.6 OS version | Ubuntu 22.04.1 LTS   |   |   |   This copy of QGIS writes debugging output.   |   |   |   Active Python plugins db_manager | 0.1.20 grassprovider | 2.12.99 MetaSearch | 0.3.6 processing | 2.12.99 sagaprovider | 2.12.99

Supported QGIS version

New profile

Additional context

No response

nicogodet commented 2 years ago

Can't reproduce on https://github.com/qgis/QGIS/commit/81ac7eb29d with a SELAFIN

DelazJ commented 2 years ago

Hi @nicogodet I reported with https://github.com/qgis/QGIS/commit/fb97c10d007c2835ec2040ca87823380d50bbef1 but this is an issue I already had with a version earlier than yours (a couple of weeks). What could then be the reason of my failure? The file format? I'm on a 2dm file (created from https://github.com/lutraconsulting/MDAL/blob/master/tests/data/ugrid/D-Flow1.1/manzese_1d2d_small_map.nc - the 2d sublayer). But since I can create new faces I don't get why moving them would be intentionally disabled. I will try other data formats later.

nicogodet commented 2 years ago

I can replicate with this file too. @vcloarec gentle ping

vcloarec commented 2 years ago

@DelazJ @nicogodet, thanks to report this.

After debugging, it appears that the problem comes partially from the file (and from MDAL) and also from the QGIS behavior: this is a 1D/2D mesh file, and when loading the 2D mesh, it seems that MDAL loads also the vertices associated with 1D mesh, but these vertices are not associated to any element (face or edge). When entering in editing mode, these vertices are considered as "free" vertices, that is, vertices not yet associated with faces (see all the red dots in the following picture). image

And with editing rules, it is not allowed to move faces/vertices that leads to have some free vertices included in faces. When QGIS checks this rule when moving, it finds some free vertices included in faces and doesn't validate the move...

So, IMHO, issues are:

vcloarec commented 2 years ago

by the way, not a regression, as this issue was always existing.

DelazJ commented 2 years ago

@vcloarec Thanks for the quick feedback

this is a 1D/2D mesh file, and when loading the 2D mesh, it seems that MDAL loads also the vertices associated with 1D mesh, but these vertices are not associated to any element (face or edge).

Yes I was surprised to have free vertices from the 1D geometry but I'm not enough versed in mesh science to have an opinion so did not report.

And with editing rules, it is not allowed to move faces/vertices that leads to have some free vertices included in faces. When QGIS checks this rule when moving, it finds some free vertices included in faces and doesn't validate the move...

@vcloarec Just to be sure I understand: when I'm moving face 1 in a mesh layer:

I'm asking because in my case, "moved" face 1 did not overlap any free vertex. And I could create faces without problem. I could save that mesh layer, despite the free vertices. Just moving a face or a vertex afterwards was problematic.

vcloarec commented 2 years ago

@DelazJ It is option 2. Because when you move an element that could lead to deform other faces in the neighborhood, and these last ones could include a free vertex after the move. When you create a new face, only the new face can contain a free vertex after the operation, so the check concerns only the face.

alexbruy commented 12 months ago

Fixed by #50310.