Fix T76303: Divide by zero importing X3D/WRL

This commit is contained in:
Campbell Barton 2020-06-22 15:31:45 +10:00
parent 866c2c1208
commit bc1262f4d6
Notes: blender-bot 2023-02-14 18:56:39 +01:00
Referenced by issue #76303, div by zero in addons / io_scene_x3d / import_x3d when importing .wrf file
1 changed files with 6 additions and 0 deletions

View File

@ -2043,6 +2043,12 @@ def importMesh_IndexedFaceSet(geom, ancestry):
t_min = mins[t_axis]
dt = deltas[t_axis]
# Avoid divide by zero T76303.
if not (ds > 0.0):
ds = 1.0
if not (dt > 0.0):
dt = 1.0
def generatePointCoords(pt):
return (pt[s_axis] - s_min) / ds, (pt[t_axis] - t_min) / dt
loops = [co for f in faces