Jump to content
bskrt

SVG world unit handling (or DXF export)

Recommended Posts

TL;DR 1) add dxf support (in- & export) 2) Change SVG exports to world/document units instead of pixels.

I recently bought Designer to escape Adobe hell, but I am running into a rather large annoyance:

We do a lot of lasercutting/CNC routing at our studio which needs DXF files to work (feature request 1, please add DXF support).
I understand this isn't implemented in Designer atm and this wouldn't have to be a deal breaker if SVG export would work properly as I could always use or write an SVG to DXF converter.

The problem with current state of SVG:

Every SVG is converted to pixel units on export.
What that means is that if I design a document in mm, it will be converted to pixels using the DPI setting in the export menu. I've figured out that 96dpi does seem to "work" to get the SVG in "correct" dimensions. Though, due to the fact that mm units are converted to pixels using DPI and are then reconverted to mm when opened up in other software packages, there are rounding errors.

Example, 100mm converted to pixels at 96dpi

(100mm*96dpi)/25.4mm = 377.952755906px

Now, due to the nature of the codebase, that resulting float value is probably being rounded to a number of decimals (all SVG height & width values seem to be limited to 2 decimals), so when we try to convert that "rounded value" back to mm, my initial 100mm isn't quite that anymore.

(377.95px/96dpi)*25.4mm = 99.999270833mm

One might argue this is not an actual issue for the final result of the work you're doing, as lasercutting and routing wood have a larger error margin than that anyway, but it is for communications sake. When I tell my CNC partner something is 100mm, it needs to be 100mm, not 99.999.

Besides that, this just feels like a bad implementation of SVG anyhow. Why would you even convert units.

The only workaround I have found is drawing everything up in pixels and manually changing the svg code to use mm. eg.:

<svg width="100%" height="100%" viewBox="0 0 1280 800" ... >

to

<svg width="1280mm" height="800mm" viewBox="0 0 1280 800" ... >

This way all the values of the paths are interpreted correctly as being in mm instead of pixels, but this just feels like an ugly patch on something that should not be that hard to fix and implement.

Please fix this. Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.