initial commit
parent
b4a5872acf
commit
45d6ed0b24
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,22 @@
|
|||
include <roundedcube.scad>;
|
||||
|
||||
// some variables
|
||||
|
||||
height = 2;
|
||||
cornerradius = 1;
|
||||
centerdiameter = 5;
|
||||
width = 19;
|
||||
|
||||
union() {
|
||||
difference() {
|
||||
roundedcube([width, width, height], true, cornerradius, "z");
|
||||
translate([3.38,10,0])
|
||||
linear_extrude(height = 10, center = false)
|
||||
import(file = "ProfileI5.dxf");
|
||||
translate([0,0,1])
|
||||
cube([width-2, width-2, height], center = true);
|
||||
}
|
||||
cylinder(h=height*2, d1=centerdiameter, d2=centerdiameter-0.5);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
Binary file not shown.
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
After Width: | Height: | Size: 1.5 MiB |
|
@ -0,0 +1,61 @@
|
|||
// Higher definition curves
|
||||
$fs = 0.01;
|
||||
|
||||
module roundedcube(size = [1, 1, 1], center = false, radius = 0.5, apply_to = "all") {
|
||||
// If single value, convert to [x, y, z] vector
|
||||
size = (size[0] == undef) ? [size, size, size] : size;
|
||||
|
||||
translate_min = radius;
|
||||
translate_xmax = size[0] - radius;
|
||||
translate_ymax = size[1] - radius;
|
||||
translate_zmax = size[2] - radius;
|
||||
|
||||
diameter = radius * 2;
|
||||
|
||||
module build_point(type = "sphere", rotate = [0, 0, 0]) {
|
||||
if (type == "sphere") {
|
||||
sphere(r = radius);
|
||||
} else if (type == "cylinder") {
|
||||
rotate(a = rotate)
|
||||
cylinder(h = diameter, r = radius, center = true);
|
||||
}
|
||||
}
|
||||
|
||||
obj_translate = (center == false) ?
|
||||
[0, 0, 0] : [
|
||||
-(size[0] / 2),
|
||||
-(size[1] / 2),
|
||||
-(size[2] / 2)
|
||||
];
|
||||
|
||||
translate(v = obj_translate) {
|
||||
hull() {
|
||||
for (translate_x = [translate_min, translate_xmax]) {
|
||||
x_at = (translate_x == translate_min) ? "min" : "max";
|
||||
for (translate_y = [translate_min, translate_ymax]) {
|
||||
y_at = (translate_y == translate_min) ? "min" : "max";
|
||||
for (translate_z = [translate_min, translate_zmax]) {
|
||||
z_at = (translate_z == translate_min) ? "min" : "max";
|
||||
|
||||
translate(v = [translate_x, translate_y, translate_z])
|
||||
if (
|
||||
(apply_to == "all") ||
|
||||
(apply_to == "xmin" && x_at == "min") || (apply_to == "xmax" && x_at == "max") ||
|
||||
(apply_to == "ymin" && y_at == "min") || (apply_to == "ymax" && y_at == "max") ||
|
||||
(apply_to == "zmin" && z_at == "min") || (apply_to == "zmax" && z_at == "max")
|
||||
) {
|
||||
build_point("sphere");
|
||||
} else {
|
||||
rotate =
|
||||
(apply_to == "xmin" || apply_to == "xmax" || apply_to == "x") ? [0, 90, 0] : (
|
||||
(apply_to == "ymin" || apply_to == "ymax" || apply_to == "y") ? [90, 90, 0] :
|
||||
[0, 0, 0]
|
||||
);
|
||||
build_point("cylinder", rotate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue