Maniphest T71424

X3D VRML2 importer throws ZeroDivisionError when trying to import a certain KiCad file
Closed, DuplicateBUG

Assigned To
None
Authored By
Fabian Maurer (FabianMaurerRedheads)
Nov 8 2019, 1:35 PM
Tags
  • Add-ons (Community)
  • Import/Export
Subscribers
Fabian Maurer (FabianMaurerRedheads)
Germano Cavalcante (mano-wii)
Philipp Oeser (lichtwerk)

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

Related Objects

Mentioned Here
rB23e1fb365b65: Merge branch 'blender-v2.81-release'

Event Timeline

Fabian Maurer (FabianMaurerRedheads) created this task.Nov 8 2019, 1:35 PM
Germano Cavalcante (mano-wii) updated the task description.Nov 8 2019, 2:39 PM
Germano Cavalcante (mano-wii) lowered the priority of this task from 90 to 50.Nov 8 2019, 2:42 PM
Germano Cavalcante (mano-wii) added a project: Import/Export.
Germano Cavalcante (mano-wii) added subscribers: Bastien Montagne (mont29), Germano Cavalcante (mano-wii).

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) updated the task description.Nov 8 2019, 2:44 PM
Bastien Montagne (mont29) added a comment.Nov 8 2019, 2:57 PM

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

Bastien Montagne (mont29) removed a subscriber: Bastien Montagne (mont29).Nov 8 2019, 2:57 PM
Germano Cavalcante (mano-wii) lowered the priority of this task from 50 to Low.Nov 8 2019, 3:35 PM
Dalai Felinto (dfelinto) added a project: Tracker Curfew.Dec 23 2019, 1:44 PM
Philipp Oeser (lichtwerk) raised the priority of this task from Low to Normal.Feb 14 2020, 12:00 PM
Philipp Oeser (lichtwerk) removed a project: Tracker Curfew.
Philipp Oeser (lichtwerk) changed the subtype of this task from "Report" to "Bug".
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

Reconfirmed, still an issue, setting back to normal priority since we support X3D by default.
(still need to check internals, might be invalid geometry or Addon not supporting totally flat objects?)

Philipp Oeser (lichtwerk) renamed this task from Blender VRML2 importer throws ZeroDivisionError when trying to import a certain KiCad file to X3D VRML2 importer throws ZeroDivisionError when trying to import a certain KiCad file.Feb 14 2020, 2:37 PM