Jump to content
You must now use your email address to sign in [click for more info] ×

SVG no good


vikingtone

Recommended Posts

I am a retired old fart and can't afford a fancy 3d app, so often use Tinkercad. it works for me. SVGs from Designer are massively expanded on export. A 148mm long things turns into 3500mm. Tinkercad refuses to import, even with a 10% scaler.  Opening the SVG in Inkscape, and making it the correct scale, imports to Tinkercad with no problems.  I really want to love Designer, but so far, it doesn't cut the mustard, sadly.

Link to comment
Share on other sites

5 hours ago, vikingtone said:

SVGs from Designer are massively expanded on export.

vikingtone, I have had some problems with svg exports and maybe can shed some light on them.  First of all the svg spec allows the width and height to be specified as a percentage (or a mm, in, px, pt, etc.)  Using a percentage has some advantages in that it allows svg images to be nested.  But it also seems to cause some problems in that different applications implement the percentages different causing what you see.

I have found 2 ways that seem to work for many applications that you can try.  If in AD you specify the Document units to be either pixels (px) or points (pt), I use pixels.  Then as you are drawing ignore that the units shown are px (or pt) just assume they are mm or whatever you want them to be.  So 100px you would just assume to be 100mm.  Do a simple test drawing and see if that works.

The other way is to edit the svg file in a text editor (not word processor like Word or Pages as they add addition data to the file).  The first few lines will look like:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg"

Change the two % symbols to mm so that portion reads like this.

<svg width="100mm" height="100mm"

Then save the file and again do a test.  One of those might help you.  Good luck.

iMac (27-inch, Late 2009) with macOS Sierra

Link to comment
Share on other sites

Oops, what I meant to say was to change the numbers of the width and height along with the % sign, if the file shows  viewBox="0 0 246 123" then change the 100 in width to 246mm and the 100 in height to 123mm.

So <svg width="100%" height="100%" viewBox="0 0 246 123" changes to <svg width="246mm" height="123mm" viewBox="0 0 246 123"

iMac (27-inch, Late 2009) with macOS Sierra

Link to comment
Share on other sites

@vikingtone  I'm 'guessing' here but I suspect the page that your 148mm long thing is sitting on is A4 in size and 300dpi and I also am guessing that when you're exporting to SVG you're exporting the Whole document rather than using the Selection without background option.

Despite being a resolution independent format, AD uses 72dpi as its default SVG resolution which I believe is incorrect since this was changed with the introduction of CSS 2.1 to 96pdi. The CSS 3.0 specification states the following:

dppx
Represents the number of dots per px unit. Due to the 1:96 fixed ratio of CSS in to CSS px, 1dppx is equivalent to 96dpi, which corresponds to the default resolution of images displayed in CSS as defined by image-resolution.

The default unit used by AD for SVG exports is pixels. An A4 landscape page is 3,508px wide when at 300dpi, hence my assumption above but let me know if that's not the case and purely a coincidence?

There seems to be an issue with Tinkercad in that it uses mm as its unit of choice and even if following the suggestion from @Gear maker when importing an AD exported 72dpi SVG, whilst this is shown at the correct size, e.g. 148mm in the import window the actual imported SVG when measured in Tinkercad is 420mm which is 148mm converted to pixels at 72pdi, i.e. Tinkercad is actually converting 420px to 420mm. This can be seen by exporting the imported file back out of Tinkercad as an SVG file and opening it up in AD.

Note: Unckecking Set viewbox under the More options in AD when exporting to SVG will achieve the same thing suggested by @Gear maker without the need to manually change the width="100%" height="100%" to mm (only it will default to px), i.e. the exported SVG will display px values instead of percentages. Changing the Width and Height to mm makes no difference in terms of how the file is interpreted by Tinkercad, it seems to see everything in mm regardless of the dimensions set in the SVG file.

For some reason Tinkercad won't recognise an SVG file that uses percentages for it's W and H, but as @Gear maker suggests, changing the dimensions to mm or px allows Tinkercad to at least read the file, only it appears to read it incorrectly, as in converting what are actually px to mm.

If you first physically select your 148mm long thing on the canvas, then export to SVG and choose the Selection without background option from the Area Dropdown and then click the More button and change the default Use document resolution to Use DPI and set that to 72 DPI and also uncheck Set viewbox prior to exporting your file you will end up with a 148mm long thing once exported as an SVG, however most laser cutting programs than use SVG files correctly use 96dpi and not 72dpi, e.g. Carbide Create, which means importing a 96dpi, 148mm long thing exported as an SVG from AD sucessfully imports into Carbide Create as a 148mm long thing.

 

Affinity Designer 2.4.1.2344 | Affinity Photo 2.4.1.2344 | Affinity Publisher 2.4.1.2344
Affinity Designer 1.7.3 | Affinity Photo 1.7.3 | Affinity Publisher 1.10.8
MacBook Pro 16GB, macOS Monterey 12.6.8, Magic Mouse

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | 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.