Giter VIP home page Giter VIP logo

kb_builder's Introduction

kb_builder

kb_builder is the original engine that ran builder.swillkb.com. That service has been completely rewritten in Golang, but this project is still a useful environment to hack on.

This tool uses the JSON layout generated by the Keyboard Layout Editor. There are a lot of hidden features that you can do when building plates. Check the ? next to the Plate Layout text field in the UI for more details.

Here are some examples of the types of features that are exposed. The following features can be applied by modifying the source copied from the keyboard layout editor. All of these features are applied to individual keys by adding or modifying the object before the key. EG: rotate switch for "Enter" would be done by entering {_r:90},"Enter".

  • {_t:<0-2>}: Change switch cutout type. Numbers are in the same order as the images. EG: {_t:0},""
  • {_s:<0-2>}: Change stabilizer cutout type. Numbers are in the same order as the dropdown list. EG: {_s:2},""
  • {_k:<mm>}: Specify a kerf value for this specific switch/stabilizer cutout which overrides the default. Values are in mm (without the * unit). EG: {_k:0.05},""
  • {_r:<degrees>}: Rotate the switch cutout independent of the stabilizer cutout (assuming there is one). EG: {_r:90},""
  • {_rs:<degrees>}: Rotate the stabilizer cutout independent of the switch cutout. EG: {_rs:180},""

This tool is implemented as a webserver and exposes a UI to be consumed in the browser, but it is not fit for actual web traffic because it can not handle drawing more than one layout at a time. This however should not be a limitiation for personal use.

Installation and Configuration

Install this one a Ubuntu VM on your laptop with either VirtualBox or VMware Fusion. I have had trouble getting the FreeCAD lib to work correctly on Mac OSX, so if you get it working, please contribute some documentation. For now I only describe Ubuntu install instructions.

Install the dependencies

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:freecad-maintainers/freecad-daily
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get -y install unzip
$ sudo apt-get -y install build-essential
$ sudo apt-get -y install freecad
$ sudo apt-get -y install git
$ sudo apt-get -y install python-pip
$ sudo apt-get -y install python-dev
$ sudo pip install tornado
$ sudo pip install cadquery

Install the Draft-dxf-importer

This is a quick start guide. Review the full docs here

$ cd ~/
$ freecad
	# note the version number
	# download the appropriate version from here: 
	# 	https://github.com/yorikvanhavre/Draft-dxf-importer
	# i will assume freecad version v16 and the latest importer (v15)
$ wget https://github.com/yorikvanhavre/Draft-dxf-importer/archive/1.38.zip
$ unzip 1.38.zip
	# this will create the 'Draft-dxf-importer-1.38/' directory
$ cp Draft-dxf-importer-1.38/* /root/.FreeCAD/
	# Note: we are putting this import into the 'root' users '.FreeCAD' 
	#	not your users because we are running with 'sudo'

Get the source and run

$ git clone https://github.com/swill/kb_builder.git
$ cd kb_builder
$ sudo ./kb_builder.py

Accessing the UI

I am assuming most people will be using VirtualBox, so here are some additional details for viewing the UI from the host machine as well as instructions for how to SSH into the box.

# Power off the VM.
# Set: VM > Settings > Network > Attached to: => Bridged Adapter
# Power on the VM.
$ ifconfig
	# record the <IP> address
# The web UI will be available on: http://<IP>
# You can SSH to the VM with: ssh your_user@<IP>

License

kb_builder builts keyboard plate and case CAD files using JSON input.

Copyright (C) 2015  Will Stevens (swill)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

kb_builder's People

Contributors

cloudops-wstevens avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.