Bug: DXF: INSERT with a scale factor does not scale the block base point

Open
#7,141 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp

Research direction

Start by locating Assimp's DXF importer and tracing how it transforms block entities for INSERT, using the attached minimal DXF files to reproduce the issue. Check the base point, insertion position, and scale order for both positive and negative scale factors; done means the imported LINE matches the expected coordinates in both cases.

Written by the indexing model from the issue text.

Description

Bug

Assimp 6.0.6 (Homebrew, macOS), Importer::ReadFile(path, 0).

Steps: open base_scale.dxf. Block base point (10,0), LINE (10,0)-(20,0), INSERT at (0,0) with scale 2.

Expected: LINE (0,0)-(20,0), i.e. insert + scale * (v - base).
Actual: LINE (10,0)-(30,0). The base point is subtracted after scaling. A mirrored insert (negative scale) with a base point is wrong in the same way.

Related: #5422 / PR #5426 fixed the order of position and scale, but not the base point.

AS3

Rendered in ODA Viewer 27.10. Black: the attached DXF as ODA Viewer draws it. Orange: what Assimp imported, added to the same file on a separate layer (cmp_*.dxf in the zip, so you can open it in any CAD program).

Found with a metamorphic testing tool that rewrites DXF files into equivalent forms. Minimal DXF files attached.

AS3_repro.zip

Dominant language
C++
Stars
13.3k
Forks
3.3k
Avg merge
3d 5h
Merged PRs (30d)
12

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from assimp/assimp

All issues in assimp/assimp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.