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

Add support for AC1032 (AutoCAD 2018) file format. #63

Merged
merged 4 commits into from
Oct 7, 2023

Conversation

michalg0x5a
Copy link
Contributor

It turns out that existing dwg parser is almost good enough to handle newer files. This series add minimal modifications to enable reading (simple) AC1032 files. No AC1032 format-specific changes have been added yet, so the AC1032 format support is unfortunately still a bit broken, but simple drawings should be read correctly.

Before the change object map section checksum was ignored. As a result,
if we started to parse object map sections past its actual contents, we could
read some garbage.

Given that we the code computes checksum correctly, we now use it to verify
if we are reading the right data. When we find invalid checksum, then we treat
it as file error.
Add preliminary support for AC1032. Given that it is very similar to R2013
format (at least according to Open Design Specification for .dwg files Version'
5.4.1), we can try to read newer format as is without much additional work.
Sample AC1032 fomat files are a bit peculiar - Handles section size is larger
than actual contents (looks like it is filled with padding). In the past we
would base on section size, but now we are a bit smarter and stop reading
object map sections upon finding empty section (as per ODA spec).
AC1032 file LayerControl object may refer to non-existant layers
(non-existant handles). We cannot really do anything about it, so we just
ignore such handles.

Behaviour has been confirmed with ODA explorer.
@dxli dxli merged commit dcaad27 into LibreCAD:master Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants