Skip to content
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

suggest to fix topological mesh error when starting mesh editing #50310

Merged
merged 9 commits into from
Oct 21, 2022

Conversation

vcloarec
Copy link
Member

@vcloarec vcloarec commented Sep 23, 2022

fix #50041 and #50062

It may happen that an editable mesh has topological errors that could prevent entering edit mode. The worst case is when the user edits a mesh, QGIS crashes and when he tries to restart editing, a topological error appeared and the user is unable to
modify the mesh... I didn't identify the reason because there is a check before saving the mesh, but apparently it happened. This leads to losing all the work on the mesh, even the saved work.

So, with this PR, when a topological prevents to enter editing mode, the following message box appears:
(here we can see a "manifold face", that is a face that cover another one, a quad).

image

If the user clicks "Yes", the mesh is fixed:

image

@vcloarec vcloarec added Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption labels Sep 23, 2022
@github-actions github-actions bot added this to the 3.28.0 milestone Sep 23, 2022
@vcloarec vcloarec added the Mesh Related to general mesh layer handling (not specific data formats) label Sep 23, 2022
@vcloarec vcloarec closed this Sep 28, 2022
@vcloarec vcloarec reopened this Sep 28, 2022
Copy link
Contributor

@DelazJ DelazJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some text fixes

python/core/auto_generated/mesh/qgsmeshlayer.sip.in Outdated Show resolved Hide resolved
python/core/auto_generated/mesh/qgsmesheditor.sip.in Outdated Show resolved Hide resolved
src/core/mesh/qgsmesheditor.h Outdated Show resolved Hide resolved
python/core/auto_generated/mesh/qgsmeshlayer.sip.in Outdated Show resolved Hide resolved
src/core/mesh/qgsmeshlayer.cpp Outdated Show resolved Hide resolved
src/core/mesh/qgsmeshlayer.h Outdated Show resolved Hide resolved
src/core/mesh/qgsmesheditor.h Outdated Show resolved Hide resolved
python/core/auto_generated/mesh/qgsmesheditor.sip.in Outdated Show resolved Hide resolved
Copy link
Contributor

@uclaros uclaros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, minor docstring changes.

It might be useful to add some reporting on the changes made by QgsMeshEditor::fixError(), like x faces removed/y vertices removed

src/core/mesh/qgsmesheditor.h Outdated Show resolved Hide resolved
src/core/mesh/qgsmesheditor.h Outdated Show resolved Hide resolved
src/core/mesh/qgsmesheditor.h Outdated Show resolved Hide resolved
src/core/mesh/qgsmeshlayer.h Outdated Show resolved Hide resolved
@vcloarec vcloarec enabled auto-merge (squash) October 20, 2022 23:31
@vcloarec vcloarec merged commit 220806e into qgis:master Oct 21, 2022
@alexbruy alexbruy mentioned this pull request Oct 27, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Mesh Related to general mesh layer handling (not specific data formats)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No obvious way to fix a broken mesh layer
3 participants