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

INSERT encoding errors (was: dwgrewrite error) #990

Closed
oyoyogg opened this issue Jul 1, 2024 · 7 comments
Closed

INSERT encoding errors (was: dwgrewrite error) #990

oyoyogg opened this issue Jul 1, 2024 · 7 comments
Assignees
Labels
blocking bug Something isn't working

Comments

@oyoyogg
Copy link

oyoyogg commented Jul 1, 2024

hello ,I saved the DWG2000 file with dwgrewrite and the CAD does not recognize the opening error
./dwgrewrite -v9 -o ./example_file_rewrite.dwg ./example_file.dwg

@oyoyogg
Copy link
Author

oyoyogg commented Jul 1, 2024

Can you provide a verification tool for DWG files to check for structure errors? thank you

@rurban
Copy link
Contributor

rurban commented Jul 1, 2024

dwgread.c is such a tool. ODAFileConverter is another.

@oyoyogg
Copy link
Author

oyoyogg commented Jul 1, 2024

stadium1_plan_level6_2000_cad.zip

The test file opens normally with CAD, but it cannot be opened after converting with a dwgrewrite.
`nohup ./dwgrewrite -v3 -o ./stadium1_plan_level6_2000_cad_rw.dwg ./stadium1_plan_level6_2000_cad.dwg >./spal_rw1.log

log:
Next object: 44871 Handleoff: 0x1 [UMC]

Object number: 44871/AF47, Size: 84 [MS], Type: 7 [BS]
Add entity INSERT [44871] Decode entity INSERT
bitsize: 561 [RL] @3.2
Hdlsize: 0x6F,
handle: 0.2.C57F [H 5]

num_eed: 0
preview_exists: 0 [B 0]
entmode: 2 [BB 0]
num_reactors: 0 [BL 0]
nolinks: 0 [B 0]
color.index: 256 [CMC.BS 62]
ltype_scale: 10 [BD 48]
ltype_flags: 0 [BB 0]
plotstyle_flags: 0 [BB 0]
invisible: 0 [BS 60]
linewt: 0x1d [RC 370]
xdicobjhandle: (3.0.0) abs:0 [H 360]
prev_entity: (4.2.C57E) abs:50558 [H 0]
next_entity: (4.2.C580) abs:50560 [H 0]
layer: (5.2.35C4) abs:13764 [H 8]
ins_pt: (-205953, 272724, 0) [3BD 10]
scale_flag: 1 [BB 0]
scale: (1, 1, 1) [DD 41]
rotation: -2.45077e+58 [BD 50] -1.40419e+60º
ERROR: bit_read_BD: unexpected 2-bit code: '11'
extrusion: (-2.25534e+241, 0, 0) [3BD 0]
has_attribs: 0 [B 0]
block_header: (5.2.4FA) abs:1274 [H 0]
crc: 6517 [RSx]
check_CRC 86: 6517 == 6517

Next object: 44872 Handleoff: 0x1 [UMC]

Object number: 44872/AF48, Size: 84 [MS], Type: 7 [BS]
Add entity INSERT [44872] Decode entity INSERT
bitsize: 561 [RL] @3.2
Hdlsize: 0x6F,
handle: 0.2.C580 [H 5]

num_eed: 0
preview_exists: 0 [B 0]
entmode: 2 [BB 0]
num_reactors: 0 [BL 0]
nolinks: 0 [B 0]
color.index: 256 [CMC.BS 62]
ltype_scale: 10 [BD 48]
ltype_flags: 0 [BB 0]
plotstyle_flags: 0 [BB 0]
invisible: 0 [BS 60]
linewt: 0x1d [RC 370]
xdicobjhandle: (3.0.0) abs:0 [H 360]
prev_entity: (4.2.C57F) abs:50559 [H 0]
next_entity: (4.2.C581) abs:50561 [H 0]
layer: (5.2.35C4) abs:13764 [H 8]
ins_pt: (-211786, 271419, 0) [3BD 10]
scale_flag: 1 [BB 0]
scale: (1, 1, 1) [DD 41]
rotation: -2.45077e+58 [BD 50] -1.40419e+60º
ERROR: bit_read_BD: unexpected 2-bit code: '11'
ERROR: bit_read_BD: unexpected 2-bit code: '11'

extrusion: (-3.44137e+236, 0, 0) [3BD 0]
has_attribs: 1 [B 0]
block_header: (5.2.500) abs:1280 [H 0]
ERROR: bit_read_RC buffer overflow at 83.1 + 1 > 84
first_attrib: NULL 4 [H 0]
ERROR: bit_read_RC buffer overflow at 83.1 + 1 > 84
last_attrib: NULL 4 [H 0]
ERROR: bit_read_RC buffer overflow at 83.1 + 1 > 84

seqend: NULL 3 [H 0]
crc: 60C0 [RSx]
check_CRC 86: 60C0 == 60C0
`

@oyoyogg oyoyogg changed the title test dwg error,CAD opening error dwgrewrite error,CAD does not recognize Jul 2, 2024
@rurban rurban self-assigned this Jul 2, 2024
@rurban rurban added bug Something isn't working blocking labels Jul 2, 2024
@rurban
Copy link
Contributor

rurban commented Jul 2, 2024

INSERT encoding errors

@rurban rurban changed the title dwgrewrite error,CAD does not recognize INSERT encoding errors (was: dwgrewrite error) Jul 2, 2024
@oyoyogg
Copy link
Author

oyoyogg commented Jul 2, 2024

I found out through the CAD coordinate positioning that there should be an error at dwg_read_file, ins_pt the corresponding block could not be found on the CAD

@rurban
Copy link
Contributor

rurban commented Jul 2, 2024

The bit_write_DD 41 seems to be wrong, because the next rotation is clearly wrong.
And the offsets do not match.

rurban added a commit that referenced this issue Jul 5, 2024
Fixes GH #990.
With scale_flag 1 we must not write scale.x
rurban added a commit that referenced this issue Jul 5, 2024
Fixes GH #990.
With scale_flag 1 we must not write scale.x
@rurban
Copy link
Contributor

rurban commented Jul 5, 2024

With scale_flag 1 we must not write scale.x, it defaults to 1.0

@rurban rurban closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants