kbl2scad

MrMcGibblets

05 Dec 2014, 02:57

Hey all, first time poster here. I got into the hobby of building keyboards with the Ergodox a couple months ago, and just designed a new one--tons of great resources on this site that made it possible. Since I think everything worth doing is worth writing a computer program to do it, I wrote a program to make the drawings for the laser cutter:

https://bitbucket.org/afqueiruga/kbl2scad

The program parses the raw data from http://www.keyboard-layout-editor.com and generates an OpenSCAD file for all of the switch holes that can be used by another OpenSCAD file to automatically create the plate drawings. You'll need to export the DXF and then edit it to fit the laser cutter's template, though, but that's the easy part. A default file is included that will give you a four-layer rectangular case for any layout that can be modified. Also, it can make a 3D model including keys and caps.

Here's the custom split keyboard that I wrote the program for:

Image

I actually just picked up the plates today from Ponoko--done in acrylic and MDF--and it looks good so far. No guarantees that the dimensions are correct, yet.

I'm releasing kbl2scad under the new BSD license, so enjoy. The program still needs a few more features; suggestions are welcome. Hopefully it's useful.

jacobolus

05 Dec 2014, 03:08

Awesome work. Mind describing the goals for your project and explaining some of your design decisions? Does your program also do PCB layout, or just the pattern for the laser cutter?

MrMcGibblets

05 Dec 2014, 23:26

Thanks. The tool chain I envision goes like this:

Layout editor ----> kb2scad -----> OpenSCAD ---export DXF ----> put into laser cutter template ---> cut

I want to keep the program short and to the point. Since people write different programs for various steps of the design process, limiting it to text-file input and text-file output in the intermediate stage, will let people chain together different tools to cover as much of a design process as possible. If someone wants to incorporate this program into a web front end that covers a complete tool-chain (it'll have to run on the server end) that would be pretty cool, and definitely make it easier for non-command-line gurus to use.

The program doesn't do the PCB, but that's definitely a good idea to look at: have it dump the pads and drill holes to be imported by a pcb editor. I'm planning on hand-wiring at least this keyboard and don't have any real experience making my own PCBs, though. The feature would fit into the code well.

OverKill

09 Dec 2014, 15:35

Good morning MrMcGibblets,

I have attempted to use KBL2SCAD and it seems to work except when I open OpenSCAD it says :

Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
PolySets in cache: 0
PolySet cache size in bytes: 0
CGAL Polyhedrons in cache: 1
CGAL cache size in bytes: 0
Total rendering time: 0 hours, 0 minutes, 0 seconds
WARNING: No top level geometry to render
Current top level object is not a 2D object.

I am not an OpenSCAD user as I use SolidWorks on a daily basis. Any idea why I am getting this error? I tried with both just the default numpad on kbl.com and with one of the files in your folder.

MrMcGibblets

09 Dec 2014, 22:07

Which file did you attempt to open? The output file, "keys.scad", doesn't actually generate any geometry, but contains routines to do so. Open "default_plates.scad" instead, which imports "keys.scad". The last lines of that file actually call the routines, where one of the routines creates a 3D preview and the other creates the 2D drawing.

Glad to see that someone is trying to use it! I used to use SolidWorks a lot back in the day; OpenSCAD is very different from SolidWorks, but can do some pretty cool things once you figure it out. Let me know if this solves your problem.

OverKill

09 Dec 2014, 23:45

Most excellent. I got it to work and that saves me a lot of time. Thanks.

krpec

06 Apr 2015, 09:46

Great tool, thanks! :) I used to do few simple things in OpenSCAD, so I guess your project will not only help me plan and build custom keyboard (I'd like to build ne0phyte's THKB), but I may learn something new from the actual OpenSCAD code too.. From what I've seen in the examples, there's no cutouts for stabs. Are you planning to add this?

EDIT: I noticed on your bitbucket project page, that it is in your to-do list.. I may fork the project and try to implement that.

Post Reply

Return to “Workshop”