Skip to content

Fix some dxf imports

Credit to @nomura9537

I've copied the dxf_input.py file they've added in that file.

I haven't had time to look through all the changes, but I'm not a python dev or dxf expert, no point "holding it back".

They've also provided a set of test files https://gitlab.com/inkscape/extensions/uploads/f81740353a99223102410b8aa24f75f3/shareDXF.zip

Current tests haven't been updated. They generally look fine, some notes

  1. dxf_with_arc.dxf changes drastically. Before, it outputted a complex of paths, now it outputs just one. Was the original file valid? Behavior now matches LibreCAD. The other paths still exist, but are just symbols that are unused
  2. test_r12.dxf now succeeds and outputs stuff (as does the one dxf r12 file they've shared)
  3. dxf_polylines.dxf looks like it's now rendering two paths that it wasn't before
  4. the more fine combed comparison of CADTextHeight.dxf shows that text size has been changed a bit. Possibly wrong now?? fixed

Adds missing arrows in inbox#5418

Todo:

  • should we remove nesting or not? Update: in discussion with nomura below, no.
  • does dxf_with_arc.dxf need modifying? Resolve first. Update: another difference noticed is that the measurements are now missing Update(2): re-added the measurements. Note: measurements in these cases (when defined inside BLOCK) are not visible in TrueView, while they are in LibreCAD.
  • add tests from shareDXF Update: done. One substitute test file was added to make up for files that I'm not sure we have permission to share.
  • fix up current tests (current issue is that text size seems a bit too small now) Update: done.
  • remember to squash changes and link to #399 (closed)
  • make sure proper author before merge
Edited by Nathan Lee

Merge request reports