mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2024-11-25 22:35:35 +00:00
add legends example
This commit is contained in:
parent
65b464ed3e
commit
a32556275f
32
examples/legends.scad
Normal file
32
examples/legends.scad
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
include <../includes.scad>
|
||||||
|
|
||||||
|
/* here's how to use the legends() command.
|
||||||
|
The first argument is the legend itself, which can also be a whole string.
|
||||||
|
The second argument is the "position" of the legend relative to center.
|
||||||
|
Legends currently have to all be inset or outset at the same time, but you
|
||||||
|
can have as many of them as you want.
|
||||||
|
The numbers used are some magic constant, so just fudge them until it looks good.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* $outset_legends = true; */
|
||||||
|
legends = [
|
||||||
|
["a", "b", "c", "d"],
|
||||||
|
["e", "f", "g", "h"],
|
||||||
|
["i", "j", "k", "l"],
|
||||||
|
];
|
||||||
|
|
||||||
|
$font_size = 4;
|
||||||
|
|
||||||
|
for (x=[0:len(legends)-1]) {
|
||||||
|
translate_u(x,0) {
|
||||||
|
legend(legends[x][0], [-1,-1]) {
|
||||||
|
legend(legends[x][1], [-1,1]) {
|
||||||
|
legend(legends[x][2], [1,-1]) {
|
||||||
|
front_legend(legends[x][3]) {
|
||||||
|
key();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user