CGCookie / retopoflow

A suite of retopology tools for Blender
2.48k stars 249 forks source link

Polypen division by zero #238

Closed Nocturael closed 8 years ago

Nocturael commented 8 years ago

In 1.2.0 beta 2, when I try to use the Polypen on a certain mesh target, I get an error message and all vertecies get hidden. Sadly, I have not yet managed to reproduce the bug with another mesh or isolate the conditions of the problem.

EXCEPTION (<class 'ZeroDivisionError'>): float division by zero C:\Users\Nicolas Braun\AppData\Roaming\Blender Foundation\Blender\2.77\scripts\addons\retopoFlow\lib\common_utilities.py 000 0623:closest_t_and_distance_point_to_line_segment() return (d_on_line/v01.length, (p-p_on_line).length) C:\Users\Nicolas Braun\AppData\Roaming\Blender Foundation\Blender\2.77\scripts\addons\retopoFlow\op_polypen\polypen_modal.py 001 0649:closest_bmedge() t,d3d = closest_t_and_distance_point_to_line_segment(p3d, bmv0.co, bmv1.co) 002 0284:modal_wait() res = self.closest_bmedge(context, p2d, p3d, 5, 0.05) C:\Users\Nicolas Braun\AppData\Roaming\Blender Foundation\Blender\2.77\scripts\addons\retopoFlow\modaloperator.py 003 0244:modal_main() nmode = self.FSM['wait'](context, eventd) 004 0299:modal() nmode = self.FSM[self.fsm_mode](context, eventd)

vxlcoder commented 8 years ago

@Nocturael, that model likely has an edge with zero length (the two endpoint vertices are at the same location). the above fix should fix polypen from throwing exceptions. please let me know if you still get that error. thanks!

Nocturael commented 8 years ago

That fixed it, thanks.