create open source hardware logo in openscad
[challenge-bot] / 3d-printables / open-source-hardware-logo-data.scad
1 /*
2 challenge-bot
3 project available here:
4 https://challenge-bot.com/
5
6 Copyright (C) 2016 Daniel Watson
7 See the end of the file for license conditions.
8 tl;dr GNU AGPLv3 (or later at your option)
9 */
10
11 /*
12 open source hardware logo data
13 this file contains all the data, and nothing else
14 see open-source-hardware-logo.scad for example use
15 */
16
17 // keep around 20 for editing, 100 for final output
18 $fn = 100;
19
20 open_source_hardware_logo_radius = 10;
21 open_source_hardware_logo_depth = 5;
22
23 module octogon_slice_upper_half(radius) {
24 polygon([[0, 0],
25 [radius, tan(360 / (8 * 2)) * radius],
26 [radius, 0]]); }
27
28 module open_source_hardware_spoke_upper_half(radius) {
29 difference(){
30 octogon_slice_upper_half(radius);
31 circle(radius / 4);
32 translate([radius * 3 / 4,
33 (5 / 12) * tan(360 / (8 * 2)) * radius]) {
34 rotate(-360 / 32) {
35 square(radius); }
36 rotate(360 / 16) {
37 square(radius); } } } }
38
39 module open_source_hardware_spoke(radius) {
40 open_source_hardware_spoke_upper_half(radius);
41 mirror([0, 1, 0]) {
42 open_source_hardware_spoke_upper_half(radius); } }
43
44 module open_source_hardware_logo_2d(radius) {
45 for(spoke_number = [-1 : 5]){
46 rotate(spoke_number * (360 / 8)) {
47 open_source_hardware_spoke(radius); } } }
48
49 module open_source_hardware_logo(radius, depth) {
50 linear_extrude(height = depth) {
51 open_source_hardware_logo_2d(radius); } }
52
53 /*
54 This file is part of challenge-bot.
55
56 Challenge-bot is free software: you can redistribute it and/or modify
57 it under the terms of the GNU Affero General Public License as published by
58 the Free Software Foundation, either version 3 of the License, or
59 (at your option) any later version.
60
61 GNU Affero Emacs is distributed in the hope that it will be useful,
62 but WITHOUT ANY WARRANTY; without even the implied warranty of
63 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
64 GNU Affero General Public License for more details.
65
66 You should have received a copy of the GNU Affero General Public License
67 along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
68 */