Fix T76303: Divide by zero importing X3D/WRL
This commit is contained in:
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
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue