Giter Site home page Giter Site logo

opk's Introduction

OPK

OPK is a spherical top keycap profile developed in CadQuery and released under the very permissive Apache License 2.0.

It's especially suited for creating high/medium profile spherical top keycaps.

The profile is still highly experimental and very alpha stage.

Please help!

I'm new to CadQuery (CQ), Ptyhon and code based CAD in general. There's a lot of guesswork and fumbling around to get to this point, any help is very much appreciated.

Usage

If you are new to CQ, the easiest is to download a CQ-Editor pre-built package, load the keycap.py file and hit Render!

CQ and CQ-Editor are eveolving fast. It is important that you install the latest version of CQ and/or CQ-Editor. The latest CQ-Editor dev release can be grabbed from jmwright's repository, get the latest successful build (you need to be logged in to download).

The latest Cadquery can be installed with PIP:

pip install --pre cadquery

The main keycap function in the opk.py file has sane defaults and parameters are sufficiently commented.

The export directory includes a few examples in both STL and STEP format.

Some examples:

Create the default 1u keycap

cap = keycap()

1U keycap

Create a 1.5U keycap

cap = keycap(unitX=1.5)

1.5U keycap

Create a flat top (not angled) 2U keycap

cap = keycap(unitX=2, angle=0)

2U flat top

Create a 4U spacebar

cap = keycap(unitX=4, angle=1, convex=True)

4U spacebar

A 2.25U Return key in system-default-serif font

cap = keycap(unitX=2.25, legend="Return", font="serif", fontsize=8)

Return

Save and Export results

CQ can export in many formats including STEP and STL. The easiest way to export an STL in CQ-Editor is by selecting the model in the 3D view and then clicking on Tools > Export as STL.

Of course it can be done programmatically and that can make exporting an entire keyboard very easy. The following code exports an STL and a STEP file.

cap = keycap()

exporters.export(cap, 'keycap.stl', tolerance=0.001, angularTolerance=0.05)
exporters.export(cap, 'keycap.step')

Notes / Recommendations

Default angle is 7deg that should be a good starting point for Row 3.

For spacebars a small angle (0-4deg) is recommended.

Not all fonts will be centered correctly, choose carefully. I'll add some way to better center the legends.

The code includes an example to use a DXF drawing as legend (check the comments at the end of the keycap function). This will be exposed to the API soon.

TODO

  • add stepped key
  • add ISO Enter
  • add 2U pos-like stabilizers
  • add support for logos and graphical legends
  • add reinforcement for big keys
  • add more examples
  • output files already supported for 3D printing
  • online editor
  • add secondary/tertiary legends
  • add support for stems other than cherry
  • clean up the code and do things "the python way"
  • better documentation

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.