3D Print Toolbox fails to calculate correct Area for object with mesh - triangulation error #87930

Closed
opened 2021-04-30 09:00:37 +02:00 by RUben · 9 comments

System Information
Operating system: win10
Graphics card: rtx2080ti

Blender Version
Broken:
2.79b release, example: 2.83.5, blender3.0
Worked: None

Short description of error
I remember this bug since 2.7x, but I also met it in 3.0:
If object mesh data has some edges dissolved and non-flat topology,
using Area Statistics from 3d-Print-Toolbox addon Analyze panel
shows different result for base and triangulated with modifier object.
In mesh_helpers.py at line 27 bmesh_copy_from_object function have triangulate=True by default and at line 56 bmesh should be triangulated.
So I can't figure out why bmesh ain't triangulated and area incorrect as result.

Exact steps for others to reproduce the error
Based on the attached .blend file (as simple as possible):
With 3D Print Toolbox calculate areas for both base and triangulated objects.
3d-Print-Toolbox AMI.blend

**System Information** Operating system: win10 Graphics card: rtx2080ti **Blender Version** Broken: 2.79b release, example: 2.83.5, blender3.0 Worked: None **Short description of error** I remember this bug since 2.7x, but I also met it in 3.0: If object mesh data has some edges dissolved and non-flat topology, using Area Statistics from 3d-Print-Toolbox addon Analyze panel shows different result for base and triangulated with modifier object. In [mesh_helpers.py ](https://developer.blender.org/diffusion/BA/browse/master/object_print3d_utils/mesh_helpers.py) at line 27 bmesh_copy_from_object function have triangulate=True by default and at line 56 bmesh should be triangulated. So I can't figure out why bmesh ain't triangulated and area incorrect as result. **Exact steps for others to reproduce the error** Based on the attached .blend file (as simple as possible): With 3D Print Toolbox calculate areas for both base and triangulated objects. [3d-Print-Toolbox AMI.blend](https://archive.blender.org/developer/F10046533/3d-Print-Toolbox_AMI.blend)
Author

Added subscriber: @RUben

Added subscriber: @RUben
Sergey Sharybin was assigned by RUben 2021-04-30 09:02:23 +02:00
Author

Added subscriber: @Sergey

Added subscriber: @Sergey
Member

Removed subscriber: @Sergey

Removed subscriber: @Sergey
Sergey Sharybin was unassigned by Ankit Meel 2021-05-07 19:11:50 +02:00
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

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

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

I can replicate that. And I hit an assert during triangulation, so this could be related.

/home/omar/projects/blender/build/bin/blender(BLI_system_backtrace+0x30) [0xf0e0c10]
/home/omar/projects/blender/build/bin/blender(_BLI_assert_print_backtrace+0x13) [0xef47c13]
/home/omar/projects/blender/build/bin/blender(BM_face_triangulate+0xbb) [0x384a74b]
/home/omar/projects/blender/build/bin/blender() [0x39b1374]
/home/omar/projects/blender/build/bin/blender(BM_mesh_triangulate+0xc8e) [0x39b05ae]
/home/omar/projects/blender/build/bin/blender(bmo_triangulate_exec+0xd2) [0x3922cb2]
/home/omar/projects/blender/build/bin/blender(BMO_op_exec+0x5f) [0x383671f]
/home/omar/projects/blender/build/bin/blender(BPy_BMO_call+0x345) [0x411aac5]
/usr/lib/libpython3.10.so.1.0(_PyObject_MakeTpCall+0x2a3) [0x7fdefd928613]
/usr/lib/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x5f0a) [0x7fdefd9243ba]
/usr/lib/libpython3.10.so.1.0(+0x134422) [0x7fdefd91d422]
/usr/lib/libpython3.10.so.1.0(PyEval_EvalCode+0x90) [0x7fdefd9d2370]
/home/omar/projects/blender/build/bin/blender() [0x40e7b69]
/home/omar/projects/blender/build/bin/blender(BPY_run_text+0x37) [0x40e7e07]
/home/omar/projects/blender/build/bin/blender() [0x4de4102]
/home/omar/projects/blender/build/bin/blender() [0x4ddfe31]
/home/omar/projects/blender/build/bin/blender() [0x3678067]
/home/omar/projects/blender/build/bin/blender() [0x366ebf2]
/home/omar/projects/blender/build/bin/blender(WM_operator_name_call_ptr+0x98) [0x366f618]
/home/omar/projects/blender/build/bin/blender(WM_operator_name_call_ptr_with_depends_on_cursor+0x101) [0x366fa01]
/home/omar/projects/blender/build/bin/blender() [0x4b722d7]
/home/omar/projects/blender/build/bin/blender() [0x4b7081e]
/home/omar/projects/blender/build/bin/blender() [0x3679e1c]
/home/omar/projects/blender/build/bin/blender() [0x3678f4e]
/home/omar/projects/blender/build/bin/blender() [0x3671c69]
/home/omar/projects/blender/build/bin/blender(wm_event_do_handlers+0x865) [0x3670fe5]
/home/omar/projects/blender/build/bin/blender(WM_main+0x27) [0x36671e7]
/home/omar/projects/blender/build/bin/blender() [0x2e200d4]
/usr/lib/libc.so.6(__libc_start_main+0xd5) [0x7fdefdefeb25]
/home/omar/projects/blender/build/bin/blender(_start+0x2e) [0x2e1fc9e]
BLI_assert failed: source/blender/bmesh/intern/bmesh_polygon.c:961, BM_face_triangulate(), at 'BM_face_is_normal_valid(f)'

The script is missing the bm.transform(obj.matrix_world) step, which is why it doesn't hit the assert and might be different.

I can replicate that. And I hit an assert during triangulation, so this could be related. ``` /home/omar/projects/blender/build/bin/blender(BLI_system_backtrace+0x30) [0xf0e0c10] /home/omar/projects/blender/build/bin/blender(_BLI_assert_print_backtrace+0x13) [0xef47c13] /home/omar/projects/blender/build/bin/blender(BM_face_triangulate+0xbb) [0x384a74b] /home/omar/projects/blender/build/bin/blender() [0x39b1374] /home/omar/projects/blender/build/bin/blender(BM_mesh_triangulate+0xc8e) [0x39b05ae] /home/omar/projects/blender/build/bin/blender(bmo_triangulate_exec+0xd2) [0x3922cb2] /home/omar/projects/blender/build/bin/blender(BMO_op_exec+0x5f) [0x383671f] /home/omar/projects/blender/build/bin/blender(BPy_BMO_call+0x345) [0x411aac5] /usr/lib/libpython3.10.so.1.0(_PyObject_MakeTpCall+0x2a3) [0x7fdefd928613] /usr/lib/libpython3.10.so.1.0(_PyEval_EvalFrameDefault+0x5f0a) [0x7fdefd9243ba] /usr/lib/libpython3.10.so.1.0(+0x134422) [0x7fdefd91d422] /usr/lib/libpython3.10.so.1.0(PyEval_EvalCode+0x90) [0x7fdefd9d2370] /home/omar/projects/blender/build/bin/blender() [0x40e7b69] /home/omar/projects/blender/build/bin/blender(BPY_run_text+0x37) [0x40e7e07] /home/omar/projects/blender/build/bin/blender() [0x4de4102] /home/omar/projects/blender/build/bin/blender() [0x4ddfe31] /home/omar/projects/blender/build/bin/blender() [0x3678067] /home/omar/projects/blender/build/bin/blender() [0x366ebf2] /home/omar/projects/blender/build/bin/blender(WM_operator_name_call_ptr+0x98) [0x366f618] /home/omar/projects/blender/build/bin/blender(WM_operator_name_call_ptr_with_depends_on_cursor+0x101) [0x366fa01] /home/omar/projects/blender/build/bin/blender() [0x4b722d7] /home/omar/projects/blender/build/bin/blender() [0x4b7081e] /home/omar/projects/blender/build/bin/blender() [0x3679e1c] /home/omar/projects/blender/build/bin/blender() [0x3678f4e] /home/omar/projects/blender/build/bin/blender() [0x3671c69] /home/omar/projects/blender/build/bin/blender(wm_event_do_handlers+0x865) [0x3670fe5] /home/omar/projects/blender/build/bin/blender(WM_main+0x27) [0x36671e7] /home/omar/projects/blender/build/bin/blender() [0x2e200d4] /usr/lib/libc.so.6(__libc_start_main+0xd5) [0x7fdefdefeb25] /home/omar/projects/blender/build/bin/blender(_start+0x2e) [0x2e1fc9e] BLI_assert failed: source/blender/bmesh/intern/bmesh_polygon.c:961, BM_face_triangulate(), at 'BM_face_is_normal_valid(f)' ``` The script is missing the `bm.transform(obj.matrix_world)` step, which is why it doesn't hit the assert and might be different.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Note: flipping normals makes a difference, too (should not be the case I think)
Changing the quad_method or ngon_method doesnt seem to make a difference https://docs.blender.org/api/3.2/bmesh.ops.html#bmesh.ops.triangulate

Note: flipping normals makes a difference, too (should not be the case I think) Changing the `quad_method` or `ngon_method` doesnt seem to make a difference https://docs.blender.org/api/3.2/bmesh.ops.html#bmesh.ops.triangulate

Closing since 3D Print Toolbox was removed from Blender, if issue is still present report it in add-on repo issue tracker: https://projects.blender.org/extensions/print3d_toolbox/issues

Closing since 3D Print Toolbox was removed from Blender, if issue is still present report it in add-on repo issue tracker: https://projects.blender.org/extensions/print3d_toolbox/issues
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2024-07-01 17:21:55 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 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#87930
No description provided.