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

Improve logging of LTYPE dashes in dwgread output #956

Open
michal-josef-spacek opened this issue Mar 12, 2024 · 5 comments
Open

Improve logging of LTYPE dashes in dwgread output #956

michal-josef-spacek opened this issue Mar 12, 2024 · 5 comments

Comments

@michal-josef-spacek
Copy link
Contributor

Example (r14):
ltype1.dwg.gz

This is line with two text dashes.

Output:

Next object: 27 Handleoff: 0xB [UMC] Offset: -1254 [MC] @1896
==========================================
Object number: 27/1B, Size: 510 [MS], Type: 57 [BS], Address: 1898
Add table record LTYPE [27] Decode table record LTYPE
handle: 0.1.28 [H 5]
EED[0] size: 0 (end)
num_eed: 0
bitsize: 3980 [RL]
 Hdlsize: 0x64, hdl_dat: @497.4 - @510.0 (510)
num_reactors: 0 [BL 0]
ownerhandle: (4.1.5) abs:5 [H 330]
xdicobjhandle: (3.0.0) abs:0 [H 360]
--common_size: 52
name: "FOO" [T 2]
is_xref_ref: 1 [B 0]
is_xref_resolved: 0 [BS 0]
is_xref_dep: 0 [B 0]
xref: (5.0.0) abs:0 [H 0]
description: "---- FOO ---- BAR ---- FOO ---- BAR ---- FOO --" [T 3]
pattern_len: 1.8 [BD 0]
alignment: 0x41 [RC 72]
numdashes: 6 [RC 73]
dashes[0].length: 0.5 [BD 49]
dashes[0].complex_shapecode: 0 [BS 75]
dashes[rcount1].style: (5.0.0) abs:0 [H 340]
dashes[0].x_offset: 0 [RD 44]
dashes[0].y_offset: 0 [RD 45]
dashes[0].scale: 1 [BD 46]
dashes[rcount1].rotation: 0 [BD 50]  0º
dashes[0].shape_flag: 0 [BS 74]
dashes[1].length: -0.2 [BD 49]
dashes[1].complex_shapecode: 0 [BS 75]
dashes[rcount1].style: (5.1.10) abs:16 [H 340] => STYLE STANDARD
dashes[1].x_offset: -0.1 [RD 44]
dashes[1].y_offset: -0.05 [RD 45]
dashes[1].scale: 0.1 [BD 46]
dashes[rcount1].rotation: 0 [BD 50]  0º
dashes[1].shape_flag: 2 [BS 74]
dashes[2].length: -0.2 [BD 49]
dashes[2].complex_shapecode: 0 [BS 75]
dashes[rcount1].style: (5.0.0) abs:0 [H 340]
dashes[2].x_offset: 0 [RD 44]
dashes[2].y_offset: 0 [RD 45]
dashes[2].scale: 1 [BD 46]
dashes[rcount1].rotation: 0 [BD 50]  0º
dashes[2].shape_flag: 0 [BS 74]
dashes[3].length: 0.5 [BD 49]
dashes[3].complex_shapecode: 0 [BS 75]
dashes[rcount1].style: (5.0.0) abs:0 [H 340]
dashes[3].x_offset: 0 [RD 44]
dashes[3].y_offset: 0 [RD 45]
dashes[3].scale: 1 [BD 46]
dashes[rcount1].rotation: 0 [BD 50]  0º
dashes[3].shape_flag: 0 [BS 74]
dashes[4].length: -0.2 [BD 49]
dashes[4].complex_shapecode: 4 [BS 75]
dashes[rcount1].style: (5.1.10) abs:16 [H 340] => STYLE STANDARD
dashes[4].x_offset: -0.1 [RD 44]
dashes[4].y_offset: -0.05 [RD 45]
dashes[4].scale: 0.1 [BD 46]
dashes[rcount1].rotation: 0 [BD 50]  0º
dashes[4].shape_flag: 2 [BS 74]
dashes[5].length: -0.2 [BD 49]
dashes[5].complex_shapecode: 0 [BS 75]
dashes[rcount1].style: (5.0.0) abs:0 [H 340]
dashes[5].x_offset: 0 [RD 44]
dashes[5].y_offset: 0 [RD 45]
dashes[5].scale: 1 [BD 46]
dashes[rcount1].rotation: 0 [BD 50]  0º
dashes[5].shape_flag: 0 [BS 74]
strings_area: "FOO" [TF 256 0]
dashes[1] @0
dashes[4] @4
 padding: +4
 object_map{28} = 27
 padding: 0/0 (4 bits)
crc: 2927 [RSx]
 check_CRC 1896-2408 = 512: 2927 == 2927

I am focusing to lines:

strings_area: "FOO" [TF 256 0]
dashes[1] @0
dashes[4] @4

In strings area is "FOO" \0 "BAR", but in logging is only "FOO", because \0.
I think that we need better logging of strings_area than TF. I am proposing hexadecimal output.

I am proposing to log real text to each dash. Something like:

dashes[1] FOO @0
dashes[4] BAR @4
@michal-josef-spacek
Copy link
Contributor Author

PR for adding of text to log: #957

@michal-josef-spacek
Copy link
Contributor Author

Another issue is r13 DWG (AC1012) which has on begin of strings_area \0
Example:
ltype1_r13.dwg.gz

Same example as previous (FOO and BAR)

Output:

strings_area: "" [TF 256 0]
dashes[1] @0
dashes[4] @1

I don't understand what this \0 mean. Some unknown RC before strings_area?

@michal-josef-spacek
Copy link
Contributor Author

I updated PR.
Actual logging output:

...
strings_area: "FOO" [TF 256 0]
dashes[1].text: "FOO" [TF 3 9] @0
dashes[4].text: "BAR" [TF 3 9] @4
...

@michal-josef-spacek
Copy link
Contributor Author

I updated PR for LTYPE version on R13. Tested on DWGs.

@michal-josef-spacek
Copy link
Contributor Author

The only thing to do is bad strings_area

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

No branches or pull requests

1 participant