9
$\begingroup$

I am planning a mechanical 40% keyboard build and are coincidentally on the home stretch of a homemade CNC project.

The only thing the CNC needs to do for the keyboard project is to drill 7*48 holes. So what I need to do now is layout those holes in SVG. Therein lies the question. What resolution should I use for the SVG? I want to space the center of the keyboard switches 19 mm apart. An online pixel to mm converter suggested that 72 pixels is exactly 19.05 mm (which actually is what Cherry MX says should be their spacing).

Now, I do understand that this really doesn't matter, but I am curious as I am new on CNCs and was suspecting that there is a number that will "just work".

EDIT: For example, if I where to print the template (SVG) on a regular printer, what pixel to mm ratio should I use so that it would come out the size I want?

$\endgroup$
6
$\begingroup$

I found one of those printer things that puts ink on dead trees and tested to print a simple SVG file.

<svg xmlns="http://www.w3.org/2000/svg"
     width="400px" height="800px">
  <rect x="10" y="10" width="72" height="72" fill="#999999" />
  <rect x="10" y="100" width="378" height="378" fill="#999999" />
</svg>

As I suspected 72 pixels came out pretty much exactly 19mm. (72/19.05)*100~=378 came out 100mm.

Given this I am going to assume that 72/19.05 is the de facto best pixel to mm ratio to use for CNC projects.

EDIT:

Found this documentation: http://w3.org/TR/SVG/coords.html#Units

<svg xmlns="http://www.w3.org/2000/svg"
     width="400px" height="800px">
  <rect x="10" y="10" width="19.05mm" height="19.05mm" fill="#999999" />
  <rect x="10" y="100" width="100mm" height="100mm" fill="#999999" />
</svg> 

Much simpler to use mm as units right away

| improve this answer | |
$\endgroup$
1
$\begingroup$

SVG is a vector-graphics format, there's no particular reason it can't scale arbitrarily. Presumably the CNC software will allow you to select the scale of a pixel? If so, pick a scale that makes the math work out easily (so some integer number of pixels per millimeter). If not, it's probably documented somewhere for the specific tool you're using.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.