Archimesh: generates invalid meshes #72635

Open
opened 2019-12-22 11:49:12 +01:00 by Hans Classen · 16 comments

System Information
Operating system: Windows 10
Graphics card: Geforce 1080

Blender Version
Broken: v 2.81a and 2.81
Worked: (optional)

Short description of error

Adding a Bevel modifier to an object leads to instant crash of Blender.

Exact steps for others to reproduce the error
I have created a window with archimesh, updated the mesh, added uv and a material. Then I removed all parenting with Alt-P, then removed the group and empty created by the addon, such that the object only contains the window.
When I now add a Bevel modifier, Blender crashes instantly.
This can be reproduced with the attached file in 2.81 and 2.81a. lfFenster.blend The file includes the textures as well.

**System Information** Operating system: Windows 10 Graphics card: Geforce 1080 **Blender Version** Broken: v 2.81a and 2.81 Worked: (optional) **Short description of error** Adding a Bevel modifier to an object leads to instant crash of Blender. **Exact steps for others to reproduce the error** I have created a window with archimesh, updated the mesh, added uv and a material. Then I removed all parenting with Alt-P, then removed the group and empty created by the addon, such that the object only contains the window. When I now add a Bevel modifier, Blender crashes instantly. This can be reproduced with the attached file in 2.81 and 2.81a. [lfFenster.blend](https://archive.blender.org/developer/F8240248/lfFenster.blend) The file includes the textures as well.
Author

Added subscriber: @hc3d

Added subscriber: @hc3d
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

Thanks for the report!

I'd like to look into this, but it would be helpful if you could upload a version of the file with just the object that crashes Blender, without textures or anything else.

Thanks for the report! I'd like to look into this, but it would be helpful if you could upload a version of the file with **just** the object that crashes Blender, without textures or anything else.
Author

lfFensterUpdate.blend
Here you go. Only one object, no textures included.
(I did not expect to get a reply on a Sunday - thanks a lot!)

[lfFensterUpdate.blend](https://archive.blender.org/developer/F8240928/lfFensterUpdate.blend) Here you go. Only one object, no textures included. (I did not expect to get a reply on a Sunday - thanks a lot!)
Member

Thank you! That's helpful. I'm just a volunteer who's been working with bevel so I figured I would take a look.

It looks like the crash happens when the mesh from the object is changed into a BMesh for the modifier, so before it's touched by bevel. Because of that I'm also getting a crash getting into edit mode with the object.

Thank you! That's helpful. I'm just a volunteer who's been working with bevel so I figured I would take a look. It looks like the crash happens when the mesh from the object is changed into a BMesh for the modifier, so before it's touched by bevel. Because of that I'm also getting a crash getting into edit mode with the object.
Member

Added subscribers: @antoniov, @JacquesLucke

Added subscribers: @antoniov, @JacquesLucke
Member

Running mesh.validate(verbose=True) shows that the mesh has invalid geometry. More specifically I get these errors:

ERROR (bke.mesh): .../mesh_validate.c:593 BKE_mesh_validate_arrays:      Poly 6 has duplicated vert reference at corner (3)
ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays:      Loop 24 is unused.
ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays:      Loop 25 is unused.
ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays:      Loop 26 is unused.
ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays:      Loop 27 is unused.
ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays:      Loop 28 is unused.

My guess is that archimesh generated this invalid geometry. @antoniov

Running `mesh.validate(verbose=True)` shows that the mesh has invalid geometry. More specifically I get these errors: ``` ERROR (bke.mesh): .../mesh_validate.c:593 BKE_mesh_validate_arrays: Poly 6 has duplicated vert reference at corner (3) ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays: Loop 24 is unused. ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays: Loop 25 is unused. ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays: Loop 26 is unused. ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays: Loop 27 is unused. ERROR (bke.mesh): .../mesh_validate.c:733 BKE_mesh_validate_arrays: Loop 28 is unused. ``` My guess is that archimesh generated this invalid geometry. @antoniov
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'
Member

Please describe more exactly how you generated the window so that we can check if geometry has been generated by archimesh indeed.

Please describe more exactly how you generated the window so that we can check if geometry has been generated by archimesh indeed.
Author

Dear Jacques, thank you for looking into this issue!
I have created the attached pdf with screenshots of how to reproduce the crash. I assume that the crash is related to the arched top of the window as it does not happen when the top is flat.

BlenderCrash.pdf

Dear Jacques, thank you for looking into this issue! I have created the attached pdf with screenshots of how to reproduce the crash. I assume that the crash is related to the arched top of the window as it does not happen when the top is flat. [BlenderCrash.pdf](https://archive.blender.org/developer/F8249851/BlenderCrash.pdf)
Member

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'
Member

Thanks. In a debug build that even crashes as I set the top to "Arch".

Thanks. In a debug build that even crashes as I set the top to "Arch".
Bastien Montagne changed title from Crash when adding Bevel modifier to Archimesh: generates invalid meshes 2020-01-15 11:11:49 +01:00

The steps in the PDF still cause a crash in Blender version 3.6.3
Archimesh version has had some updates since this ticket was raised and is now at 1.2.5.

The curved top window has significantly more non-manifold elements compared with the flat top.

Looks like there are 4 commits ahead of this release.

The steps in the PDF still cause a crash in Blender version 3.6.3 Archimesh version has had some updates since this ticket was raised and is now at 1.2.5. The curved top window has significantly more non-manifold elements compared with the flat top. Looks like there are 4 commits ahead of this release.

I can stop it crashing with an edit to the python addon :)
In another toolbox I saw the use of mesh.validate()

Add the following lines at the end of remove_doubles in achm_tools.py

    for myMesh in bpy.data.meshes:
        if myMesh.validate(verbose=1):
            print ('Fixed_mesh =  ', myMesh)

Now when launching blender from the terminal I get a lot of output relating to fixing the mesh:

ERROR (bke.mesh): source/blender/blenkernel/intern/mesh_validate.cc:594 BKE_mesh_validate_arrays: Poly 12 has duplicated vert reference at corner (36)
ERROR (bke.mesh): source/blender/blenkernel/intern/mesh_validate.cc:745 BKE_mesh_validate_arrays: Loop 48 is unused.
+.... 70 more lines

The corrected mesh now means I can then add a Bevel without crashing Blender.

FYI the tail of the crash file

Writing: /tmp/arch_top_window.crash.txt
Segmentation fault (core dumped)
looks like:
bpy.ops.mesh.normals_make_consistent(inside=False) # Operator
bpy.ops.object.editmode_toggle() # Operator
bpy.ops.object.editmode_toggle() # Operator
bpy.ops.object.editmode_toggle() # Operator
bpy.context.space_data.context = 'MODIFIER' # Property
bpy.ops.object.modifier_add(type='BEVEL') # Operator
. backtrace
. Python backtrace

I can stop it crashing with an edit to the python addon :) In another toolbox I saw the use of mesh.validate() Add the following lines at the end of remove_doubles in achm_tools.py ``` for myMesh in bpy.data.meshes: if myMesh.validate(verbose=1): print ('Fixed_mesh = ', myMesh) ``` Now when launching blender from the terminal I get a lot of output relating to fixing the mesh: > ERROR (bke.mesh): source/blender/blenkernel/intern/mesh_validate.cc:594 BKE_mesh_validate_arrays: Poly 12 has duplicated vert reference at corner (36) > ERROR (bke.mesh): source/blender/blenkernel/intern/mesh_validate.cc:745 BKE_mesh_validate_arrays: Loop 48 is unused. > +.... 70 more lines The corrected mesh now means I can then add a Bevel without crashing Blender. FYI the tail of the crash file > Writing: /tmp/arch_top_window.crash.txt > Segmentation fault (core dumped) looks like: > bpy.ops.mesh.normals_make_consistent(inside=False) # Operator > bpy.ops.object.editmode_toggle() # Operator > bpy.ops.object.editmode_toggle() # Operator > bpy.ops.object.editmode_toggle() # Operator > bpy.context.space_data.context = 'MODIFIER' # Property > bpy.ops.object.modifier_add(type='BEVEL') # Operator > . backtrace > . Python backtrace

Further testing with my suggestion shows that while Blender no longer crashes the mesh ends up with a non-contiguous surface. The root to fixing this is going to be understanding the generation of the archway over the window rather than a sticking plaster.... More work to do, I'll continue to investigate as I get time.

Further testing with my suggestion shows that while Blender no longer crashes the mesh ends up with a non-contiguous surface. The root to fixing this is going to be understanding the generation of the archway over the window rather than a sticking plaster.... More work to do, I'll continue to investigate as I get time.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#72635
No description provided.