1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-09 17:06:34 +02:00

Fixed origin of T-nuts to be consistent with others.

I.e the mating face is at Z = 0.
This commit is contained in:
Chris Palmer
2020-02-24 09:11:59 +00:00
parent 66a7a9bfe0
commit 573425055a

View File

@@ -159,40 +159,41 @@ module hammer_nut(type) {
module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, holeOffset = 0, hammerNut = false) { module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, holeOffset = 0, hammerNut = false) {
// center section // center section
linear_extrude(size.z - tabSizeZ) h = size.z - tabSizeZ;
difference() { translate_z(-h)
square([size.x, size.y], center = true); linear_extrude(h)
if(hammerNut) {
translate([size.x / 2, size.y / 2])
rotate(180)
fillet(1);
translate([-size.x / 2, -size.y / 2])
fillet(1);
}
if(holeRadius)
translate([holeOffset, 0])
circle(holeRadius);
}
translate_z(size.z - tabSizeZ)
linear_extrude(tabSizeZ)
difference() { difference() {
square([size.x, tabSizeY2], center = true); square([size.x, size.y], center = true);
if(hammerNut) {
translate([size.x / 2, size.y / 2])
rotate(180)
fillet(1);
translate([-size.x / 2, -size.y / 2])
fillet(1);
}
if(holeRadius) if(holeRadius)
translate([holeOffset, 0]) translate([holeOffset, 0])
circle(holeRadius); circle(holeRadius);
} }
linear_extrude(tabSizeZ)
difference() {
square([size.x, tabSizeY2], center = true);
if(holeRadius)
translate([holeOffset, 0])
circle(holeRadius);
}
thread_d = 2 * holeRadius; thread_d = 2 * holeRadius;
if(show_threads) if(show_threads)
translate([holeOffset, 0]) translate([holeOffset, 0, -h])
female_metric_thread(thread_d, metric_coarse_pitch(thread_d), size.z, center = false); female_metric_thread(thread_d, metric_coarse_pitch(thread_d), size.z, center = false);
// add the side tabs // add the side tabs
for(m = [0, 1]) for(m = [0, 1])
mirror([0, m, 0]) mirror([0, m, 0])
translate([0, tabSizeY2 / 2, size.z - tabSizeZ]) { translate([0, tabSizeY2 / 2, 0]) {
cubeZ = 1; cubeZ = 1;
translate([-size.z / 2, 0, 0]) translate([-size.x / 2, 0, 0])
cube([size.x, (tabSizeY1 - tabSizeY2) / 2, cubeZ]); cube([size.x, (tabSizeY1 - tabSizeY2) / 2, cubeZ]);
translate_z(cubeZ) translate_z(cubeZ)
rotate([0, -90, 0]) rotate([0, -90, 0])