Skip to content

DXF reader: an omitted material map source means a file map (#906) - #907

Merged
HakanSeven12 merged 2 commits into
hakanaktt:mainfrom
acsgh:fix/dxf-material-map-source-default
Dec 3, 2026
Merged

HakanSeven12 merged 2 commits into
hakanaktt:mainfrom
acsgh:fix/dxf-material-map-source-default

Conversation

@acsgh

@acsgh acsgh commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #906

Commits:

  1. 530fdec5 Red tests (tests/dxf_material_map_source_default.rs): a minimal AC1032 DXF with one MATERIAL. With no source codes, all six maps (diffuse, specular, reflection, opacity, bump, refraction) must read as source 1; with explicit 0, 1 or 2 the written value must win; and a diffuse file name with no 72 must survive saving as DWG. On main, an_omitted_map_source_reads_as_a_file (diffuse source 0) and a_map_file_name_without_a_source_survives_saving_as_dwg (source 0, file name dropped) fail; the explicit-source test passes.
  2. 2b6675fe Fix: read_material sets the six map sources to 1 before reading the group codes, so an omitted code means "file" as in AutoCAD's DXF, and a written one still wins. The three tests pass.

Red commit confirmed in CI (run 47190590094: the two tests above fail; nothing else fails).

Ran on the last commit:

  • cargo test: 3722 passed, 0 failed

  • Closes #N is above

  • Bug: red-tests commit first, fix commit second, same PR

  • cargo test passes on the last commit (say what you ran)

  • No formatting-only or unrelated changes

🤖 Generated with Claude Code

acsgh and others added 2 commits December 3, 2026 20:02
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AutoCAD writes the map source codes only for scene (0) and procedural (2)
sources. Reading them as 0 lost the source, and the DWG writer then dropped
the map file names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@acsgh
acsgh marked this pull request as ready for review December 3, 2026 20:59
@HakanSeven12
HakanSeven12 merged commit 59d215e into hakanaktt:main Dec 3, 2026
6 checks passed
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.

DXF reader: an omitted MATERIAL map source reads as scene (0) instead of file (1); DWG save then drops the file names

2 participants