Skip to content

ELLIPSE should accept an axis ratio as small as 1e-10 #800

Description

@mozman

Discussed in #799

Originally posted by dmkh1984 December 15, 2022
Good day.
I open document (try DXF2018 and DXF2010/2013 formats, works same), delete some entities with paperspace.delete_entity(entity) and try to save document with doc.save() and got broken file and this:
`Traceback (most recent call last):
File "F:\Scipts\Delete\Delete.py", line 35, in
doc.save()
File "C:\Users\PyDev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ezdxf\document.py", line 543, in save
self.write(fp, fmt=fmt) # type: ignore
File "C:\Users\PyDev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ezdxf\document.py", line 601, in write
self.export_sections(tagwriter)
File "C:\Users\PyDev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ezdxf\document.py", line 620, in export_sections
self.entities.export_dxf(tagwriter)
File "C:\Users\PyDev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ezdxf\sections\entities.py", line 111, in export_dxf
layouts.modelspace().entity_space.export_dxf(tagwriter)
File "C:\Users\PyDev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ezdxf\entitydb.py", line 391, in export_dxf
entity.export_dxf(tagwriter)
File "C:\Users\PyDev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ezdxf\entities\dxfentity.py", line 686, in export_dxf
self.export_entity(tagwriter)
File "C:\Users\PyDev\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\ezdxf\entities\ellipse.py", line 126, in export_entity
assert is_valid_ratio(self.dxf.ratio)

AssertionError`

Overall, great package, big thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions