tbfleming / jscut

In-browser CAM package
http://jscut.org
GNU General Public License v3.0
295 stars 136 forks source link

Object from SVG too big #32

Closed kennylevinsen closed 9 years ago

kennylevinsen commented 9 years ago

The following SVG was made in inkscape to be 90x85mm. The versions of inkscape I have tried agree on the size, and Makercam figures it out correctly too (although it spaces the two pieces far apart). However, jscut makes it ~96mm wide.

A browser gives me a pixel-count matching what jscut makes gcode for, but it might be necessary to listen to the specified (The SVG states that it's 90x85mm), as inkscape (which is a quite popular tool for making projected 2D for milling) can apparently not be trusted to output 90px/inch.

Link to SVG: https://www.dropbox.com/s/mzq81jfazikf6ie/spindle-clamp.svg?dl=0

EDIT: On second thought, Makercam uses the input px/inch to compute the size, and gets it wrong if you type the default of 72, instead of inkscapes 90. I'm not entirely sure of what's going on.

tbfleming commented 9 years ago

Inkscape blindsided me with a silent change to their default px per inch. It's now 96 instead of 90. I'll change the default and update the help text.

tbfleming commented 9 years ago

0.48.5 (current release) is defaulting to 90 on new files but your file is 96. Did you ever touch this file with an Inkscape version greater than 0.48.5 (unreleased versions)? Did you install it from a source other than Inkscape.org? (may be patched). It looks like the default changed on the unreleased version tree (0.9x series) but not on the current releases.

tbfleming commented 9 years ago

Here's discussion on Inkscape's list: http://inkscape.13.x6.nabble.com/Change-in-pixels-per-inch-td4970305.html

kennylevinsen commented 9 years ago

Mine is edited in both a 48.5 and something-something-devel. I tried converting formats and playing around with the files in both, but as the origin was from the dev version, I suppose the px/inch was just inherited.

I wonder as to why makercam does it right when set to 90px/inch, though. If you leave it at the default 72 px/inch things break, so it doesn't just ignore it all together and compute it based on the description of the absolute work-area size in the svg. Does it do something wrong, something magic, or something completely different? I wonder if there's anything worth looking into there.

As for now, I'll just work with 96px/inch (Old inkscape requires X11 on Mac - dev does not). I apologize for the inconvenience of having to find that info for me. My google-fu failed me.