├── .gitattributes
├── .gitignore
├── LICENSE
├── Photos
├── GigiMinima.jpg
├── GigiStd.jpg
└── Keycaps.png
├── README.md
└── Things
├── ChocKeycaps.scad
├── GiGi.scad
├── GiGiAbsMin.scad
├── GiGiTent13.stl
└── Switch.scad
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Things/Experimental/*
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
--------------------------------------------------------------------------------
/Photos/GigiMinima.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pseudoku/GiGi/96a6632022499082ca6abc95ccdf56933f764431/Photos/GigiMinima.jpg
--------------------------------------------------------------------------------
/Photos/GigiStd.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pseudoku/GiGi/96a6632022499082ca6abc95ccdf56933f764431/Photos/GigiStd.jpg
--------------------------------------------------------------------------------
/Photos/Keycaps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pseudoku/GiGi/96a6632022499082ca6abc95ccdf56933f764431/Photos/Keycaps.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This repository is outdated, the [dactyl it yourself](https://github.com/pseudoku/Dactyl-It-Yourself-Editor) repo should be used instead.
2 |
3 | It provides code modules for more powerful configuration, and bottom inserts.
4 |
--------------------------------------------------------------------------------
/Things/ChocKeycaps.scad:
--------------------------------------------------------------------------------
1 | // adjust as needed
2 | $fn = 360; //rip render time takes about 30min at 70 for hatch design
3 | dimpleR = 40; //radius of dimple
4 |
5 | //##### Generaton Calls ######
6 |
7 | translate([20,0,0])KailhCapR2(false, true);
8 | translate([-20,0,0])KailhCapR1();
9 | translate([0, 8.5,0])rotate([15,0,0])KailhCapR();
10 | translate([0,-8.5,0])rotate([15,0,180])KailhCapR();
11 | // translate([0,-8,0])cube([20,10,10],center =true);
12 |
13 |
14 | //#############################
15 |
16 | //#### Modules ################
17 | module KailhCapR2(hatch = false, home = false){
18 | difference(){
19 | hull(){
20 | translate([0,0,1])cube([17.3,16.4,2],center = true);
21 | translate([0,.75,1+2.5])cube([14.5,12,1.5],center = true);
22 | }
23 | //cuts
24 | translate([0,0,.75])cube([17.5-2.5,16.8-2.5,2.1],center = true); //
25 | translate([0,1.25,dimpleR + 2.5])sphere(r=dimpleR);
26 |
27 | if(hatch == true){
28 | for(i= [-4:4]){
29 | translate([0,1.25,dimpleR +.5+2.5])rotate([-90+i*3,0,45])rotate_extrude(angle = 180)translate([dimpleR +.1,0])circle(.5);
30 | translate([0,1.25,dimpleR +.5+2.5])rotate([-90+i*3,0,-45])rotate_extrude(angle = 180)translate([dimpleR +.1,0])circle(.5);
31 | }
32 | }
33 | }
34 |
35 | //legs
36 | translate([5.7/2,0,-3.4/2+2])difference(){
37 | cube([1.25,3, 3.4], center= true);
38 | translate([3.9,0,0])cylinder(d=7,3.4,center = true);
39 | translate([-3.9,0,0])cylinder(d=7,3.4,center = true);
40 | }
41 | translate([-5.7/2,0,-3.4/2+2])difference(){
42 | cube([1.25,3, 3.4], center= true);
43 | translate([3.9,0,0])cylinder(d=7,3.4,center = true);
44 | translate([-3.9,0,0])cylinder(d=7,3.4,center = true);
45 | }
46 |
47 | //homing bump
48 | if(home == true){
49 | translate([0,1,0])rotate([0,0,0])translate([0,1.25,2.1])sphere(r = .75);
50 | translate([0,1,0])rotate([0,0,120])translate([0,1.25,2.1])sphere(r = .75);
51 | translate([0,1,0])rotate([0,0,240])translate([0,1.25,2.1])sphere(r = .75);
52 | }
53 | }
54 |
55 | module KailhCapR1(hatch = false){
56 | shift = -10 ;
57 | difference(){
58 | union(){
59 | hull(){
60 | translate([0,0,1])cube([17.3,16.4,1.5],center = true);
61 | translate([0,.75,1+2])cube([14.5,12,1.5],center = true);
62 | }
63 | }
64 | //cuts
65 | translate([0,0,.75])cube([17.5-2.5,16.8-2.5,2.1],center = true);
66 | translate([0,shift, dimpleR + 2])sphere(r=dimpleR );
67 |
68 | if(hatch == true){
69 | for(i= [-4:5]){
70 | translate([0, shift,dimpleR +.5+2.])rotate([-90+i*3,0,45])rotate_extrude(angle = 180)translate([dimpleR +.1,0])circle(.5);
71 | translate([0, shift,dimpleR +.5+2.])rotate([-90+i*3,0,-45])rotate_extrude(angle = 180)translate([dimpleR +.1,0])circle(.5);
72 | }
73 | for(i= [-2:4]){
74 | fact = 1.45;
75 | translate([0+i*fact,shift+11.5+i*fact,4])rotate([90,0,45])cylinder(r= .5, 20, center= true);
76 | translate([0-i*fact,shift+11.5+i*fact,4])rotate([90,0,-45])cylinder(r= .5, 20, center= true);
77 | }
78 | }
79 | //uncommment for cross section for wall thickness check
80 | // translate([0,16.8/4,1])cube([17.5,16.8/2,5],center = true);
81 | }
82 |
83 | //Legs
84 | translate([5.7/2,0,-3.4/2+2])difference(){
85 | cube([1.3,3, 3.4], center= true);
86 | translate([3.9,0,0])cylinder(d=7,3.4,center = true);
87 | translate([-3.9,0,0])cylinder(d=7,3.4,center = true);
88 | }
89 | translate([-5.7/2,0,-3.4/2+2])difference(){
90 | cube([1.3,3, 3.4], center= true);
91 | translate([3.9,0,0])cylinder(d=7,3.4,center = true);
92 | translate([-3.9,0,0])cylinder(d=7,3.4,center = true);
93 | }
94 | }
95 |
96 | module KailhCapR(hatch = false, home = false){
97 | shift = -5 ;
98 | difference(){
99 | union(){
100 | rotate([0,0,180])hull(){
101 | translate([0,0,1])cube([17.3,16.4,2],center = true);
102 | translate([0,.75,1+2.5])cube([14.5,12,1.5],center = true);
103 | }
104 | }
105 | //cuts
106 | translate([0,0,.75])cube([17.5-2.5,16.8-2.5,2.1],center = true); //
107 |
108 | translate([0,shift, dimpleR + 2.5])sphere(r=dimpleR );
109 |
110 | if(hatch == true){
111 | for(i= [-4:5]){
112 | translate([0, shift,dimpleR +.5+2.5])rotate([-90+i*3,0,45])rotate_extrude(angle = 180)translate([dimpleR +.1,0])circle(.5);
113 | translate([0, shift,dimpleR +.5+2.5])rotate([-90+i*3,0,-45])rotate_extrude(angle = 180)translate([dimpleR +.1,0])circle(.5);
114 | }
115 | for(i= [-4:2]){
116 | fact = 1.45;
117 | translate([0+i*fact,shift+11.5+i*fact,3.5])rotate([90,0,45])cylinder(r= .5, 20, center= true);
118 | translate([0-i*fact,shift+11.5+i*fact,3.5])rotate([90,0,-45])cylinder(r= .5, 20, center= true);
119 | }
120 | }
121 | // translate([0,16.8/4,1])cube([17.5,16.8/2,5],center = true); //cross section
122 | }
123 |
124 | translate([5.7/2,0,-3.4/2+2])difference(){
125 | cube([1.3,3, 3.4], center= true);
126 | translate([3.9,0,0])cylinder(d=7,3.4,center = true);
127 | translate([-3.9,0,0])cylinder(d=7,3.4,center = true);
128 | }
129 | translate([-5.7/2,0,-3.4/2+2])difference(){
130 | cube([1.3,3, 3.4], center= true);
131 | translate([3.9,0,0])cylinder(d=7,3.4,center = true);
132 | translate([-3.9,0,0])cylinder(d=7,3.4,center = true);
133 | }
134 | if(home == true){
135 | translate([0,1,0])rotate([0,0,0])translate([0,1.25,2.1])sphere(r = .75);
136 | translate([0,1,0])rotate([0,0,120])translate([0,1.25,2.1])sphere(r = .75);
137 | translate([0,1,0])rotate([0,0,240])translate([0,1.25,2.1])sphere(r = .75);
138 | }
139 | }
--------------------------------------------------------------------------------
/Things/GiGi.scad:
--------------------------------------------------------------------------------
1 | use //modules for mx switch and key holes o
2 | use
3 | use
4 | use //for cheaper minwoski
5 | use
6 | use
7 | use
8 | use
9 | use
10 |
11 | //use
12 |
13 | //TODOs
14 | /*
15 | 1) Robust Rim Job
16 | 2) MCU Mount
17 | 3) Pretty trackball structure
18 | */
19 |
20 | $fn = 32;
21 | //----- Alias
22 |
23 | R0 = 0; //bottom row
24 | R1 = 1;
25 | R2 = 2;
26 | R3 = 3;
27 | PM = 3;
28 | R4 = 4;
29 | R5 = 5;
30 |
31 | C0 = 0; //Column
32 | C1 = 1;
33 | C2 = 2;
34 | C3 = 3;
35 | C4 = 4;
36 | C5 = 5;
37 | C6 = 6;
38 | T0 = 7; //Thumb
39 |
40 | IN = 0; //inner path
41 | OUT = 1; //outter path
42 | PATH = 0; //path function
43 | NORMAL = 1; //path normal
44 |
45 | //Modulation Reference
46 | FRONT = 1;
47 | RIGHT = -1;
48 | BACK = -1;
49 | LEFT = 1;
50 | TOP = 1;
51 | BOTTOM = -1;
52 |
53 | //------ Grid parameters
54 | unit = 18.05;
55 | Tol = 0.001; // tolance
56 | HullThickness = 0.0001; // modulation hull thickness
57 | TopHeight = 0; // Reference Origin of the keyswitch
58 | BottomHeight = 3.6; // height adjustment used for R0 keys for cherry types
59 |
60 | SwitchWidth = 15.6; // switch width
61 | PlateOffsets = 2.5; // additional pading on width of plates
62 | PlateOffsetsY = 2.5; // additional padding on lenght of plates
63 | PlateThickness = 3.5; // switch plate thickness H_1st
64 | PlateDimension = [SwitchWidth+PlateOffsets, SwitchWidth+PlateOffsetsY, PlateThickness];
65 | PlateHeight = 6.6; //
66 | SwitchBottom = 4.8; // from plate
67 |
68 | WebThickness = 2; // inter column hull inward offsets, 0 thickness results in poor plate thickness
69 | cutLen = 0; //3.4 scut length for clipped khail
70 | cutLenM = cutLen+0; // fudging
71 |
72 | //----- Enclusure and plate parameter
73 | RScale = 2; //Rim bottom scaling
74 | EScale = 2.5; //Enclosure bottom scaling
75 |
76 | Bthickness = PlateDimension[0]-2; //thickness of the enclosure rim
77 | BFrontHeight = 3; //Height of frontside of the enclosure rim
78 | BBackHeight = 3; //Height of Backside of the enclosure rim
79 | T0Buffer = 0; //Additional Plate thickness buffer for T0 position.
80 |
81 | T0FrontH = BFrontHeight + T0Buffer; //Adjusted height for T0
82 | T0BackH = BBackHeight + T0Buffer; //Adjuted height for T0
83 |
84 | //----- Tenting Parameters
85 | tenting = [0,13,0]; // tenting for enclusoure
86 | plateHeight = 18; // height adjustment for enclusure
87 |
88 |
89 | //----- Trackball Parameters
90 | trackR = 17; //trackball raidus M570: 37mm, Ergo and Kennington: 40mm
91 | trackOrigin = [2,-25,7]; //trackball origin
92 | trackTilt = [0,0,0]; //angle for tilting trackpoint support and PCB
93 |
94 | //------- LAYOUT parameters
95 |
96 | //structure to hold column origin transformation
97 | ColumnOrigin = [//[translation vec] [rotation vec1] [rotation vec2]
98 | [[ -48, -unit*3/4, 0], [0, 0, 0], [ 0, 90, 0]], //INDEX 1
99 | [[ -36, -unit/2, 0], [0, 0, 0], [ 0, 90, 0]], //INDEX 2 knuckle
100 | [[ -18, -unit/4, 0], [0, 0, 0], [ 0, 90, 0]], //INDEX 3 knuckle
101 | [[ 0, 0, 0], [0, 0, 0], [ 0, 90, 0]], //MIDDLE knuckle
102 | [[ 18, -unit/4, 0], [0, 0, -0], [ 0, 90, 0]], //RING knuckle
103 | [[ 35.0, -unit*5/8, 6], [0, 5, -15], [ 0, 90, 0]], //PINKY 1 knuckle
104 | [[ 52.0, -unit*5/8, 10], [0,10, -15], [ 0, 90, 0]], //PINKY 2 knuckle
105 | [[ -0, -5, 0], [0,-5, 0], [ 0, 0, 0]] //Thumb wrist origin
106 | ];
107 |
108 | // structure to pass to thumbplacement module
109 | ThumbPosition = [//[translation vec] [rotation vec1]
110 | [[-29,-13.5, 2.9],[15, -60, 0]], //R0 original [[-33,-20, 8.5],[ 0,-130, 15]],
111 | [[-36,-22, -14],[15, -60, 0]], //R1
112 | [[-43, -3,-9.9],[40, -60, -0]], //R2
113 | [[-58,-26,-24],[ 0,15, 10]] //R3 if you want another I'd put it here reluctantly not tested
114 | ];
115 |
116 | //------- and adjustment parameters
117 | //
118 | // C0:i1 C1:i2 C2:i3 C3:m C4:r C5:p1 C6:p2 T0:t
119 |
120 | RowTrans =[[ 0, .8, .8, .8, .8, .45, .45, 0], //R0
121 | [ 1.05, 1.95, 1.95, 1.95, 1.95, 1.60, 1.60, 1], //R1s
122 | [ 2.1, 2.36, 2.36, 2.36, 2.36, 1.58, 1.75, 2], //R2s
123 | [ 3,1.375,1.375,1.375,1.375, 1, .83, 3], //PCB Mount (PM)
124 | [ 0, 0, 4, -4, -4, 4, -4, -4], //R4
125 | [ 0, 0, 4, 4, -4, 4, -4, 4] //R5
126 | ]*unit;
127 |
128 | Pitch =[[ 0, 15, 15, 15, 15, 15, 15, 0], //R0
129 | [ -10, -15, -15, -15, -15, -15, -15, 0], //R1s
130 | [ -15, -10, -10, -0, -0, -10, 0, 0], //R2s
131 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R3
132 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R4
133 | [ 0, 0, 0, 0, 0, 0, 0, 0] //R5
134 | ];
135 |
136 | Roll =[[ 10, 0, 0, 0, 0, 0, 0, 0], //R0
137 | [ -10, 0, 0, 0, 0, 0, 0, 0], //R1s
138 | [ -10, 0, 0, 0, 0, 0, 0, 0], //R2s
139 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R3
140 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R4
141 | [ 0, 0, 0, 0, 0, 0, 0, 0] //R5
142 | ];
143 |
144 | Height =[[ 0, 0, 0, 0, 0, 0, 0, 0], //R0
145 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R1s
146 | [ -2.3, -3, -3, -3, -3, -3, -2, 0], //R2s
147 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R3
148 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R4
149 | [ 0, 0, 0, 0, 0, 0, 0, 0] //R5
150 | ];
151 |
152 | //Manual Adjustment of Pitches post Calculation for minor adjustment
153 | Clipped =[[cutLen, cutLen, cutLen, cutLen, cutLen, -cutLen, cutLen, cutLen], //R0
154 | [cutLen,-cutLen, -cutLen, -cutLen, -cutLen, -cutLen, cutLen, cutLen], //R1s
155 | [cutLen, cutLen, cutLen, cutLen, cutLen, cutLen, -cutLen, cutLen], //R2s
156 | [cutLen, cutLen, -cutLen, cutLen, cutLen, cutLen, -cutLen, -cutLen], //R3
157 | [cutLen, cutLen, cutLen, -cutLen, -cutLen, cutLen, -cutLen, -cutLen], //R4
158 | [cutLen, cutLen, cutLen, cutLen, -cutLen, cutLen, -cutLen, cutLen] //R5
159 | ];
160 |
161 | //Orientation of the clippede switches
162 | ClippedOrientation = //if length-wise true
163 | [[false, true, true, true, true, true, true, true],
164 | [false, true, true, true, true, true, true, true],
165 | [false, true, true, true, true, true, false, true],
166 | [false, false, false, true, true, true, false, false],
167 | [false, false, false, false, false, true, false, true],
168 | [false, false, false, false, false, true, false, false]
169 | ];
170 |
171 | KeyOriginCnRm = [for( i= [C0:C6])[[0,BottomHeight],0], for(j = [R1:R4])[0,TopHeight,0]];
172 | //row and column loop setter
173 | RMAX = R1; // Set max rows on columns
174 | CStart = C1; // Set column to begin looping for the build
175 | CEnd = C6; // Set column to end for the build
176 |
177 |
178 |
179 | //################## Main Calls ##################
180 | //rotate([0,0,360*$t]){
181 | difference(){
182 | union(){
183 | rotate(tenting)translate([0,0,plateHeight])BuildTopPlate(keyhole = true, trackball = false, channel = false, platethickness =-1);
184 | BuildEnclosure(trackball = false, platethickness = -1);
185 | // rotate(tenting)translate([0,0,plateHeight])translate(trackOrigin)rotate(trackTilt)TrackBall();
186 | }
187 | translate([0,0,-10])cube([200,100,20], center = true);
188 | // rotate(tenting)translate([0,0,plateHeight])translate(trackOrigin)color("royalblue")sphere(d=trackR*2+.5,$fn= 64);
189 | }
190 |
191 | //mock ups for visualization
192 | //caps
193 | rotate(tenting)translate([0,0,plateHeight]){
194 | // BuildSet2();
195 | // PlaceOnThumb(0)rotate([0,0,-0])Switch(colors = "Steelblue",clipLength = cutLen);
196 | // PlaceOnThumb(1)rotate([0,0,-0])Switch(colors = "Steelblue",clipLength = cutLen);
197 | // PlaceOnThumb(2)rotate([0,0,-0])Switch(colors = "Steelblue",clipLength = cutLen);
198 | //// PlaceOnThumb(3)rotate([0,0,-0])Switch(colors = "Steelblue",clipLength = cutLen);
199 | }
200 | //TrackBall
201 | // rotate(tenting)translate([0,0,plateHeight])translate(trackOrigin)color("royalblue")sphere(d=trackR*2,$fn= 64);
202 |
203 |
204 |
205 |
206 | //######### Supporting Modules for Main Builder Modules
207 | function hadamard(a, b) = !(len(a) > 0) ? a*b : [ for (i = [0:len(a) - 1]) hadamard(a[i], b[i])]; // elementwise mult
208 |
209 | //Convinient notation for hulling a cube by face/edge/point
210 | module hullPlate(referenceDimensions = [0,0,0], offsets = [0,0,0], scalings = [1,1,1])
211 | {
212 | x = offsets[0] == 0 ? scalings[0]*referenceDimensions[0]:HullThickness;
213 | y = offsets[1] == 0 ? scalings[1]*referenceDimensions[1]:HullThickness;
214 | z = offsets[2] == 0 ? scalings[2]*referenceDimensions[2]:HullThickness;
215 | hullDimension = [x, y, z];
216 |
217 | translate(hadamard(referenceDimensions, offsets/2))translate(hadamard(hullDimension, -offsets/2))cube(hullDimension, center = true);
218 | }
219 |
220 | //Convinient cube transferomation and hulling
221 | module modulate(referenceDimension = [0,0,0], referenceSide = [0,0,0], objectDimension = [0,0,0], objectSide = [0,0,0], Hull = false, hullSide = [0,0,0], scalings = [1,1,1]){
222 | if(Hull == false){
223 | translate(hadamard(referenceDimension, referenceSide/2))translate(hadamard(hadamard(objectDimension,scalings),objectSide/2))scale(scalings)cube(objectDimension, center = true);
224 | }else{
225 | color("red")translate(hadamard(referenceDimension,referenceSide/2))translate(hadamard(hadamard(objectDimension,scalings), objectSide/2))hullPlate(objectDimension, hullSide, scalings);
226 | }
227 | }
228 |
229 | module PlaceColumnOrigin(Cn = C0) {
230 | rotate(ColumnOrigin[Cn][1])translate(ColumnOrigin[Cn][0])rotate([90,0,0])mirror([0,1,0])rotate(ColumnOrigin[Cn][2])children();
231 | }
232 |
233 | module OnPlateOrigin(Rm = R0, Cn = C0){
234 | translate((KeyOriginCnRm[Cn][Rm]+[0,PlateHeight+PlateThickness/2,0]))children();
235 | }
236 |
237 | //place child object on the target position with all transforms
238 | module BuildRmCn(row, col) {
239 | PlaceColumnOrigin(col)
240 | translate([RowTrans[row][col],Height[row][col],0])
241 | rotate([90,90,Pitch[row][col]])
242 | rotate([0,Roll[row][col],0])
243 | children();
244 | }
245 |
246 |
247 | module PlaceOnThumb(Rn = R0){ //for thumb
248 | translate(ColumnOrigin[T0][0])rotate(ColumnOrigin[T0][1])translate(ThumbPosition[Rn][0])rotate(ThumbPosition[Rn][1])children();
249 | }
250 |
251 | module BuildColumn(plateThickness, offsets, sides =TOP, col=0, rowInit = R0, rowEnd = RMAX){
252 | refDim = PlateDimension +[0,0,offsets];
253 | buildDim = [PlateDimension[0], PlateDimension[1], plateThickness];
254 |
255 | module modPlateLen(Hulls = true, hullSides = [0,0,0], rows, cols){//shorthand call for length-wise clipping
256 | modulate(refDim,[0,sign(Clipped[rows][cols]),sides], buildDim-[0,abs(Clipped[rows][cols]),0], [0,-sign(Clipped[rows][cols]),BOTTOM], Hull = Hulls, hullSide = hullSides);
257 | //use clip length sign to direct transform sides and adjust platle length rather than if else statement for more compact call
258 | }
259 |
260 | module modPlateWid(Hulls = true, hullSides = [0,0,0], rows, cols){//shorthand call for Width-wise clipping
261 | modulate(refDim,[sign(Clipped[rows][cols]), 0, sides], buildDim-[abs(Clipped[rows][cols]),0,0], [-sign(Clipped[rows][cols]), 0, BOTTOM], Hull = Hulls, hullSide = hullSides);
262 | }
263 |
264 | for (row = [rowInit:rowEnd]){// Plate
265 | if (ClippedOrientation[row][col] == true){ //for length-wise Clip
266 | BuildRmCn(row, col)modPlateLen(Hulls = false, rows =row, cols = col);
267 | if (row < rowEnd){//Support struct
268 | hull(){
269 | BuildRmCn(row, col)modPlateLen(Hulls = true, hullSides = [0,FRONT,0], rows = row, cols = col);
270 | BuildRmCn(row+1, col)modPlateLen(Hulls = true, hullSides = [0,BACK,0], rows = row+1, cols = col);
271 | }
272 | }
273 | }else { // for Width-wise Clip
274 | BuildRmCn(row, col)modPlateWid(Hulls = false, rows =row, cols = col);
275 | if (row < rowEnd){//Support struct
276 | hull(){
277 | BuildRmCn(row, col)modPlateWid(Hulls = true, hullSides = [0,FRONT,0], rows = row, cols = col);
278 | BuildRmCn(row+1, col)modPlateWid(Hulls = true, hullSides = [0,BACK,0], rows = row+1, cols = col);
279 | }
280 | }
281 | }
282 | }
283 | }
284 |
285 | module BuildTopCuts(plateThickness, offsets, sides =TOP, col=0, rowInit = R0, rowEnd = RMAX){
286 | refDim = PlateDimension +[0,0,offsets];
287 | buildDim = [PlateDimension[0], PlateDimension[1], plateThickness];
288 |
289 | //for fine tuning top cuts
290 | cutAdjustment = 2;
291 | function clipFudge(rows, cols) = abs(Clipped[rows][cols]) != 0 ? abs(Clipped[rows][cols])+cutAdjustment : 0;
292 |
293 | module modPlateLen(Hulls = true, hullSides = [0,0,0], rows, cols){//shorthand call for length-wise clipping
294 | modulate(refDim,[0,sign(Clipped[rows][cols]),sides], buildDim-[0,clipFudge(rows, cols),0], [0,-sign(Clipped[rows][cols]),TOP], Hull = Hulls, hullSide = hullSides);
295 | //use clip length sign to direct transform sides and adjust platle length rather than if else statement for more compact call
296 | }
297 |
298 | module modPlateWid(Hulls = true, hullSides = [0,0,0], rows, cols){//shorthand call for Width-wise clipping
299 | modulate(refDim,[sign(Clipped[rows][cols]), 0, sides], buildDim-[clipFudge(rows, cols),0,0], [-sign(Clipped[rows][cols]), 0, TOP], Hull = Hulls, hullSide = hullSides);
300 | }
301 | if(col != T0){ // for column section
302 | for (row = [rowInit:rowEnd]){// Plate
303 | if (ClippedOrientation[row][col] == true){ //for length-wise Clip
304 | BuildRmCn(row, col)modPlateLen(Hulls = false, rows =row, cols = col);
305 | if (row < rowEnd){//Support struct
306 | hull(){
307 | BuildRmCn(row, col)modPlateLen(Hulls = true, hullSides = [0,FRONT,0], rows = row, cols = col);
308 | BuildRmCn(row+1, col)modPlateLen(Hulls = true, hullSides = [0,BACK,0], rows = row+1, cols = col);
309 | }
310 | }
311 | }else { // for Width-wise Clip
312 | BuildRmCn(row, col)modPlateWid(Hulls = false, rows =row, cols = col);
313 | if (row < rowEnd){//Support struct
314 | hull(){
315 | BuildRmCn(row, col)modPlateWid(Hulls = true, hullSides = [0,FRONT,0], rows = row, cols = col);
316 | BuildRmCn(row+1, col)modPlateWid(Hulls = true, hullSides = [0,BACK,0], rows = row+1, cols = col);
317 | }
318 | }
319 | }
320 | }
321 | }
322 | else if(col == T0){
323 | for (row = [rowInit:rowEnd]){// Plate
324 | if (ClippedOrientation[row][col] == true){ //for length-wise Clip
325 | PlaceOnThumb(row)modPlateWid(Hulls = false, rows =row, cols = col);
326 | }else { // for Width-wise Clip
327 | PlaceOnThumb(row)modPlateLen(Hulls = false, rows =row, cols = col);
328 | }
329 | }
330 | }
331 | }
332 |
333 |
334 | //################ Main Builder ############################
335 | module BuildTopPlate(keyhole = false, trackball = false, platethickness = 0)
336 | {
337 | plateDim = PlateDimension +[0,0,0]; //adjust Plate Dimension parameter
338 | //Submodules
339 | module modPlate(Hulls = true, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], row, col){//shorthand
340 | BuildRmCn(row, col)modulate(PlateDimension,[0,sign(Clipped[row][col]), sides],plateDim-[0,abs(Clipped[row][col]),-platethickness-thickBuff], [0,-sign(Clipped[row][col]),refSides], Hull = Hulls, hullSide = hullSides);
341 | }
342 | module modPlateWid(Hulls = true, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows, cols){//shorthand call for Width-wise clipping
343 | BuildRmCn(rows, cols)modulate(PlateDimension,[sign(Clipped[rows][cols]), 0, sides], plateDim-[abs(Clipped[rows][cols]),0,-platethickness-thickBuff], [-sign(Clipped[rows][cols]), 0, refSides], Hull = Hulls, hullSide = hullSides);
344 | }
345 | module modBoarderLen(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, cols, scaling = [1,1,1]){
346 | BuildRmCn(rows, cols)modulate(PlateDimension+[0,-refClip*2,platethickness*2], [refSides,sides, BOTTOM],plateDim+[-dimClip,-Bthickness,height], [-refSides,sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
347 | }
348 | module modBoarderWid(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, cols, scaling = [1,1,1]){
349 | BuildRmCn(rows, cols)modulate(PlateDimension+[-refClip*2,0,platethickness*2], [refSides,sides, BOTTOM],plateDim+[-Bthickness,-dimClip,height], [refSides,-sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
350 | }
351 | //same as above but for thumb
352 | module modPlateT(Hulls = false, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows){//shorthand for thumb
353 | PlaceOnThumb(rows)modulate(PlateDimension,[0,sign(Clipped[rows][T0]), sides],plateDim-[0,abs(Clipped[rows][T0]),-platethickness-thickBuff], [0,-sign(Clipped[rows][T0]),refSides], Hull = Hulls, hullSide = hullSides);
354 | }
355 | module modPlateWidT(Hulls = false, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows){//shorthand call for Width-wise clipping
356 | PlaceOnThumb(rows)modulate(PlateDimension,[sign(Clipped[rows][T0]), 0, sides], plateDim-[abs(Clipped[rows][T0]),0,-platethickness-thickBuff], [-sign(Clipped[rows][T0]), 0, refSides], Hull = Hulls, hullSide = hullSides);
357 | }
358 | module modBoarderLenT(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows,scaling = [1,1,1], Buffer = 0){
359 | PlaceOnThumb(rows)modulate(PlateDimension+[0,-refClip*2,platethickness*2+Buffer*2], [refSides,sides, BOTTOM],plateDim+[-dimClip,-Bthickness,height], [-refSides,sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
360 | }
361 | module modBoarderWidT(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, scaling = [1,1,1], Buffer = 0){
362 | PlaceOnThumb(rows)modulate(PlateDimension+[-refClip*2,0,platethickness*2+Buffer*2], [refSides,sides, BOTTOM],plateDim+[-Bthickness,-dimClip,height], [refSides,-sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
363 | }
364 | //End of Submodules
365 |
366 | //Main builds
367 | difference(){
368 | union(){//SwitchPlate
369 | //build columns
370 | for (cols = [CStart:CEnd]){// build Webs
371 | BuildColumn(PlateDimension[2]+platethickness, 0, TOP, col = cols, rowInit = R0, rowEnd = R1); //builds plate
372 | if (cols != CEnd && cols != C4){
373 | hull(){
374 | modPlate(false, sides = TOP, refSides = BOTTOM, hullSides = [RIGHT,0,0],row = R0,col = cols);
375 | modPlate(false, sides = TOP, refSides = BOTTOM, hullSides = [RIGHT,0,0],row = R1,col = cols);
376 | modPlate(false, sides = TOP, refSides = BOTTOM, hullSides = [LEFT,0,0],row = R0,col = cols+1);
377 | modPlate(false, sides = TOP, refSides = BOTTOM, hullSides = [LEFT,0,0],row = R1,col = cols+1);
378 | }
379 | }
380 | }
381 | hull(){
382 | modPlate(false, sides = TOP, refSides = BOTTOM, hullSides = [RIGHT,0,0],row = R0,col = C4);
383 | modPlate(false, sides = TOP, refSides = BOTTOM, hullSides = [RIGHT,0,0],row = R1,col = C4);
384 | modPlate(true, sides = TOP, refSides = BOTTOM, hullSides = [LEFT,0,0],row = R1,col = C5);
385 | }
386 |
387 | //Pretty Boarder
388 | //Top side
389 | hull(){ //C1R0 Edge
390 | modBoarderLen(true, BACK, LEFT, 0, cutLenM, BBackHeight, [LEFT,0,TOP], R0, C1);
391 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C1);
392 |
393 | modBoarderLen(true, BACK, LEFT, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C1, [1,RScale,1]);
394 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,BOTTOM], R0, C1, [RScale,1,1]);
395 | }
396 | hull(){
397 | modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,BACK,TOP], R1, C1);
398 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,TOP], R0, C1);
399 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C1);
400 |
401 | modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,BACK,BOTTOM], R1, C1, [RScale,1,1]);
402 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,BOTTOM], R0, C1, [RScale,1,1]);
403 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,BOTTOM], R0, C1, [RScale,1,1]);
404 | }
405 | hull(){
406 | modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,0,TOP], R1, C1);
407 | modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,0,BOTTOM], R1, C1, [RScale,1,1]);
408 | }
409 | hull(){
410 | modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,FRONT,TOP], R1, C1);
411 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,TOP], R1, C1);
412 |
413 | modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,FRONT,BOTTOM], R1, C1, [RScale,1,1]);
414 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,RScale,1]);
415 | }
416 | hull(){
417 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C1);
418 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C2);
419 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C3);
420 |
421 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C1, [1,RScale,1]);
422 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C2, [1,RScale,1]);
423 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C3, [1,RScale,1]);
424 | }
425 | hull(){
426 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C3);
427 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C4);
428 |
429 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C3, [1,RScale,1]);
430 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C4, [1,RScale,1]);
431 | }
432 | hull(){
433 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,TOP], R1, C4);
434 | modBoarderLen(true, FRONT,RIGHT, cutLenM, 0, BFrontHeight, [0,0,TOP], R1, C5);
435 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [0,0,TOP], R1, C6);
436 |
437 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,RScale,1]);
438 | modBoarderLen(true, FRONT,RIGHT, cutLenM, 0, BFrontHeight, [0,0,BOTTOM], R1, C5, [1,RScale,1]);
439 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [0,0,BOTTOM], R1, C6, [1,RScale,1]);
440 | }
441 | hull(){
442 | modBoarderLen(true, FRONT, 0, 0, cutLenM,BFrontHeight, [RIGHT,0,0], R1, C4);
443 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,0,0], R0, C4);
444 | modBoarderLen(true, FRONT,RIGHT, cutLenM, 0,BFrontHeight, [LEFT,0,0], R1, C5);
445 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,0], R1, C5);
446 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,0], R0, C5);
447 | }
448 | hull(){
449 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0,BFrontHeight, [RIGHT,0,TOP], R1, C6);
450 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,TOP], R1, C6);
451 |
452 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0,BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,RScale,1]);
453 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [RScale,1,1]);
454 | }
455 | hull(){
456 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, C6);
457 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,TOP], R1, C6);
458 |
459 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [RScale,1,1]);
460 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [RScale,1,1]);
461 | }
462 | hull(){
463 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, C6);
464 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C6);
465 |
466 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [RScale,1,1]);
467 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [RScale,1,1]);
468 | }
469 | hull(){
470 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C6);
471 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C6);
472 |
473 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [RScale,1,1]);
474 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [RScale,1,1]);
475 | }
476 |
477 | //Bottom side
478 | hull(){
479 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,TOP], R0, C1);
480 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C1, [1,RScale,1]);
481 | }
482 | hull(){
483 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,TOP], R0, C2);
484 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C2, [1,RScale,1]);
485 | }
486 | hull(){
487 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,TOP], R0, C2);
488 | modBoarderLen(false,BACK, 0, 0, cutLenM, BBackHeight, [0,0,0], R0, C3);
489 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,0], R0, C4);
490 |
491 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C2, [1,RScale,1]);
492 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,RScale,1]);
493 | }
494 | hull(){
495 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,TOP], R0, C4);
496 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C4, [1,RScale,1]);
497 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,0], R1, C5);
498 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,0], R0, C5);
499 | }
500 | hull(){
501 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C5);
502 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C5);
503 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, C5);
504 |
505 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5, [RScale,1,1]);
506 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5, [RScale,1,1]);
507 | }
508 | hull(){
509 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C5);
510 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,TOP], R0, C5);
511 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5, [RScale,1,1] );
512 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,RScale,1]);
513 | }
514 | hull(){
515 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [0,0,TOP], R0, C5);
516 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,TOP], R0, C6);
517 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C5, [1,RScale,1]);
518 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C6, [1,RScale,1]);
519 | }
520 | hull(){
521 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C6);
522 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,TOP], R0, C6);
523 |
524 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [RScale,RScale,1]);
525 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight,[RIGHT,0,BOTTOM], R0, C6, [1,RScale,1]);
526 | }
527 |
528 | //----- Thumb Cluster Section
529 |
530 | modPlateWidT(rows = R0,thickBuff = T0Buffer);
531 | modPlateWidT(rows = R1);
532 | modPlateWidT(rows = R2);
533 |
534 | hull(){
535 | modPlateWidT(Hulls = true, hullSides = [BOTTOM,0,0], rows = R0, thickBuff = T0Buffer);
536 | modPlateWidT(Hulls = true, hullSides = [TOP,0,0], rows = R1);
537 | }
538 | hull(){
539 | modPlateWidT(Hulls = true, hullSides = [0,RIGHT,0], rows = R2);
540 | modPlateWidT(Hulls = true, hullSides = [0,LEFT,0], rows = R1);
541 | }
542 | hull(){
543 | modPlateWidT(Hulls = true, hullSides = [TOP,RIGHT,0], rows = R2);
544 | modPlateWidT(Hulls = true, hullSides = [TOP,LEFT,0], rows = R1);
545 | modPlateWidT(Hulls = true, hullSides = [BOTTOM,LEFT,BOTTOM], rows = R0,thickBuff = T0Buffer);
546 | modBoarderWidT(true,BACK,LEFT, cutLenM, 0, BBackHeight, [0,BACK,BOTTOM], R2);
547 | }
548 | hull(){
549 | modPlateWidT(Hulls = true, hullSides = [BOTTOM,LEFT,0], rows = R0,thickBuff = T0Buffer);
550 | modPlateWidT(Hulls = true, hullSides = [TOP,RIGHT,0], rows = R2);
551 | modPlateWidT(Hulls = true, hullSides = [TOP,LEFT,0], rows = R1);
552 | }
553 |
554 | //pretty thumb Boarder
555 | modBoarderLenT(false,FRONT, LEFT, cutLen, 0, T0BackH, [0,0,0], R0, Buffer=T0Buffer);
556 | hull(){
557 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
558 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [0,FRONT,0], R0, Buffer=T0Buffer);
559 | }
560 | modBoarderWidT(false, 0, LEFT, 0, 0, T0BackH, [0,0,0], R0, Buffer=T0Buffer);
561 | hull(){
562 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [0,BACK,0], R0, Buffer=T0Buffer);
563 | modBoarderLenT(true, BACK, LEFT, cutLenM, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
564 | }
565 | modBoarderLenT(false,BACK, LEFT, cutLen, 0, T0BackH, [RIGHT,0,0], R0, Buffer=T0Buffer);
566 | hull(){
567 | // modBoarderLenT(true, BACK, LEFT, cutLen, 0, T0BackH, [RIGHT,0,0], R0, Buffer=T0Buffer);
568 | modBoarderLenT(true,BACK, LEFT, cutLen, 0, T0BackH, [0,BACK,0], R0, Buffer=T0Buffer);
569 | modBoarderLenT(true, BACK, LEFT, cutLenM, 0, BBackHeight, [LEFT,0,0], R1);
570 | }
571 | modBoarderLenT(false,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,0], R1);
572 | hull(){
573 | modBoarderLenT(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,0], R1);
574 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,0], R1);
575 | }
576 | modBoarderWidT(false,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,0,0], R1);
577 | hull(){
578 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,0], R1);
579 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,0], R2);
580 | }
581 | modBoarderWidT(false,BACK,RIGHT, 0, cutLenM, BBackHeight, [0,0,0], R2);
582 | hull(){
583 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight,[0,FRONT,TOP], R1);
584 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R2);
585 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [0,0,0], R2);
586 | }
587 | hull(){
588 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,0], R2);
589 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,0], R2);
590 | }
591 | modBoarderLenT(false,FRONT,LEFT, cutLenM, 0, BBackHeight, [0,0,0], R2);
592 | hull(){
593 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [0,FRONT,0], R2);
594 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [LEFT,0,0], R2);
595 | }
596 | modBoarderWidT(false,BACK,LEFT, 0, 0, BBackHeight, [0,0,0], R2);
597 | hull(){
598 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [LEFT,0,0], R2);
599 | modBoarderLenT(true,FRONT, LEFT, cutLen, 0, T0BackH, [0,0,0], R0, Buffer=T0Buffer);
600 | }
601 | //
602 | //binding Cluster and Columns
603 | hull(){
604 | modBoarderWid(true, BACK, LEFT, cutLen, 0,BFrontHeight, [0,BACK,TOP], R1, C1);
605 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,TOP], R0, C1);
606 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,0], R2);
607 |
608 | modBoarderWid(true, BACK, LEFT, cutLen, 0,BFrontHeight, [0,BACK,BOTTOM], R1, C1,[RScale,1,1]);
609 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight,[0,FRONT,BOTTOM],R0, C1,[RScale,1,1]);
610 | }
611 | hull(){
612 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [0,FRONT,0], R2);
613 | modBoarderLenT(true,FRONT,RIGHT, 0, 0, BBackHeight, [LEFT,0,0], R2);
614 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,0], R0, C1);
615 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,0], R0, C1);
616 | modBoarderWid(true, BACK, LEFT, cutLenM, 0,BFrontHeight, [0,BACK,0], R1, C1);
617 | }
618 | hull(){
619 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [0,FRONT,0], R2);
620 | modBoarderLenT(true,FRONT,RIGHT, 0, 0, BBackHeight, [LEFT,0,0], R2);
621 |
622 | modBoarderLen(true, BACK, LEFT, 0, cutLenM, BBackHeight, [LEFT,0,TOP], R0, C1);
623 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C1);
624 |
625 | modBoarderLen(true, BACK, LEFT, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C1, [1,RScale,1]);
626 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,BOTTOM], R0, C1, [RScale,1,1]);
627 | }
628 | hull(){
629 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,TOP], R0, C1);
630 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,0], R0, C1);
631 |
632 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C1,[1,RScale,1]);
633 | }
634 | hull(){
635 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [LEFT,FRONT,0], R2);
636 | modBoarderLenT(true,FRONT, LEFT, cutLen, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
637 |
638 | modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,BACK,TOP], R0, C1);
639 | modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,BACK,TOP], R0, C2);
640 |
641 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C1, [1,RScale,1]);
642 | modBoarderLen(true, BACK, 0, 0, cutLenM,BBackHeight,[LEFT,BACK,BOTTOM], R0, C2, [1,RScale,1]);
643 | }
644 |
645 | hull(){
646 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
647 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [LEFT,FRONT,0], R0, Buffer=T0Buffer);
648 |
649 | modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,BACK,TOP], R0, C2);
650 | modBoarderLen(true, BACK, 0, 0, cutLenM,BBackHeight,[LEFT,BACK,BOTTOM], R0, C2, [1,RScale,1]);
651 | }
652 |
653 | // #hull(){
654 | // modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
655 | //
656 | // modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,BACK,TOP], R0, C2);
657 | // modBoarderLen(true, BACK, 0, 0, cutLenM,BBackHeight,[LEFT,BACK,BOTTOM], R0, C2, [1,RScale,1]);
658 | // }
659 |
660 | //additional clean up with bind to columns
661 | hull(){
662 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
663 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [LEFT,FRONT,0], R0, Buffer=T0Buffer);
664 |
665 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C2);
666 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C2, [1,RScale,1]);
667 | }
668 | hull(){
669 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
670 |
671 | modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,BACK,TOP], R0, C2);
672 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight,[RIGHT,BACK,BOTTOM], R0, C2, [1,RScale,1]);
673 | }
674 | hull(){
675 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [LEFT,0,0], R2);
676 | modBoarderLenT(true,FRONT, LEFT, cutLen, 0, T0BackH, [0,0,0], R0, Buffer=T0Buffer);
677 |
678 | modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,TOP], R0, C1);
679 | modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,BACK,TOP], R0, C2);
680 |
681 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C1, [1,RScale,1]);
682 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,BACK,BOTTOM], R0, C2, [1,RScale,1]);
683 | }
684 | hull(){
685 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [0,0,0], R2);
686 | modBoarderLen(true, BACK, LEFT, 0, cutLenM, BBackHeight, [LEFT,0,TOP], R0, C1);
687 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C1);
688 |
689 | modBoarderLen(true, BACK, LEFT, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C1, [1,RScale,1]);
690 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,BOTTOM], R0, C1, [RScale,1,1]);
691 | }
692 | hull(){
693 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [0,0,0], R2);
694 |
695 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C1);
696 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,BACK,BOTTOM], R0, C1, [RScale,1,1]);
697 | modBoarderWid(true, BACK, LEFT, cutLen, 0,BFrontHeight, [0,BACK,TOP], R1, C1);
698 | modBoarderWid(true, BACK, LEFT, cutLen, 0,BFrontHeight, [0,BACK,BOTTOM], R1, C1,[RScale,1,1]);
699 | }
700 |
701 | //Tarckballs
702 | if(trackball == true){
703 | hull(){
704 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,0,TOP], R0, C2);
705 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,0,BOTTOM], R0, C2, [1,RScale,1]);
706 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,0], R0, C4);
707 |
708 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,RScale,1]);
709 |
710 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,TOP], R0, C4);
711 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight , [0,0,BOTTOM], R0, C4, [1,RScale,1]);
712 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,0], R1, C5);
713 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,0], R0, C5);
714 |
715 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C5);
716 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C5);
717 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, C5);
718 |
719 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5, [RScale,1,1]);
720 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5, [RScale,1,1]);
721 |
722 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C5);
723 | modBoarderLen(true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,TOP], R0, C5);
724 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5, [RScale,1,1] );
725 | modBoarderLen(true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,RScale,1]);
726 |
727 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [LEFT,BACK,0], R0, Buffer=T0Buffer);
728 | modBoarderLenT(true, BACK, LEFT, cutLenM, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
729 | }
730 | hull(){
731 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,BACK,TOP], R0, C2);
732 | modBoarderLenT(true, FRONT, LEFT, cutLenM, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
733 | modBoarderLen(true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,TOP], R0, C5);
734 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
735 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,BACK,TOP], R0, C4);
736 | }
737 | }
738 | }
739 | // !!!CUTS
740 | union(){
741 | if(keyhole == true){
742 | for(cols = [C2:C5]){
743 | for(rows = [R0:RMAX]){
744 | BuildRmCn(rows, cols){
745 | if(ClippedOrientation[rows][cols] == true){
746 | Keyhole(clipLength = Clipped[rows][cols]);
747 | }else {
748 | rotate([0,0,-90])Keyhole(clipLength = Clipped[rows][cols],cutThickness = 3);
749 | }
750 | }
751 | }
752 | }
753 |
754 | BuildRmCn(R0, C1)rotate([0,0, 0])Keyhole(clipLength = Clipped[R0][C1], cutThickness = 0);
755 | BuildRmCn(R1, C1)rotate([0,0, 0])Keyhole(clipLength = Clipped[R1][C1]);
756 | BuildRmCn(R1, C6)rotate([0,0,-90])Keyhole(clipLength = Clipped[R1][C6]);
757 | BuildRmCn(R0, C6)rotate([0,0,-90])Keyhole(clipLength = Clipped[R0][C6]);
758 |
759 | //PCB mount
760 | // for(cols = [CStart:CEnd])BuildRmCn(PM,cols)cylinder(d=3, 20, center = true);
761 | //thumb
762 | PlaceOnThumb(0)rotate([0,0,-90])Keyhole(clipLength = cutLen, cutThickness = 1);
763 | PlaceOnThumb(1)rotate([0,0,-90])Keyhole(clipLength = cutLen, cutThickness = 2);
764 | PlaceOnThumb(2)rotate([0,0,-90])Keyhole(clipLength = cutLen, cutThickness = 2);
765 |
766 | //cuttting artifacts
767 | for(cols = [CStart:CEnd]){
768 | BuildTopCuts(PlateDimension[2]+platethickness+8, 0, TOP, col = cols, rowInit = R0, rowEnd = R1);
769 | }
770 | BuildTopCuts(PlateDimension[2]+platethickness+8, 0, TOP, col = T0, rowInit = R0, rowEnd = R2);
771 | }
772 | }
773 | }
774 | }
775 |
776 | module BuildEnclosure(platethickness = 0, trackball = false, Jacks = false)
777 | {
778 | plateDim = PlateDimension +[0,0,0];
779 | //Submodules
780 | module modPlate(Hulls = true, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows, cols){//shorthand
781 | BuildRmCn(rows, cols)modulate(PlateDimension,[0,sign(Clipped[rows][cols]), sides],plateDim-[0,abs(Clipped[rows][cols]),-platethickness-thickBuff], [0,-sign(Clipped[rows][cols]),refSides], Hull = Hulls, hullSide = hullSides);
782 | }
783 | module modPlateT(Hulls = false, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows){//shorthand for thumb
784 | PlaceOnThumb(rows)modulate(PlateDimension,[0,sign(Clipped[rows][T0]), sides],plateDim-[0,abs(Clipped[rows][T0]),-platethickness-thickBuff], [0,-sign(Clipped[rows][T0]),refSides], Hull = Hulls, hullSide = hullSides);
785 | }
786 | module modPlateWid(Hulls = true, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows, cols){//shorthand call for Width-wise clipping
787 | BuildRmCn(rows, cols)modulate(PlateDimension,[sign(Clipped[rows][cols]), 0, sides], plateDim-[abs(Clipped[rows][cols]),0,-platethickness-thickBuff], [-sign(Clipped[rows][cols]), 0, refSides], Hull = Hulls, hullSide = hullSides);
788 | }
789 | module modPlateWidT(Hulls = false, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows){//shorthand call for Width-wise clipping
790 | PlaceOnThumb(rows)modulate(PlateDimension,[sign(Clipped[rows][T0]), 0, sides], plateDim-[abs(Clipped[rows][T0]),0,-platethickness-thickBuff], [-sign(Clipped[rows][T0]), 0, refSides], Hull = Hulls, hullSide = hullSides);
791 | }
792 | module modBoarderLen(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, cols, scaling = [1,1,1]){
793 | BuildRmCn(rows, cols)modulate(PlateDimension+[0,-refClip*2,platethickness*2], [refSides,sides, BOTTOM],plateDim+[-dimClip,-Bthickness,height], [-refSides,sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
794 | }
795 | module modBoarderWid(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, cols, scaling = [1,1,1]){
796 | BuildRmCn(rows, cols)modulate(PlateDimension+[-refClip*2,0,platethickness*2], [refSides,sides, BOTTOM],plateDim+[-Bthickness,-dimClip,height], [refSides,-sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
797 | }
798 | module modBoarderLenT(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows,scaling = [1,1,1], Buffer = 0){
799 | PlaceOnThumb(rows)modulate(PlateDimension+[0,-refClip*2,platethickness*2+Buffer*2], [refSides,sides, BOTTOM],plateDim+[-dimClip,-Bthickness,height], [-refSides,sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
800 | }
801 | module modBoarderWidT(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, scaling = [1,1,1], Buffer = 0){
802 | PlaceOnThumb(rows)modulate(PlateDimension+[-refClip*2,0,platethickness*2+Buffer*2], [refSides,sides, BOTTOM],plateDim+[-Bthickness,-dimClip,height], [refSides,-sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
803 | }
804 | module hullEnclusure(){
805 | hull(){
806 | rotate(tenting)translate([0,0,plateHeight])hull(){
807 | children([0:$children-1]);
808 | }
809 | linear_extrude(1)projection()rotate(tenting)translate([0,0,plateHeight])hull(){
810 | children([0:$children-1]);
811 | }
812 | }
813 | }
814 | module transEnclose(){
815 | rotate(tenting)translate([0,0,plateHeight]){
816 | children([0:$children-1]);
817 | }
818 | }
819 | module projectEnclose(){
820 | linear_extrude(1)projection()rotate(tenting)translate([0,0,plateHeight])hull(){
821 | children([0:$children-1]);
822 | }
823 | }
824 | // End of submodules
825 | difference(){
826 | union(){
827 | //TOP side
828 | hull(){
829 | transEnclose()modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,0,BOTTOM],R1, C1, [RScale,1,1]);
830 | projectEnclose()modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,0,BOTTOM],R1, C1, [EScale,1,1]);
831 | }
832 | hull(){
833 | transEnclose(){
834 | modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,FRONT,BOTTOM], R1, C1, [RScale,1,1]);
835 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,RScale,1]);
836 | }
837 | projectEnclose(){
838 | modBoarderWid(true, BACK, LEFT, cutLenM, 0, BFrontHeight, [0,FRONT,BOTTOM], R1, C1, [EScale,1,1]);
839 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,EScale,1]);
840 | }
841 | }
842 | hull(){
843 | transEnclose(){
844 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,RScale,1]);
845 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C3, [1,RScale,1]);
846 | }
847 | projectEnclose(){
848 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,EScale,1]);
849 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C3, [1,EScale,1]);
850 | }
851 | }
852 | hull(){
853 | transEnclose()
854 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C3, [1,RScale,1]);
855 | projectEnclose()
856 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C3, [1,EScale,1]);
857 | }
858 | hull(){
859 | transEnclose(){
860 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C3, [1,RScale,1]);
861 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,RScale,1]);
862 | }
863 | projectEnclose(){
864 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C3, [1,EScale,1]);
865 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,EScale,1]);
866 | }
867 | }
868 | hull(){
869 | transEnclose(){
870 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,TOP], R1, C4);
871 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,TOP], R1, C6);
872 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,RScale,1]);
873 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,RScale,1]);
874 | }
875 | projectEnclose(){
876 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,EScale,1]);
877 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,EScale,1]);
878 | }
879 | }
880 | hull(){
881 | transEnclose(){
882 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight,[RIGHT,FRONT,TOP], R1, C6);
883 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BFrontHeight,[RIGHT,FRONT,TOP], R1, C6);
884 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,RScale,1]);
885 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [RScale,1,1]);
886 | }
887 | projectEnclose(){
888 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,EScale,1]);
889 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [EScale,1,1]);
890 | }
891 | }
892 | hull(){
893 | transEnclose(){
894 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,BACK,TOP], R1, C6);
895 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [RIGHT,FRONT,TOP], R1, C6);
896 |
897 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [RScale,1,1]);
898 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [RScale,1,1]);
899 | }
900 | projectEnclose(){
901 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [EScale,1,1]);
902 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [EScale,1,1]);
903 | }
904 | }
905 | hull(){
906 | transEnclose(){
907 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [ RIGHT,BACK,TOP], R1, C6);
908 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,FRONT,TOP], R0, C6);
909 |
910 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [RScale,1,1]);
911 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [RScale,1,1]);
912 | }
913 | projectEnclose(){
914 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [EScale,1,1]);
915 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [EScale,1,1]);
916 | }
917 | }
918 | hull(){
919 | transEnclose(){
920 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,BACK,TOP], R0, C6);
921 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,FRONT,TOP], R0, C6);
922 |
923 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [RScale,1,1]);
924 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [RScale,1,1]);
925 | }
926 | projectEnclose(){
927 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [EScale,1,1]);
928 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [EScale,1,1]);
929 | }
930 | }
931 |
932 | //Bottom side
933 | if (trackball == false){
934 | hull(){
935 | transEnclose(){
936 | modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,0,BOTTOM], R0, C2, [1,RScale,1]);
937 | modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,RScale,1]);
938 | }
939 | projectEnclose(){
940 | modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,0,BOTTOM], R0, C2, [1,EScale,1]);
941 | modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,EScale,1]);
942 | }
943 | }
944 | hull(){
945 | transEnclose(){
946 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C4, [1,RScale,1]);
947 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5);
948 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C5);
949 | }
950 | projectEnclose(){
951 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,EScale,1]);
952 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5);
953 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C5);
954 | }
955 | }
956 | hull(){
957 | transEnclose(){
958 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[RScale,1,1]);
959 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5,[RScale,1,1]);
960 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C5);
961 | }
962 | projectEnclose(){
963 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[EScale,1,1]);
964 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5,[EScale,1,1]);
965 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C5);
966 | }
967 | }
968 |
969 | //thumb track section
970 | hull(){
971 | transEnclose(){
972 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [LEFT,BACK,BOTTOM], R0);
973 | modBoarderWidT(true, BACK, LEFT, cutLen, 0, BBackHeight, [LEFT,BACK,BOTTOM], R0);
974 | modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,0,BOTTOM], R0, C2, [1,RScale,1]);
975 | modBoarderLen( true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,BACK,TOP], R0, C2);
976 | }
977 | projectEnclose(){
978 | modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,0,BOTTOM], R0, C2, [1,EScale,1]);
979 | modBoarderWidT(true, BACK, LEFT, cutLen, 0, BBackHeight, [LEFT,BACK,BOTTOM], R0);
980 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [LEFT,0,BOTTOM], R0, [1,EScale,1]);
981 | }
982 | }
983 |
984 | }
985 | else{
986 | hull(){
987 | projectEnclose(){
988 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [LEFT,0,0], R0, [1,EScale,1]);
989 | }
990 | transEnclose(){
991 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[RScale,1,1]);
992 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,RScale,1]);
993 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [LEFT,BACK,0], R0);
994 | }
995 | projectEnclose(){
996 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[EScale,1,1]);
997 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,EScale,1]);
998 | }
999 | }
1000 | }
1001 |
1002 | hull(){
1003 | transEnclose(){
1004 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[RScale,1,1]);
1005 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,RScale,1]);
1006 | }
1007 | projectEnclose(){
1008 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[EScale,1,1]);
1009 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,EScale,1]);
1010 | }
1011 | }
1012 | hull(){
1013 | transEnclose(){
1014 | modBoarderLen(true,BACK, RIGHT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C5, [1,1,1]);
1015 | modBoarderLen(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C6, [1,1,1]);
1016 | modBoarderLen(true,BACK, RIGHT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C5, [1,RScale,1]);
1017 | modBoarderLen(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C6, [1,RScale,1]);
1018 | }
1019 | projectEnclose(){
1020 | modBoarderLen(true,BACK, RIGHT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C5, [1,EScale,1]);
1021 | modBoarderLen(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C6, [1,EScale,1]);
1022 | }
1023 | }
1024 | hull(){
1025 | transEnclose(){
1026 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C6);
1027 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,TOP], R0, C6);
1028 |
1029 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [RScale,RScale,1]);
1030 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,BOTTOM],R0, C6, [1,RScale,1]);
1031 | }
1032 | projectEnclose(){
1033 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [EScale,EScale,1]);
1034 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,BOTTOM],R0, C6, [1,EScale,1]);
1035 | }
1036 | }
1037 |
1038 | //Thumb Section
1039 | hull(){
1040 | transEnclose(){
1041 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [LEFT,BACK,0], R0);
1042 | modBoarderLenT(true, BACK, LEFT,cutLenM, 0, BBackHeight, [LEFT,BACK,0], R1);
1043 | }
1044 | projectEnclose(){
1045 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [LEFT,0,0], R0, [1,EScale,1]);
1046 | modBoarderLenT(true, BACK, LEFT,cutLenM, 0, BBackHeight, [LEFT,0,0], R1, [1,RScale,1]);
1047 | }
1048 | }
1049 | hull(){
1050 | transEnclose(){
1051 | modBoarderLenT(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,BACK,0], R1);
1052 | }
1053 | projectEnclose(){
1054 | modBoarderLenT(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,0], R1, [1,RScale,1]);
1055 | }
1056 | }
1057 | hull(){
1058 | transEnclose(){
1059 | modBoarderLenT(true, BACK, LEFT,cutLenM, 0, BBackHeight, [RIGHT,BACK,0], R1);
1060 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,BACK,0], R1);
1061 | }
1062 | projectEnclose(){
1063 | modBoarderLenT(true, BACK, LEFT,cutLenM, 0, BBackHeight, [RIGHT,0,0], R1, [1,RScale,1]);
1064 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,0], R1, [EScale,1,1]);
1065 | }
1066 | }
1067 | hull(){
1068 | transEnclose(){
1069 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,0,0], R1);
1070 | }
1071 | projectEnclose(){
1072 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,0,0], R1, [EScale,1,1]);
1073 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, [EScale,1,1]);
1074 | }
1075 | }
1076 | hull(){
1077 | transEnclose(){
1078 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight,[BOTTOM,FRONT,0], R1);
1079 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,BACK,0], R2);
1080 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight,[BOTTOM,FRONT,0], R2);
1081 | }
1082 | projectEnclose(){
1083 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,FRONT,0], R1, [EScale,1,1]);
1084 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,BACK,0], R2, [EScale,1,1]);
1085 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,FRONT,0], R2, [EScale,1,1]);
1086 | }
1087 | }
1088 | hull(){
1089 | transEnclose(){
1090 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,FRONT,0], R2);
1091 | modBoarderLenT(true,FRONT, LEFT,cutLenM, 0, BBackHeight, [RIGHT,FRONT,0], R2);
1092 | }
1093 | projectEnclose(){
1094 | // modBoarderWidT(true,FRONT,RIGHT, cutLenM, 0, BBackHeight,[BOTTOM,FRONT,0], R2, [1,1,1]);
1095 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight,[BOTTOM,FRONT,0], R2, [EScale,1,1]);
1096 | }
1097 | }
1098 | hull(){
1099 | transEnclose(){
1100 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,0], R2);
1101 | modBoarderWid(true, BACK, LEFT, cutLen, 0, BFrontHeight, [0,BACK,BOTTOM], R1, C1,[RScale,1,1]);
1102 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,BOTTOM], R0, C1,[RScale,1,1]);
1103 | }
1104 | projectEnclose(){
1105 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight,[BOTTOM,FRONT,0], R2, [EScale,1,1]);
1106 | modBoarderWid(true, BACK, LEFT, cutLen, 0, BFrontHeight, [0,BACK,BOTTOM], R1, C1,[EScale,1,1]);
1107 | modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,BOTTOM], R0, C1,[EScale,1,1]);
1108 | }
1109 | }
1110 | }
1111 | // basecut to remove artifact when height is set low
1112 |
1113 | }
1114 | //trackball
1115 | // hullEnclusure(){
1116 | // modBoarderWid(true, 0, LEFT, 0, BBackHeight, [0,BACK,BOTTOM], R0, C5);
1117 | // modBoarderLen(true, BACK, 0, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5);
1118 | // modPlateWidT(Hulls = true, hullSides = [BOTTOM,0,BOTTOM], rows = R0);
1119 | // modPlateWidT(Hulls = true, hullSides = [TOP,0,BOTTOM], rows = R1);
1120 | // }
1121 |
1122 | //MCU and Jacks
1123 | }
1124 |
1125 | //Trackball Module
1126 | step = 5;
1127 |
1128 | //--- shorthard transform to blob center
1129 |
1130 | //Path function.
1131 | function oval_path(theta, phi, a, b, c, deform = 0) = [
1132 | a*cos(theta)*cos(phi), //x
1133 | c*sin(theta)*(1+deform*cos(theta)) , //
1134 | b*sin(phi),
1135 | ];
1136 |
1137 | //oval path with linear angle offset
1138 | function oval_path2(theta, phi_init, a, b, c, d = 0, p = 1, deform = 0) = [
1139 | a*cos(theta)*cos(phi_init), //x
1140 | b*sin(theta)*(1+deform*cos(theta))*cos(phi_init + d * sin(theta*p)), //
1141 | c*sin(phi_init + d * sin(theta*p))
1142 | ];
1143 |
1144 | //oval path with angle offset with hypersine
1145 | function oval_path3(theta, phi_init, a, b, c, d = 0, p = 1, deform = 0) = [
1146 | a*cos(theta)*cos(phi_init), //x
1147 | b*sin(theta)*(1+deform*cos(theta))*cos(phi_init + d * pow(sin(theta*p), 1)), //
1148 | c*sin(phi_init + d * pow(sin(theta*p), 3))
1149 | ];
1150 |
1151 | //shape functions
1152 | function ellipse(a, b, d = 0) = [for (t = [0:step:360]) [a*cos(t), b*sin(t)*(1+d*cos(t))]]; //shape to
1153 |
1154 | // sweep generators
1155 |
1156 | module palm_track() {
1157 | a = trackR;
1158 | b = trackR;
1159 | c = trackR;
1160 | //Ellipsoid([20*2,25*2,60],[30*2,25*2,60], center = true);
1161 | function shape() = ellipse(3, 3);
1162 | function shape2() = ellipse(4, 6);
1163 | path_transforms = [for (t=[0:step:180]) translation(oval_path3(t,20,a,c,b,30,1,0))*rotation([90,-20-20*sin(t),t])];
1164 | path_transforms2 = [for (t=[0:step:180]) translation(oval_path3(t,70,b,a,c,6,1,0))*rotation([90,-70+5*sin(t),t])];
1165 | // path_transforms3 = [for (t=[0:step:360]) translation(oval_path3(t,-5,a,c,b,-15,1,0))*rotation([90,20+15*cos(t),t])];
1166 | path_transforms3 = [for (t=[0:step:180]) translation(oval_path3(t,-20,a,c,b,-30,1,0))*rotation([90,20+20*sin(t),t])];
1167 | path_transforms4 = [for (t=[0:step:360]) translation(oval_path3(t,-40,a,c,b,0,1,0))*rotation([90,40+sin(t),t])];
1168 |
1169 | translate([0,0,-1]){
1170 | rotate([-90,0,0])sweep(shape(), path_transforms);
1171 | rotate([90,0,-90])sweep(shape(), path_transforms2); //tip
1172 | rotate([90,0,90])sweep(shape(), path_transforms2); //tip
1173 | rotate([-90,0,0])sweep(shape(), path_transforms3);
1174 | }
1175 | //support ring
1176 | rotate([0,0,0])sweep(shape2(), path_transforms4);
1177 | }
1178 |
1179 |
1180 | module PCB(){
1181 | tol = .05;
1182 | PL = 21/2+tol;
1183 | PW = 18.6/2+tol;
1184 | PT = 3;
1185 | PCBT = 1.6;
1186 |
1187 | //Prism
1188 | translate([0,0,-PT])linear_extrude(PT)rounding(r=8)polygon([[PL,PW],[-PL,PW],[-PL,-PW],[PL,-PW]]);
1189 | translate([PL-6,0,.5])cube([2,4,1],center= true);
1190 |
1191 | //PCB
1192 | translate([0,0,-.8-PT])cube([28,21,PCBT],center= true);
1193 | translate([24/2,0,-PT-PCBT-2])cylinder(d=2.44, 10);
1194 | translate([-24/2,0,-PT-PCBT-2])cylinder(d=2.44, 10);
1195 |
1196 | //Apeture
1197 | translate([0,0,0])cylinder(d1=5, d2= 12, 4);
1198 | }
1199 |
1200 | PCBA = [45,0,0];
1201 | rbearing = .5;
1202 | module TrackBall(){
1203 | difference(){
1204 | union(){
1205 | palm_track();
1206 | rotate(PCBA)translate([0,0,-trackR-1])cube([30,22,8],center= true); // pcb housing
1207 | }
1208 |
1209 | // sphere(d= trackR*2+.5);
1210 | //bearing holes
1211 |
1212 | //lower bearing
1213 | for(i= [0:2])rotate([0,40,120*i-90])translate([trackR,0,0])sphere(r=rbearing); //upper bearing for tighter fit?
1214 | for(i= [0:1])rotate([0,-10,180*i])translate([trackR,0,0])sphere(r=rbearing); //upper bearing for tighter fit?
1215 | rotate(PCBA)translate([0,0,-42/2])PCB();
1216 | }
1217 | }
1218 | //################## Section E:: Key Switches and Caps ##################
1219 | module BuildSet2()
1220 | {
1221 | for(cols = [C1:C6])
1222 | {
1223 | for(rows = [R0:R1])
1224 | {
1225 | // if ( (rows != R0 || cols != C1) ){
1226 | BuildRmCn(rows, cols)
1227 | if(ClippedOrientation[rows][cols] == true){Switch(colors = "Steelblue", clipLength = Clipped[rows][cols]);}
1228 | else {rotate([0,0,-90])Switch(colors = "Steelblue", clipLength = Clipped[rows][cols]);}
1229 | // }
1230 | }
1231 | }
1232 | }
1233 |
1234 | module BuildSetCaps()
1235 | {
1236 | for(cols = [CStart:CEnd])
1237 | {
1238 | for(rows = [R0:RMAX])
1239 | {
1240 | color()BuildRmCn(rows, cols)
1241 | {translate([0,0,8.9])keycap(rows+cols*(RMAX+1), ClippedOrientation[rows][cols], Clipped[rows][cols]);}
1242 | }
1243 | }
1244 | }
1245 |
1246 |
1247 |
1248 |
1249 |
1250 |
1251 |
1252 |
1253 |
1254 |
1255 |
1256 |
--------------------------------------------------------------------------------
/Things/GiGiAbsMin.scad:
--------------------------------------------------------------------------------
1 | use //modules for mx switch and key holes o
2 | use
3 | use
4 | use //for cheaper minwoski
5 | use
6 | use
7 | use
8 | use
9 | use
10 |
11 | //use
12 |
13 | //TODOs
14 | /*
15 | 1) Palm Mount
16 | 2) MCU Mount
17 | 3) Base Mount
18 | a) on palm rest
19 | b) by the pinkie column
20 | 4) trackball structure
21 | 5) pretty boarder for final print
22 | */
23 |
24 | $fn = 32;
25 | //----- Alias
26 |
27 | R0 = 0; //bottom row
28 | R1 = 1;
29 | R2 = 2;
30 | R3 = 3;
31 | PM = 3;
32 | R4 = 4;
33 | R5 = 5;
34 |
35 | C0 = 0; //Column
36 | C1 = 1;
37 | C2 = 2;
38 | C3 = 3;
39 | C4 = 4;
40 | C5 = 5;
41 | C6 = 6;
42 | T0 = 7; //Thumb
43 |
44 | IN = 0; //inner path
45 | OUT = 1; //outter path
46 | PATH = 0; //path function
47 | NORMAL = 1; //path normal
48 |
49 | //Modulation Reference
50 | FRONT = 1;
51 | RIGHT = -1;
52 | BACK = -1;
53 | LEFT = 1;
54 | TOP = 1;
55 | BOTTOM = -1;
56 |
57 | //------ physical parameters
58 | unit = 18.05;
59 | Tol = 0.001; // tolance
60 | HullThickness = 0.0001; // modulation hull thickness
61 | TopHeight = 0; // Reference Origin of the keyswitch
62 | BottomHeight = 3.6; // height adjustment used for R0 keys for cherry types
63 |
64 | SwitchWidth = 15.6; // switch width
65 | PlateOffsets = 2.5; // additional pading on width of plates
66 | PlateOffsetsY = 2.5; // additional padding on lenght of plates
67 | PlateThickness = 3.5; // switch plate thickness H_1st
68 | PlateDimension = [SwitchWidth+PlateOffsets, SwitchWidth+PlateOffsetsY, PlateThickness];
69 | PlateHeight = 6.6; //
70 | SwitchBottom = 4.8; // from plate
71 |
72 | WebThickness = 2; // inter column hull inward offsets, 0 thickness results in poor plate thickness
73 | dMount = 5.1054; // mounting bore size
74 | dChamfer = 6; // chamfer diameter
75 |
76 | //-------enclusure and plate parameter
77 | cutLen = 3.2; //3.2scut length for clipped khail
78 | cutLenM = cutLen+2; // fudging
79 | RScale = 2; //rim bottom scaling
80 | EScale = 2.5; //Enclosure bottom scaling
81 |
82 | Bthickness = PlateDimension[0]-2; //thickness of the enclosure rim
83 | BFrontHeight = 2; //Height of frontside of the enclosure rim
84 | BBackHeight = 2; //Height of Backside of the enclosure rim
85 | T0Buffer = 0; //Additional Plate thickness buffer for T0 position.
86 | T0FrontH = BFrontHeight + T0Buffer; //Adjusted height for T0
87 | T0BackH = BBackHeight + T0Buffer; //Adjuted height for T0
88 |
89 | tenting = [0,9,0]; // tenting for enclusoure
90 | plateHeight = 11.5; // height adjustment for enclusure
91 | trackOrigin = [-1,-22,4]; //trackball origin
92 | trackTilt = [10,0,0]; //angle for tilting trackpoint support and PCB
93 | //------- finger parametes and rule
94 |
95 | //structure to hold column origin transformation
96 | ColumnOrigin = [//[translation vec] [rotation vec1] [rotation vec2]
97 | [[ -48, -unit*3/4, 0], [0, 0, 0], [ 0, 90, 0]], //INDEX 1
98 | [[ -30, -unit/2, 0], [0, 0, 0], [ 0, 90, 0]], //INDEX 2 knuckle
99 | [[-12.5, -unit/2, 0], [0, 0, 0], [ 0, 90, 0]], //INDEX 3 knuckle
100 | [[ 0, 0, 0], [0, 0, 0], [ 0, 90, 0]], //MIDDLE knuckle
101 | [[ 18, -unit/2, 0], [0, 0, -0], [ 0, 90, 0]], //RING knuckle
102 | [[ 25.0, -unit*9/8, 0], [0, 0, -15], [ 0, 90, 0]], //PINKY 1 knuckle
103 | [[ 42.0, -unit*9/8-1, -3], [0, 0, -15], [ 0, 90, 0]], //PINKY 2 knuckle
104 | [[ 4, 0, 4], [0, 0, 0], [ 0, 0, 0]] //Thumb wrist origin
105 | ];
106 |
107 | // structure to pass to thumbplacement module
108 | ThumbPosition =
109 | [//[[thetaDist, thetaMed, thetaProx, phiProx][rotation angle][rotation angle2][translation vec], clipLen, clip orientation]
110 | [[-32,-20, 6.5],[ 0,-130, 15]], //R0
111 | [[-36,-22, -14],[15, -60, 0]], //R1
112 | [[-43, -3,-9.9],[40, -60, -0]] //R2 43
113 | ];
114 |
115 | //------- design and adjustment parameters
116 | //Angles used in the pathfunction
117 | // i1 i2 i3 m r p1 p2
118 | KeycapOffset = [ 0, 0, 0, 0, 5, 2, 2]; //adjust path radius
119 |
120 | //Manual Adjustment of Pitches post Calculation for minor adjustment
121 | RowTrans =[[ 0, .8, .8, .8, .8, .41, .20, 0], //R0
122 | [ 1.05, 1.98, 1.98, 1.95, 1.95, 1.60, 1.44, 1], //R1s
123 | [ 2.1, 2.36, 2.36, 2.36, 2.36, 1.58, 1.75, 2], //R2s
124 | [ 3,1.375,1.375,1.375,1.375, 1, .83, 3], //PCB Mount (PM)
125 | [ 0, 0, 4, -4, -4, 4, -4, -4], //R4
126 | [ 0, 0, 4, 4, -4, 4, -4, 4] //R5
127 | ]*unit;
128 |
129 | Pitch =[[ 0, 15, 15, 15, 15, 15, 15, 0], //R0
130 | [ -10, -15, -15, -15, -15, -15, -15, 0], //R1s
131 | [ -15, -10, -10, -0, -0, -10, 0, 0], //R2s
132 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R3
133 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R4
134 | [ 0, 0, 0, 0, 0, 0, 0, 0] //R5
135 | ];
136 |
137 | Roll =[[ 10, 0, 0, 0, 0, -5, -10, 0], //R0
138 | [ -10, 0, 0, 0, 0, -5, -10, 0], //R1s
139 | [ -10, 0, 0, 0, 0, 0, 0, 0], //R2s
140 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R3
141 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R4
142 | [ 0, 0, 0, 0, 0, 0, 0, 0] //R5
143 | ];
144 |
145 | Height =[[ 0, 0, 0, 0, 0, -4, -5, 0], //R0
146 | [ 0, 0, 0, 0, 0, -4, -5, 0], //R1s
147 | [ -2.3, -3, -3, -3, -3, -3, -2, 0], //R2s
148 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R3
149 | [ 0, 0, 0, 0, 0, 0, 0, 0], //R4
150 | [ 0, 0, 0, 0, 0, 0, 0, 0] //R5
151 | ];
152 |
153 | //Manual Adjustment of Pitches post Calculation for minor adjustment
154 | // i1 i2 i3 m r p1 p2 T
155 | Clipped =[[cutLen,-cutLen, cutLen, cutLen, cutLen, -cutLen, cutLen, cutLen], //R0
156 | [cutLen,-cutLen, cutLen, -cutLen, -cutLen, -cutLen, cutLen, cutLen], //R1s
157 | [cutLen, cutLen, cutLen, cutLen, cutLen, cutLen, -cutLen, cutLen], //R2s
158 | [cutLen, cutLen, -cutLen, cutLen, cutLen, cutLen, -cutLen, -cutLen], //R3
159 | [cutLen, cutLen, cutLen, -cutLen, -cutLen, cutLen, -cutLen, -cutLen], //R4
160 | [cutLen, cutLen, cutLen, cutLen, -cutLen, cutLen, -cutLen, cutLen] //R5
161 | ];
162 |
163 | //Orientation of the clippede switches
164 |
165 | ClippedOrientation = //if length-wise true
166 | [[false, false, false, true, true, false, false, true],
167 | [false, false, false, true, true, false, false, true],
168 | [false, true, true, true, true, true, false, true],
169 | [false, false, false, true, true, true, false, false],
170 | [false, false, false, false, false, true, false, true],
171 | [false, false, false, false, false, true, false, false]
172 | ];
173 |
174 |
175 | KeyOriginCnRm = [for( i= [C0:C6])[[0,BottomHeight+KeycapOffset[i],0], for(j = [R1:R4])[0,TopHeight+KeycapOffset[i],0]]];
176 | //row and column loop setter
177 | RMAX = R1; // Set max rows on columns
178 | CStart = C1; // Set column to begin looping for the build
179 | CEnd = C6; // Set column to end for the build
180 |
181 | //######### Supporting Modules for Main Builder Modules
182 | function hadamard(a, b) = !(len(a) > 0) ? a*b : [ for (i = [0:len(a) - 1]) hadamard(a[i], b[i])]; // elementwise mult
183 |
184 | //Convinient notation for hulling a cube by face/edge/point
185 | module hullPlate(referenceDimensions = [0,0,0], offsets = [0,0,0], scalings = [1,1,1])
186 | {
187 | x = offsets[0] == 0 ? scalings[0]*referenceDimensions[0]:HullThickness;
188 | y = offsets[1] == 0 ? scalings[1]*referenceDimensions[1]:HullThickness;
189 | z = offsets[2] == 0 ? scalings[2]*referenceDimensions[2]:HullThickness;
190 | hullDimension = [x, y, z];
191 |
192 | translate(hadamard(referenceDimensions, offsets/2))translate(hadamard(hullDimension, -offsets/2))cube(hullDimension, center = true);
193 | }
194 |
195 | //Convinient cube transferomation and hulling
196 | module modulate(referenceDimension = [0,0,0], referenceSide = [0,0,0], objectDimension = [0,0,0], objectSide = [0,0,0], Hull = false, hullSide = [0,0,0], scalings = [1,1,1]){
197 | if(Hull == false){
198 | translate(hadamard(referenceDimension, referenceSide/2))translate(hadamard(hadamard(objectDimension,scalings),objectSide/2))scale(scalings)cube(objectDimension, center = true);
199 | }else{
200 | color("red")translate(hadamard(referenceDimension,referenceSide/2))translate(hadamard(hadamard(objectDimension,scalings), objectSide/2))hullPlate(objectDimension, hullSide, scalings);
201 | }
202 | }
203 |
204 | module PlaceColumnOrigin(Cn = C0) {
205 | translate(ColumnOrigin[Cn][0])rotate(ColumnOrigin[Cn][1])rotate([90,0,0])mirror([0,1,0])rotate(ColumnOrigin[Cn][2])children();
206 | }
207 |
208 | module OnPlateOrigin(Rm = R0, Cn = C0){
209 | translate((KeyOriginCnRm[Cn][Rm]+[0,PlateHeight+PlateThickness/2,0]))children();
210 | }
211 |
212 | //place child object on the target position with all transforms
213 | module BuildRmCn(row, col) {
214 | PlaceColumnOrigin(col)
215 | translate([RowTrans[row][col],Height[row][col],0])
216 | rotate([90,90,Pitch[row][col]])
217 | rotate([0,Roll[row][col],0])
218 | children();
219 | }
220 |
221 | module PlaceOnThumb(Rn = R0){ //for thumb
222 | translate(ColumnOrigin[T0][0])rotate(ColumnOrigin[T0][1])translate(ThumbPosition[Rn][0])rotate(ThumbPosition[Rn][1])children();
223 | }
224 |
225 | module BuildColumn(plateThickness, offsets, sides =TOP, col=0, rowInit = R0, rowEnd = RMAX){
226 | refDim = PlateDimension +[0,0,offsets];
227 | buildDim = [PlateDimension[0], PlateDimension[1], plateThickness];
228 |
229 | module modPlateLen(Hulls = true, hullSides = [0,0,0], rows, cols){//shorthand call for length-wise clipping
230 | modulate(refDim,[0,sign(Clipped[rows][cols]),sides], buildDim-[0,abs(Clipped[rows][cols]),0], [0,-sign(Clipped[rows][cols]),BOTTOM], Hull = Hulls, hullSide = hullSides);
231 | //use clip length sign to direct transform sides and adjust platle length rather than if else statement for more compact call
232 | }
233 |
234 | module modPlateWid(Hulls = true, hullSides = [0,0,0], rows, cols){//shorthand call for Width-wise clipping
235 | modulate(refDim,[sign(Clipped[rows][cols]), 0, sides], buildDim-[abs(Clipped[rows][cols]),0,0], [-sign(Clipped[rows][cols]), 0, BOTTOM], Hull = Hulls, hullSide = hullSides);
236 | }
237 |
238 | for (row = [rowInit:rowEnd]){// Plate
239 | if (ClippedOrientation[row][col] == true){ //for length-wise Clip
240 | BuildRmCn(row, col)modPlateLen(Hulls = false, rows =row, cols = col);
241 | if (row < rowEnd){//Support struct
242 | hull(){
243 | BuildRmCn(row, col)modPlateLen(Hulls = true, hullSides = [0,FRONT,0], rows = row, cols = col);
244 | BuildRmCn(row+1, col)modPlateLen(Hulls = true, hullSides = [0,BACK,0], rows = row+1, cols = col);
245 | }
246 | }
247 | }else { // for Width-wise Clip
248 | BuildRmCn(row, col)modPlateWid(Hulls = false, rows =row, cols = col);
249 | if (row < rowEnd){//Support struct
250 | hull(){
251 | BuildRmCn(row, col)modPlateWid(Hulls = true, hullSides = [0,FRONT,0], rows = row, cols = col);
252 | BuildRmCn(row+1, col)modPlateWid(Hulls = true, hullSides = [0,BACK,0], rows = row+1, cols = col);
253 | }
254 | }
255 | }
256 | }
257 | }
258 |
259 | module BuildTopCuts(plateThickness, offsets, sides =TOP, col=0, rowInit = R0, rowEnd = RMAX){
260 | refDim = PlateDimension +[0,0,offsets];
261 | buildDim = [PlateDimension[0], PlateDimension[1], plateThickness];
262 |
263 | //for fine tuning top cuts
264 | cutAdjustment = 2;
265 | function clipFudge(rows, cols) = abs(Clipped[rows][cols]) != 0 ? abs(Clipped[rows][cols])+cutAdjustment : 0;
266 |
267 | module modPlateLen(Hulls = true, hullSides = [0,0,0], rows, cols){//shorthand call for length-wise clipping
268 | modulate(refDim,[0,sign(Clipped[rows][cols]),sides], buildDim-[0,clipFudge(rows, cols),0], [0,-sign(Clipped[rows][cols]),TOP], Hull = Hulls, hullSide = hullSides);
269 | //use clip length sign to direct transform sides and adjust platle length rather than if else statement for more compact call
270 | }
271 |
272 | module modPlateWid(Hulls = true, hullSides = [0,0,0], rows, cols){//shorthand call for Width-wise clipping
273 | modulate(refDim,[sign(Clipped[rows][cols]), 0, sides], buildDim-[clipFudge(rows, cols),0,0], [-sign(Clipped[rows][cols]), 0, TOP], Hull = Hulls, hullSide = hullSides);
274 | }
275 | if(col != T0){ // for column section
276 | for (row = [rowInit:rowEnd]){// Plate
277 | if (ClippedOrientation[row][col] == true){ //for length-wise Clip
278 | BuildRmCn(row, col)modPlateLen(Hulls = false, rows =row, cols = col);
279 | if (row < rowEnd){//Support struct
280 | hull(){
281 | BuildRmCn(row, col)modPlateLen(Hulls = true, hullSides = [0,FRONT,0], rows = row, cols = col);
282 | BuildRmCn(row+1, col)modPlateLen(Hulls = true, hullSides = [0,BACK,0], rows = row+1, cols = col);
283 | }
284 | }
285 | }else { // for Width-wise Clip
286 | BuildRmCn(row, col)modPlateWid(Hulls = false, rows =row, cols = col);
287 | if (row < rowEnd){//Support struct
288 | hull(){
289 | BuildRmCn(row, col)modPlateWid(Hulls = true, hullSides = [0,FRONT,0], rows = row, cols = col);
290 | BuildRmCn(row+1, col)modPlateWid(Hulls = true, hullSides = [0,BACK,0], rows = row+1, cols = col);
291 | }
292 | }
293 | }
294 | }
295 | }
296 | else if(col == T0){
297 | for (row = [rowInit:rowEnd]){// Plate
298 | if (ClippedOrientation[row][col] == true){ //for length-wise Clip
299 | PlaceOnThumb(row)modPlateWid(Hulls = false, rows =row, cols = col);
300 | }else { // for Width-wise Clip
301 | PlaceOnThumb(row)modPlateLen(Hulls = false, rows =row, cols = col);
302 | }
303 | }
304 | }
305 | }
306 |
307 |
308 | //################ Main Builder ############################
309 | module BuildTopPlate(keyhole = false, trackball = false, platethickness = 0)
310 | {
311 | plateDim = PlateDimension +[0,0,0]; //adjust Plate Dimension parameter
312 | //Submodules
313 | module modPlate(Hulls = true, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows, cols){//shorthand
314 | BuildRmCn(rows, cols)modulate(PlateDimension,[0,sign(Clipped[rows][cols]), sides],plateDim-[0,abs(Clipped[rows][cols]),-platethickness-thickBuff], [0,-sign(Clipped[rows][cols]),refSides], Hull = Hulls, hullSide = hullSides);
315 | }
316 | module modPlateWid(Hulls = true, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows, cols){//shorthand call for Width-wise clipping
317 | BuildRmCn(rows, cols)modulate(PlateDimension,[sign(Clipped[rows][cols]), 0, sides], plateDim-[abs(Clipped[rows][cols]),0,-platethickness-thickBuff], [-sign(Clipped[rows][cols]), 0, refSides], Hull = Hulls, hullSide = hullSides);
318 | }
319 | module modBoarderLen(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, cols, scaling = [1,1,1]){
320 | BuildRmCn(rows, cols)modulate(PlateDimension+[0,-refClip*2,platethickness*2], [refSides,sides, BOTTOM],plateDim+[-dimClip,-Bthickness,height], [-refSides,sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
321 | }
322 | module modBoarderWid(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, cols, scaling = [1,1,1]){
323 | BuildRmCn(rows, cols)modulate(PlateDimension+[-refClip*2,0,platethickness*2], [refSides,sides, BOTTOM],plateDim+[-Bthickness,-dimClip,height], [refSides,-sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
324 | }
325 | //same as above but for thumb
326 | module modPlateT(Hulls = false, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows){//shorthand for thumb
327 | PlaceOnThumb(rows)modulate(PlateDimension,[0,sign(Clipped[rows][T0]), sides],plateDim-[0,abs(Clipped[rows][T0]),-platethickness-thickBuff], [0,-sign(Clipped[rows][T0]),refSides], Hull = Hulls, hullSide = hullSides);
328 | }
329 | module modPlateWidT(Hulls = false, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows){//shorthand call for Width-wise clipping
330 | PlaceOnThumb(rows)modulate(PlateDimension,[sign(Clipped[rows][T0]), 0, sides], plateDim-[abs(Clipped[rows][T0]),0,-platethickness-thickBuff], [-sign(Clipped[rows][T0]), 0, refSides], Hull = Hulls, hullSide = hullSides);
331 | }
332 | module modBoarderLenT(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows,scaling = [1,1,1], Buffer = 0){
333 | PlaceOnThumb(rows)modulate(PlateDimension+[0,-refClip*2,platethickness*2+Buffer*2], [refSides,sides, BOTTOM],plateDim+[-dimClip,-Bthickness,height], [-refSides,sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
334 | }
335 | module modBoarderWidT(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, scaling = [1,1,1], Buffer = 0){
336 | PlaceOnThumb(rows)modulate(PlateDimension+[-refClip*2,0,platethickness*2+Buffer*2], [refSides,sides, BOTTOM],plateDim+[-Bthickness,-dimClip,height], [refSides,-sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
337 | }
338 | //End of Submodules
339 |
340 | //Main builds
341 | difference(){
342 | union(){//SwitchPlate
343 | //build columns
344 | for(cols = [CStart:CEnd]){// build Webs
345 | BuildColumn(PlateDimension[2]+platethickness, 0, TOP, col = cols, rowInit = R0, rowEnd = R1); //builds plate
346 | }
347 | //Pretty Boarder
348 | //Top side
349 | hull(){ //C1R0 Edge
350 | modBoarderLen(true, BACK,RIGHT,cutLenM, 0, BBackHeight, [LEFT,0,TOP], R0, C1);
351 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C1);
352 |
353 | modBoarderLen(true, BACK,RIGHT,cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C1, [1,RScale,1]);
354 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C1, [RScale,1,1]);
355 | }
356 | hull(){
357 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,BACK,TOP], R1, C1);
358 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C1);
359 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C1);
360 |
361 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,BACK,BOTTOM], R1, C1, [RScale,1,1]);
362 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C1, [RScale,1,1]);
363 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C1, [RScale,1,1]);
364 | }
365 | hull(){
366 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C1);
367 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C1, [RScale,1,1]);
368 | }
369 | hull(){
370 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,FRONT,TOP], R1, C1);
371 | modBoarderLen(true,FRONT,RIGHT,cutLenM, 0, BFrontHeight, [LEFT,0,TOP], R1, C1);
372 |
373 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,FRONT,BOTTOM], R1, C1, [RScale,1,1]);
374 | modBoarderLen(true, FRONT,RIGHT,cutLenM, 0, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,RScale,1]);
375 | }
376 | hull(){
377 | modBoarderLen(true, FRONT,RIGHT,cutLenM, 0, BFrontHeight, [0,0,TOP], R1, C1);
378 | modBoarderLen(true, FRONT, LEFT,cutLenM, 0, BFrontHeight, [0,0,TOP], R1, C2);
379 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C3);
380 |
381 | modBoarderLen(true, FRONT,RIGHT,cutLenM, 0, BFrontHeight, [0,0,BOTTOM], R1, C1, [1,RScale,1]);
382 | modBoarderLen(true, FRONT, LEFT,cutLenM, 0, BFrontHeight, [0,0,BOTTOM], R1, C2, [1,RScale,1]);
383 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C3, [1,RScale,1]);
384 | }
385 | hull(){
386 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C3);
387 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,TOP], R1, C4);
388 |
389 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C3, [1,RScale,1]);
390 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C4, [1,RScale,1]);
391 | }
392 | hull(){
393 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,TOP], R1, C4);
394 | modBoarderLen(true, FRONT,RIGHT, cutLenM, 0, BFrontHeight, [0,0,TOP], R1, C5);
395 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [0,0,TOP], R1, C6);
396 |
397 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,RScale,1]);
398 | modBoarderLen(true, FRONT,RIGHT, cutLenM, 0, BFrontHeight, [0,0,BOTTOM], R1, C5, [1,RScale,1]);
399 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [0,0,BOTTOM], R1, C6, [1,RScale,1]);
400 | }
401 | hull(){
402 | modBoarderLen(true, FRONT, 0, 0, cutLenM,BFrontHeight, [RIGHT,0,0], R1, C4);
403 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [RIGHT,0,0], R0, C4);
404 |
405 | modBoarderWid(true, BACK, RIGHT, cutLenM, 0, BBackHeight, [0,0,0], R1, C4);
406 | modBoarderWid(true,FRONT, RIGHT, cutLenM, 0, BBackHeight, [0,FRONT,0], R0, C4);
407 |
408 | modBoarderLen(true, FRONT,RIGHT, cutLenM, 0,BFrontHeight, [LEFT,0,0], R1, C5);
409 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,0], R1, C5);
410 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,0], R0, C5);
411 | }
412 | hull(){
413 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0,BFrontHeight, [RIGHT,0,TOP], R1, C6);
414 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,TOP], R1, C6);
415 |
416 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0,BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,RScale,1]);
417 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [RScale,1,1]);
418 | }
419 | hull(){
420 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, C6);
421 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,TOP], R1, C6);
422 |
423 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [RScale,1,1]);
424 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [RScale,1,1]);
425 | }
426 | hull(){
427 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, C6);
428 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C6);
429 |
430 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [RScale,1,1]);
431 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [RScale,1,1]);
432 | }
433 | hull(){
434 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C6);
435 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C6);
436 |
437 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [RScale,1,1]);
438 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [RScale,1,1]);
439 | }
440 |
441 | //Bottom side
442 | hull(){
443 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [0,0,TOP], R0, C1);
444 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C1, [1,RScale,1]);
445 | }
446 | hull(){
447 | modBoarderLen(true, BACK, LEFT,cutLenM, 0, BBackHeight, [0,0,TOP], R0, C2);
448 | modBoarderLen(true, BACK, LEFT,cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C2, [1,RScale,1]);
449 | }
450 | hull(){
451 | modBoarderLen(true, BACK, LEFT,cutLenM, 0, BBackHeight, [0,0,TOP], R0, C2);
452 | modBoarderLen(false,BACK, 0, 0, cutLenM, BBackHeight, [0,0,0], R0, C3);
453 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,0], R0, C4);
454 |
455 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C2, [1,RScale,1]);
456 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,RScale,1]);
457 | }
458 | hull(){
459 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,TOP], R0, C4);
460 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C4, [1,RScale,1]);
461 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,0], R1, C5);
462 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,0], R0, C5);
463 | }
464 | hull(){
465 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C5);
466 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C5);
467 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, C5);
468 |
469 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5, [RScale,1,1]);
470 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5, [RScale,1,1]);
471 | }
472 | hull(){
473 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C5);
474 | modBoarderLen(true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,TOP], R0, C5);
475 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5, [RScale,1,1] );
476 | modBoarderLen(true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,RScale,1]);
477 | }
478 | hull(){
479 | modBoarderLen(true,BACK, RIGHT, cutLenM, 0, BBackHeight, [0,0,TOP], R0, C5);
480 | modBoarderLen(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,TOP], R0, C6);
481 | modBoarderLen(true,BACK, RIGHT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C5, [1,RScale,1]);
482 | modBoarderLen(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C6, [1,RScale,1]);
483 | }
484 | hull(){
485 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C6);
486 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,TOP], R0, C6);
487 |
488 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [RScale,RScale,1]);
489 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight,[RIGHT,0,BOTTOM], R0, C6, [1,RScale,1]);
490 | }
491 |
492 | //----- Thumb Cluster Section
493 | modPlateWidT(rows = R0,thickBuff = T0Buffer);
494 | modPlateWidT(rows = R1);
495 | modPlateWidT(rows = R2);
496 |
497 | hull(){
498 | modPlateWidT(Hulls = true, hullSides = [BOTTOM,0,0], rows = R0, thickBuff = T0Buffer);
499 | modPlateWidT(Hulls = true, hullSides = [TOP,0,0], rows = R1);
500 | }
501 | hull(){
502 | modPlateWidT(Hulls = true, hullSides = [0,RIGHT,0], rows = R2);
503 | modPlateWidT(Hulls = true, hullSides = [0,LEFT,0], rows = R1);
504 | }
505 | hull(){
506 | modPlateWidT(Hulls = true, hullSides = [TOP,RIGHT,0], rows = R2);
507 | modPlateWidT(Hulls = true, hullSides = [TOP,LEFT,0], rows = R1);
508 | modPlateWidT(Hulls = true, hullSides = [BOTTOM,LEFT,BOTTOM], rows = R0,thickBuff = T0Buffer);
509 | modBoarderWidT(true,BACK,LEFT, cutLenM, 0, BBackHeight, [0,BACK,BOTTOM], R2);
510 | }
511 | hull(){
512 | modPlateWidT(Hulls = true, hullSides = [BOTTOM,LEFT,0], rows = R0,thickBuff = T0Buffer);
513 | modPlateWidT(Hulls = true, hullSides = [TOP,RIGHT,0], rows = R2);
514 | modPlateWidT(Hulls = true, hullSides = [TOP,LEFT,0], rows = R1);
515 | }
516 |
517 | //pretty thumb Boarder
518 | modBoarderLenT(false,FRONT, LEFT, cutLen, 0, T0BackH, [0,0,0], R0, Buffer=T0Buffer);
519 | hull(){
520 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
521 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [0,FRONT,0], R0, Buffer=T0Buffer);
522 | }
523 | modBoarderWidT(false, 0, LEFT, 0, 0, T0BackH, [0,0,0], R0, Buffer=T0Buffer);
524 | hull(){
525 | modBoarderWidT(true, 0, LEFT, 0, 0, T0BackH, [0,BACK,0], R0, Buffer=T0Buffer);
526 | modBoarderLenT(true, BACK, LEFT, cutLenM, 0, T0BackH, [LEFT,0,0], R0, Buffer=T0Buffer);
527 | }
528 | modBoarderLenT(false,BACK, LEFT, cutLen, 0, T0BackH, [RIGHT,0,0], R0, Buffer=T0Buffer);
529 | hull(){
530 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, T0BackH, [RIGHT,0,0], R0, Buffer=T0Buffer);
531 | modBoarderLenT(true, BACK, LEFT, cutLenM, 0, BBackHeight, [LEFT,0,0], R1);
532 | }
533 | modBoarderLenT(false,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,0], R1);
534 | hull(){
535 | modBoarderLenT(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,0], R1);
536 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,0], R1);
537 | }
538 | modBoarderWidT(false,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,0,0], R1);
539 | hull(){
540 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,0], R1);
541 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,0], R2);
542 | }
543 | modBoarderWidT(false,BACK,RIGHT, 0, cutLenM, BBackHeight, [0,0,0], R2);
544 | hull(){
545 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight,[0,FRONT,TOP], R1);
546 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R2);
547 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [0,0,TOP], R2);
548 | }
549 | hull(){
550 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,0], R2);
551 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,0], R2);
552 | }
553 | modBoarderLenT(false,FRONT,LEFT, cutLenM, 0, BBackHeight, [0,0,0], R2);
554 | hull(){
555 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [0,FRONT,0], R2);
556 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [LEFT,0,0], R2);
557 | }
558 | modBoarderWidT(false,BACK,LEFT, 0, 0, BBackHeight, [0,0,0], R2);
559 | hull(){
560 | modBoarderWidT(true, BACK, LEFT, 0, 0, BBackHeight, [LEFT,0,0], R2);
561 | modBoarderLenT(true,FRONT, LEFT, cutLen, 0, T0BackH, [0,0,0], R0, Buffer=T0Buffer);
562 | }
563 |
564 | //binding to Columns
565 | hull(){
566 | modBoarderWid(true, BACK, LEFT, 0, cutLenM,BFrontHeight, [0,BACK,TOP], R1, C1);
567 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM,BBackHeight, [0,FRONT,TOP], R0, C1);
568 | modBoarderWid(false,FRONT, LEFT, 0, cutLenM, BBackHeight, [LEFT,BACK,TOP], R0, C1);
569 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,0], R2);
570 |
571 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,BACK,BOTTOM], R1, C1,[RScale,1,1]);
572 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight,[0,FRONT,BOTTOM],R0, C1,[RScale,1,1]);
573 | }
574 |
575 | hull(){
576 | modBoarderWidT(true,BACK, LEFT, 0, 0, BBackHeight, [LEFT,FRONT,0], R2);
577 | modBoarderLenT(true,FRONT, LEFT, 0, 0, BBackHeight, [LEFT,FRONT,0], R2);
578 |
579 | modBoarderLen(true, BACK,RIGHT,cutLenM, 0, BBackHeight, [LEFT,0,TOP], R0, C1);
580 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C1);
581 |
582 | }
583 | hull(){
584 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [LEFT,BACK,TOP], R0, C1);
585 | modBoarderLen( true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,BACK,TOP], R0, C1);
586 | // modBoarderWid(true, FRONT, LEFT,cutLenM, 0, BBackHeight, [LEFT,BACK,0], R0, C1);
587 | modBoarderWidT(true,BACK, LEFT, 0, 0, BBackHeight, [LEFT,FRONT,0], R2);
588 | modBoarderLenT(true,FRONT, LEFT, cutLen, 0 , T0BackH, [0,FRONT,0], R0, Buffer=T0Buffer);
589 | }
590 | hull(){
591 | modBoarderLen(true, BACK,RIGHT,cutLenM, 0, BBackHeight, [LEFT,0,TOP], R0, C1);
592 | modBoarderWid(true, FRONT, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C1);
593 |
594 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [0,0,TOP], R0, C1);
595 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C1, [1,RScale,1]);
596 |
597 | modBoarderLen(true, BACK, LEFT,cutLenM, 0, BBackHeight, [0,0,TOP], R0, C2);
598 | modBoarderLen(true, BACK, LEFT,cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C2, [1,RScale,1]);
599 |
600 | modBoarderLen( true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,BACK,TOP], R0, C1);
601 |
602 | modBoarderLenT(true,FRONT, LEFT, cutLen, 0 , T0BackH, [BOTTOM,0,0], R0, Buffer=T0Buffer);
603 | modPlateWidT(Hulls = true, hullSides = [TOP,RIGHT,0], rows = R2);
604 | modPlateWidT(Hulls = true, hullSides = [TOP,LEFT,0], rows = R1);
605 | }
606 |
607 | //Tarckballs
608 | if(trackball == true){
609 | hull(){
610 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,TOP], R0, C2);
611 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C2, [1,RScale,1]);
612 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,0], R0, C4);
613 |
614 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,RScale,1]);
615 |
616 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,TOP], R0, C4);
617 | modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C4, [1,RScale,1]);
618 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,0], R1, C5);
619 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,0], R0, C5);
620 |
621 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C5);
622 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,TOP], R0, C5);
623 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, C5);
624 |
625 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5, [RScale,1,1]);
626 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight,[0,FRONT,BOTTOM], R0, C5, [RScale,1,1]);
627 |
628 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C5);
629 | modBoarderLen(true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,TOP], R0, C5);
630 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5, [RScale,1,1] );
631 | modBoarderLen(true, BACK, RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,RScale,1]);
632 |
633 | modBoarderLenT(true,FRONT, LEFT, cutLen, 0, T0BackH, [RIGHT,FRONT,0], R0, Buffer=T0Buffer);
634 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, T0BackH, [RIGHT,BACK,0], R0, Buffer=T0Buffer);
635 | }
636 | }
637 | }
638 | // !!!CUTS
639 | union(){
640 | if(keyhole == true){
641 | for(cols = [C2:C5]){
642 | for(rows = [R0:RMAX]){
643 | BuildRmCn(rows, cols){
644 | if(ClippedOrientation[rows][cols] == true){
645 | Keyhole(clipLength = Clipped[rows][cols]);
646 | }else {
647 | rotate([0,0,-90])Keyhole(clipLength = Clipped[rows][cols],cutThickness = 3);
648 | }
649 | }
650 | }
651 | }
652 |
653 | BuildRmCn(R0, C1)rotate([0,0,-90])Keyhole(clipLength = Clipped[R0][C1], cutThickness = 0);
654 | BuildRmCn(R1, C1)rotate([0,0,-90])Keyhole(clipLength = Clipped[R1][C1]);
655 | BuildRmCn(R1, C6)rotate([0,0,-90])Keyhole(clipLength = Clipped[R1][C6]);
656 | BuildRmCn(R0, C6)rotate([0,0,-90])Keyhole(clipLength = Clipped[R0][C6]);
657 |
658 | //PCB mount
659 | // for(cols = [CStart:CEnd])BuildRmCn(PM,cols)cylinder(d=3, 20, center = true);
660 | //thumb
661 | PlaceOnThumb(0)rotate([0,0,-90])Keyhole(clipLength = cutLen, cutThickness = 1);
662 | PlaceOnThumb(1)rotate([0,0,-90])Keyhole(clipLength = cutLen, cutThickness = 2);
663 | PlaceOnThumb(2)rotate([0,0,-90])Keyhole(clipLength = cutLen, cutThickness = 2);
664 |
665 | //cuttting artifacts
666 | for(cols = [CStart:CEnd]){
667 | BuildTopCuts(PlateDimension[2]+platethickness+8, 0, TOP, col = cols, rowInit = R0, rowEnd = R1);
668 | }
669 | BuildTopCuts(PlateDimension[2]+platethickness+8, 0, TOP, col = T0, rowInit = R0, rowEnd = R2);
670 | }
671 | }
672 | }
673 | }
674 |
675 | module BuildEnclosure(platethickness = 0, trackball = false, edgeonly = false, Jacks = false)
676 | {
677 | plateDim = PlateDimension +[0,0,0];
678 | //Submodules
679 | module modPlate(Hulls = true, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows, cols){//shorthand
680 | BuildRmCn(rows, cols)modulate(PlateDimension,[0,sign(Clipped[rows][cols]), sides],plateDim-[0,abs(Clipped[rows][cols]),-platethickness-thickBuff], [0,-sign(Clipped[rows][cols]),refSides], Hull = Hulls, hullSide = hullSides);
681 | }
682 | module modPlateT(Hulls = false, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows){//shorthand for thumb
683 | PlaceOnThumb(rows)modulate(PlateDimension,[0,sign(Clipped[rows][T0]), sides],plateDim-[0,abs(Clipped[rows][T0]),-platethickness-thickBuff], [0,-sign(Clipped[rows][T0]),refSides], Hull = Hulls, hullSide = hullSides);
684 | }
685 | module modPlateWid(Hulls = true, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows, cols){//shorthand call for Width-wise clipping
686 | BuildRmCn(rows, cols)modulate(PlateDimension,[sign(Clipped[rows][cols]), 0, sides], plateDim-[abs(Clipped[rows][cols]),0,-platethickness-thickBuff], [-sign(Clipped[rows][cols]), 0, refSides], Hull = Hulls, hullSide = hullSides);
687 | }
688 | module modPlateWidT(Hulls = false, thickBuff = 0, sides = TOP, refSides = BOTTOM, hullSides = [0,0,0], rows){//shorthand call for Width-wise clipping
689 | PlaceOnThumb(rows)modulate(PlateDimension,[sign(Clipped[rows][T0]), 0, sides], plateDim-[abs(Clipped[rows][T0]),0,-platethickness-thickBuff], [-sign(Clipped[rows][T0]), 0, refSides], Hull = Hulls, hullSide = hullSides);
690 | }
691 | module modBoarderLen(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, cols, scaling = [1,1,1]){
692 | BuildRmCn(rows, cols)modulate(PlateDimension+[0,-refClip*2,platethickness*2], [refSides,sides, BOTTOM],plateDim+[-dimClip,-Bthickness,height], [-refSides,sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
693 | }
694 | module modBoarderWid(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, cols, scaling = [1,1,1]){
695 | BuildRmCn(rows, cols)modulate(PlateDimension+[-refClip*2,0,platethickness*2], [refSides,sides, BOTTOM],plateDim+[-Bthickness,-dimClip,height], [refSides,-sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
696 | }
697 | module modBoarderLenT(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows,scaling = [1,1,1], Buffer = 0){
698 | PlaceOnThumb(rows)modulate(PlateDimension+[0,-refClip*2,platethickness*2+Buffer*2], [refSides,sides, BOTTOM],plateDim+[-dimClip,-Bthickness,height], [-refSides,sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
699 | }
700 | module modBoarderWidT(Hulls = false, sides = 0, refSides = 0, dimClip = 0, refClip = 0, height = 6, hullSides = [0,0,0], rows, scaling = [1,1,1], Buffer = 0){
701 | PlaceOnThumb(rows)modulate(PlateDimension+[-refClip*2,0,platethickness*2+Buffer*2], [refSides,sides, BOTTOM],plateDim+[-Bthickness,-dimClip,height], [refSides,-sides,TOP], Hull = Hulls, hullSide = hullSides, scalings = scaling);
702 | }
703 | module hullEnclusure(){
704 | hull(){
705 | rotate(tenting)translate([0,0,plateHeight])hull(){
706 | children([0:$children-1]);
707 | }
708 | linear_extrude(1)projection()rotate(tenting)translate([0,0,plateHeight])hull(){
709 | children([0:$children-1]);
710 | }
711 | }
712 | }
713 | module transEnclose(){
714 | rotate(tenting)translate([0,0,plateHeight]){
715 | children([0:$children-1]);
716 | }
717 | }
718 | module projectEnclose(){
719 | linear_extrude(1)projection()rotate(tenting)translate([0,0,plateHeight])hull(){
720 | children([0:$children-1]);
721 | }
722 | }
723 | // End of submodules
724 | difference(){
725 | union(){
726 | //TOP side
727 | hull(){
728 | transEnclose()modBoarderWid(true, BACK, LEFT, 0, cutLenM,BFrontHeight, [0,0,BOTTOM],R1, C1, [RScale,1,1]);
729 | projectEnclose()modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,0,BOTTOM],R1, C1, [EScale,1,1]);
730 | }
731 | hull(){
732 | transEnclose(){
733 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,FRONT,BOTTOM], R1, C1, [RScale,1,1]);
734 | modBoarderLen(true, FRONT, RIGHT, cutLenM, 0, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,RScale,1]);
735 | }
736 | projectEnclose(){
737 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,FRONT,BOTTOM], R1, C1, [EScale,1,1]);
738 | modBoarderLen(true, FRONT, 0, cutLenM, 0, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,EScale,1]);
739 | }
740 | }
741 | hull(){
742 | transEnclose(){
743 | modBoarderLen(true, FRONT,RIGHT, cutLenM, 0, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,RScale,1]);
744 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C3, [1,RScale,1]);
745 | }
746 | projectEnclose(){
747 | modBoarderLen(true, FRONT, 0, cutLenM, 0, BFrontHeight, [LEFT,0,BOTTOM], R1, C1, [1,EScale,1]);
748 | // modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [LEFT,0,BOTTOM], R1, C3, [1,EScale,1]);
749 | }
750 | }
751 | // hull(){
752 | // transEnclose()
753 | // modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C3, [1,RScale,1]);
754 | // projectEnclose()
755 | // modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [0,0,BOTTOM], R1, C3, [1,EScale,1]);
756 | // }
757 | // hull(){
758 | // transEnclose(){
759 | // modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C3, [1,RScale,1]);
760 | // modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,RScale,1]);
761 | // }
762 | // projectEnclose(){
763 | // modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C3, [1,EScale,1]);
764 | // modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,EScale,1]);
765 | // }
766 | // }
767 | hull(){
768 | transEnclose(){
769 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,TOP], R1, C4);
770 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,TOP], R1, C6);
771 | modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,RScale,1]);
772 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,RScale,1]);
773 | }
774 | projectEnclose(){
775 | // modBoarderLen(true, FRONT, 0, 0, cutLenM, BFrontHeight, [RIGHT,0,BOTTOM], R1, C4, [1,EScale,1]);
776 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,EScale,1]);
777 | }
778 | }
779 | hull(){
780 | transEnclose(){
781 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight,[RIGHT,FRONT,TOP], R1, C6);
782 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BFrontHeight,[RIGHT,FRONT,TOP], R1, C6);
783 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,RScale,1]);
784 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [RScale,1,1]);
785 | }
786 | projectEnclose(){
787 | modBoarderLen(true, FRONT, LEFT, cutLenM, 0, BFrontHeight, [RIGHT,0,BOTTOM], R1, C6, [1,EScale,1]);
788 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [EScale,1,1]);
789 | }
790 | }
791 | hull(){
792 | transEnclose(){
793 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,BACK,TOP], R1, C6);
794 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [RIGHT,FRONT,TOP], R1, C6);
795 |
796 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [RScale,1,1]);
797 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [RScale,1,1]);
798 | }
799 | projectEnclose(){
800 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [EScale,1,1]);
801 | modBoarderWid(true, 0,RIGHT, 0, cutLenM,BFrontHeight, [0,FRONT,BOTTOM], R1, C6, [EScale,1,1]);
802 | }
803 | }
804 | hull(){
805 | transEnclose(){
806 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [ RIGHT,BACK,TOP], R1, C6);
807 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,FRONT,TOP], R0, C6);
808 |
809 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [RScale,1,1]);
810 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [RScale,1,1]);
811 | }
812 | projectEnclose(){
813 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C6, [EScale,1,1]);
814 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [EScale,1,1]);
815 | }
816 | }
817 | hull(){
818 | transEnclose(){
819 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,BACK,TOP], R0, C6);
820 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,FRONT,TOP], R0, C6);
821 |
822 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [RScale,1,1]);
823 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [RScale,1,1]);
824 | }
825 | projectEnclose(){
826 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [EScale,1,1]);
827 | modBoarderWid(true, 0,RIGHT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C6, [EScale,1,1]);
828 | }
829 | }
830 |
831 | //Bottom side
832 | if (trackball == false){
833 | // hull(){
834 | // transEnclose(){
835 | // modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C2, [1,RScale,1]);
836 | // modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,RScale,1]);
837 | // }
838 | // projectEnclose(){
839 | // modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [0,0,BOTTOM], R0, C2, [1,EScale,1]);
840 | // modBoarderLen(true,BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,EScale,1]);
841 | // }
842 | // }
843 | // hull(){
844 | // transEnclose(){
845 | // modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,RScale,1]);
846 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5);
847 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C5);
848 | // }
849 | // projectEnclose(){
850 | // modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C4, [1,EScale,1]);
851 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5);
852 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C5);
853 | // }
854 | // }
855 | // hull(){
856 | // transEnclose(){
857 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[RScale,1,1]);
858 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5,[RScale,1,1]);
859 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C5);
860 | // }
861 | // projectEnclose(){
862 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[EScale,1,1]);
863 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,FRONT,BOTTOM], R0, C5,[EScale,1,1]);
864 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R1, C5);
865 | // }
866 | // }
867 |
868 | //thumb track section
869 | // hull(){
870 | // transEnclose(){
871 | // modBoarderLenT(true, FRONT, LEFT, cutLen, 0, BBackHeight, [RIGHT,FRONT,0], R0, Buffer = T0Buffer);
872 | //
873 | // modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,BACK,TOP], R0, C2);
874 | // modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C2, [1,RScale,1]);
875 | // }
876 | // projectEnclose(){
877 | // modBoarderLenT(true, FRONT, LEFT, cutLen, 0, BBackHeight, [RIGHT,FRONT,0], R0, [EScale,1,1]);
878 | // modBoarderLen(true, BACK, 0, 0, cutLenM, BBackHeight, [LEFT,0,BOTTOM], R0, C2, [1,EScale,1]);
879 | // }
880 | // }
881 | // hull(){
882 | // transEnclose(){
883 | // modBoarderLenT(true, BACK, LEFT, cutLen, 0, 2, [RIGHT,0,0], R0, Buffer = T0Buffer);
884 | // modBoarderLenT(true, FRONT, LEFT, cutLen, 0, 0, [RIGHT,0,0], R0, Buffer = T0Buffer);
885 | // }
886 | // projectEnclose(){
887 | // modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight,[RIGHT,0,0], R0, [EScale,EScale,1]);
888 | //// modBoarderLenT(true, FRONT, LEFT, cutLen, 0, BBackHeight, [RIGHT,0,0], R0, [EScale,1,1]);
889 | // }
890 | // }
891 | }
892 | else{
893 | hull(){
894 | projectEnclose(){
895 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [RIGHT,0,BOTTOM], R0, [EScale,EScale,1]);
896 | }
897 | transEnclose(){
898 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[RScale,1,1]);
899 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,RScale,1]);
900 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [RIGHT,BACK,0], R0);
901 | }
902 | projectEnclose(){
903 | modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[EScale,1,1]);
904 | modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,EScale,1]);
905 | }
906 | }
907 | }
908 |
909 | // hull(){
910 | // transEnclose(){
911 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[RScale,1,1]);
912 | // modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,RScale,1]);
913 | // }
914 | // projectEnclose(){
915 | // modBoarderWid(true, 0, LEFT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C5,[EScale,1,1]);
916 | // modBoarderLen(true, BACK,RIGHT, cutLenM, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5, [1,EScale,1]);
917 | // }
918 | // }
919 | hull(){
920 | transEnclose(){
921 | modBoarderLen(true,BACK, RIGHT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C5, [1,1,1]);
922 | modBoarderLen(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,BACK,TOP], R0, C6, [1,1,1]);
923 | modBoarderLen(true,BACK, RIGHT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C5, [1,RScale,1]);
924 | modBoarderLen(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C6, [1,RScale,1]);
925 | }
926 | projectEnclose(){
927 | // modBoarderLen(true,BACK, RIGHT, cutLenM, 0, BBackHeight, [0,0,BOTTOM], R0, C5, [1,EScale,1]);
928 | modBoarderLen(true,BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,BOTTOM], R0, C6, [1,EScale,1]);
929 | }
930 | }
931 | hull(){
932 | transEnclose(){
933 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R0, C6);
934 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,TOP], R0, C6);
935 |
936 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [RScale,RScale,1]);
937 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,BOTTOM],R0, C6, [1,RScale,1]);
938 | }
939 | projectEnclose(){
940 | modBoarderWid(true, 0, RIGHT, 0, cutLenM, BBackHeight, [0,BACK,BOTTOM], R0, C6, [EScale,EScale,1]);
941 | modBoarderLen(true, BACK, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,BOTTOM],R0, C6, [1,EScale,1]);
942 | }
943 | }
944 |
945 | //Thumb Section
946 | hull(){
947 | transEnclose(){
948 | modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [RIGHT,BACK,0], R0);
949 | modBoarderLenT(true, BACK, LEFT,cutLenM, 0, BBackHeight, [LEFT,BACK,0], R1);
950 | }
951 | projectEnclose(){
952 | // modBoarderLenT(true, BACK, LEFT, cutLen, 0, BBackHeight, [RIGHT,0,0], R0, [EScale,EScale,1]);
953 | modBoarderLenT(true, BACK, LEFT,cutLenM, 0, BBackHeight, [LEFT,0,0], R1, [1,RScale,1]);
954 | }
955 | }
956 | hull(){
957 | transEnclose(){
958 | modBoarderLenT(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,BACK,0], R1);
959 | }
960 | projectEnclose(){
961 | modBoarderLenT(true,BACK, LEFT, cutLenM, 0, BBackHeight, [0,0,0], R1, [1,RScale,1]);
962 | }
963 | }
964 | hull(){
965 | transEnclose(){
966 | modBoarderLenT(true, BACK, LEFT,cutLenM, 0, BBackHeight, [RIGHT,BACK,0], R1);
967 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,BACK,0], R1);
968 | }
969 | projectEnclose(){
970 | modBoarderLenT(true, BACK, LEFT,cutLenM, 0, BBackHeight, [RIGHT,0,0], R1, [1,RScale,1]);
971 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,0], R1, [EScale,1,1]);
972 | }
973 | }
974 | hull(){
975 | transEnclose(){
976 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,0,0], R1);
977 | }
978 | projectEnclose(){
979 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,0,0], R1, [EScale,1,1]);
980 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [0,BACK,TOP], R1, [EScale,1,1]);
981 | }
982 | }
983 | hull(){
984 | transEnclose(){
985 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight,[BOTTOM,FRONT,0], R1);
986 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,BACK,0], R2);
987 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight,[BOTTOM,FRONT,0], R2);
988 | }
989 | projectEnclose(){
990 | modBoarderWidT(true,FRONT,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,FRONT,0], R1, [EScale,1,1]);
991 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,BACK,0], R2, [EScale,1,1]);
992 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,FRONT,0], R2, [EScale,1,1]);
993 | }
994 | }
995 | hull(){
996 | transEnclose(){
997 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [RIGHT,FRONT,0], R2);
998 | modBoarderLenT(true,FRONT, LEFT,cutLenM, 0, BBackHeight, [RIGHT,FRONT,0], R2);
999 | }
1000 | projectEnclose(){
1001 | // modBoarderWidT(true,FRONT,RIGHT, cutLenM, 0, BBackHeight,[BOTTOM,FRONT,0], R2, [1,1,1]);
1002 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight,[BOTTOM,FRONT,0], R2, [EScale,1,1]);
1003 | }
1004 | }
1005 | hull(){
1006 | transEnclose(){
1007 | modBoarderLenT(true,FRONT, LEFT, cutLenM, 0, BBackHeight, [RIGHT,0,0], R2);
1008 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,BACK,BOTTOM], R1, C1,[RScale,1,1]);
1009 | // modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight,[0,FRONT,BOTTOM], R0, C1,[RScale,1,1]);
1010 | }
1011 | projectEnclose(){
1012 | modBoarderWidT(true, BACK,RIGHT, 0, cutLenM, BBackHeight, [BOTTOM,FRONT,0], R2, [EScale,1,1]);
1013 | modBoarderWid(true, BACK, LEFT, 0, cutLenM, BFrontHeight, [0,BACK,BOTTOM], R1, C1,[EScale,1,1]);
1014 | // modBoarderWid(true, FRONT, LEFT, cutLenM, 0, BBackHeight, [0,FRONT,BOTTOM], R0, C1,[EScale,1,1]);
1015 | }
1016 | }
1017 | }
1018 | // basecut to remove artifact when height is set low
1019 |
1020 | }
1021 | //trackball
1022 | // hullEnclusure(){
1023 | // modBoarderWid(true, 0, LEFT, 0, BBackHeight, [0,BACK,BOTTOM], R0, C5);
1024 | // modBoarderLen(true, BACK, 0, 0, BBackHeight, [LEFT,0,BOTTOM], R0, C5);
1025 | // modPlateWidT(Hulls = true, hullSides = [BOTTOM,0,BOTTOM], rows = R0);
1026 | // modPlateWidT(Hulls = true, hullSides = [TOP,0,BOTTOM], rows = R1);
1027 | // }
1028 |
1029 | //MCU and Jacks
1030 | }
1031 |
1032 | //Trackball Module
1033 | step = 5;
1034 |
1035 | //--- shorthard transform to blob center
1036 |
1037 | //Path function.
1038 | function oval_path(theta, phi, a, b, c, deform = 0) = [
1039 | a*cos(theta)*cos(phi), //x
1040 | c*sin(theta)*(1+deform*cos(theta)) , //
1041 | b*sin(phi),
1042 | ];
1043 |
1044 | //oval path with linear angle offset
1045 | function oval_path2(theta, phi_init, a, b, c, d = 0, p = 1, deform = 0) = [
1046 | a*cos(theta)*cos(phi_init), //x
1047 | b*sin(theta)*(1+deform*cos(theta))*cos(phi_init + d * sin(theta*p)), //
1048 | c*sin(phi_init + d * sin(theta*p))
1049 | ];
1050 |
1051 | //oval path with angle offset with hypersine
1052 | function oval_path3(theta, phi_init, a, b, c, d = 0, p = 1, deform = 0) = [
1053 | a*cos(theta)*cos(phi_init), //x
1054 | b*sin(theta)*(1+deform*cos(theta))*cos(phi_init + d * pow(sin(theta*p), 1)), //
1055 | c*sin(phi_init + d * pow(sin(theta*p), 3))
1056 | ];
1057 |
1058 | //shape functions
1059 | function ellipse(a, b, d = 0) = [for (t = [0:step:360]) [a*cos(t), b*sin(t)*(1+d*cos(t))]]; //shape to
1060 |
1061 | // sweep generators
1062 |
1063 | module palm_track() {
1064 | a = 20;
1065 | b = 20;
1066 | c = 20;
1067 | //Ellipsoid([20*2,25*2,60],[30*2,25*2,60], center = true);
1068 | function shape() = ellipse(3, 3);
1069 | function shape2() = ellipse(4, 6);
1070 | path_transforms = [for (t=[0:step:180]) translation(oval_path3(t,20,a,c,b,30,1,0))*rotation([90,-20-20*sin(t),t])];
1071 | path_transforms2 = [for (t=[0:step:180]) translation(oval_path3(t,70,b,a,c,6,1,0))*rotation([90,-70+5*sin(t),t])];
1072 | // path_transforms3 = [for (t=[0:step:360]) translation(oval_path3(t,-5,a,c,b,-15,1,0))*rotation([90,20+15*cos(t),t])];
1073 | path_transforms3 = [for (t=[0:step:180]) translation(oval_path3(t,-20,a,c,b,-30,1,0))*rotation([90,20+20*sin(t),t])];
1074 | path_transforms4 = [for (t=[0:step:360]) translation(oval_path3(t,-40,a,c,b,0,1,0))*rotation([90,40+sin(t),t])];
1075 |
1076 | translate([0,0,-1]){
1077 | rotate([-90,0,0])sweep(shape(), path_transforms);
1078 | rotate([90,0,-90])sweep(shape(), path_transforms2); //tip
1079 | rotate([90,0,90])sweep(shape(), path_transforms2); //tip
1080 | rotate([-90,0,0])sweep(shape(), path_transforms3);
1081 | }
1082 | //support ring
1083 | rotate([0,0,0])sweep(shape2(), path_transforms4);
1084 | }
1085 |
1086 |
1087 | module PCB(){
1088 | tol = .05;
1089 | PL = 21/2+tol;
1090 | PW = 18.6/2+tol;
1091 | PT = 3;
1092 | PCBT = 1.6;
1093 |
1094 | //Prism
1095 | translate([0,0,-PT])linear_extrude(PT)rounding(r=8)polygon([[PL,PW],[-PL,PW],[-PL,-PW],[PL,-PW]]);
1096 | translate([PL-6,0,.5])cube([2,4,1],center= true);
1097 |
1098 | //PCB
1099 | translate([0,0,-.8-PT])cube([28,21,PCBT],center= true);
1100 | translate([24/2,0,-PT-PCBT-2])cylinder(d=2.44, 10);
1101 | translate([-24/2,0,-PT-PCBT-2])cylinder(d=2.44, 10);
1102 |
1103 | //Apeture
1104 | translate([0,0,0])cylinder(d1=5, d2= 12, 4);
1105 | }
1106 |
1107 | PCBA = [45,0,0];
1108 | rbearing = .5;
1109 | module TrackBall(){
1110 | difference(){
1111 | union(){
1112 | palm_track();
1113 | rotate(PCBA)translate([0,0,-42/2])cube([30,22,8],center= true); // pcb housing
1114 | }
1115 |
1116 | // sphere(d= 40.5);
1117 | //bearing holes
1118 |
1119 | //lower bearing
1120 | for(i= [0:2])rotate([0,40,120*i-90])translate([40/2,0,0])sphere(r=rbearing); //upper bearing for tighter fit?
1121 | for(i= [0:1])rotate([0,-10,180*i])translate([40/2,0,0])sphere(r=rbearing); //upper bearing for tighter fit?
1122 | rotate(PCBA)translate([0,0,-42/2])PCB();
1123 | }
1124 | }
1125 |
1126 | module mockPCB(thickness,offsets ){
1127 | for(cols = [CStart:C4]){
1128 | color("blue")PlaceColumnOrigin(cols)translate([25,offsets,0])rotate([90,0,0])cube([28,15,thickness],center = true);
1129 | }
1130 | color("blue")PlaceColumnOrigin(C5)translate([18,offsets+1,7.5])rotate([90,0,0])rotate([-10,0,0])cube([35,25,thickness],center = true);
1131 | }
1132 | //################## Section E:: Main Calls ##################
1133 | //rotate([0,0,360*$t]){
1134 | difference(){
1135 | union(){
1136 | rotate(tenting)translate([0,0,plateHeight])BuildTopPlate(keyhole = true, trackball = false, channel = false, platethickness =-1);
1137 | BuildEnclosure(trackball = false, edgeonly = true, platethickness = -1);
1138 | // color("royalblue")rotate([180,0,0])translate([-15,-20,-2])PCB();//PMW3360
1139 |
1140 | // rotate(tenting)translate([0,0,plateHeight])mockPCB(1, 3);
1141 |
1142 | // rotate(tenting)translate([0,0,plateHeight])translate(trackOrigin)rotate(trackTilt)TrackBall();
1143 | }
1144 | // translate([0,0,-10])cube([200,100,20], center = true);
1145 | // rotate(tenting)translate([0,0,plateHeight])translate(trackOrigin)color("royalblue")sphere(d=40.5,$fn= 64);
1146 | }
1147 | //caps
1148 | rotate(tenting)translate([0,0,plateHeight]){
1149 | // BuildSet2();
1150 | // PlaceOnThumb(0)rotate([0,0,-90])Switch(colors = "Steelblue",clipLength = cutLen);
1151 | // PlaceOnThumb(1)rotate([0,0,-90])Switch(colors = "Steelblue",clipLength = cutLen);
1152 | // PlaceOnThumb(2)rotate([0,0,-90])Switch(colors = "Steelblue",clipLength = cutLen);
1153 | }
1154 |
1155 | // rotate(tenting)translate([0,0,plateHeight])translate(trackOrigin)color("royalblue")sphere(d=34,$fn= 64);
1156 | // rotate(tenting)translate([0,0,plateHeight])translate([-2,-22,-6])color("royalblue")cylinder(d1=60, d2= 49, 10, $fn= 64, center = true);
1157 | //}
1158 | //################## Section F:: Key Switches and Caps ##################
1159 | module BuildSet2()
1160 | {
1161 | for(cols = [C1:C6])
1162 | {
1163 | for(rows = [R0:R1])
1164 | {
1165 | // if ( (rows != R0 || cols != C1) ){
1166 | BuildRmCn(rows, cols)
1167 | if(ClippedOrientation[rows][cols] == true){Switch(colors = "Steelblue", clipLength = Clipped[rows][cols]);}
1168 | else {rotate([0,0,-90])Switch(colors = "Steelblue", clipLength = Clipped[rows][cols]);}
1169 | // }
1170 | }
1171 | }
1172 | }
1173 |
1174 | module BuildSetCaps()
1175 | {
1176 | for(cols = [CStart:CEnd])
1177 | {
1178 | for(rows = [R0:RMAX])
1179 | {
1180 | color()BuildRmCn(rows, cols)
1181 | {translate([0,0,8.9])keycap(rows+cols*(RMAX+1), ClippedOrientation[rows][cols], Clipped[rows][cols]);}
1182 | }
1183 | }
1184 | }
1185 |
--------------------------------------------------------------------------------
/Things/Switch.scad:
--------------------------------------------------------------------------------
1 | plate_thickness = 1;
2 | plate_size = 15.6;
3 | edge_offset = 1;
4 | bottom_height = 5;
5 | bottom_size = plate_size - 2;
6 |
7 | top_height = 11.6;
8 |
9 | switch_height = 3.0;
10 | switch_thick = 1;
11 | switch_width = 5;
12 | switch_length = 3;
13 |
14 | cap_height = .38*25.4;
15 | cap_heightShift = 0.69*25.4;
16 | cap_width = 18.3;
17 |
18 | clip_Length = 3; // length clipped
19 |
20 | //dummy key switch with caps to check position
21 | module Switch(switchScale= [1,1,1], colors = "teal", clipLength = 0)
22 | {
23 | difference(){
24 | union(){
25 | translate([0,0,1.75]){
26 | difference(){
27 | translate([0,0,0.5])cube([15,15,1], center = true);
28 | //cuts
29 | // translate([15/2-1/2,0,.5])cube([1,10.5,2], center = true);
30 | // translate([-15/2+1/2,0,.5])cube([1,10.5,2], center = true);
31 | }
32 |
33 | translate([0,0,1.5])cube([13,13,2], center = true);
34 | color("springGreen")translate([0,0,4])cube([11.4,4,3], center = true);
35 | color("springGreen")translate([0,1,4])cube([3,5,3], center = true);
36 | color("DarkSlateGray")translate([0,0,-1])cube([13,14,2,],center = true);
37 | color("DarkSlateGray")translate([0,0,-2-2.5])cylinder(d=3.3, 2.5);
38 | color("DarkSlateGray")translate([5,0,-2-2.5])cylinder(d=1.6, 2.5);
39 | color("DarkSlateGray")translate([-5,0,-2-2.5])cylinder(d=1.6, 2.5);
40 |
41 | //cap
42 | color("ivory")hull(){
43 | translate([0,0,4.5+1])cube([17.5,16.8,2],center = true);
44 | translate([0,1.25,4.5+1+1.5])cube([14.5,12.5,1.5],center = true);
45 | }
46 | }
47 | }
48 | if (clipLength != 0){ // commiting unholy act in name of ergonomics
49 | translate([0, -sign(clipLength)*7.8-clipLength, 0])cube([20, 15.6, 40], center = true);
50 | }
51 | }
52 | }
53 |
54 | module Cutter()
55 | {
56 | bottom_height = 4.5;
57 | bottom_chamfer_width = 3;
58 | bottom_chamfer_height = 1;
59 | bottom_chamfer_thickness = .6;
60 |
61 | bottom_peg_diameter = 4;
62 | bottom_peg_height = 3;
63 | bottom_peg_chamfer = 1;
64 | bottom_peg_side_scale = 1.7/4;
65 |
66 | translate([-bottom_size/2, -bottom_size/2 ,0])cube([bottom_size,bottom_size,bottom_height]);
67 |
68 | translate([0,0, -(bottom_peg_height -bottom_peg_chamfer)]){
69 | cylinder(d=bottom_peg_diameter, h= bottom_peg_height -bottom_peg_chamfer);
70 | translate([5,0,0])scale(v=[bottom_peg_side_scale,bottom_peg_side_scale,1])cylinder(d=bottom_peg_diameter, h= bottom_peg_height -bottom_peg_chamfer);
71 | translate([-5,0,0])scale(v=[bottom_peg_side_scale,bottom_peg_side_scale,1])cylinder(d=bottom_peg_diameter, h= bottom_peg_height -bottom_peg_chamfer);
72 |
73 | translate([0,0, -bottom_peg_chamfer]){
74 | cylinder(d2=bottom_peg_diameter , d1 = bottom_peg_diameter -2*bottom_peg_chamfer, h= bottom_peg_chamfer);
75 | translate([5,0,0])scale(v=[bottom_peg_side_scale,bottom_peg_side_scale,1])cylinder(d2=bottom_peg_diameter , d1 = bottom_peg_diameter -2*bottom_peg_chamfer, h= bottom_peg_chamfer);
76 | translate([-5,0,0])scale(v=[bottom_peg_side_scale,bottom_peg_side_scale,1])cylinder(d2=bottom_peg_diameter , d1 = bottom_peg_diameter -2*bottom_peg_chamfer, h= bottom_peg_chamfer);
77 | }
78 | }
79 | }
80 |
81 | //MX series keyhole
82 | // TODO: add alps support?
83 | module Keyhole(tol = .1, cutThickness = .5, clipLength = 0)
84 | {
85 | $fn = 10;
86 | bottom_length = 13.9+tol;
87 | plate_thickness = 3.51; //mm
88 | holeLength = bottom_length+tol*2;
89 | //latch nibs
90 | nib_radius= 1;
91 | nib_length = 3;
92 |
93 | translate([0,0,-1.25])difference(){
94 | union(){
95 | translate([0,0,1.25])cube([holeLength, holeLength, plate_thickness+tol], center =true);
96 | translate([0,0,.25-cutThickness/2])cube([holeLength+1, holeLength+1, plate_thickness+cutThickness], center =true);
97 | }
98 |
99 | union(){
100 | if (clipLength != 0){
101 | translate([0, -sign(clipLength)*7.8-clipLength, 0])cube([20, 15.6, 40], center = true);
102 | }
103 | }
104 | }
105 | }
106 |
107 | module Stabilizer(offsets = 23.8/2)
108 | {
109 | plate_thickness = 3.6; //mm
110 | stabilizer_width = 5;
111 | stabilizer_length = 12.2;
112 | translate([offsets,0,0])cube([stabilizer_width,stabilizer_length,plate_thickness], center = true);
113 | translate([-offsets,0,0])cube([stabilizer_width,stabilizer_length,plate_thickness], center = true);
114 | }
115 |
116 | module TrackPoint(nibLength = 20)
117 | {
118 | color("red")translate([0,0,-.5])cube([4.5,4.5,5], center= true); //nib
119 | color("gold")cylinder(d = 2, nibLength); //nib
120 | color("gold")translate([0,0,nibLength])sphere(2); //nib
121 | translate([0,30.3/2-8,-3/2])cube([26.46, 30.3, 3], center = true);
122 | }
123 |
124 | module RotaryEncoder(stemLength = 13, Wheel = 0)
125 | {
126 | color("grey")translate([0,0, -6.1/2])cube([11.5, 13.5, 6.1], center = true);
127 | cylinder(d = 7, 7.8);
128 |
129 | translate([0,0,7.8])difference(){
130 | cylinder(d = 5.8, stemLength);
131 | translate([-5.8/2,5.8/2-1.5,3])cube([11.5, 13.5, stemLength]);
132 | }
133 | color("grey")translate([0,0,7.8])cylinder(d = Wheel, stemLength);
134 | }
135 |
136 | //################ Test Calls ###################
137 | Switch(clipLength = -4);
138 | #Keyhole(.1, clipLength = -4);
139 | //Stabilizer(20);
140 | // RotaryEncoder(Wheel = 0);
141 | //Switch([1,1.5,1]);
142 | //TrackPoint();
143 |
--------------------------------------------------------------------------------