MAJOR UPDATE!!!This update has been a LONG time in coming. I had to do a major rewrite for how I handle the dimensions of the plates and how absolute positioning changes those dimensions. Many pieces of the drawing code have been completely rewritten with this update. Hopefully it all is worth it, because the builder now supports rotated clusters and absolute positioning of clusters.
So for example, here is a draw of the Ergodox layout:
Code:
More
[{x:3.5},"#\n3",{x:10.5},"*\n8"],
[{y:-0.875,x:2.5},"@\n2",{x:1},"$\n4",{x:8.5},"&\n7",{x:1},"(\n9"],
[{y:-0.875,x:5.5},"%\n5",{a:7},"",{x:4.5},"",{a:4},"^\n6"],
[{y:-0.875,a:7,w:1.5},"",{a:4},"!\n1",{x:14.5},")\n0",{a:7,w:1.5},""],
[{y:-0.375,x:3.5,a:4},"E",{x:10.5},"I"],
[{y:-0.875,x:2.5},"W",{x:1},"R",{x:8.5},"U",{x:1},"O"],
[{y:-0.875,x:5.5},"T",{a:7,h:1.5},"",{x:4.5,h:1.5},"",{a:4},"Y"],
[{y:-0.875,a:7,w:1.5},"",{a:4},"Q",{x:14.5},"P",{a:7,w:1.5},""],
[{y:-0.375,x:3.5,a:4},"D",{x:10.5},"K"],
[{y:-0.875,x:2.5},"S",{x:1},"F",{x:8.5},"J",{x:1},"L"],
[{y:-0.875,x:5.5},"G",{x:6.5},"H"],
[{y:-0.875,a:7,w:1.5},"",{a:4},"A",{x:14.5},":\n;",{a:7,w:1.5},""],
[{y:-0.625,x:6.5,h:1.5},"",{x:4.5,h:1.5},""],
[{y:-0.75,x:3.5,a:4},"C",{x:10.5},"<\n,"],
[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."],
[{y:-0.875,x:5.5},"B",{x:6.5},"N"],
[{y:-0.875,a:7,w:1.5},"",{a:4},"Z",{x:14.5},"?\n/",{a:7,w:1.5},""],
[{y:-0.375,x:3.5},"",{x:10.5},""],
[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""],
[{y:-0.75,x:0.5},"","",{x:14.5},"",""],
[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""],
[{h:2,_rs:180},"",{h:2,_rs:180},"",""],
[{x:2},""],
[{r:-30,rx:13,y:-1,x:-3},"",""],
[{x:-3},"",{h:2},"",{h:2},""],
[{x:-3},""]
Or you can create each of the hands individually (code included below):
Left Hand:
Code:
More
[{x:3.5},"#\n3"],
[{y:-0.875,x:2.5},"@\n2",{x:1},"$\n4"],
[{y:-0.875,x:5.5},"%\n5",{a:7},""],
[{y:-0.875,a:7,w:1.5},"",{a:4},"!\n1"],
[{y:-0.375,x:3.5,a:4},"E"],
[{y:-0.875,x:2.5},"W",{x:1},"R"],
[{y:-0.875,x:5.5},"T",{a:7,h:1.5},""],
[{y:-0.875,a:7,w:1.5},"",{a:4},"Q"],
[{y:-0.375,x:3.5,a:4},"D"],
[{y:-0.875,x:2.5},"S",{x:1},"F"],
[{y:-0.875,x:5.5},"G"],
[{y:-0.875,a:7,w:1.5},"",{a:4},"A"],
[{y:-0.625,x:6.5,h:1.5},""],
[{y:-0.75,x:3.5,a:4},"C"],
[{y:-0.875,x:2.5},"X",{x:1},"V"],
[{y:-0.875,x:5.5},"B"],
[{y:-0.875,a:7,w:1.5},"",{a:4},"Z"],
[{y:-0.375,x:3.5},""],
[{y:-0.875,x:2.5},"",{x:1},""],
[{y:-0.75,x:0.5},"",""],
[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""],
[{h:2},"",{h:2},"",""],
[{x:2},""]
Right Hand:
Code:
More
[{x:5.1},"*\n8"],
[{y:-0.875,x:4.1},"&\n7",{x:1},"(\n9"],
[{y:-0.875,x:2.1},"",{a:4},"^\n6"],
[{y:-0.875,x:7.1},")\n0",{a:7,w:1.5},""],
[{y:-0.375,x:5.1},"I"],
[{y:-0.875,x:4.1},"U",{x:1},"O"],
[{y:-0.875,x:2.1,h:1.5},"",{a:4},"Y"],
[{y:-0.875,x:7.1},"P",{a:7,w:1.5},""],
[{y:-0.375,x:5.1},"K"],
[{y:-0.875,x:4.1},"J",{x:1},"L"],
[{y:-0.875,x:3.1},"H"],
[{y:-0.875,x:7.1},":\n;",{a:7,w:1.5},""],
[{y:-0.625,x:2.1,h:1.5},""],
[{y:-0.75,x:5.1},"<\n,"],
[{y:-0.875,x:4.1},"M",{x:1},">\n."],
[{y:-0.875,x:3.1},"N"],
[{y:-0.875,x:7.1},"?\n/",{a:7,w:1.5},""],
[{y:-0.375,x:5.1},""],
[{y:-0.875,x:4.1},"",{x:1},""],
[{y:-0.75,x:7.1},"",""],
[{r:-30,rx:3.1,ry:4.25,y:-1,x:-3},"",""],
[{x:-3},"",{h:2},"",{h:2},""],
[{x:-3},""]
With this change there is one sporadic issue that I still have to resolve, which I will work on over the next week or so.
Sometimes the stabilizers are not drawing correctly. Basically, I currently have the switch cutouts and the stabilizer cutouts as different shapes and I union the shapes together based on the selected configuration. Unfortunately the algorithm for the union has some issues and the union does not always work. The algorithm is very complex already, so I have not tried to create a pull request for that module yet. This problem happens mainly with the Ergodox layout because the angles seem to cause a higher rate of failure. Sometimes changing the amount of padding for the plate changes the numbers enough that the union works, or flipping the stabilizer (eg:
{_rs:180}) will make it draw correctly. In short, double check your plates to make sure the stabilizers are drawn correctly for now.
Instead of doing the union, I will probably just manually draw out all permutations of possible switch + stabilizer cutouts as individual drawings and then just reference them based on the scenario. This should resolve the problem and make the draw function less error prone.
I fixed a number of minor issues with this build, but this post is getting long, so I won't cover them in detail...
Since this is a major change to the code, please let me know if you find anything that you feel may be an issue.