Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LEADER entites are saved with code 76 doubled #60

Open
lordofbikes opened this issue Mar 19, 2022 · 0 comments
Open

LEADER entites are saved with code 76 doubled #60

lordofbikes opened this issue Mar 19, 2022 · 0 comments
Labels
bug minor additional label to rate others

Comments

@lordofbikes
Copy link
Member

followup to LibreCAD/LibreCAD#875

The referenced LibreCAD issue is caused by LEADER entities without coordinates.

Means code 76 is 0 and AutoCAD abandon loading this file. Whereas other CAD software load the file by ignoring the malicious LEADER entity. This includes latest LibreCAD.

Investigating this LibreCAD issue brought up, that libdxfrw saves code 76 twice.

libdxfrw/src/libdxfrw.cpp

Lines 1043 to 1044 in 072aecd

writer->writeDouble(76, ent->vertnum);
writer->writeDouble(76, ent->vertexlist.size());

While this seems not to be a serious issue, it should be fixed anyhow.

It is also indicated, that the whole LEADER entity should be dropped on writing when ent->vertnum or ent->vertexlist.size() is less than 2.
This will not solve the cause of the LibreCAD issue, but it will avoid that AutoCAD rejects the file when the issue happens.

@lordofbikes lordofbikes added bug minor additional label to rate others labels Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug minor additional label to rate others
Projects
None yet
Development

No branches or pull requests

1 participant