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:
@@ -159,7 +159,9 @@ 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;
|
||||||
|
translate_z(-h)
|
||||||
|
linear_extrude(h)
|
||||||
difference() {
|
difference() {
|
||||||
square([size.x, size.y], center = true);
|
square([size.x, size.y], center = true);
|
||||||
if(hammerNut) {
|
if(hammerNut) {
|
||||||
@@ -173,7 +175,6 @@ module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, hol
|
|||||||
translate([holeOffset, 0])
|
translate([holeOffset, 0])
|
||||||
circle(holeRadius);
|
circle(holeRadius);
|
||||||
}
|
}
|
||||||
translate_z(size.z - tabSizeZ)
|
|
||||||
linear_extrude(tabSizeZ)
|
linear_extrude(tabSizeZ)
|
||||||
difference() {
|
difference() {
|
||||||
square([size.x, tabSizeY2], center = true);
|
square([size.x, tabSizeY2], center = true);
|
||||||
@@ -184,15 +185,15 @@ module extrusionSlidingNut(size, tabSizeY1, tabSizeY2, tabSizeZ, holeRadius, hol
|
|||||||
|
|
||||||
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])
|
||||||
|
Reference in New Issue
Block a user