454 lines
18 KiB
OpenSCAD
454 lines
18 KiB
OpenSCAD
// Include after common.scad
|
|
$extra_thickness_above_center = is_undef($extra_thickness_above_center) ? 0 : $extra_thickness_above_center;
|
|
|
|
function default_fret_widths(zero_fret_width, other_fret_width) = flatten([[zero_fret_width], [ for (i = [1:$num_frets]) other_fret_width ]]);
|
|
function default_neck_width_nut() = ($num_strings-1)*$string_spacing_nut + $string_margin*2;
|
|
function default_neck_width_bridge() = ($num_strings-1)*$string_spacing_bridge + $string_margin*2;
|
|
|
|
function neck_width(mm=0, fret=-9999) = lerp($neck_width_bridge, $neck_width_nut, (fret>-9999) ? (2^(-fret/12)) : (mm/fret_scale_length(0)));
|
|
function get_fret_width(fret) = $fret_widths[clamp(0, fret, len($fret_widths)-1)];
|
|
function get_fret_height(fret) = sin($fret_angle) * get_fret_width(fret)/2;
|
|
function get_max_fret_width() = max($fret_widths);
|
|
function arc_starting_angle_to_height_ratio(angle) = ((1-cos(angle))/(sin(angle)));
|
|
function get_max_fret_height() = arc_starting_angle_to_height_ratio($fret_angle) * get_max_fret_width()/2;
|
|
function get_max_scallop_angle() = (is_undef($max_scallop_angle) || $max_scallop_angle <= 0) ? $fret_angle : $max_scallop_angle;
|
|
function get_final_scallop_length() = $scallop_depth / arc_starting_angle_to_height_ratio(get_max_scallop_angle());
|
|
function get_final_scallop_() = $scallop_depth / arc_starting_angle_to_height_ratio(get_max_scallop_angle());
|
|
function get_end_of_fretboard() = after_fret($num_frets) - get_final_scallop_length();
|
|
|
|
function behind_fret(fret) = fret_scale_length(fret) + get_fret_width(fret)/2;
|
|
function after_fret(fret) = fret_scale_length(fret) - get_fret_width(fret)/2;
|
|
|
|
function string_spacing(y) = lerp($string_spacing_bridge, $string_spacing_nut, y/fret_scale_length(0));
|
|
function string_x(i, y) = ($num_strings-i-1)*string_spacing(y) - neck_width(y)/2 + $string_margin;
|
|
|
|
|
|
module strings_reference(string_excess=80) {
|
|
z_nut = $extra_thickness_above_center + $scallop_depth + get_max_fret_height();
|
|
y_nut = fret_scale_length(0);
|
|
z_bridge = z_nut + 4;
|
|
y_bridge = -string_excess;
|
|
|
|
for (i = [0:$num_strings-1]) {
|
|
hull() {
|
|
d = $string_diameters_mm[i];
|
|
translate([string_x(i, y_bridge), y_bridge, z_bridge + d/2]) sphere(d=d, $fn=cyl_ld_fn);
|
|
translate([string_x(i, y_nut), y_nut, z_nut + d/2]) sphere(d=d, $fn=cyl_ld_fn);
|
|
}
|
|
}
|
|
}
|
|
|
|
module neck(string_spacing=18, string_margin=4.5, num_strings=3, target_neck_thickness=15, target_neck_thickness_additional_points=[], scallop_depth=3, num_frets=24, fret_width=2.4, filler=false, inlays_only=false, side_markers_only=false, fret_layers_only=false, remove_fret_layers=false, engrave_markers=true) {
|
|
fw2 = fret_width/2;
|
|
neck_length = fret_scale_length(0)+fw2;
|
|
neck_width = (num_strings-1)*string_spacing + string_margin*2;
|
|
module neck_stock() {
|
|
angle_excess = asin((scallop_depth+fw2)/target_neck_thickness);
|
|
a0 = 90-angle_excess;
|
|
a1 = 270+angle_excess;
|
|
rotate([-90, 0, 0])
|
|
if (len(target_neck_thickness_additional_points) < 1) {
|
|
linear_extrude(neck_length)
|
|
polygon([for (i = [0:300]) let(a=lerp(a0, a1, i/300.0)) [neck_width*0.5*sin(a), -target_neck_thickness*cos(a)]]); // Ellipse
|
|
} else {
|
|
pts = flatten([[[neck_length, target_neck_thickness]], target_neck_thickness_additional_points]);
|
|
echo(pts);
|
|
for (i = [0:len(pts)-2]) {
|
|
pt0 = pts[i];
|
|
pt1 = pts[i+1];
|
|
echo(i, pt0, pt1);
|
|
render() hull() {
|
|
translate([0,0,pt0[0]]) linear_extrude(0.01)
|
|
polygon([for (i = [0:300]) let(a=lerp(a0, a1, i/300.0)) [neck_width*0.5*sin(a), -pt0[1]*cos(a)]]); // Ellipse
|
|
translate([0,0,pt1[0]]) linear_extrude(0.01)
|
|
polygon([for (i = [0:300]) let(a=lerp(a0, a1, i/300.0)) [neck_width*0.5*sin(a), -pt1[1]*cos(a)]]); // Ellipse
|
|
}
|
|
}
|
|
}
|
|
}
|
|
module scallop(fret) {
|
|
x0 = fret_scale_length(fret-1) - fw2;
|
|
x1 = fret_scale_length(fret) + fw2;
|
|
xmid = lerp(x0, x1, 0.5);
|
|
// Radius it?
|
|
arc = arc_points([[x0, scallop_depth], [x1, scallop_depth], [xmid, 0]]);
|
|
// echo(arc);
|
|
rotate([90, 0, 90]) linear_extrude(neck_width, center=true) polygon(arc);
|
|
}
|
|
module scallops() {
|
|
for (fret = [0:num_frets]) {
|
|
scallop(fret);
|
|
}
|
|
}
|
|
module fret_bumps() {
|
|
for (fret = [0:num_frets]) {
|
|
translate([0, fret_scale_length(fret), scallop_depth])
|
|
rotate([0, 90]) cylinder(d=fret_width, h = neck_width, center = true, $fn=200);
|
|
}
|
|
}
|
|
module intersect_fret_layers() {
|
|
for (fret = [0:num_frets]) {
|
|
translate([-500, fret_scale_length(fret)-fret_width/2, -500])
|
|
cube([1000, fret_width, 1000]);
|
|
}
|
|
// Some precision error with fret 0 :/
|
|
translate([-500, fret_scale_length(0)-fret_width/2+0.0006, -500])
|
|
cube([1000, fret_width, 1000]);
|
|
}
|
|
module fret_inlays() {
|
|
for (num_text = $fret_inlays) {
|
|
fret = num_text[0];
|
|
if (fret <= num_frets) {
|
|
x0 = fret_scale_length(fret-1);
|
|
x1 = fret_scale_length(fret);
|
|
diff = x0 - x1;
|
|
translate([0, lerp(x0, x1, 0.5), -0.5])
|
|
linear_extrude(30)
|
|
text(text = num_text[1], font = JP_Sans_Font, halign = "center", valign = "center", size = clamp(2, diff-fret_width*2-2, 10));
|
|
}
|
|
}
|
|
}
|
|
module fret_side_markers() {
|
|
for (num_text = $fret_inlays) {
|
|
fret = num_text[0];
|
|
if (fret <= num_frets) {
|
|
x0 = fret_scale_length(fret-1);
|
|
x1 = fret_scale_length(fret);
|
|
diff = x0 - x1;
|
|
mid = lerp(x0, x1, 0.67);
|
|
rotate([0, -94, 0])
|
|
translate([0, mid, neck_width/2-3])
|
|
linear_extrude(50)
|
|
rotate(-37)
|
|
text(text = str(fret), font = JP_Serif_Font, halign = "right", valign = "center", size = 5);
|
|
}
|
|
}
|
|
}
|
|
|
|
module carved_stock() {
|
|
render() difference() {
|
|
neck_stock();
|
|
scallops();
|
|
scallop(num_frets+1);
|
|
// Chop off anything above the frets
|
|
translate([-neck_width, 0, scallop_depth]) cube([neck_width*2, $guitar_scale_length_mm*3, target_neck_thickness*3]);
|
|
// Reduce rest of the body to 0
|
|
translate([-neck_width, 0, 0]) cube([neck_width*2, (fret_scale_length(num_frets)+fret_scale_length(num_frets+1))/2, target_neck_thickness*3]);
|
|
}
|
|
intersection() {
|
|
fret_bumps();
|
|
neck_stock();
|
|
}
|
|
}
|
|
|
|
if (filler) { // Somewhat placeholder for now
|
|
difference() {
|
|
neck_stock();
|
|
scallop(25);
|
|
translate([-neck_width, 0, scallop_depth]) cube([neck_width*2, $guitar_scale_length_mm*3, target_neck_thickness*3]);
|
|
translate([-neck_width, 0, 0]) cube([neck_width*2, (fret_scale_length(25)+fret_scale_length(24))/2, target_neck_thickness*3]);
|
|
}
|
|
} else {
|
|
render() intersection() {
|
|
difference() {
|
|
carved_stock();
|
|
if (engrave_markers) {
|
|
fret_inlays();
|
|
fret_side_markers();
|
|
}
|
|
if (remove_fret_layers) intersect_fret_layers();
|
|
}
|
|
if (fret_layers_only || inlays_only || side_markers_only) union() {
|
|
if (fret_layers_only) intersect_fret_layers();
|
|
if (inlays_only) fret_inlays();
|
|
if (side_markers_only) fret_side_markers();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
module TaperNeck(
|
|
target_neck_thickness_additional_points = [],
|
|
filler = false,
|
|
fret_side_marker_x_angle = -37,
|
|
fret_side_marker_y_angle = -4,
|
|
// $include_colours = [0, 1, 2, 3], // 0: Base neck/fretboard 1: Frets 2: Inlays 3: Side markers
|
|
){
|
|
neck_length = fret_scale_length(0) + get_fret_width(0)/2;
|
|
|
|
z0 = $extra_thickness_above_center; // Deepest scallops hit here, => thinnest top of neck
|
|
z1 = z0 + $scallop_depth; // Frets protrude from here
|
|
z2 = z1 + get_max_fret_height(); // Nothing above this => thickest top of neck
|
|
|
|
y2 = after_fret($num_frets); // bridge-side edge of final fret
|
|
y1 = y2 - get_final_scallop_length();
|
|
|
|
module neck_stock() {
|
|
angle_excess = asin(z2/$target_neck_thickness);
|
|
a0 = 90-angle_excess;
|
|
a1 = 270+angle_excess;
|
|
rotate([-90, 0, 0])
|
|
if (len(target_neck_thickness_additional_points) < 1) {
|
|
render() hull() {
|
|
translate([0,0,neck_length-0.0001]) linear_extrude(0.0001)
|
|
polygon([for (i = [0:300]) let(a=lerp(a0, a1, i/300.0)) [neck_width(neck_length)*0.5*sin(a), -$target_neck_thickness*cos(a)]]); // Ellipse
|
|
translate([0,0,0]) linear_extrude(0.0001)
|
|
polygon([for (i = [0:300]) let(a=lerp(a0, a1, i/300.0)) [neck_width(0)*0.5*sin(a), -$target_neck_thickness*cos(a)]]); // Ellipse
|
|
}
|
|
} else {
|
|
pts = flatten([[[neck_length, $target_neck_thickness]], target_neck_thickness_additional_points]);
|
|
echo(pts);
|
|
for (i = [0:len(pts)-2]) {
|
|
pt0 = pts[i];
|
|
pt1 = pts[i+1];
|
|
echo(i, pt0, pt1);
|
|
render() hull() {
|
|
translate([0,0,pt0[0]]) linear_extrude(0.01)
|
|
polygon([for (i = [0:300]) let(a=lerp(a0, a1, i/300.0)) [neck_width*0.5*sin(a), -pt0[1]*cos(a)]]); // Ellipse
|
|
translate([0,0,pt1[0]]) linear_extrude(0.01)
|
|
polygon([for (i = [0:300]) let(a=lerp(a0, a1, i/300.0)) [neck_width*0.5*sin(a), -pt1[1]*cos(a)]]); // Ellipse
|
|
}
|
|
}
|
|
}
|
|
// Add any children to this so other functions will difference from the additions
|
|
children();
|
|
}
|
|
module scallop(fret) {
|
|
x0 = fret_scale_length(fret) - get_fret_width(fret)/2;
|
|
x_fret = fret_scale_length(fret+1) + get_fret_width(fret+1)/2;
|
|
x1 = (fret < $num_frets) ? x_fret : (x0 - get_final_scallop_length()*2);
|
|
xmid = lerp(x0, x1, 0.5);
|
|
xdelta = x0-x1;
|
|
|
|
maxdepth_angle = 90+arc_points_angle([[x0, z1], [x1, z1], [xmid, z0]]);
|
|
// echo(str(maxdepth_angle));
|
|
a = min(get_max_scallop_angle(), maxdepth_angle);
|
|
fn = 50;
|
|
fn2 = fn * 2;
|
|
ca = cos(a);
|
|
sa = sin(a);
|
|
r = xdelta / (2*sa);
|
|
arc = [ for (i = [-fn:fn]) [xmid+xdelta*i/fn2, z1-r*(sqrt(1 - ((sa*i/fn)^2))-ca)] ];
|
|
// echo(arc);
|
|
rotate([90, 0, 90]) linear_extrude($neck_width_bridge, center=true) polygon(arc);
|
|
}
|
|
module scallops() {
|
|
for (fret = [0:$num_frets]) {
|
|
scallop(fret);
|
|
}
|
|
}
|
|
module fret_bump(fw, a = $fret_angle) {
|
|
// a must be in range (0,90] for correct geometry
|
|
fn = 50;
|
|
fn2 = fn * 2;
|
|
ca = cos(a);
|
|
sa = sin(a);
|
|
r = fw / (2*sa);
|
|
arc = [ for (i = [-fn:fn]) [fw*i/fn2, r*(sqrt(1 - ((sa*i/fn)^2))-ca)] ];
|
|
// echo("fret_bump", a, ca, arc);
|
|
rotate([90, 0, 90]) linear_extrude($neck_width_bridge, center=true) polygon(arc);
|
|
}
|
|
module fret_bumps() {
|
|
for (fret = [0:$num_frets])
|
|
translate([0, fret_scale_length(fret), z1])
|
|
fret_bump(get_fret_width(fret));
|
|
}
|
|
module intersect_fret_layers(all=true) {
|
|
for (fret = [0:$num_frets]) {
|
|
colour = is_undef($fret_colours) ? 1 : (len($fret_colours) > fret) ? $fret_colours[fret] : 1;
|
|
if (all || list_has($include_colours, colour))
|
|
translate([-500, fret_scale_length(fret)-get_fret_width(fret)/2, -500])
|
|
cube([1000, get_fret_width(fret), 1000]);
|
|
}
|
|
// Some precision error with fret 0 :/
|
|
colour = is_undef($fret_colours) ? 1 : (len($fret_colours) > 0) ? $fret_colours[0] : 1;
|
|
if (all || list_has($include_colours, colour))
|
|
translate([-500, fret_scale_length(0)-get_fret_width(0)/2+0.0006, -500])
|
|
cube([1000, get_fret_width(0), 1000]);
|
|
}
|
|
module fret_inlays() {
|
|
for (num_text = $fret_inlays) {
|
|
fret = num_text[0];
|
|
if (fret <= $num_frets) {
|
|
y0 = behind_fret(fret);
|
|
y1 = after_fret(fret-1);
|
|
y_mid = lerp(y0, y1, 0.5);
|
|
max_height = y1 - y0 - 4;
|
|
max_width = neck_width(y_mid) * 0.8;
|
|
estimated_width_chars = len(num_text[1])*7/5;
|
|
fontsize_from_max_width = max_width/estimated_width_chars;
|
|
fontsize_from_max_height = max_height;
|
|
// echo(str(max_width, " ", estimated_width_chars, " ", fontsize_from_max_height, " ", fontsize_from_max_width));
|
|
desired_fontsize = min(fontsize_from_max_height, fontsize_from_max_width);
|
|
fontsize = clamp(2, desired_fontsize, 10);
|
|
t = num_text[1];
|
|
// TODO: account for shallow scallops
|
|
translate([0, y_mid, z0-0.5]) linear_extrude(30) {
|
|
if (t == ".") {
|
|
circle(d=fontsize*0.9, $fn=72);
|
|
} else {
|
|
text(text = num_text[1], font = JP_Sans_Font, halign = "center", valign = "center", size = fontsize);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
module fret_side_markers() {
|
|
for (num_text = $fret_inlays) {
|
|
fret = num_text[0];
|
|
if (fret <= (is_undef($last_fret_side_marker) ? $num_frets : $last_fret_side_marker)) {
|
|
x0 = fret_scale_length(fret-1)-get_fret_width(fret-1)/2;
|
|
x1 = fret_scale_length(fret)+get_fret_width(fret)/2;
|
|
diff = x0 - x1;
|
|
mid = lerp(x0, x1, 0.67);
|
|
fontsize = min(5, (diff-1)*0.6);
|
|
rotate([0, fret_side_marker_y_angle-90, 0])
|
|
translate([0, mid, neck_width(mid)/2-3])
|
|
linear_extrude(50)
|
|
rotate(fret_side_marker_x_angle)
|
|
text(text = str(fret), font = JP_Serif_Font, halign = "right", valign = "center", size = fontsize);
|
|
}
|
|
}
|
|
}
|
|
|
|
module carved_stock() {
|
|
render() difference() {
|
|
neck_stock() children();
|
|
scallops();
|
|
// Chop off anything above the frets
|
|
translate([-$neck_width_bridge, 0, z1]) cube([$neck_width_bridge*2, $guitar_scale_length_mm*3, $target_neck_thickness*3]);
|
|
// Reduce rest of the body to 0
|
|
translate([-$neck_width_bridge, 0, z0]) cube([$neck_width_bridge*2, y1, $target_neck_thickness*3]);
|
|
}
|
|
intersection() {
|
|
fret_bumps();
|
|
neck_stock();
|
|
}
|
|
}
|
|
|
|
if (filler) { // Somewhat placeholder for now
|
|
difference() {
|
|
neck_stock();
|
|
scallop(25);
|
|
translate([-$neck_width_bridge, 0, scallop_depth]) cube([$neck_width_bridge*2, $guitar_scale_length_mm*3, target_neck_thickness*3]);
|
|
translate([-$neck_width_bridge, 0, 0]) cube([$neck_width_bridge*2, (fret_scale_length(25)+fret_scale_length(24))/2, target_neck_thickness*3]);
|
|
}
|
|
} else {
|
|
has1 = list_has($include_colours, 1);
|
|
has2 = list_has($include_colours, 2);
|
|
has3 = list_has($include_colours, 3);
|
|
if (list_has($include_colours, 0)) render() difference() {
|
|
carved_stock() children();
|
|
intersect_fret_layers();
|
|
fret_inlays();
|
|
fret_side_markers();
|
|
}
|
|
if (list_has($include_colours, 1)) render() intersection() {
|
|
carved_stock() children();
|
|
intersect_fret_layers(false);
|
|
}
|
|
if (list_has($include_colours, 2)) render() intersection() {
|
|
carved_stock() children();
|
|
fret_inlays();
|
|
}
|
|
if (list_has($include_colours, 3)) render() intersection() {
|
|
carved_stock() children();
|
|
fret_side_markers();
|
|
}
|
|
if (list_has($include_colours, 4)) render() intersection() {
|
|
carved_stock() children();
|
|
intersect_fret_layers(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
module FlatBridge(saddle_height = 10, base_height = 6, y_len = 15, screw_hole = true) {
|
|
// A bridge with no channel notch or piezo strip notch, to be printed more easily for coil-only guitars
|
|
// Base
|
|
render() difference() {
|
|
// Flatten off a rounded cube
|
|
r = 0.6;
|
|
translate([-neck_width()/2, 0, -r]) round_cube([neck_width(), y_len, base_height+r], r=r);
|
|
translate([-neck_width()/2, 0, -r]) cube([neck_width(), y_len, r]);
|
|
// screw hole just in case
|
|
if (screw_hole) {
|
|
translate([0, y_len/2, 0]) cylinder_outer(d=2.25, h=base_height);
|
|
countersink = 3;
|
|
translate([0, y_len/2, base_height-countersink]) cylinder_outer(d=5, h=countersink);
|
|
}
|
|
}
|
|
// String saddles - rule of thumb: string diameter multiplied by 4
|
|
// Make the thinnest string sit right at the front
|
|
m = 4;
|
|
m_unwound = 8;
|
|
saddle_y0 = 2.5; //1.2;
|
|
saddle_y1 = -3.7;
|
|
r0 = 0.85;
|
|
string_setbacks = [ for (i=[0:$num_strings-1]) $string_diameters_mm[i] * ((i < $num_unwound_strings) ? m_unwound : m) ];
|
|
y_start = y_len + min(string_setbacks) - (r0+saddle_y0);
|
|
for (i = [0:$num_strings-1]) translate([($num_strings-i-1)*string_spacing(0) - neck_width()/2 + $string_margin, y_start - string_setbacks[i], base_height]) {
|
|
step = ($preview) ? 9 : 3;
|
|
r1 = r0 + $string_diameters_mm[i]*1.2;
|
|
r2 = r0 + $string_diameters_mm[i]*1.1;
|
|
translate([0, 0, saddle_height]) for (a=[90:step:270-step]) hull() {
|
|
translate([-sin(a)*r1, 0, cos(a)*r2]) sphere(r=r0, $fn=cyl_ld_fn);
|
|
translate([-sin(a+step)*r1, 0, cos(a+step)*r2]) sphere(r=r0, $fn=cyl_ld_fn);
|
|
translate([-sin(a)*r1, saddle_y0, -saddle_height-r0]) sphere(r=r0, $fn=cyl_ld_fn);
|
|
translate([-sin(a+step)*r1, saddle_y0, -saddle_height-r0]) sphere(r=r0, $fn=cyl_ld_fn);
|
|
translate([-sin(a)*r1, saddle_y1, -saddle_height-r0]) sphere(r=r0, $fn=cyl_ld_fn);
|
|
translate([-sin(a+step)*r1, saddle_y1, -saddle_height-r0]) sphere(r=r0, $fn=cyl_ld_fn);
|
|
}
|
|
}
|
|
}
|
|
|
|
module NotchBridge(bridge_channel_depth, bridge_channel_width, saddle_height = 4, base_height = 6, y_len = 11) {
|
|
// Add a key at the bottom to fit the bridge channel
|
|
// Add a channel for the piezo pickup
|
|
w = neck_width();
|
|
pickup_w = 3;
|
|
pickup_h = 2;
|
|
render() difference() {
|
|
union() {
|
|
FlatBridge(saddle_height = saddle_height, base_height = base_height, y_len = y_len, screw_hole = false);
|
|
// Bridge channel notch
|
|
notch_w = bridge_channel_width - CF_Square_Width_tolerance; // Shrink a little for tolerance
|
|
notch_d = bridge_channel_depth - CF_Square_Width_tolerance/2;
|
|
translate([-notch_w/2, 0, -notch_d]) cube([notch_w, y_len, notch_d]);
|
|
}
|
|
// Pickup notch
|
|
tol = 0.75;
|
|
translate([-w/2, 2, -tol]) hull() {
|
|
cube([w, pickup_w, pickup_h+tol]);
|
|
translate([0, (pickup_h+tol)*0.8, 0]) cube([w, pickup_w, 0.01]);
|
|
}
|
|
// Version stamp
|
|
y0 = 0;
|
|
y1 = y_len;
|
|
translate([-15,y0+0.5,4]) rotate([90,0,0]) linear_extrude(10) {
|
|
text(str($id_lines[0], $id_lines[1]), size=2.9, halign="center", valign="center", $fn=100);
|
|
}
|
|
translate([-15,y1-0.5,4]) rotate([90,0,180]) linear_extrude(10) {
|
|
text(str($id_lines[0], $id_lines[1]), size=2.9, halign="center", valign="center", $fn=100);
|
|
}
|
|
}
|
|
}
|
|
|
|
module BeltHole(xz_pts, belthole_y0, belthole_y1, belthole_r=3, belthole_fn=72, fragments_per_mm=1, xy_curve_width=neck_width(), xy_curve_angle=120, xy_curve_x=20) {
|
|
// Add a belt hole
|
|
arc = arc_points(xz_pts, fragments_per_mm=fragments_per_mm);
|
|
|
|
render() for (i = [0:len(arc)-2]) {
|
|
$fn = belthole_fn;
|
|
hull() {
|
|
x0 = arc[i][0];
|
|
x1 = arc[i+1][0];
|
|
cx0 = xy_curve_x*(1-cos(x0*xy_curve_angle/xy_curve_width));
|
|
cx1 = xy_curve_x*(1-cos(x1*xy_curve_angle/xy_curve_width));
|
|
translate([x0, belthole_y0-cx0, arc[i][1]]) sphere(belthole_r);
|
|
translate([x1, belthole_y0-cx1, arc[i+1][1]]) sphere(belthole_r);
|
|
translate([x0, belthole_y1+cx0, arc[i][1]]) sphere(belthole_r);
|
|
translate([x1, belthole_y1+cx1, arc[i+1][1]]) sphere(belthole_r);
|
|
}
|
|
}
|
|
}
|