Page MenuHome

Blender VRML2 importer throws ZeroDivisionError when trying to import a certain KiCad file
Open, Confirmed, LowPublic

Description

Blender Version
Broken:
2.8 release
2.8.2 alpha (23e1fb365b65)

Short description of error
VRML2 (.wrl) import fails with ZeroDivisionError
It divides by zero inside import_x3d.py (for me in line 2047), because a bit earlier x_min and x_max are the same.

C:\Germano\Dev\BlenderDev\blender\release\scripts\addons\io_scene_x3d\import_x3d.py:1270: DeprecationWarning: 'U' mode is deprecated
  filehandle = open(path, 'rU', encoding='utf-8', errors='surrogateescape')
Traceback (most recent call last):
  File "C:\Germano\Dev\BlenderDev\blender\release\scripts\addons\io_scene_x3d\__init__.py", line 78, in execute
    return import_x3d.load(context, **keywords)
  File "C:\Germano\Dev\BlenderDev\blender\release\scripts\addons\io_scene_x3d\import_x3d.py", line 3633, in load
    global_matrix=global_matrix,
  File "C:\Germano\Dev\BlenderDev\blender\release\scripts\addons\io_scene_x3d\import_x3d.py", line 3529, in load_web3d
    importShape(bpycollection, node, ancestry, global_matrix)
  File "C:\Germano\Dev\BlenderDev\blender\release\scripts\addons\io_scene_x3d\import_x3d.py", line 3148, in importShape
    bpydata = geom_fn(geom, ancestry)
  File "C:\Germano\Dev\BlenderDev\blender\release\scripts\addons\io_scene_x3d\import_x3d.py", line 2048, in importMesh_IndexedFaceSet
    loops = [co for f in faces
  File "C:\Germano\Dev\BlenderDev\blender\release\scripts\addons\io_scene_x3d\import_x3d.py", line 2050, in <listcomp>
    for co in generatePointCoords(points[v])]
  File "C:\Germano\Dev\BlenderDev\blender\release\scripts\addons\io_scene_x3d\import_x3d.py", line 2047, in generatePointCoords
    return (pt[s_axis] - s_min) / ds, (pt[t_axis] - t_min) / dt
ZeroDivisionError: float division by zero

Exact steps for others to reproduce the error

Details

Type
Bug

Event Timeline

Germano Cavalcante (mano-wii) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.Fri, Nov 8, 2:42 PM

I can confirm.
@Bastien Montagne (mont29), you are one of the maintainers of this addon.
Do you mind taking a look?

@Germano Cavalcante (mano-wii) that add-on is not officially maintained anymore by blender…

Germano Cavalcante (mano-wii) lowered the priority of this task from Confirmed, Medium to Confirmed, Low.Fri, Nov 8, 3:35 PM