You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Not sure if this is a bug but I have a DXF that contains a SPLINE that has two identical control points thus resulting in division by zero. When the file is opened in QCAD the corrupted (?) SPLINE gets removed. See attached DXF files.
Here is the trace:
$ ezdxf draw splinetest.dxf
loading file "splinetest.dxf"...
Traceback (most recent call last):
File "/home/vscode/.local/bin/ezdxf", line 8, in<module>sys.exit(main())
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/__main__.py", line 98, in main
run(args)
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/commands.py", line 390, in run
frontend.draw_layout(layout, finalize=True)
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/addons/drawing/frontend.py", line 242, in draw_layout
self.draw_entities(
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/addons/drawing/frontend.py", line 259, in draw_entities
_draw_entities(self, self.ctx, entities, filter_func=filter_func)
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/addons/drawing/frontend.py", line 1030, in _draw_entities
frontend.draw_entity(entity, properties)
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/addons/drawing/frontend.py", line 278, in draw_entity
draw_method(entity, properties)
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/addons/drawing/frontend.py", line 378, in draw_curve_entity
path = make_path(entity)
File "/usr/local/lib/python3.10/functools.py", line 889, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/path/converter.py", line 164, in _from_spline
tools.add_spline(path, spline.construction_tool(), level=level, reset=True)
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/path/tools.py", line 731, in add_spline
curves = spline.cubic_bezier_approximation(level=level)
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/math/bspline.py", line 1309, in cubic_bezier_approximation
points = list(self.points(self.approximation_params(level)))
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/math/bspline.py", line 1326, in approximation_params
params = list(create_t_vector(self._control_points, "chord"))
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/math/parametrize.py", line 41, in distance_t_vector
yield from _normalize_distances(list(linear_distances(fit_points)))
File "/home/vscode/.local/lib/python3.10/site-packages/ezdxf/math/parametrize.py", line 57, in _normalize_distances
yield s / total_length
ZeroDivisionError: float division by zero
Describe the bug
Not sure if this is a bug but I have a DXF that contains a
SPLINE
that has two identical control points thus resulting in division by zero. When the file is opened in QCAD the corrupted (?)SPLINE
gets removed. See attached DXF files.Here is the trace:
To Reproduce
Version info:
Please find attached simplified splinetest.dxf.zip DXF that triggers the error:
splinetest.dxf.zip
The text was updated successfully, but these errors were encountered: