Initial import

This commit is contained in:
Ian Gulliver
2026-07-12 11:43:07 -07:00
commit 5ce02d1de2
64 changed files with 465901 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
*.stl filter=lfs diff=lfs merge=lfs -text
*.STL filter=lfs diff=lfs merge=lfs -text
*.3mf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
+359
View File
@@ -0,0 +1,359 @@
// Derived from http://www.sergepayen.fr/en/parametric-u-hook by Serge Payen, January 2016
// Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
// http://creativecommons.org/licenses/by-nc-sa/4.0/
/* [General] */
// (millimeters, object width/print height)
thickness = 20; // [0.1:250]
// (millimeters, thinnest point2)
stiffness = 7; // [0.1:250]
/* [Main Hook] */
// (millimeters, internal diameter of U shape)
hook_size = 40; // [0.1:250]
// (hole in center of hook for material reduction)
hook_hole = 0; // [0:No, 1:Yes]
hook_tip = 1; // [0:Flat, 1:Triangle]
/* [Second hook] */
second_hook = 0; // [0:No, 1:Yes]
// (millimeters)
second_hook_length = 30; // [0.1:200]
// (degrees from vertical, best between 45° and 65°)
second_hook_angle = 55; // [0:90]
second_hook_tip = 1; // [0:Flat, 1:Triangle]
/* [Spacers] */
// (millimeters, between main hook and bottom screw)
spacer_1 = 40; // [0:200]
// (millimeters, between bottom screw and secondary hook)
spacer_2 = 10; // [0:200]
// (millimeters, between second hook and top screw)
spacer_3 = 10; // [0:200]
// (millimeters, between top screw and hook top)
spacer_4 = 10; // [0:200]
/* [Screw holes] */
screw_holes = 0; // [0:No, 1:Yes]
// (millimeters)
screw_diameter = 3; // [0:0.5:20]
// (millimeters)
countersink_diameter = 8; // [0:0.5:40]
// (millimeters)
countersink_depth = 3; // [0:0.5:20]
// (millimeters)
screw_tolerance = 0.5; // [0:0.1:10]
/* [Bracket] */
bracket_type = 1; // [0:None, 1:Square, 2:Round]
// (millimeters)
bracket_size = 27; // [0:250]
// (millimeters, back length, for Bracket Type: Square)
bracket_stop_length = 25; // [0:250]
// (millimeters, for Bracket Type: Square)
bracket_stiffness = 8; // [0:100]
// (for Bracket Type: Square)
bracket_safety_screw = 0; // [0:No, 1:Yes]
// (for Bracket Type: Square)
bracket_rounded_corners = 1; // [0:No, 1:Yes]
/* [Hidden] */
bottom_width = hook_size + (stiffness * 2);
bottom_height = bottom_width - (hook_size / 2);
screw_house = countersink_diameter + (screw_tolerance * 2);
$fn = 150;
epsilon = 0.1;
bottom(bottom_width, bottom_height, thickness, stiffness, hook_hole)
belly(bottom_width, hook_size / 2, thickness) {
translate([bottom_width - stiffness, 0, 0]) {
tip(stiffness, 0, thickness, hook_tip);
}
spacer(stiffness, spacer_1, thickness)
screw(stiffness, screw_house, thickness)
spacer(stiffness, spacer_2, thickness)
arm(stiffness, second_hook_length, thickness, second_hook_angle, second_hook_tip)
spacer(stiffness, spacer_3, thickness)
screw(stiffness, screw_house, thickness)
spacer(stiffness, spacer_4, thickness)
if (bracket_type == 1) {
head(stiffness, stiffness, thickness, bracket_rounded_corners)
translate([-bracket_stiffness, 0, 0]) {
top(bracket_stiffness, bracket_size, thickness)
head(bracket_stiffness, bracket_stiffness, thickness, bracket_rounded_corners)
translate([-bracket_stiffness, 0, 0]) {
stop(bracket_stiffness, bracket_stop_length, thickness);
}
}
} else if (bracket_type == 2) {
pipeHook(stiffness, bracket_size, thickness);
}
}
module bottom(width, height, depth, stiffness, hole) {
color("Cyan")
difference() {
intersection() {
cube([width, height, depth]);
translate([(width / 2) - stiffness, height, 0]) {
cylinder(r=height, h=depth);
}
}
if (hole) {
translate([width / 2, height / 2, -epsilon]) {
hull() {
big_r = height / 5;
small_r = height / 10;
translate([-big_r / 2 - stiffness / 4, 0, 0]) {
cylinder(r=big_r, h=depth + (epsilon * 2));
}
translate([big_r, stiffness / 2, 0]) {
cylinder(r=small_r, h=depth + (epsilon * 2));
}
}
}
}
}
translate([0, height, 0]) children();
}
module belly(width, height, depth) {
color("Crimson")
difference() {
// base cube
cube([width, height, depth]);
// half-cylindric hole
translate([width / 2, height, -epsilon]) {
cylinder(r=height, h=depth + (epsilon * 2));
}
}
translate([0, height, 0]) children();
}
module tip(width, height, depth, type) {
color("SpringGreen")
translate([0, 0, depth / 2]) {
rotate([0, 90, 0]) {
difference() {
hull() {
translate([depth/2 - depth/10, 0, 0]) {
cylinder(d=depth/5, h=width);
}
translate([-depth/2 + depth/10, 0, 0]) {
cylinder(d=depth/5, h=width);
}
if (type == 1) {
translate([depth/7, depth/5, 0]) {
cylinder(d=depth/5, h=width);
}
translate([-depth/7, depth/5, 0]) {
cylinder(d=depth/5, h=width);
}
}
}
translate([-depth / 2, -depth / 5, -epsilon]) {
cube([depth, depth / 5, width + epsilon * 2]);
}
}
}
}
}
module spacer(width, height, depth) {
color("DeepSkyBlue")
cube([width, height, depth]);
translate([0, height, 0]) children();
}
module screw(width, height, depth) {
if (screw_holes) {
color("Silver")
difference() {
cube([width, height, depth]);
translate([0, height / 2, depth / 2]) {
rotate([0, 90, 0]) {
screwHole(width);
}
}
}
translate([0, height, 0]) children();
} else {
children();
}
}
module screwHole(depth) {
screw_hole = screw_diameter + (screw_tolerance * 2);
translate([0, 0, -epsilon]) {
cylinder(d=screw_hole, h=depth + (epsilon * 2));
translate([0, 0, depth - countersink_depth + (epsilon * 2)]) {
cylinder(d=screw_house, h=countersink_depth + epsilon);
}
}
}
module arm(width, height, depth, angle, tip) {
if (second_hook) {
color("Orange")
union() {
cube([width, height, depth]);
hull() {
cube([width, width, depth]);
translate([0, width, 0]) {
rotate([0, 0, -angle]) {
cube([width, height, depth]);
}
}
}
}
translate([0, width, 0]) {
rotate([0, 0, -angle]) {
translate([0, height, 0]) {
tip(width, 0, depth, tip);
}
}
}
translate([0, height, 0]) children();
} else {
children();
}
}
module head(width, height, depth, rounded) {
color("Gold")
intersection() {
cube([width, height, depth]);
if (rounded) {
translate([0, 0, -epsilon]) {
cylinder(r=width, h=depth + (epsilon * 2));
}
}
}
translate([0, height, 0]) rotate([0, 0, 90]) children();
}
module top(width, height, depth) {
color("Crimson")
difference() {
cube([width, height, depth]);
if (bracket_safety_screw) {
translate([0, height / 2, depth / 2]) {
rotate([0, 90, 0]) {
screwHole(width);
}
}
}
}
translate([0, height, 0]) children();
}
module stop(width, height, depth) {
color("DeepSkyBlue")
union() {
cube([width, height, depth]);
translate([0, height, 0]) {
intersection() {
cube([width, width, depth]);
cylinder(r=bracket_stiffness, h=thickness+0.2);
}
}
}
}
module pipeHook(width, height, depth) {
outside_diam = height + (width * 2);
color("Crimson")
union() {
translate([-height / 2, 0, 0]) {
difference() {
cylinder(d=outside_diam, h=depth);
translate([0, 0, -epsilon]) {
cylinder(d=height, h=depth + (epsilon * 2));
}
translate([-outside_diam / 2, -outside_diam / 2, -epsilon]) {
cube([outside_diam, outside_diam / 2, depth + (epsilon * 2)]);
}
}
}
translate([-(height + (width / 2)), 0, 0]) {
difference() {
cylinder(d=width, h=depth);
translate([-width / 2, 0, -epsilon]) {
cube([width, width, depth + (epsilon * 2)]);
}
}
}
}
}
/*
// TODO: Enable when OpenSCAD turns on assert support in builds
assert(hook_hole == 0 || hook_hole == 1);
assert(hook_tip == 0 || hook_tip == 1);
assert(second_hook == 0 || second_hook == 1);
assert(second_hook_tip == 0 || second_hook_tip == 1);
assert(screw_holes == 0 || screw_holes == 1);
assert(bracket_type == 0 || bracket_type == 1 || bracket_type == 2);
assert(bracket_safety_screw == 0 || bracket_safety_screw == 1);
assert(bracket_rounded_corners == 0 || bracket_rounded_corners == 1);
if ((bracket_type == 1 && safety_screw) || screw_holes) {
if (countersink_depth > 0) {
assert(countersink_diameter >= screw_diameter);
}
}
if (screw_holes) {
assert(screw_house < thickness);
assert(countersink_depth < stiffness);
}
if (bracket_type == 1 && safety_screw) {
assert(screw_house < bracket_thickness);
assert(countersink_depth < bracket_stiffness);
}
*/
Binary file not shown.
+359
View File
@@ -0,0 +1,359 @@
// Derived from http://www.sergepayen.fr/en/parametric-u-hook by Serge Payen, January 2016
// Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
// http://creativecommons.org/licenses/by-nc-sa/4.0/
/* [General] */
// (millimeters, object width/print height)
thickness = 25; // [0.1:250]
// (millimeters, thinnest point2)
stiffness = 8; // [0.1:250]
/* [Main Hook] */
// (millimeters, internal diameter of U shape)
hook_size = 35; // [0.1:250]
// (hole in center of hook for material reduction)
hook_hole = 1; // [0:No, 1:Yes]
hook_tip = 1; // [0:Flat, 1:Triangle]
/* [Second hook] */
second_hook = 1; // [0:No, 1:Yes]
// (millimeters)
second_hook_length = 30; // [0.1:200]
// (degrees from vertical, best between 45° and 65°)
second_hook_angle = 55; // [0:90]
second_hook_tip = 1; // [0:Flat, 1:Triangle]
/* [Spacers] */
// (millimeters, between main hook and bottom screw)
spacer_1 = 20; // [0:200]
// (millimeters, between bottom screw and secondary hook)
spacer_2 = 10; // [0:200]
// (millimeters, between second hook and top screw)
spacer_3 = 10; // [0:200]
// (millimeters, between top screw and hook top)
spacer_4 = 10; // [0:200]
/* [Screw holes] */
screw_holes = 0; // [0:No, 1:Yes]
// (millimeters)
screw_diameter = 3; // [0:0.5:20]
// (millimeters)
countersink_diameter = 8; // [0:0.5:40]
// (millimeters)
countersink_depth = 3; // [0:0.5:20]
// (millimeters)
screw_tolerance = 0.5; // [0:0.1:10]
/* [Bracket] */
bracket_type = 1; // [0:None, 1:Square, 2:Round]
// (millimeters)
bracket_size = 40; // [0:250]
// (millimeters, back length, for Bracket Type: Square)
bracket_stop_length = 15; // [0:250]
// (millimeters, for Bracket Type: Square)
bracket_stiffness = 8; // [0:100]
// (for Bracket Type: Square)
bracket_safety_screw = 0; // [0:No, 1:Yes]
// (for Bracket Type: Square)
bracket_rounded_corners = 1; // [0:No, 1:Yes]
/* [Hidden] */
bottom_width = hook_size + (stiffness * 2);
bottom_height = bottom_width - (hook_size / 2);
screw_house = countersink_diameter + (screw_tolerance * 2);
$fn = 150;
epsilon = 0.1;
bottom(bottom_width, bottom_height, thickness, stiffness, hook_hole)
belly(bottom_width, hook_size / 2, thickness) {
translate([bottom_width - stiffness, 0, 0]) {
tip(stiffness, 0, thickness, hook_tip);
}
spacer(stiffness, spacer_1, thickness)
screw(stiffness, screw_house, thickness)
spacer(stiffness, spacer_2, thickness)
arm(stiffness, second_hook_length, thickness, second_hook_angle, second_hook_tip)
spacer(stiffness, spacer_3, thickness)
screw(stiffness, screw_house, thickness)
spacer(stiffness, spacer_4, thickness)
if (bracket_type == 1) {
head(stiffness, stiffness, thickness, bracket_rounded_corners)
translate([-bracket_stiffness, 0, 0]) {
top(bracket_stiffness, bracket_size, thickness)
head(bracket_stiffness, bracket_stiffness, thickness, bracket_rounded_corners)
translate([-bracket_stiffness, 0, 0]) {
stop(bracket_stiffness, bracket_stop_length, thickness);
}
}
} else if (bracket_type == 2) {
pipeHook(stiffness, bracket_size, thickness);
}
}
module bottom(width, height, depth, stiffness, hole) {
color("Cyan")
difference() {
intersection() {
cube([width, height, depth]);
translate([(width / 2) - stiffness, height, 0]) {
cylinder(r=height, h=depth);
}
}
if (hole) {
translate([width / 2, height / 2, -epsilon]) {
hull() {
big_r = height / 5;
small_r = height / 10;
translate([-big_r / 2 - stiffness / 4, 0, 0]) {
cylinder(r=big_r, h=depth + (epsilon * 2));
}
translate([big_r, stiffness / 2, 0]) {
cylinder(r=small_r, h=depth + (epsilon * 2));
}
}
}
}
}
translate([0, height, 0]) children();
}
module belly(width, height, depth) {
color("Crimson")
difference() {
// base cube
cube([width, height, depth]);
// half-cylindric hole
translate([width / 2, height, -epsilon]) {
cylinder(r=height, h=depth + (epsilon * 2));
}
}
translate([0, height, 0]) children();
}
module tip(width, height, depth, type) {
color("SpringGreen")
translate([0, 0, depth / 2]) {
rotate([0, 90, 0]) {
difference() {
hull() {
translate([depth/2 - depth/10, 0, 0]) {
cylinder(d=depth/5, h=width);
}
translate([-depth/2 + depth/10, 0, 0]) {
cylinder(d=depth/5, h=width);
}
if (type == 1) {
translate([depth/7, depth/5, 0]) {
cylinder(d=depth/5, h=width);
}
translate([-depth/7, depth/5, 0]) {
cylinder(d=depth/5, h=width);
}
}
}
translate([-depth / 2, -depth / 5, -epsilon]) {
cube([depth, depth / 5, width + epsilon * 2]);
}
}
}
}
}
module spacer(width, height, depth) {
color("DeepSkyBlue")
cube([width, height, depth]);
translate([0, height, 0]) children();
}
module screw(width, height, depth) {
if (screw_holes) {
color("Silver")
difference() {
cube([width, height, depth]);
translate([0, height / 2, depth / 2]) {
rotate([0, 90, 0]) {
screwHole(width);
}
}
}
translate([0, height, 0]) children();
} else {
children();
}
}
module screwHole(depth) {
screw_hole = screw_diameter + (screw_tolerance * 2);
translate([0, 0, -epsilon]) {
cylinder(d=screw_hole, h=depth + (epsilon * 2));
translate([0, 0, depth - countersink_depth + (epsilon * 2)]) {
cylinder(d=screw_house, h=countersink_depth + epsilon);
}
}
}
module arm(width, height, depth, angle, tip) {
if (second_hook) {
color("Orange")
union() {
cube([width, height, depth]);
hull() {
cube([width, width, depth]);
translate([0, width, 0]) {
rotate([0, 0, -angle]) {
cube([width, height, depth]);
}
}
}
}
translate([0, width, 0]) {
rotate([0, 0, -angle]) {
translate([0, height, 0]) {
tip(width, 0, depth, tip);
}
}
}
translate([0, height, 0]) children();
} else {
children();
}
}
module head(width, height, depth, rounded) {
color("Gold")
intersection() {
cube([width, height, depth]);
if (rounded) {
translate([0, 0, -epsilon]) {
cylinder(r=width, h=depth + (epsilon * 2));
}
}
}
translate([0, height, 0]) rotate([0, 0, 90]) children();
}
module top(width, height, depth) {
color("Crimson")
difference() {
cube([width, height, depth]);
if (bracket_safety_screw) {
translate([0, height / 2, depth / 2]) {
rotate([0, 90, 0]) {
screwHole(width);
}
}
}
}
translate([0, height, 0]) children();
}
module stop(width, height, depth) {
color("DeepSkyBlue")
union() {
cube([width, height, depth]);
translate([0, height, 0]) {
intersection() {
cube([width, width, depth]);
cylinder(r=bracket_stiffness, h=thickness+0.2);
}
}
}
}
module pipeHook(width, height, depth) {
outside_diam = height + (width * 2);
color("Crimson")
union() {
translate([-height / 2, 0, 0]) {
difference() {
cylinder(d=outside_diam, h=depth);
translate([0, 0, -epsilon]) {
cylinder(d=height, h=depth + (epsilon * 2));
}
translate([-outside_diam / 2, -outside_diam / 2, -epsilon]) {
cube([outside_diam, outside_diam / 2, depth + (epsilon * 2)]);
}
}
}
translate([-(height + (width / 2)), 0, 0]) {
difference() {
cylinder(d=width, h=depth);
translate([-width / 2, 0, -epsilon]) {
cube([width, width, depth + (epsilon * 2)]);
}
}
}
}
}
/*
// TODO: Enable when OpenSCAD turns on assert support in builds
assert(hook_hole == 0 || hook_hole == 1);
assert(hook_tip == 0 || hook_tip == 1);
assert(second_hook == 0 || second_hook == 1);
assert(second_hook_tip == 0 || second_hook_tip == 1);
assert(screw_holes == 0 || screw_holes == 1);
assert(bracket_type == 0 || bracket_type == 1 || bracket_type == 2);
assert(bracket_safety_screw == 0 || bracket_safety_screw == 1);
assert(bracket_rounded_corners == 0 || bracket_rounded_corners == 1);
if ((bracket_type == 1 && safety_screw) || screw_holes) {
if (countersink_depth > 0) {
assert(countersink_diameter >= screw_diameter);
}
}
if (screw_holes) {
assert(screw_house < thickness);
assert(countersink_depth < stiffness);
}
if (bracket_type == 1 && safety_screw) {
assert(screw_house < bracket_thickness);
assert(countersink_depth < bracket_stiffness);
}
*/
+359
View File
@@ -0,0 +1,359 @@
// Derived from http://www.sergepayen.fr/en/parametric-u-hook by Serge Payen, January 2016
// Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
// http://creativecommons.org/licenses/by-nc-sa/4.0/
/* [General] */
// (millimeters, object width/print height)
thickness = 25; // [0.1:250]
// (millimeters, thinnest point)
stiffness = 8; // [0.1:250]
/* [Main Hook] */
// (millimeters, internal diameter of U shape)
hook_size = 35; // [0.1:250]
// (hole in center of hook for material reduction)
hook_hole = 1; // [0:No, 1:Yes]
hook_tip = 1; // [0:Flat, 1:Triangle]
/* [Second hook] */
second_hook = 1; // [0:No, 1:Yes]
// (millimeters)
second_hook_length = 30; // [0.1:200]
// (degrees from vertical, best between 45° and 65°)
second_hook_angle = 55; // [0:90]
second_hook_tip = 1; // [0:Flat, 1:Triangle]
/* [Spacers] */
// (millimeters, between main hook and bottom screw)
spacer_1 = 20; // [0:200]
// (millimeters, between bottom screw and secondary hook)
spacer_2 = 10; // [0:200]
// (millimeters, between second hook and top screw)
spacer_3 = 10; // [0:200]
// (millimeters, between top screw and hook top)
spacer_4 = 10; // [0:200]
/* [Screw holes] */
screw_holes = 0; // [0:No, 1:Yes]
// (millimeters)
screw_diameter = 3; // [0:0.5:20]
// (millimeters)
countersink_diameter = 8; // [0:0.5:40]
// (millimeters)
countersink_depth = 3; // [0:0.5:20]
// (millimeters)
screw_tolerance = 0.5; // [0:0.1:10]
/* [Bracket] */
bracket_type = 1; // [0:None, 1:Square, 2:Round]
// (millimeters)
bracket_size = 40; // [0:250]
// (millimeters, back length, for Bracket Type: Square)
bracket_stop_length = 15; // [0:250]
// (millimeters, for Bracket Type: Square)
bracket_stiffness = 8; // [0:100]
// (for Bracket Type: Square)
bracket_safety_screw = 0; // [0:No, 1:Yes]
// (for Bracket Type: Square)
bracket_rounded_corners = 1; // [0:No, 1:Yes]
/* [Hidden] */
bottom_width = hook_size + (stiffness * 2);
bottom_height = bottom_width - (hook_size / 2);
screw_house = countersink_diameter + (screw_tolerance * 2);
$fn = 150;
epsilon = 0.1;
bottom(bottom_width, bottom_height, thickness, stiffness, hook_hole)
belly(bottom_width, hook_size / 2, thickness) {
translate([bottom_width - stiffness, 0, 0]) {
tip(stiffness, 0, thickness, hook_tip);
}
spacer(stiffness, spacer_1, thickness)
screw(stiffness, screw_house, thickness)
spacer(stiffness, spacer_2, thickness)
arm(stiffness, second_hook_length, thickness, second_hook_angle, second_hook_tip)
spacer(stiffness, spacer_3, thickness)
screw(stiffness, screw_house, thickness)
spacer(stiffness, spacer_4, thickness)
if (bracket_type == 1) {
head(stiffness, stiffness, thickness, bracket_rounded_corners)
translate([-bracket_stiffness, 0, 0]) {
top(bracket_stiffness, bracket_size, thickness)
head(bracket_stiffness, bracket_stiffness, thickness, bracket_rounded_corners)
translate([-bracket_stiffness, 0, 0]) {
stop(bracket_stiffness, bracket_stop_length, thickness);
}
}
} else if (bracket_type == 2) {
pipeHook(stiffness, bracket_size, thickness);
}
}
module bottom(width, height, depth, stiffness, hole) {
color("Cyan")
difference() {
intersection() {
cube([width, height, depth]);
translate([(width / 2) - stiffness, height, 0]) {
cylinder(r=height, h=depth);
}
}
if (hole) {
translate([width / 2, height / 2, -epsilon]) {
hull() {
big_r = height / 5;
small_r = height / 10;
translate([-big_r / 2 - stiffness / 4, 0, 0]) {
cylinder(r=big_r, h=depth + (epsilon * 2));
}
translate([big_r, stiffness / 2, 0]) {
cylinder(r=small_r, h=depth + (epsilon * 2));
}
}
}
}
}
translate([0, height, 0]) children();
}
module belly(width, height, depth) {
color("Crimson")
difference() {
// base cube
cube([width, height, depth]);
// half-cylindric hole
translate([width / 2, height, -epsilon]) {
cylinder(r=height, h=depth + (epsilon * 2));
}
}
translate([0, height, 0]) children();
}
module tip(width, height, depth, type) {
color("SpringGreen")
translate([0, 0, depth / 2]) {
rotate([0, 90, 0]) {
difference() {
hull() {
translate([depth/2 - depth/10, 0, 0]) {
cylinder(d=depth/5, h=width);
}
translate([-depth/2 + depth/10, 0, 0]) {
cylinder(d=depth/5, h=width);
}
if (type == 1) {
translate([depth/7, depth/5, 0]) {
cylinder(d=depth/5, h=width);
}
translate([-depth/7, depth/5, 0]) {
cylinder(d=depth/5, h=width);
}
}
}
translate([-depth / 2, -depth / 5, -epsilon]) {
cube([depth, depth / 5, width + epsilon * 2]);
}
}
}
}
}
module spacer(width, height, depth) {
color("DeepSkyBlue")
cube([width, height, depth]);
translate([0, height, 0]) children();
}
module screw(width, height, depth) {
if (screw_holes) {
color("Silver")
difference() {
cube([width, height, depth]);
translate([0, height / 2, depth / 2]) {
rotate([0, 90, 0]) {
screwHole(width);
}
}
}
translate([0, height, 0]) children();
} else {
children();
}
}
module screwHole(depth) {
screw_hole = screw_diameter + (screw_tolerance * 2);
translate([0, 0, -epsilon]) {
cylinder(d=screw_hole, h=depth + (epsilon * 2));
translate([0, 0, depth - countersink_depth + (epsilon * 2)]) {
cylinder(d=screw_house, h=countersink_depth + epsilon);
}
}
}
module arm(width, height, depth, angle, tip) {
if (second_hook) {
color("Orange")
union() {
cube([width, height, depth]);
hull() {
cube([width, width, depth]);
translate([0, width, 0]) {
rotate([0, 0, -angle]) {
cube([width, height, depth]);
}
}
}
}
translate([0, width, 0]) {
rotate([0, 0, -angle]) {
translate([0, height, 0]) {
tip(width, 0, depth, tip);
}
}
}
translate([0, height, 0]) children();
} else {
children();
}
}
module head(width, height, depth, rounded) {
color("Gold")
intersection() {
cube([width, height, depth]);
if (rounded) {
translate([0, 0, -epsilon]) {
cylinder(r=width, h=depth + (epsilon * 2));
}
}
}
translate([0, height, 0]) rotate([0, 0, 90]) children();
}
module top(width, height, depth) {
color("Crimson")
difference() {
cube([width, height, depth]);
if (bracket_safety_screw) {
translate([0, height / 2, depth / 2]) {
rotate([0, 90, 0]) {
screwHole(width);
}
}
}
}
translate([0, height, 0]) children();
}
module stop(width, height, depth) {
color("DeepSkyBlue")
union() {
cube([width, height, depth]);
translate([0, height, 0]) {
intersection() {
cube([width, width, depth]);
cylinder(r=bracket_stiffness, h=thickness+0.2);
}
}
}
}
module pipeHook(width, height, depth) {
outside_diam = height + (width * 2);
color("Crimson")
union() {
translate([-height / 2, 0, 0]) {
difference() {
cylinder(d=outside_diam, h=depth);
translate([0, 0, -epsilon]) {
cylinder(d=height, h=depth + (epsilon * 2));
}
translate([-outside_diam / 2, -outside_diam / 2, -epsilon]) {
cube([outside_diam, outside_diam / 2, depth + (epsilon * 2)]);
}
}
}
translate([-(height + (width / 2)), 0, 0]) {
difference() {
cylinder(d=width, h=depth);
translate([-width / 2, 0, -epsilon]) {
cube([width, width, depth + (epsilon * 2)]);
}
}
}
}
}
/*
// TODO: Enable when OpenSCAD turns on assert support in builds
assert(hook_hole == 0 || hook_hole == 1);
assert(hook_tip == 0 || hook_tip == 1);
assert(second_hook == 0 || second_hook == 1);
assert(second_hook_tip == 0 || second_hook_tip == 1);
assert(screw_holes == 0 || screw_holes == 1);
assert(bracket_type == 0 || bracket_type == 1 || bracket_type == 2);
assert(bracket_safety_screw == 0 || bracket_safety_screw == 1);
assert(bracket_rounded_corners == 0 || bracket_rounded_corners == 1);
if ((bracket_type == 1 && safety_screw) || screw_holes) {
if (countersink_depth > 0) {
assert(countersink_diameter >= screw_diameter);
}
}
if (screw_holes) {
assert(screw_house < thickness);
assert(countersink_depth < stiffness);
}
if (bracket_type == 1 && safety_screw) {
assert(screw_house < bracket_thickness);
assert(countersink_depth < bracket_stiffness);
}
*/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+103
View File
@@ -0,0 +1,103 @@
difference() {
body_with_rounded_hole();
trnalsate([
resize([0, 0, 1.01])
trace();
}
color("red")
trace();
module trace() {
difference() {
hull() {
translate([19, 19, 0])
cylinder(h=1, d=3, $fn=100);
translate([19, 5, 0])
cylinder(h=1, d=3, $fn=100);
translate([65, 19, 0])
cylinder(h=1, d=3, $fn=100);
translate([65, 5, 0])
cylinder(h=1, d=3, $fn=100);
}
translate([0, 0, -1])
resize([0, 0, 3])
hull() {
translate([19, 19, 0])
cylinder(h=1.02, d=2, $fn=100);
translate([19, 5, 0])
cylinder(h=1.02, d=2, $fn=100);
translate([65, 19, 0])
cylinder(h=1.02, d=2, $fn=100);
translate([65, 5, 0])
cylinder(h=1.02, d=2, $fn=100);
}
}
}
module body_with_rounded_hole() {
body_with_hole();
hole_rounding();
}
module body_with_hole() {
difference() {
body();
translate([10, 12, -0.01])
cylinder(h=7.02, d=12);
}
}
module hole_rounding() {
difference() {
translate([10, 12, 2])
cylinder(d=12, h=3);
translate([10, 12, 0])
cylinder(d=8, h=7, $fn=100);
}
translate([10, 12, 5])
torus(r1=6, r2=2, $fn=100);
translate([10, 12, 2])
torus(r1=6, r2=2, $fn=100);
}
module body() {
hull() {
end();
translate([52, 0, 0])
end();
}
}
module end() {
translate([12, 12, 0])
cylinder(h=7, d=20, $fn=100);
translate([12, 12, 2])
cylinder(h=3, d=24, $fn=100);
translate([12, 12, 2])
torus(r1=10, r2=2, $fn=100);
translate([12, 12, 5])
torus(r1=10, r2=2, $fn=100);
}
module torus(r1, r2) {
rotate_extrude()
translate([r1,0,0])
circle(r2);
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,38 @@
$fn = 100;
difference() {
union() {
translate(v=[0, 0, 2.5]) {
cylinder(h=5, d=61, center=true);
}
translate(v=[30.5, 0, 2.5]) {
cylinder(h=5, d=12, center=true);
}
translate(v=[-30.5, 0, 2.5]) {
cylinder(h=5, d=12, center=true);
}
translate(v=[0, 0, 40]) {
cylinder(h=80, d=53, center=true);
}
}
union() {
translate(v=[0, 0, 45]) {
cylinder(h=100, d=47, center=true);
}
translate(v=[31, 0, 2.5]) {
cylinder(h=6, d=4, center=true);
}
translate(v=[-31, 0, 2.5]) {
cylinder(h=6, d=4, center=true);
}
translate(v=[31, 0, 4.01]) {
cylinder(h=2, d1=4, d2=7, center=true);
}
translate(v=[-31, 0, 4.01]) {
cylinder(h=2, d1=4, d2=7, center=true);
}
translate(v=[0, -90, 86]) {
sphere(r=100);
}
}
}
@@ -0,0 +1,45 @@
$fn = 100;
base_height = 4;
total_height = 80;
epsilon = 0.01;
difference() {
union() {
translate(v=[0, 0, base_height / 2]) {
cylinder(h=base_height, d=61, center=true);
}
translate(v=[30.5, 0, base_height / 2]) {
cylinder(h=base_height, d=12, center=true);
}
translate(v=[-30.5, 0, base_height / 2]) {
cylinder(h=base_height, d=12, center=true);
}
difference() {
translate(v=[0, 0, total_height / 2]) {
cylinder(h=total_height, d=53, center=true);
}
union() {
translate(v=[0, -30.5, 30.5 + base_height]) {
rotate(a=[0, 90, 0]) {
cylinder(h=100, r=30.5, center=true);
}
}
translate(v=[0, -50, 50 + 30.5 + base_height]) {
cube(100, center=true);
}
}
}
}
union() {
translate(v=[0, 0, 45]) {
cylinder(h=100, d=47, center=true);
}
translate(v=[31, 0, base_height / 2]) {
cylinder(h=base_height + epsilon, d=4.5, center=true);
}
translate(v=[-31, 0, base_height / 2]) {
cylinder(h=base_height + epsilon, d=4.5, center=true);
}
}
}
@@ -0,0 +1,61 @@
$fn = 100;
base_height = 4;
total_height = 80;
top_height = (47 / 2) + 3;
epsilon = 0.01;
difference() {
union() {
translate(v=[0, 0, base_height / 2]) {
cylinder(h=base_height, d=61, center=true);
}
translate(v=[30.5, 0, base_height / 2]) {
cylinder(h=base_height, d=12, center=true);
}
translate(v=[-30.5, 0, base_height / 2]) {
cylinder(h=base_height, d=12, center=true);
}
difference() {
translate(v=[0, 0, (total_height - top_height) / 2]) {
cylinder(h=total_height - top_height, d=53, center=true);
}
union() {
translate(v=[0, -30.5, 30.5 + base_height]) {
rotate(a=[0, 90, 0]) {
cylinder(h=100, r=30.5, center=true);
}
}
translate(v=[0, -50, 50 + 30.5 + base_height]) {
cube(100, center=true);
}
}
}
}
union() {
translate(v=[0, 0, 45]) {
cylinder(h=100, d=47, center=true);
}
translate(v=[31, 0, base_height / 2]) {
cylinder(h=base_height + epsilon, d=4.5, center=true);
}
translate(v=[-31, 0, base_height / 2]) {
cylinder(h=base_height + epsilon, d=4.5, center=true);
}
}
}
difference() {
translate(v=[0, 0, total_height - top_height]) {
sphere(d=53);
}
translate(v=[0, 0, total_height - top_height]) {
sphere(d=47);
}
translate(v=[0, -60, total_height]) {
cube(120, center=true);
}
translate(v=[0, 0, total_height - top_height - 60]) {
cube(120, center=true);
}
}
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+24
View File
@@ -0,0 +1,24 @@
translate(v=[0, 0, 55/2])
difference() {
cube(size=[20, 20, 55], center=true);
translate(v=[10, 0, 0])
scale(v=[10/55, 1, 1])
rotate(a=[90, 0, 0])
cylinder(h=50, d=55, center=true);
translate(v=[-10, 0, 0])
scale(v=[10/55, 1, 1])
rotate(a=[90, 0, 0])
cylinder(h=50, d=55, center=true);
translate(v=[0, 10, 0])
scale(v=[1, 10/55, 1])
rotate(a=[0, 90, 0])
cylinder(h=50, d=55, center=true);
translate(v=[0, -10, 0])
scale(v=[1, 10/55, 1])
rotate(a=[0, 90, 0])
cylinder(h=50, d=55, center=true);
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+105
View File
@@ -0,0 +1,105 @@
$fn = 100;
w_board = 14;
d_board = 12.75;
h_board = 3.20;
pad = 0.2;
pad_top = 0.0;
w_pad = w_board + pad;
d_pad = d_board + pad;
h_pad = h_board + pad;
wall = 1;
w_wall = w_pad + (wall * 2);
d_wall = d_pad + (wall * 2);
h_wall = h_pad + (wall * 2);
w_usbm = 8.1;
h_usbm = 2.4;
w_usbm_pad = w_usbm + pad;
h_usbm_pad = h_usbm + pad;
w_usbf = 8.9;
h_usbf = 3.2;
w_usbf_pad = w_usbf + pad;
h_usbf_pad = h_usbf + pad;
r_usb_corner = 1.5;
d_corner = 1.5;
text_depth = 0.2;
e = 0.01;
difference() {
outer();
translate([wall, wall, wall])
cube([w_pad, d_pad, h_pad + pad_top]);
translate([(w_wall - w_usbm_pad) / 2 + r_usb_corner, 0, (h_wall - h_usbf_pad) / 2])
cube([w_usbm_pad - (r_usb_corner * 2), wall + e, h_usbf_pad]);
translate([(w_wall - w_usbm_pad) / 2, 0, (h_wall - h_usbf_pad) / 2 + r_usb_corner])
cube([w_usbm_pad, wall + e, h_usbf_pad - r_usb_corner]);
translate([(w_wall - w_usbm_pad) / 2 + r_usb_corner, wall + e, (h_wall - h_usbf_pad) / 2 + r_usb_corner])
rotate([90, 0, 0])
cylinder(h=(wall + e), r=r_usb_corner);
translate([(w_wall - w_usbm_pad) / 2 + w_usbm_pad - r_usb_corner, wall + e, (h_wall - h_usbf_pad) / 2 + r_usb_corner])
rotate([90, 0, 0])
cylinder(h=(wall + e), r=r_usb_corner);
translate([(w_wall - w_usbf_pad) / 2 + r_usb_corner, d_wall - wall - e, (h_wall - h_usbf_pad) / 2])
cube([w_usbf_pad - (r_usb_corner * 2), wall + e, h_usbf_pad]);
translate([(w_wall - w_usbf_pad) / 2, d_wall - wall - e, (h_wall - h_usbf_pad) / 2 + r_usb_corner])
cube([w_usbf_pad, wall + e, h_usbf_pad - r_usb_corner]);
translate([(w_wall - w_usbf_pad) / 2 + r_usb_corner, d_wall, (h_wall - h_usbf_pad) / 2 + r_usb_corner])
rotate([90, 0, 0])
cylinder(h=(wall + e), r=r_usb_corner);
translate([(w_wall - w_usbf_pad) / 2 + w_usbf_pad - r_usb_corner, d_wall, (h_wall - h_usbf_pad) / 2 + r_usb_corner])
rotate([90, 0, 0])
cylinder(h=(wall + e), r=r_usb_corner);
translate([1.5, 11.5, 0])
linear_extrude(height=text_depth)
mirror([0, 1, 0])
text(text="RF", size=8, font="JetBrains Mono");
translate([1.5, 3.5, h_wall - text_depth])
linear_extrude(height=text_depth)
text(text="RF", size=8, font="JetBrains Mono");
}
module outer() {
hull()
{
for (x = [0, w_wall - d_corner]) {
for (y = [0, d_wall - d_corner]) {
for (z = [0, h_wall + pad_top - d_corner]) {
translate([x, y, z])
translate([d_corner / 2, d_corner / 2, d_corner / 2])
sphere(d=d_corner);
}
}
}
}
}
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+56
View File
@@ -0,0 +1,56 @@
$fn = 100;
difference() {
union() {
hull() {
translate([0, 1, 0])
rotate([90, 0, 0])
rounded_corners(x=16, y=16, r=0.5);
translate([0, 116, 0])
rotate([90, 0, 0])
rounded_corners(x=16, y=16, r=0.5);
}
hull() {
translate([1, 0, 0])
rotate([0, -90, 0])
rounded_corners(x=16, y=16, r=0.5);
translate([68, 0, 0])
rotate([0, -90, 0])
rounded_corners(x=16, y=16, r=0.5);
}
hull() {
translate([52, 1, 0])
rotate([90, 0, 0])
rounded_corners(x=16, y=16, r=0.5);
translate([52, 54, 0])
rotate([90, 0, 0])
rounded_corners(x=16, y=16, r=0.5);
}
}
translate([8, 8, -1])
cylinder(h=18, d=3.2);
translate([8, 107.5, -1])
cylinder(h=18, d=3.2);
}
module rounded_corners(x, y, r) {
translate([r, r, r])
sphere(r=r);
translate([x - r, r, r])
sphere(r=r);
translate([r, y - r, r])
sphere(r=r);
translate([x - r, y - r, r])
sphere(r=r);
}
BIN
View File
Binary file not shown.
Binary file not shown.
+28960
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+14688
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+378
View File
@@ -0,0 +1,378 @@
/* Version 3
Added support for font selection (default is Letters.dxf)
Added WriteCube module
Added Rotate for text (rotates on the plane of the text)
Added writesphere
Added space= (spacing between characters in char widths) def=1
Added writecylinder()
By Harlan Martin
harlan@sutlog.com
January 2012
(The file TestWrite.scad gives More usage examples)
(This module requires the file Letters.dxf to reside in the same folder)
(The file Letters.dfx was created with inkscape..Each letter is in its own layer)
(This module seperates each letter in the string and imports it from Letters.dfx)
*/
pi=3.1415926535897932384626433832795028841971693993751058209;
pi2=pi*2;
// These control the default values for write() writesphere() writecube()
// if the parameters are not included in the call. Feel free to set your own
// defaults.
//default settings
center=false;
h = 4; //mm letter height
t = 1; //mm letter thickness
space =1; //extra space between characters in (character widths)
rotate=0; // text rotation (clockwise)
font = "Letters.dxf"; //default for aditional fonts
// write cube defaults
face = "front"; // default face (top,bottom,left,right,back,front)
up =0; //mm up from center on face of cube
down=0;
right =0; //mm left from center on face of cube
left=0;
// write sphere defaults
rounded=false; //default for rounded letters on writesphere
north=0; // intial text position (I suggest leave these 0 defaults)
south=0;
east=0;
west=0;
spin=0;
// writecylinder defaults
middle=0; //(mm toward middle of circle)
ccw=false; //write on top or bottom in a ccw direction
r1=0; //(not implimented yet)
r2=0; //(not implimented yet)
// Contact me if your interested in how to make your own font files
// Its tedious and time consuming, but not very hard
module writecylinder(text,where,radius,height){
wid=(.125* h *5.5 * space);
widall=wid*(len(text)-1)/2;
//angle that measures width of letters on sphere
function NAngle(radius)=(wid/(pi2*radius))*360;
//angle of half width of text
function mmangle(radius)=(widall/(pi2*radius)*360);
if ((face=="top")||(face=="bottom") ){
if (face=="top" ){
if (center==true){
writecircle(text,where+[0,0,height/2],radius-h,rotate=rotate,font=font,h=h,t=t,
space=space,east=east,west=west,middle=middle,ccw=ccw);
}else{
writecircle(text,where+[0,0,height],radius-h,rotate=rotate,font=font,h=h,t=t,
space=space,east=east,west=west,middle=middle,ccw=ccw);
}
}else{
rotate(180,[1,0,0])
if (center==true){
writecircle(text,where+[0,0,height/2],radius-h,rotate=rotate,font=font,h=h,t=t,
space=space,east=east,west=west,middle=middle,ccw=ccw);
}else{
writecircle(text,where+[0,0,0],radius-h,rotate=rotate,font=font,h=h,t=t,
space=space,east=east,west=west,middle=middle,ccw=ccw);
}
}
}else{
// if (radius>0){
if (center==true) {
rotate(-mmangle(radius)*(1-abs(rotate)/90),[0,0,1])
translate(where)
writethecylinder(text,where,radius,height,r1=radius,r2=radius,h=h,
rotate=rotate,t=t,font=font,face=face,up=up,down=down,
east=east,west=west,center=center,space=space,rounded=rounded);
} else{
rotate(-mmangle(radius)*(1-abs(rotate)/90),[0,0,1])
translate(where+[0,0,height/2])
writethecylinder(text,where,radius,height,r1=radius,r2=radius,h=h,
rotate=rotate,t=t,font=font,face=face,up=up,down=down,
east=east,west=west,center=center,space=space,rounded=rounded);
}
// the remarked out code is for cone shaped cylinders (not complete)
// }else{
// if (center==true) {
// rotate(-mmangle(radius)*(1-abs(rotate)/90),[0,0,1])
// translate(where)
// writethecylinder(text,where,radius,height,r1=r1,r2=r2,h=h,
// rotate=rotate,t=t,font=font,face=face,up=up,down=down,
// east=east,west=west,center=center,space=space,rounded=rounded);
// } else{
// rotate(-mmangle(radius)*(1-abs(rotate)/90),[0,0,1])
// translate(where+[0,0,height/2])
// writethecylinder(text,where,radius,height,r1=r1,r2=r2,h=h,
// rotate=rotate,t=t,font=font,face=face,up=up,down=down,
// east=east,west=west,center=center,space=space,rounded=rounded);
// }
// }
}
}
module writecircle(text,where,radius){
wid=(.125* h *5.5 * space);
widall=wid*(len(text)-1)/2;
//angle that measures width of letters on sphere
function NAngle(radius)=(wid/(pi2*radius))*360;
//angle of half width of text
function mmangle(radius)=(widall/(pi2*radius)*360);
if (ccw==true){
rotate(-rotate+east-west,[0,0,1]){
rotate(-mmangle(radius-middle),[0,0,1]){
translate(where)
for (r=[0:len(text)-1]){
rotate(-90+r*NAngle(radius-middle),[0,0,1]) // bottom out=-270+r
translate([radius-middle,0,0])
//rotate(90,[1,0,0])
//rotate(90,[0,1,0])
rotate(-270,[0,0,1]) // flip text (botom out = -270)
write(text[r],center=true,h=h,t=t,font=font);
}
}
}
}else{
rotate(-rotate-east+west,[0,0,1]){
rotate(mmangle(radius-middle),[0,0,1]){
translate(where)
for (r=[0:len(text)-1]){
rotate(90-r*NAngle(radius-middle),[0,0,1]) // bottom out=-270+r
translate([radius-middle,0,0])
//rotate(90,[1,0,0])
//rotate(90,[0,1,0])
rotate(270,[0,0,1]) // flip text (botom out = -270)
write(text[r],center=true,h=h,t=t,font=font);
}
}
}
}
}
module writethecylinder(text,where,radius,height,r1,r2){
wid=(.125* h *5.5 * space);
widall=wid*(len(text)-1)/2;
//angle that measures width of letters on sphere
function NAngle(radius)=(wid/(pi2*radius))*360*(1-abs(rotate)/90);
//angle of half width of text
function mmangle(radius)=(widall/(pi2*radius)*360);
translate([0,0,up-down])
rotate(east-west,[0,0,1])
for (r=[0:len(text)-1]){
rotate(-90+(r*NAngle(radius)),[0,0,1])
translate([radius,0,-r*((rotate)/90*wid)+(len(text)-1)/2*((rotate)/90*wid)])
rotate(90,[1,0,0])
rotate(90,[0,1,0])
write(text[r],center=true,h=h,rotate=rotate,t=t,font=font);
//echo("zloc=",height/2-r*((rotate)/90*wid)+(len(text)-1)/2*((rotate)/90*wid));
}
}
module writesphere(text,where,radius){
wid=(.125* h *5.5 * space);
widall=wid*(len(text)-1)/2;
echo("-----------------",widall,wid,mmangle(radius));
//angle that measures width of letters on sphere
function NAngle(radius)=(wid/(pi2*radius))*360;
//angle of half width of text
function mmangle(radius)=(widall/(pi2*radius)*360);
rotate(east-west,[0,0,1]){
rotate(south-north,[1,0,0]){
rotate(spin,[0,1,0]){
rotate(-mmangle(radius),[0,0,1]){
if ( rounded== false ){
translate(where)
for (r=[0:len(text)-1]){
rotate(-90+r*NAngle(radius),[0,0,1])
translate([radius,0,0])
rotate(90,[1,0,0])
rotate(90,[0,1,0])
write(text[r],center=true,h=h,rotate=rotate,t=t,font=font);
}
}else{
difference(){
translate(where)
for (r=[0:len(text)-1]){
rotate(-90+r*NAngle(radius),[0,0,1])
translate([radius,0,0])
rotate(90,[1,0,0])
rotate(90,[0,1,0])
write(text[r],center=true,h=h,rotate=rotate,t=t*2+h,font=font);
}
difference(){ //rounded outside
sphere(radius+(t*2+h)*2);
sphere(radius+t/2);
}
sphere(radius-t/2); // rounded inside for indented text
}
}
}
}}}
}
module writecube(text,where,size){
if (str(size)[0] != "["){
// its a square cube (size was not a matrix so make it one)
writethecube(text,where,[size,size,size],h=h,rotate=rotate,space=space,
t=t,font=font,face=face,up=up,down=down,right=right,left=left);
}else{
// its not square
writethecube(text,where,size,h=h,rotate=rotate,space=space,
t=t,font=font,face=face,up=up,down=down,right=right,left=left);
}
}
// I split the writecube module into 2 pieces.. easier to add features later
module writethecube(text,where,size){
if (face=="front") {
translate([where[0]+right-left,where[1]-size[1]/2,where[2]+up-down])
rotate(90,[1,0,0])
write(text,center=true,h=h,rotate=rotate,t=t,font=font);
}
if (face=="back") {
translate([where[0]+right-left,where[1]+size[1]/2,where[2]+up-down])
rotate(90,[1,0,0]) // rotate around the x axis
rotate(180,[0,1,0]) // rotate around the y axis (z before rotation)
write(text,center=true,h=h,rotate=rotate,t=t,font=font);
}
if (face=="left") {
translate([where[0]-size[0]/2,where[1]-right+left,where[2]+up-down ])
rotate(90,[1,0,0]) // rotate around the x axis
rotate(90,[0,-1,0]) // rotate around the y axis (z before rotation)
write(text,center=true,h=h,rotate=rotate,t=t,font=font);
}
if (face=="right") {
translate([where[0]+size[0]/2,where[1]+right-left,where[2] +up-down])
rotate(90,[1,0,0]) // rotate around the x axis
rotate(90,[0,1,0]) // rotate around the y axis (z before rotation)
write(text,center=true,h=h,rotate=rotate,t=t,font=font);
}
if (face=="top") {
translate([where[0]+right-left,where[1]+up-down,where[2]+size[2]/2 ])
write(text,center=true,h=h,rotate=rotate,t=t,font=font);
}
if (face=="bottom") {
translate([where[0]+right-left,where[1]-up+down,where[2]-size[2]/2 ])
rotate(180,[1,0,0])
write(text,center=true,h=h,rotate=rotate,t=t,font=font);
}
}
module write(word){
echo (h);
echo (word);
echo ("There are " ,len(word) ," letters in this string");
// echo ("The second letter is ",word[1]);
// echo (str(word[0],"_"));
rotate(rotate,[0,0,-1]){
for (r = [0:len(word)]){ // count off each character
// if the letter is lower case, add an underscore to the end for file lookup
if ((word[r] == "a" ) || (word[r]== "b") || (word[r]== "c")
|| (word[r]== "d") || (word[r]== "e") || (word[r]== "f")
|| (word[r]== "g") || (word[r]== "h") || (word[r]== "i")
|| (word[r]== "j") || (word[r]== "k") || (word[r]== "l")
|| (word[r]== "m") || (word[r]== "n") || (word[r]== "o")
|| (word[r]== "p") || (word[r]== "q") || (word[r]== "r")
|| (word[r]== "s") || (word[r]== "t") || (word[r]== "u")
|| (word[r]== "v") || (word[r]== "w") || (word[r]== "x")
|| (word[r]== "y" )|| (word[r]== "z")){
if (center == true) {
translate([0,-h/2,0]){
scale([.125*h,.125*h,t]){
translate([ (-len(word)*5.5*space/2) + (r*5.5*space),0,0])
linear_extrude(height=1,convexity=10,center=true){
import(file = font,layer=str(word[r],"_"));
}
}
}
}else{
translate([0,0,t/2]){
scale([.125*h,.125*h,t]){
translate([r*5.5*space,0,0])
linear_extrude(height=1,convexity=10,center=true){
import(file = font,layer=str(word[r],"_"));
}
}
}
}
}else{
if (center == true) {
translate([0,-h/2,0]){
scale([.125*h,.125*h,t]){
translate([ (-len(word)*5.5*space/2) + (r*5.5*space),0,0])
linear_extrude(height=1,convexity=10,center=true){
import(file = font,layer=str(word[r]));
}
}
}
}else{
translate([0,0,t/2]){
scale([.125*h,.125*h,t]){
translate([r*5.5*space,0,0])
linear_extrude(height=1,convexity=10,center=true){
import(file = font,layer=str(word[r]));
}
}
}
}
}
}
}
}
/*writecylinder test
translate([0,0,0])
%cylinder(r=20,h=40,center=true);
color([1,0,0])
writecylinder("rotate=90",[0,0,0],20,40,center=true,down=0,rotate=90);
writecylinder("rotate = 30,east = 90",[0,0,0],20,40,center=true,down=0,rotate=30,east=90);
writecylinder("ccw = true",[0,0,0],20,40,center=true,down=0,face="top",ccw=true);
writecylinder("middle = 8",[0,0,0],20,40,h=3,center=true,down=0,face="top",middle=8);
writecylinder("face = top",[0,0,0],20,40,center=true,down=0,face="top");
writecylinder("east=90",[0,0,0],20,40,h=3,center=true,down=0,face="top",east=90);
writecylinder("west=90",[0,0,0],20,40,h=3,center=true,down=0,face="top",ccw=true,west=90);
writecylinder("face = bottom",[0,0,0],20,40,center=true,down=0,face="bottom");
*/
/*writesphere test
sphere(20);
color([1,0,0])
writesphere("Hello World",[0,0,0],20,t=1,h=6);
*/
/* writecube test
translate([30,30,30])
cube([10,15,30],center=true);
write("hello",center=true,rotate =30);
color([1,0,0])
writecube( "front",[30,30,30],[10,15,30],h=5,rotate=-90);
color([0,1,0])
writecube( "back",[30,30,30],size=[10,15,30],h=5,face="back",rotate=90,t=4);
color([0,0,1])
writecube( "left",[30,30,30],[10,15,30],h=5,face="left",up=5);
color([1,1,0])
writecube( "right",where=[30,30,30],size=[10,15,30],h=5,face="right",rotate=55);
color([1,0,1])
writecube( "top",where=[30,30,30],size=[10,15,30],h=5,face="top");
color([1,1,1])
writecube( "bttm",where=[30,30,30],size=[10,15,30],h=5,face="bottom",rotate=90);
*/
+18182
View File
File diff suppressed because it is too large Load Diff
+34740
View File
File diff suppressed because it is too large Load Diff
+33
View File
@@ -0,0 +1,33 @@
use <Write.scad>;
$fn = 20;
part = 1;
letter = "M";
font = "orbitron.dxf";
height = 3;
module letter() {
color("red")
write(letter, t=height, h=16, font=font, center=true);
}
module block() {
color("blue")
difference() {
cube([20, 20, height], center=true);
translate([7.5, 7.5, 0])
cylinder(h=height, d=3, center=true);
}
}
if (part == 1) {
difference() {
block();
letter();
}
} else if (part == 2) {
letter();
}
+16730
View File
File diff suppressed because it is too large Load Diff