Lightmap unwrap improvements - prevent division by zero #113716
|
@ -114,8 +114,10 @@ class prettyface:
|
|||
# ngons work different, we store projected result
|
||||
# in UVs to avoid having to re-project later.
|
||||
for i, co in enumerate(cos_2d):
|
||||
self.uv[i][:] = ((co.x - xmin) / xspan,
|
||||
(co.y - ymin) / yspan)
|
||||
if xspan < 0.0000001 or yspan < 0.0000001:
|
||||
|
||||
self.uv[i][:] = (0, 0)
|
||||
else:
|
||||
self.uv[i][:] = ((co.x - xmin) / xspan, (co.y - ymin) / yspan)
|
||||
|
||||
self.children = []
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Is there a standard "epsilon" value to use instead?
There is
sys.float_info.epsilon
but it's ~2.2e-16
and often too small to be useful.