kad icon indicating copy to clipboard operation
kad copied to clipboard

Creating a custom switch geometry

Open RichardBronosky opened this issue 5 years ago • 2 comments

I'd like to add a custom geometry to https://github.com/swill/kad/blob/master/key.go#L10-L20 that I'd assign const SWITCHSOCKET = 5 It would consist of the 5 holes for PCB mounting an MX switch, but the 2 for the contacts would be enlarged to fit Kailh sockets. It looks like a switch is just a Path which is just an array of Points which is just 2 float64s. And since CirclePolygon returns a Path, which can be appended easily... This should be "easy".

But, what I'm unsure about is:

  • Can I put multiple desparate holes in a path?
  • Would I do that?
    • I figured that your stabs are multiple paths, but I could not make sense of it by eyeballing the code.

Please advise.

RichardBronosky avatar Sep 24 '18 17:09 RichardBronosky

Doh! I just realized that the Cherry Stabilizer that I was looking at is one piece! By looking at the Alps Stabilizer, I notice that multiple Paths are created and appended to the CutPoly for that layer, which is just an array of Paths.

I would have picked up on that if had finished reading the Draw function down to the part where it also appended to the CutPolys rather than stopping when I got to the case where the switch_path is defined.

I'd still appreciate any suggestions/hint you have. I'm quite new to golang. (I had to Google: Function declaration syntax: things in parenthesis before function name. 🤦 )

RichardBronosky avatar Sep 24 '18 18:09 RichardBronosky

Sorry for the delay getting back to you. I am having a bit of a hard time trying to follow what you are trying to do, so maybe we can review together what you are trying to do.

One thing to note is that you are able to create a cutout (or set of cutouts) and apply them at each switch location, so this should give you a way to adapt the switch cutout if you need to.

Check the following documentation if you haven't already:

  • Custom Polygons: http://builder-docs.swillkb.com/features/#custom-polygons
  • Custom Polygon placement at key locations: http://builder-docs.swillkb.com/features/#plate-layout

Let me know if you need additional information or if you are still struggling with this.

swill avatar Jul 09 '19 13:07 swill