swill/kad

builder error for float value

Closed this issue · 6 comments

While trying to generate the CAD files for the raw data for http://www.keyboard-layout-editor.com/#/gists/0cdad2a4bb53598240bb1b9e94ff0eb8 , I got the following error:

The build process has encountered the following error.
json: cannot unmarshal string into Go struct field Key.h of type float64
swill commented

Your code has two problems.

You have a row of keys which are just labels at the top. You will need to remove these:

[{x:1,a:7,f:6,w:4,d:true},"Left Half",{x:5.3,w:4,d:true},"Right Half"],

Second, the arrow keys in the bottom right have incorrect h values. They should be of type float instead of string. Basically, removing the "s from around the h field to make them numbers instead of text strings. So you need to change them to:

{x:1.5,f:5,fa:[0,0,0,1],h:0.5},"\n\n\npg up\n\n\n<i class='kb kb-Arrows-Up-Circle-Filled'></i>\n\n\n·"],
[{y:-0.45,x:12.5,h:0.5},"\n\n\nhome\n\n\n<i class='kb kb-Arrows-Left-Circle-Filled'></i>\n\n\n·",
{x:0.05,h:0.5},"\n\n\npg dn\n\n\n<i class='kb kb-Arrows-Down-Circle-Filled'></i>\n\n\n·",
{x:0.05,h:0.5},"\n\n\nend\n\n\n<i class='kb kb-Arrows-Right-Circle-Filled'></i>\n\n\n·"

I have your layout working with those changes. I like the layout, but you won't be able to use Cherry MX switches with some of those positions. You can't use 1/2 height keys with cherry MX without the switches taking up the same space. I think you will need to use full height keys in order to use Cherry (or Alps) switches (and keycaps).

image

Cheers...

@swill

  1. Thank you for pointing out the code issues. I will fix them.
  2. I was just trying out your tool for my layout, which is actually for a scissor switch type keyboard (I'm working on building a DIY switch matrix on plastic sheeting). Would you have any interest in extending your project to a scissor switch backing plate?
swill commented

Do you have the dimensions of what you need cut for each switch? Adding switch options is reasonably easy assuming I know what I am adding...

If you can find me the spec, I can probably add it.

For scissor switches, instead of cuts on on the plate to mount the switches, notches are cut out and bent up perpendicular to the plate to hold the switches. An example image can be seen at https://davidzou.com/user/pages/01.blog/moshi-luna-an-almost-perfect-keyboard/MoshiLuna_Key_DualRetainingClip.jpg

As there isn't a standard for scissor switches between companies, and custom switches are unavailable, my request is more of a moonshot instead of an easily implementable solution. I don't have the background enough to be able to design something of this level of complexity to allow you to model the cuts. However, I am hoping this may get your creative juices flowing.

swill commented

Since that would require both cutting and bending, I am not sure that is something I can support. Not sure how I would be able to communicate all the requirements of the operations needed and too many people use my tool blindly assuming that if I support it, it will work, so I have to be a bit careful about that.

You could add the {_c:"0"} option on every key and then use the Custom Polygons to draw what you want cut (you may need more than only one type of cutout for the different key widths). Then you would have to apply the cutouts to the bottom layer of the sandwich case which will act as a blank canvas for your cutouts. That should work. Cheers...

Relevant Docs: http://builder-docs.swillkb.com/features/#custom-polygons

That might just work, if I can manage some scissor switches. Further,I'll let you know if I find something worth supporting (I doubt there is anything like that out there, but I never know).