From bc1262f4d61feeba235bb75046e65e0e8411241f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 22 Jun 2020 15:31:45 +1000 Subject: Fix T76303: Divide by zero importing X3D/WRL --- io_scene_x3d/import_x3d.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'io_scene_x3d') diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py index 5a1a4b32..653b8d9f 100644 --- a/io_scene_x3d/import_x3d.py +++ b/io_scene_x3d/import_x3d.py @@ -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 -- cgit v1.2.3