forked from LibreDWG/libredwg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangeLog
14924 lines (9974 loc) · 434 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Full history from the git log
-----------------------------
2019-12-25 Reini Urban <[email protected]>
Release 0.9.3
2019-12-25 Reini Urban <[email protected]>
enable ax_restrict
re-format docs: autoconf-archive is pretty strict
gcc-9.2 on fedora has it fixed.
enable it. we do have several small inlined functions with loops on arrays,
so it might affects us. See GH #141
2019-12-25 Reini Urban <[email protected]>
fix -Wcpp warning with AX_ADD_FORTIFY_SOURCE
protect from invalid preR13 table numbers
various int overflows. Fixes GH #176, case 8.
add more preR13 error handling.
Fixes the remaining GH #176 case 9
more illegal preR13 protections
and optional byte overflow counter to abort >200
errors. Helpful in fuzzing, but not really useful for
libs, the program must install a SIGABRT handler then.
Fixes part of the remaining GH #176 case 9 (id:000024)
2019-12-24 Reini Urban <[email protected]>
fix REPEAT overflow check for <r2004
earlier DWGs can also be broken to include wrong REPEAT counts.
Fixes Case 3 of GH #176
fix ref double-free on error
Let the ref loop in dwg_free() free those refs.
Fixes case 5 of GH #176.
fix illegal SPLINE scenarios
from fuzzed DWGs, See GH #176, case 1
2019-12-20 Reini Urban <[email protected]>
fix dwg_find_table_extname -Wnull-dereference
use format(ms_printf) only on _WIN32
silences a few warnings
fix theoretical strncpy truncations
gcc-9 warns too much to my taste.
2019-11-07 Reini Urban <[email protected]>
geom: fix transform_OCS
normalized the wrong vector, ax => az typo,
worked with random stack values.
fix PROXY_ENTITY.ownerhandle leak
found in example r13 DWGs
extnames: add documentation
Closes GH #167
dwg_find_table_extname improved
find more ACAD_XREC_ROUNDTRIP, not only at the first index.
find the correct XRECORD via the xdic itemhandles[], no need to search
the next or all XRECORDs
extnames: only for r13-r14
EXTNAMES do not exist since r2000. just ignore it
and return the normal layer name
extnames: abstract is_extnames_xrecord
and xdata_string_match, which catches now
linked xrecs, which are not EXTNAMES
DICTIONARY.itemhandles always
i.e. also for r13 and r14, where it is needed for XRECORD
EXTNAMES
implement dwg_find_table_extname
See GH #167
2019-11-06 Reini Urban <[email protected]>
extnames: use dwg_find_table_extname
to be implemented yet
prepare dwglayers --extnames
see GH #167
2019-11-05 Reini Urban <[email protected]>
fixup gen-dynapi.pl for HANDLE_VECTOR_N
to generate the same docs (dxf 331)
2019-11-05 Reini Urban <[email protected]>
fix SORTENTSTABLE leak
HANDLE_VECTOR does an overflow check, with resetting the
num_ents field. Which does not free the sort_ents then anymore.
Note that SORTENTSTABLE.ents can be empty in some dwgs. They are
filled with NULLs then.
2019-11-05 Reini Urban <[email protected]>
fixup dwglayers, add asserts
and flush each layer line. It can error during the loop.
fix dwglayers
on empty layer_control.entries.
Closes GH #166, thanks to @fpmalard for the testcase
fflush (stdout) before dwg_free
on programs printing to stdout. They might fail there.
See GH #166, thanks to @fpmalard.
2019-10-31 Reini Urban <[email protected]>
update TODO
2019-10-30 Reini Urban <[email protected]>
rm README-alpha
already beta since 0.9
more geom.h use
use M_PI
change extrusion types from 3DPOINT,3BD to BE
2019-10-30 Reini Urban <[email protected]>
dwg2SVG: add POLYLINE_2D and LWPOLYLINE
basic lines only. no arcs (bulges), no other curve_types (spline, bezier)
no widths.
Closes GH #137
2019-10-30 Reini Urban <[email protected]>
fix geom normalize div by zero
add programs/geom.c utilities
for dwg2SVG and dwg2ps
dwg2SVG: add transform_OCS
See #165
add OCS doc Closes #165
2019-10-29 Reini Urban <[email protected]>
add FIELD_BE logging to decode
some .x values are flipped when extrusion.z is -1.0. see GH #165
more fixup illegal bitsizes
document codepage names
2019-10-28 Reini Urban <[email protected]>
set aligned_access_required on ubsan
fail with illegal section_info num_desc2
with a fuzzed dwg. cannot continue then
fix bit_read_RC overflow
found when fuzzing on 32bit.
fixup illegal bitsize's.
2019-10-28 Reini Urban <[email protected]>
Release 0.9.1
Implement ALIGNED_ACCESS_REQUIRED bit_convert_TU
when the wstr pointer is unaligned. E.g. for ubsan
check for ALIGNED_ACCESS_REQUIRED
stricter risc machines, like sparc, alpha.
but also settable for intel or with ubsan.
2019-10-27 Reini Urban <[email protected]>
fix r2007 Invalid section->pages[%d].*size
via fuzzing. skip invalid sections. replace assert
with proper error
fix xdata hang
on buf overflow. check for advance
fix info->sections[0] NULL deref
found by fuzzing
fix xdata hangs
error with wrong xdata types
fix decode_R13_R2000 stack-overflow
with too many sections (i.e. 8)
2019-10-26 Reini Urban <[email protected]>
fix VECTOR_CHKCOUNT overflow
e.g. with num_owned = 2147483899 * unsigned, overflowing to a low int (512)
fix divide by zero in VPORT.aspect_ratio
fix ub in bit_reset_chain overflow
ubsan runtime error: addition of unsigned offset to 0x00010a401800
overflowed to 0x00010a4014c1, asan fuzzing.
fix decode_3DSOLID VECTOR_CHKCOUNT
where obj->nam may be realloced but not cleared, resulting
in an invalid free
2019-10-25 Reini Urban <[email protected]>
fail with VALUEOUTOFBOUNDS ent num_reactors
usually only found when fuzzing
fix #162 decompression DOS
check while loops for exhaustion.
fix #163 header.section[SECTION_HEADER_R13].size - 34
overflow, with empty size. Illegal fuzzed dwg only.
fix #162 Null pointer dereference in check_POLYLINE_handles
fuzzed DWG only, not a real one
2019-10-24 Reini Urban <[email protected]>
skip test with x86_64-mingw-w64 gcc-9.2.0 miscompilation
in bit_read_H with val[i]: (%rbx) being dat+1.
Previous compilers are fine.
similar errors also in other packages.
warn about this problem, to use an older working compiler.
2019-10-24 Reini Urban <[email protected]>
fix section[].size overflow
Fixes GH #160
fix Overflow section_array_size dos
Only allow a certain amount of overflows, to repair it later.
Fixes GH #161
fix decode 2004 literal_length overflow
Fixes GH #159.
Check the initial literal_length also, not only in the loop
fix Null pointer dereference in decode_R13_R2000 #158
unit-testing: fix -Wunused-function warning
ok is unused in dynapi_test.c
probe for attribute format(ms_printf)
2019-10-23 Reini Urban <[email protected]>
decode: fix more leaks on DWG_ERR_VALUEOUTOFBOUNDS
found by e.g. GH #156 fuzzing testcases, bailing out early
on REPEAT_CHKCOUNT
decode: fix thumbnail sentinel mismatch leak
detected by GH #156
bits_test: fix Conditional jump or move depends on uninitialised value
bitchain.opts was left uninitialized on the stack, needed for LOG_TRACE
probe for attribute format(gnu_printf)
bits_test: more leaks
all now
bits_test: fix leaks
fix bit_read_4BITS
off-by-one for the first bit.
Only detected by mingw-w64-x86_64
2019-10-22 Reini Urban <[email protected]>
fix win32 multiple definition of `dwg_version_type
in test/unit-testing/decode_test
add dwg_version_type()
a printable release version string
_FORTIFY_SOURCE: and add -fstack-protector
on mingw32-w64 for broken _FORTIFY_SOURCE.
This adds -lssp (needed for _FORTIFY_SOURCE)
and is useful in its own acount.
2019-10-19 Reini Urban <[email protected]>
fixup prev. ax_add_fortify_source
[] needs to be quoted. use something else.
2019-10-19 Reini Urban <[email protected]>
fix AX_ADD_FORTIFY_SOURCE for msys2
msys2 bug with headers-git-7.0.0.5546.d200317d-1
either add -fstack-protector for -lssp to be added,
or omit adding -D_FORTIFY_SOURCE=2 to CPPFLAGS.
See https://github.com/msys2/MINGW-packages/issues/5868
actually try to link it, to catch it
2019-10-18 Reini Urban <[email protected]>
fix REPEAT -Wtype-limits checks
uint32_t has only 4 byte. check for signedness overflow.
indxf: protect NULL derefs
detected by mingw gcc only
fix win32 decode logging
eed wstring
2019-10-18 Reini Urban <[email protected]>
dwg2SVG: honor TTF font styles => Verdana or Courier.
Translate font-styles to svg font-families.
Use Courier for all non-ttf fonts, and Arial or Verdana for ttf fonts.
There's no SIMPLEX or COMPLEX in svg imho.
Closes #156
2019-10-18 Reini Urban <[email protected]>
fix leak in r2007+ dwg_ref_tblname logging
a temp. utf8 handle ref name
2019-10-08 Reini Urban <[email protected]>
spec: LIGHT.shadow_map_size
see unknown LIGHT.pi
unknown: minor fixes
2019-10-06 Reini Urban <[email protected]>
Release 0.9
2019-10-05 Reini Urban <[email protected]>
indxf: fix VIEW_CONTROL 70 -1
which appears in the wild.
fix get_next_owned_entity
esp needed for dwg2dxf, which missed the very last
block entity. Fixes GH #143, thanks to @soundd1
dxf: fix BLOCK.base_pt
take it from the BLOCK_HEADER. see GH #143
fix bit_convert_TU for >U+0800
a major blunder. wrong order of bytes AND wrong numbers.
thanks to some chinese examples with chinese application names,
esp. GH #109 and #143
2019-10-04 Reini Urban <[email protected]>
fix int overflows
detected by lgtm
dxf: VALUEOUTOFBOUNDS CellStyle.num_borders
overflow with gh143/testBlock
regen broken 2000/TS1.dxf example
it could not even be loaded by acad
dxf: fix FIELD_BSd formatting
%6i, not %d.
E.g. $DIMLWE
bindings: add dynapi
2019-10-04 lorenz <[email protected]>
swig: swig4 needs "stdint.i" to be included (PR #153)
2019-10-02 Reini Urban <[email protected]>
dxf: encode all r2007+ strings as utf-8
see e.g. GH #109 and #143
dxf-check: we start with dxf not dwg
dynapi: add dxf for VISUALSTYLE.unknown_float45
even if unused in DWG
indxf: add_LTYPE_dashes
spec: restrict POLYLINE_MESH to max 100000 vertices
alloc failure with 32bit fuzzing there
dwg2SVG: ignore empty pspaces
We also assume all refs are resolved already.
Fixes GH #109
decode: fix more -Wsign-compare
and -Wtype-limits
decode: fix a -Wsign-compare
fuzz: skip corrupt classes
avoid strcmp on NULL
fuzz: fail on corrupt es.fields.address
protect from overflow segv, found via fuzzing.
Turn asserts into an error
fuzz: more section repair protection
segv on i = 0 with [i - 1]
2019-10-02 Reini Urban <[email protected]>
fuzz: protect from dat overflow
ERROR: bit_read_RC buffer overflow at 18446744073709549374
bits.c:103:14: runtime error: addition of unsigned offset to 0x7ff41c4a9800 overflowed
undefined-behavior
dont advance already overflowed pointer
2019-10-02 Reini Urban <[email protected]>
decode: fix NULL strcmp
found via fuzzing, with corrupt input
decode: fix double-free
with corrupt compressed sections.
Found via fuzzing
fixup htmlescape in src/out_json.h
this is not library specific, just for helper programs.
moved to programs/escape.h
2019-10-01 Reini Urban <[email protected]>
new programs/escape.c,h
extract from out_json, because we dont want
to add these to the API
2019-10-01 Reini Urban <[email protected]>
dwg2SVG: htmlescape strings and names
and for widestrings escape to hex.
Also protect from a few NULL strings.
Closes GH #149
2019-10-01 Reini Urban <[email protected]>
spec: splice TABLECONTENT into TABLE r2010+
as macro, not to duplicate it.
spec: merge TABLECONTENT into TABLE r2010+
a call will not work. TABLECONTENT is only an object, not an entity
and has totally different offsets.
Either put it into a macro or duplicate it.
2019-10-01 Reini Urban <[email protected]>
indxf: resolve_postponed_object_refs
some TABLE/BLOCK/OBJECT field handles neeed to be resolved
at the end, when the blocks and tables are all read.
e.g. INSERT.block_header and various layer or other entity names
Fixes GH #150, INSERT.block_header missing
2019-10-01 Reini Urban <[email protected]>
encode: fix VPORT.VIEWMODE
bit_write_4BITS was broken, and the indxf calculation was missing.
simplify the 4BITS reader and writer, add proper bit logging.
indxf: set UCSFOLLOW and VIEWMODE
2019-10-01 Reini Urban <[email protected]>
decode: better pt logging
print the proper point types, not just RD or BD
indxf: fix VPORT.aspect_ratio
r13+ aspect_ratio is calculated, the internal field
really is VPORT.viewwidth. added to the API.
calculate both.
indxf: more default points values
e.g. VPORT.view_target.z (GH #150)
2019-09-30 Reini Urban <[email protected]>
indxf: fix default points values
e.g. WIPEOUT.uvec (GH #150)
indxf: IMAGE,WIPEOUT.imagedefreactor is code 3
not 5.
2019-09-30 Reini Urban <[email protected]>
change DIMASSOC, indxf: add_DIMASSOC
change the spec a bit.
H 331 seems to be repeated with main_subent_type 73,
H 332 with intsect_subent_type 74
The other handles seem to be superfluous.
Change the order of order of some fields to allow proper dxf
roundtrips.
(just rotated_type fails still)
Only the indices with the bit set in associativity are filled. (no change)
2019-09-30 Reini Urban <[email protected]>
indxf: add_PERSSUBENTMANAGER, add_ASSOCDEPENDENCY
but some of them are not yet encoded.
encode: implement encode_3dsolid
for most cases no encryption needed.
decode has it already, indxf also
indxf: add postprocess_TEXTlike and MTEXT defaults
to minimize defaults to dataflags,
and set default style handle.
2019-09-29 Reini Urban <[email protected]>
json: work on TABLE segv
when it errored on decode TABLE after num_owned.
Don't decode a r2010+ TABLE/CONTENT object header twice, only
process the fields, because it's an entity afterall, not an object.
But now we need to share the struct fields somehow.
2019-09-29 Reini Urban <[email protected]>
indxf: add_TABLESTYLE
for the subfields.
We need a seperate Dwg_TABELSTYLE_border from Dwg_BorderStyle
because of two major differences: BL visible vs B invisible, and
BL vs BS linewt.
2019-09-29 Reini Urban <[email protected]>
harmonize REPEAT names
_ adds idx
C does no checks
N does constant times (else _obj->times)
(and cannot reset times to 0 on error)
F does not calloc/free
spec: VALUEOUTOFBOUNDS TABLEGEOMETRY cell.num_geom_data
as it happens in example_r13.dwg
more DEBUG: unstable TABLESTYLE
promote TABLESTYLE from debugging-only to unstable (just r2010+ is unhandled).
2019-09-28 Reini Urban <[email protected]>
more DEBUG: check CELLSTYLEMAP overflow
samples with too small CELLSTYLEMAP survive now roundtrips.
fix MATERIAL color types
decode: check for bits string overflows
encode: better point logging
indxf: fix new_LWPOLYLINE
no bulges unless needed.
properly encode flags from dxf, honor defaults.
e.g. no const_width if 0.0.
2019-09-28 Reini Urban <[email protected]>
spec: add TABLESTYLE
at least until r2010.
reformat wrong dwg_api.
also fix a few minor ASSOCACTION decl problems.
2019-09-27 Reini Urban <[email protected]>
DOCUMENTOPTIONS is alias for CSACDOCUMENTOPTIONS
dxf, log: shorter make
2019-09-27 Reini Urban <[email protected]>
encode: fix entity bitsize calculation
set START_HANDLE_STREAM for entities in COMMON_ENTITY_HANDLE_DATA.
Fixes GH #142, the very first version which imports most entities.
2019-09-27 Reini Urban <[email protected]>
indxf: comments, logging only
dxf-check for 2000/TS1
use the proper basename
indxf: encode OLE2FRAME.data 310
2019-09-27 Reini Urban <[email protected]>
indxf: fix new_MLINESTYLE_lines
forgot to set MLINESTYLE.num_lines
also improve some obj->type checks. by int, not by name
2019-09-27 Reini Urban <[email protected]>
api: add dwg_find_dicthandle
fixes dwg_find_tablehandle for dicts.
We need to search for the name in the dict given by the first NOD search.
Not just returning this dict. With MLSTYLE we need to return the
MLINESTYLE object ref.
Also use the absolute refs, even if dict handles are code 2, not 4.
2019-09-27 Reini Urban <[email protected]>
indxf: cosmetics only
HEADER.CMLSTYLE is still pointing to the wrong
MLEADERSTYLE object, not MLINESTYLE.
decode: more stable eed decoder
with overflow, e.g. when dat does not advance error earlier.
avoid endless loops on eed decoding errors.
indxf: more eed size fixes
the final string \0 does not count. It is just allocated
for better logging.
indxf: add DIMSTYLE defaults
2019-09-27 Reini Urban <[email protected]>
indxf: fix LAYOUT subclass conflicts
groups 70 and 1 are in both subclasses.
rename two LAYOUT fields:
pspace_block_record => block_header,
last_viewport => active_viewport.
fix setting mspace_block_header and active_viewport from dxf.
2019-09-26 Reini Urban <[email protected]>
log BLOCK_HEADER.num_inserts
for de,encode consistently
indxf: fix BLOCK_HEADER first|last_entity to abs
Fixes Reading handle 1F object type AcDbBlockTableRecord
Error 34 (eWrongObjectType) Object discarded
indxf: nolinks = 0 for BLOCK
always add r2000 prev_entity + next_entity BLOCK, even
if 0
decode eed: fix data decoding
dont jump to a wrong end pos
encode eed: no codepage r2007+
and add a bunch of LOG_POS dat->byte locations for debugging.
indxf: collect eed sizes
only add a new EED size block with a new handle.
else add size to previous block
encode: fix encode_eed
always write the handle after each new sized data block.
not just the first
add dwg_find_tablehandle_silent
and use it in in_dxf.
not exported for now.
encode: fix -Wtautological-constant-out-of-range-compare
warnings. case size to long to compare same types
doc: fix ENTITIES summary line
doc: add Structures for EED and XDATA.
Maybe more special structs later
indxf: add postprocess_BLOCK_HEADER
Closes GH #146
encode: - logging prefix
for patched sizes
2019-09-25 Reini Urban <[email protected]>
indxf: more abs/rel ownerhandle logic
dwg_add_handleref: when searching for existing refs,
DICTIONARY, XRECORD or class may need to be relative.
skip the search for existing absolute ref then.
< GROUP needs to be abs, MLINESTYLE e.g. not, is rel.
2019-09-25 Reini Urban <[email protected]>
indxf: resolve class types earlier
via dwg_encode_get_class, from encode.
improve the abs/rel ownerhandle logic for DICTIONARY and XRECORD
sample_2000.dxf: add THUMBNAILIMAGE section
2019-09-24 Reini Urban <[email protected]>
indxf: ownerhandle abs logic
abs for all old-style types < 500
rel for all classes
WIP dwg_encode_get_class
indxf: WIP skip eed[0].size for handles
still wrong though
indxf: preserve eed[0] handle
and size.
handle is unfortunately stored at eed[0], and was
cleared by the first non-handle value at eed[0].
indxf: no SEQEND nor ENDBLK prev entities
indxf: no 2x XRECORD.ownerhandle
xdata then
encode: prefer class->number over old type
When a class with the same type exists, such as
ACDBPLACEHOLDER or OLE2FRAME, prefer the varies type (>500),
over the fixed type.
Fixes Error 34 (eWrongObjectType)
indxf: better entity defaults
entities bordering to SEQEND, ENDBLK have nolinks.
set ltype defaults
indxf: fixup BLOCK_CONTROL[0].entries[0]
wrong num_entries
indxf: flip logging type code
indxf: fix duplicate handle for BLOCK_HEADER.*Model_Space
it is allocated at objid 0 for minimal DXFs. Reuse the pre-allocated
object then.
2019-09-23 Reini Urban <[email protected]>
dxf: fix wrong INSERT.block_header 2 (name)
Thanks to @soundd1 detecting this bug.
Closes GH #143
dxf: fix wrong COLOR.byblock GH #143
index 256 == bylayer
index 0 == byblock
skip bylayer for dxf, and index & 255 turned bylayer into byblock.
Thanks to @soundd1 detecting this bug
decode: try to repair the section_info_id WIP
See GH #144
2019-09-23 Reini Urban <[email protected]>
WIP decode: more r2004 section map checks
try to fix GH #144.
allow negative Dwg_Section.size ??
ignore overlarge Section id > last_section_id.
added various consistency checks and a section_map_address repair.
2019-09-23 Reini Urban <[email protected]>
json: no 0x%x numeric formats
they cannot be parsed
api: change Dwg_Section address to uint64_t
It is read as such. see GH #144 for a testcase
dwgwrite: fix -y overwrite
write the dwg then
alive.test: timeout 10s
fails on my mac air with asan and 2 larger dwgs, example_2013
and example2018 with dxf2dwg
indxf: set entities entmode
2 for mspace (default)
indxf: set entity codes 6, 390, 347
BB ltype_flags, plotstyle_flags, material_flags
2019-09-22 Reini Urban <[email protected]>
indxf: fix init of points
with extrusion setting pt.z to 1.0, i.e. LINE start.z
indxf: fix EED for points and handle
add proper logging
indxf: but leave room for one active entry
indxf: fixup entries vs num_entries
no NULL entries[] allowed. esp. VIEW_CONTROL entries
are mostly NULL.
encode LTYPE.strings_area if empty
All TF, TFF strings must be dumped, even if NULL.
Fixes Reading handle 14 object type AcDbLinetypeTableRecord
Error 67 (eDwgObjectImproperlyRead) Object discarded
encode: no NULL handles, always with code
Fixes Recover: error eWrongObjectType reading Header.
spec: fixup LTYPE_CONTROL.bylayer and byblock
mixed up.
2019-09-22 Reini Urban <[email protected]>
indxf: fixup HEADER.CMLSTYLE
MLINESTYLE, not MLEADERSTYLE.
Also don't change existing ref.code to 5, recreate if not 5 already
2019-09-22 Reini Urban <[email protected]>
indxf: fixup HEADER.HANDSEED->code = 0
indxf: no NULL ownerhandle, 4.0.0 then
encode all ownerhandles. do relative offsets only for valid absref
targets.
indxf: encode HEADER.FLAGS and CELWEIGHT
add reverse dxf_revcvt_lweight(), add more HEADER defaults
which dont appear in most DXFs
2019-09-21 Reini Urban <[email protected]>
silence FIELD_HANDLE names
add 2 new API funcs: dwg_ref_object_silent,
dwg_resolve_handle_silent (was static)
2019-09-20 Reini Urban <[email protected]>
dxf: fix xdata 3DPOINT DXF
fixes XRECORD:
10 group not followed by 20 group
dxf: fix DICTIONARY bug
with dupl. itemhandles
dxf: skip dupl. 330 ownerhandle
already via common_entity_handle_data now
2019-09-20 Reini Urban <[email protected]>
decode: log bwd handleref names
to log fwd handles we would need to scan all object
types in advance, and then a 2nd time for its fields
This might catch at least some wrong H refs.
2019-09-20 Reini Urban <[email protected]>
decode: macro aesthetics
shorten a few vars. add clang-format directives
example_2000.dxf: add THUMBNAILIMAGE
to have closer numbers in the generated DWG
dxf: ATTDEF.prompt 3 is DXF mandatory
not just SINCE (R_2010)
2019-09-19 Reini Urban <[email protected]>
abstract set_handle_size
for longer handles
indxf: reactors[] always absolute,
but the others, esp. ownrhandle always relative
XRECORD logging spec
free aesthetics
2019-09-19 Reini Urban <[email protected]>
GH #85: COMMON_ENTITY_HANDLE_DATA earlier
Since r2007 we have a seperate hdl stream, which we can call at the
beginning already.
This enables the removal of the extra handles loops in the spec.
But just r2007+, before those handles are still after the normal
fields. Needs a special free logic there, not to delete ctx.leaders
before the 2nd loop.
free: combine common_entity_data with common_entity_handle_data,
just call them in series.
2019-09-19 Reini Urban <[email protected]>
fix MULTILEADER leak
in 2nd REPEAT loop for the handles, when
the leaders field was already removed by the 1st loop.
This will be properly fixed later, when we seperate the
hdl_dat stream earlier from the obj stream, to process both at once.
The text stream str_dat also. See GH #85, branch work/gh85-common
2019-09-18 Reini Urban <[email protected]>
encode: set xdicobjhandle to (3.0.0) not NULL
when empty on r13-r2000
decode refs not as NULL handle
To store the original handle.code on encode.
more logging aesthetics
dwg_bmp: better BMP offset logging
decode: fix FIELD_RSx logging
encode: fixup type with dwg_encode_variable_type
need the proper class id.
Fixes ACAD eNoClassId and eWrongObjectType
decode preR13: strncpy overflow
tbl->name has only 64 byte
fix dwgrewrite leaks
encode: Thumbnail even with empty HEADER.thumbnail_address
The address may be computed.
parse the thumbnail data
mostly for logging
dwgrewrite: overwrite existing -rewrite.dwg
log more types
each read and write should be logged ideally.
not yet for eed, xdata, sentinels, class.
2019-09-17 Reini Urban <[email protected]>
indxf HEADER strings
they disappeared in encode FIELD_TV
with IF_ENCODE_FROM_EARLIER.
indxf: log HEADER dxf codes also.
2019-09-17 Reini Urban <[email protected]>
add proper FORMAT_RLx ditto
add RSx type
encode header: set is_maint defaults
decode: Clearer Handles logging
encode: fix Handles CRC_LE
The little-endian variant, not BE.
indxf: reformat prev.
indxf: dwg_find_tablehandle is already case-insensitive
since 7222ec07edb48ab298a3d90f66f5bcb23c1ef245
indxf: seperate LTYPE bylayer/byblock
into its own fields in LTYPE_CONTROL. Like with BLOCK_CONTROL
model/paper_space before
encode: fix bitsize calculation
indxf: set tablerecord->xrefref = 1 as default
encode: fix object CRC
fix bitsize_pos logging,
fix object address for the size calculation (dxf only).
2019-09-16 Reini Urban <[email protected]>
log the CRC sizes also
encode: fix bit_write_CRC logging
off-by-2
dxf: add dxf-check
similar to dxf-roundtrip.sh via TeighaFileConverter, but
the other way round, for dxf2dwg.