Refactored nut capture assembly into it's own module file.

This commit is contained in:
Revar Desmera
2014-09-03 13:54:26 -07:00
parent c6fe9167de
commit a0db9be5e6
6 changed files with 168 additions and 87 deletions

View File

@@ -1,52 +0,0 @@
include <config.scad>
use <GDMUtils.scad>
module capture_nut_cap()
{
nut_rad = lifter_nut_size/cos(30)/2;
color("DeepSkyBlue") union() {
// cap
translate([0, 0, 2/2])
cube(size=[lifter_nut_size+6, lifter_nut_thick+6, 2], center=true);
difference() {
// Plug
translate([0, 0, -lifter_nut_size/3/2])
cube(size=[lifter_nut_size+0.75, lifter_nut_thick, lifter_nut_size/3], center=true);
// Remove nut area.
translate([0, 0, roller_base+roller_thick/2-lifter_nut_size-roller_thick]) {
zrot(90) yrot(90) {
cylinder(h=lifter_nut_thick+2, r=nut_rad+0.5, center=true, $fn=6);
}
}
}
// Snap ridges
grid_of(xa=[-(lifter_nut_size+0.75)/2, (lifter_nut_size+0.75)/2]) {
translate([0, 0, -3])
scale([0.5, 1, 1]) yrot(45) cube(size=[1, 5, 1], center=true);
}
}
}
module capture_nut_cap_part() { // make me
grid_of(ya=[-15, 15]) {
translate([0, 0, 2])
yrot(180) capture_nut_cap();
}
}
capture_nut_cap_part();
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap

View File

@@ -28,6 +28,7 @@ lifter_rod_diam = 9.5; // mm
lifter_rod_length = 300.0; // mm
lifter_nut_size = 17.4; // mm
lifter_nut_thick = 9.3; // mm
lifter_thread_size = 3.175; // mm lift per revolution

96
nut_capture.scad Normal file
View File

@@ -0,0 +1,96 @@
use <GDMUtils.scad>
module nut_capture(nut_size=17.4, nut_thick=9.5, offset=18, slop=0.25, wall=3)
{
nut_rad = nut_size/cos(30)/2;
base = (offset - nut_rad);
h = nut_rad*2 + base;
w = nut_thick + wall*2;
l = nut_size + wall*2;
difference() {
// Outer shell.
translate([0, 0, h/2])
cube(size=[l, w, h], center=true);
translate([0, 0, base+nut_rad]) {
// Nut slot.
hull() {
grid_of(za=[0, h]) {
zrot(90) yrot(90) {
cylinder(h=nut_thick+slop*2, r=nut_rad+slop, center=true, $fn=6);
}
}
}
// Rod access.
hull() {
grid_of(za=[0, h]) {
zrot(90) yrot(90) {
cylinder(h=w+1, r=nut_size/2-1, center=true, $fn=24);
}
}
}
}
// Snap hole.
translate([0, 0, h-3])
cube(size=[l+1, nut_thick/2, 1.5], center=true);
}
}
//!nut_capture(nut_size=17.4, nut_thick=9.5);
module nut_capture_cap(nut_size=17.4, nut_thick=9.5, wall=3, cap_thick=2)
{
nut_rad = nut_size/cos(30)/2;
h = nut_rad/2;
l = nut_size + wall*2;
w = nut_thick + wall*2;
color("DeepSkyBlue") union() {
// cap
translate([0, 0, cap_thick/2])
cube(size=[l, w, cap_thick], center=true);
difference() {
// Plug
union() {
translate([0, 0, -h/2])
cube(size=[nut_size, nut_thick, h], center=true);
translate([0, 0, -h/2])
cube(size=[nut_size-2, w, h], center=true);
}
// Remove nut area.
translate([0, 0, -nut_rad]) {
zrot(90) yrot(90) {
cylinder(h=nut_thick+1, r=nut_rad, center=true, $fn=6);
}
}
// Remove Rod access.
translate([0, 0, -nut_rad]) {
zrot(90) yrot(90) {
cylinder(h=w+1, r=nut_size/2-1, center=true, $fn=24);
}
}
}
// Snap ridges
grid_of(
xa=[-nut_size/2, nut_size/2],
za=[-3]
) {
scale([1.0, nut_thick/2, 2.0])
yrot(45) cube(size=1/sqrt(2), center=true);
}
}
}
!nut_capture_cap(nut_size=17.4, nut_thick=9.5);
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap

26
test_part.scad Normal file
View File

@@ -0,0 +1,26 @@
include <config.scad>
use <GDMUtils.scad>
use <z_nut_cap_part.scad>
use <nut_capture.scad>
module test_part() { // make me
translate([-15, 0, 0])
zrot(90)
nut_capture(
nut_size=lifter_nut_size,
nut_thick=lifter_nut_thick,
offset=roller_base+roller_thick/2
);
translate([ 15, 0, 2]) yrot(180) zrot(90) z_nut_cap();
}
test_part();
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap

35
z_nut_cap_part.scad Normal file
View File

@@ -0,0 +1,35 @@
include <config.scad>
use <GDMUtils.scad>
use <nut_capture.scad>
module z_nut_cap()
{
color("DeepSkyBlue") {
nut_capture_cap(
nut_size=lifter_nut_size,
nut_thick=lifter_nut_thick,
wall=3,
cap_thick=2
);
}
}
module z_nut_cap_part() { // make me
grid_of(ya=[-15, 15]) {
translate([0, 0, 2])
yrot(180) z_nut_cap();
}
}
z_nut_cap_part();
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap

View File

@@ -1,13 +1,14 @@
include <config.scad>
use <GDMUtils.scad>
use <slider_sled.scad>
use <nut_capture.scad>
module z_sled()
{
nut_size=lifter_nut_size;
nut_thick=lifter_nut_thick;
// Quantize nut housing spacing to the thread lift size.
nut_spacing = floor((platform_length-20)/lifter_thread_size) * lifter_thread_size;
color("DeepSkyBlue") union() {
// Base slider sled.
@@ -18,39 +19,13 @@ module z_sled()
cube(size=[14,platform_length,platform_thick], center=true);
}
// Drive nut capture.
grid_of(ya=[-roller_spacing/2, roller_spacing/2]) {
difference() {
// Outer shell.
translate([0, 0, (nut_size+roller_base)/2])
cube(size=[nut_size+6, nut_thick+6, nut_size+roller_base], center=true);
// Nut slot.
translate([0, 0, roller_base+roller_thick/2]) {
hull() {
grid_of(za=[0, 20]) {
zrot(90) yrot(90) {
cylinder(h=nut_thick+1, r=(0.5+nut_size/2)/cos(30), center=true, $fn=6);
}
}
}
}
// Rod access.
translate([0, 0, roller_base+roller_thick/2]) {
hull() {
grid_of(za=[0, 20]) {
zrot(90) yrot(90) {
cylinder(h=nut_thick*3, r=(nut_size/2-2)/cos(30), center=true, $fn=24);
}
}
}
}
// snap hole.
translate([0, 0, nut_size+roller_thick-3])
cube(size=[nut_size+10, 5, 1.5], center=true);
}
// Drive nut capture
grid_of(ya=[-nut_spacing/2, nut_spacing/2]) {
nut_capture(
nut_size=lifter_nut_size,
nut_thick=lifter_nut_thick,
offset=roller_base+roller_thick/2
);
}
}
}