« Return to Thread: Bug or refactoring artifact?

Re: Bug or refactoring artifact?

by Timothy M. Shead :: Rate this Message:

Reply to Author | View in Thread

> Daniel Scott Matthews wrote:
>> I am seeing this on the console when importing with both the OBJ and
>> the 3DS mesh readers.
>>
>> ERROR: /home/daniel/projects/k3d/k3dsdk/normal3.h line 207: assertion
>> `length' failed
>
> This message indicates that we're trying to normalize a zero-length
> normal vector, which would cause a divide-by-zero error if we didn't
> catch it.  Could you send a small sample OBJ that causes this message?

After loading a modest example sent by Daniel, I'm able to reproduce this.
 After putting an assert() in k3dsdk/normal3.h, I can see that this
computation is happening in the painter cache code, so I'm going to hand
this off to Bart ...

Cheers,
Tim

#0  0x9334fe42 in __kill ()
#1  0x9334fe34 in kill$UNIX2003 ()
#2  0x933c223a in raise ()
#3  0x933ce679 in abort ()
#4  0x933c33db in __assert_rtn ()
#5  0x00d96351 in k3d::normalize (Normal=@0x18b02654) at normal3.h:207
#6  0x1848d0ca in
module::opengl::painters::detail::face_normals::on_face_end
(this=0x18b025f0, Face=43110) at
/Users/tshead/src/k3d/modules/opengl_painters/normal_cache.cpp:153
#7  0x1848d41a in
module::opengl::painters::detail::traverse_polyhedra<module::opengl::painters::detail::face_normals>
(Mesh=@0x18387030, Functor=@0x18b025f0) at
/Users/tshead/src/k3d/modules/opengl_painters/normal_cache.cpp:133
#8  0x1848f8c1 in
module::opengl::painters::detail::face_normals::on_execute
(this=0x18b025f0, Mesh=@0x18387030, Painter=0x255c600) at
/Users/tshead/src/k3d/modules/opengl_painters/normal_cache.cpp:196
#9  0x1845067f in module::opengl::painters::scheduler::execute
(this=0x18b025f0, Mesh=@0x18387030, Painter=0x255c600) at
painter_cache.h:219
#10 0x18490a30 in
module::opengl::painters::painter_cache<module::opengl::painters::detail::face_normals,
k3d::mesh const* const>::get_data (this=0x183ad580, Key=0x18387030,
Painter=0x255c600) at painter_cache.h:70
#11 0x18490a84 in
module::opengl::painters::get_data<module::opengl::painters::detail::face_normals>
(Key=0x18387030, Painter=0x255c600) at painter_cache.h:176
#12 0x18489d3b in module::opengl::painters::normal_cache::face_normals
(this=0x183995e0, Painter=0x255c600) at
/Users/tshead/src/k3d/modules/opengl_painters/normal_cache.cpp:296
#13 0x1846dac9 in module::opengl::painters::face_painter::on_paint_mesh
(this=0x255c600, Mesh=@0x18387030, RenderState=@0xbfffe394) at
/Users/tshead/src/k3d/modules/opengl_painters/face_painter.cpp:114
#14 0x1840fc96 in k3d::gl::mesh_painter::paint_mesh (this=0x255c600,
Mesh=@0x18387030, RenderState=@0xbfffe394) at mesh_painter_gl.h:57
#15 0x1847fbe4 in module::opengl::painters::multi_painter::on_paint_mesh
(this=0x16ddbc40, Mesh=@0x18387030, RenderState=@0xbfffe394) at
/Users/tshead/src/k3d/modules/opengl_painters/multi_painter.cpp:62
#16 0x1840fc96 in k3d::gl::mesh_painter::paint_mesh (this=0x16ddbc40,
Mesh=@0x18387030, RenderState=@0xbfffe394) at mesh_painter_gl.h:57
#17 0x18d92625 in module::mesh_instance::mesh_instance::on_gl_draw
(this=0x258e200, State=@0xbfffe6b8) at
/Users/tshead/src/k3d/modules/mesh_instance/mesh_instance.cpp:198
#18 0x18d9cd17 in
k3d::gl::renderable<k3d::ri::renderable<k3d::mesh_selection_sink<k3d::parentable<k3d::transformable<k3d::node>
> > > >::gl_draw (this=0x258e200, State=@0xbfffe6b8) at renderable_gl.h:78
#19 0x051d8127 in module::opengl::detail::draw::operator()
(this=0xbfffe648, Object=0x258e200) at
/Users/tshead/src/k3d/modules/opengl/render_engine.cpp:121
#20 0x051d8152 in std::for_each<std::_List_const_iterator<k3d::inode*>,
module::opengl::detail::draw> (__first={_M_node = 0x183adfc0},
__last={_M_node = 0xbfffe7a0}, __f={m_state = @0xbfffe6b8,
m_node_selection = 0x1ecaddc}) at stl_algo.h:158
#21 0x051dad15 in module::opengl::render_engine::render_viewport
(this=0x2029e00, Camera=@0x20368d4, PixelWidth=934, PixelHeight=578,
ViewMatrix=0x5f9f6a8, ProjectionMatrix=0x5f9f728, Viewport=0x5f9f7a8) at
/Users/tshead/src/k3d/modules/opengl/render_engine.cpp:533




------------------------------------------------------------------------------
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

 « Return to Thread: Bug or refactoring artifact?