Open jaredjennings opened 5 years ago
With the experience of https://gitlab.com/jaredjennings/fourier-box, I can say this could probably be done with some Bezier patches fairly easily, and in OpenSCAD. That would surface the old problem, though, that key-place is a function that translates objects, and not a function that transforms point coordinates. Bezier patches need points. Also the look of the keyboard would be determined by the positions of control points, rather than the shape used for pairwise hulling. And there could be some (if you will pardon the pun) corner cases, too...
So I tried this in Five. It turned out to be sort of easy to write a function that could displace an axis-aligned slice of any shape, so as to deal with the column staggering. I got it to use a piece of sine wave to interpolate between the non-displaced and displaced parts. Then I figured I would write another function that takes something flat and curls it up at the edges. (Then I was going to take some straight shapes and subtract them from this to get a curvy thing with straight-sided holes.) This was quite difficult and I never succeeded at it. You can't abstract things very much in libfive, because it takes the code you write and translates it into a tree of C++ objects, and all the objects have to do directly with math on x, y, and z; so I couldn't take tricky or repeated bits and put them in functions. I tried some macro magic, which did not ultimately work.
And then I started browsing patents. I found the old IBM patent, where the columns grow apart from each other as you go north (my term not theirs) on the keyboard. I found the idea of columns whose profile is spiral not elliptical, because the joints of the finger place the tip of the finger along a spiral as the finger is curled up, not along an ellipse. And this let me know that all the work I'd done to curl up a flat shape along the surface of an ellipsoid was not as well-founded and invariant as I thought. That means I need to think about the shape of the keyboard more before I use something as brittle as libfive to express it. And that means work for this issue takes a hiatus.
https://reddit.com/u/Thatothermofo has brought to my attention the idea of continuous curvature in product design. https://www.reddit.com/r/MechanicalKeyboards/comments/b3soxi/once_youve_seen_it_you_cant_unsee_it/
At present there are discontinuities in the curvature of the sides and bottom of the keyboard at every keyswitch: it is a 3d piecewise linear object, not defined as a curve.
To fix, stop taking the hull of this and that, and instead define their shapes as continuous functions, whose first derivatives are constrained to be zero, for example, within 2mm of a keyswitch hole. Stopping using hull would enable the use of Five to model the keyboard, although defining and evaluating such functions as these make me think more of solving equations (like CFD or FEM) than drawing or describing (like CAD, POVRay, OpenGL). Either way it may be so much change as to compel a completely different project.