33 lines
1.4 KiB
OpenSCAD
33 lines
1.4 KiB
OpenSCAD
// include <../../config.scad>;
|
|
use <./beam_hexagonal.scad>;
|
|
use <./metric_countersunk_head_bolt_functions.scad>;
|
|
use <./metric_bolt_functions.scad>;
|
|
use <./metric_nut.scad>;
|
|
|
|
module metric_countersunk_head_bolt(size, length, has_nut = true, offset_nut_from_end = 0) {
|
|
echo("Metric countersunk head bolt assembly:");
|
|
head_height = get_metric_countersunk_head_bolt_head_height(size);
|
|
head_diameter = get_metric_countersunk_head_bolt_head_diameter(size);
|
|
nut_height = get_metric_bolt_head_height(size);
|
|
color("gray") union() {
|
|
// Stem
|
|
cylinder(length, size / 2, size / 2, center = true);
|
|
// Head
|
|
translate([0, 0, length / 2 + head_height / 2]) difference() {
|
|
cylinder(head_height, size / 2, head_diameter / 2, center = true);
|
|
translate([0, 0, head_height / 2 - head_diameter / 10 / 2]) cube([head_diameter / 5, head_diameter, head_diameter / 10], center = true);
|
|
}
|
|
if (has_nut) {
|
|
// Nut
|
|
translate([0, 0, -(length / 2 - nut_height / 2) + offset_nut_from_end]) metric_nut(size);
|
|
}
|
|
}
|
|
// Shopping
|
|
echo(str("Bolt: Countersunk head bolt M", size, " x ", length, "mm - x1"));
|
|
}
|
|
|
|
// $fn = 200;
|
|
metric_countersunk_head_bolt(4, 40);
|
|
translate([30, 0, 0]) metric_countersunk_head_bolt(12, 200, false);
|
|
translate([60, 0, 0]) metric_countersunk_head_bolt(12, 200, true, 10);
|
|
translate([90, 0, 0]) metric_countersunk_head_bolt(12, 100, true, 5); |