File->Save As 'Desktop Cutting Plotter' DXF does not scale correctly if a custom viewbox is used.

Bug #1672066 reported by Alvin Penner on 2017-03-11
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Alvin Penner

Bug Description

Attached is an svg file with a custom viewbox. The Document Properties Dialog shows the Scale as 25.4. The viewbox is 5334 by 7543.8, much larger than normal for an A4 page. The file is from:

The blue rectangle in this file is 100mm by 100mm.
Saving this as 'Desktop Cutting Plotter' DXF using a Base Unit of mm in the output dialog yields a dxf file where the rectangle is much too large, 672mm by 672 mm.

The same problem is also encountered in the Python extension: Extensions->Export->Win32 Vector Print

Alvin Penner (apenner) wrote :
su_v (suv-lp) wrote :

Possibly related to the underlying issue as described in these earlier reports:

Bug #1508400 “ support arbitrary (but uniform) document scale (0.92)”
Bug #1525418 “DXF export fixed to 96 dpi, should use user unit scale”

tags: added: dxf exporting viewbox
Alvin Penner (apenner) wrote :

attached is a proposed fix for the dxf output.
This uses essentially the same compensation method for viewbox as in

Alvin Penner (apenner) wrote :

attached is a proposed fix for the Extensions->Export->Win32 Vector Print.
this was modified in the same way as for the dxf output above.

TylerDurden (8thrule) wrote :

I tested with various scales (uniform) and display units, along with variation in plotter output base units. All resulting dxf files had correct size objects compared to original svg objects.

Looks good!


Alvin Penner (apenner) wrote :

good to hear.
committed to rev 15590

Changed in inkscape:
status: New → Fix Committed
jazzynico (jazzynico) on 2017-03-13
Changed in inkscape:
assignee: nobody → Alvin Penner (apenner)
importance: Undecided → Medium
milestone: none → 0.93
Reptorian (reptillia-39) wrote :

I tested it myself using Solidworks import, and I think it works so far. By the way, Alvin, would it possible to automatically insert unit to be used in the name during saving .dxf? Thanks for fixing it, man.

Alvin Penner (apenner) wrote :

@Reptorian - glad to hear it is working. As far as the file name is concerned, I do not think that the Python extension is able to change the name in any way. I believe that part of the process is handled by C code over which I have no control.

Alvin Penner (apenner) wrote :

a merge request to backport the latest changes in to the 0.92.x branch has been issued at:

Alvin Penner (apenner) wrote :

backported to 0.92.x branch in rev:
Inkscape 0.92.2 (0af2471, 2018-01-13)

Patrick Storz (ede123) on 2018-01-16
Changed in inkscape:
milestone: 0.93 → 0.92.3
Bryce Harrington (bryce) on 2018-05-12
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers