Add readme.md

This commit is contained in:
Matt 2016-01-11 16:39:27 -05:00
parent f67aa6ba6a
commit 53b0d8a600
3 changed files with 968 additions and 90 deletions

55
Readme.md Normal file
View File

@ -0,0 +1,55 @@
# INTVAL 2.0
##### Intervalometer for Bolex 16mm Cameras
----
1. Overview
2. Attachment
3. Usage
4. Power
5. Assembly
6. Maintainance
----
### 1) Overview
The INTVAL 2.0 is an open-source/hardware intervalometer for Bolex
16mm cameras. It enables you to expose single frames of film
at a regulated interval. Utilizing the 1:1 shaft in Bolex cameras (Rex
3 and later models) the INTVAL 2.0 can complete a full rotation of the shutter
in either 1 or 2 seconds. This allows for a range of long exposure options when
used in conjuncture with the Rexofader.
----
### 2) Attachment
To attach the INTVAL 2.0 to a Bolex camera, disable the motor and line up the four standoffs
with the mounting holes on the body of the camera and insert the key into the 1:1 shaft.
This can be done by laying the camera on its side--with the mounting holes facing up--and placing the INTVAL 2.0 on top of the body and making sure the key fits into the slotted 1:1 opening.
If you have never attached anything to the mounts before, you may have to
remove small screws that are in the holes. This opens up the mounting holes for
the screws that will hold the intervalometer in place. There are four standoffs
and screws, but only three need to be attached to maintain the hold required for operation.
----
### 3) Usage
The INTVAL 2.0 has two physical interfaces: the buttons on the case and the shutter
release cable. The shutter release cable plugs into the underside of the case, next
to the DC adapter, and triggers the camera. A single, short press will trigger a ``single
frame``. Holding down the shutter release for more than 1 second will start a ``continuous sequence``
of frames. Hitting the shutter release during a running sequence will stop the camera.
The buttons on the case control three variables: direction, speed and delay. The camera
direction can be set to ``forward`` (default) with a quick press, and set to ``backwards`` by holding the
button for more than 1 second. Similarly, the speed can be set to ``1 second rotation`` (default) with a
quick press and set to ``2 second rotation`` by holding the button for more than 1 second. Delay refers
to the time the intervalometer pauses between frames and only matters when running a sequence. The delay is
set to ``42 ms`` by default and will be set to however long you hold it down for; holding the button for``10 seconds`` will set the delay between each frame to ``10 seconds``. Pressing the button quickly will reset
the timer to the default ``42 ms``.
----
### 4) Power
Power the INTVAL 2.0 with 12VDC to the 2.1mm DC power jack located on the bottom of the case.
The maximum draw of the motor is under 1 Amp, so that much current should be ample to run the
intervalometer. Portable batteries, such as those used as supplimental cellphone power supplies,
can be used to as mobile power sources, they just must be able to provide 12V and not the typical (ex. http://www.anker.com/product/79AN7906-BA).

View File

@ -1,8 +1,9 @@
include <../readyCAD/ready.scad>
mm_x = [54.5 + 6, -30 + 54.5, 6, 45.5, 18, 55, 55];
mm_y = [-30 + 12, 7 + 12, -27.5, -27.5, 7, 40, 40];
include <./ready.scad>
mm_x = [61.5, 21.5, 6, 45.5, 18, 39];
mm_y = [-18, 21, -27.5, -27.5, 7, 39];
mm_r = [110, -15, 0, 0, 0, -70];
mm_l = [13, 9, 0, 0, 0, 8];
//xArray = [-3, 57, 55, 10, -26]; //WITH MIDDLE PIN
//yArray = [38, 31, -56, -22, -33]; //WITH MIDDLE PIN
xArray = [-3, 57, 55, -26]; //NO MIDDLE PIN
@ -20,7 +21,9 @@ panel_2_y = 110;
one_to_one_x = 54.5;
one_to_one_y = 12;
bolt_inner = 2.7;
bolt_inner = 2.55;
screw_distance = 31;
module intval_panel () {
difference () {
@ -28,10 +31,10 @@ module intval_panel () {
difference () {
translate ([0, 0, 8.5]) {
union () {
translate([22, -5, 0]) rotate([0, 0, -13]) rounded_cube([panel_2_x, panel_2_y, 2], d = 20, c = true);
translate([22, -5, 0]) rotate([0, 0, -13]) rounded_cube([panel_2_x, panel_2_y, 2], d = 20, center = true);
//reinforces
translate([54, -12, -3]) rotate([0, 0, 89]) rounded_cube([110, 20, 4], 20, c = true);
translate([-17, 2, -3]) rotate([0, 0, 72]) rounded_cube([94, 13, 4], 13, c = true);
translate([54, -12, -3]) rotate([0, 0, 89]) rounded_cube([110, 20, 4], 20, center = true);
translate([-17, 2, -3]) rotate([0, 0, 72]) rounded_cube([94, 13, 4], 13, center = true);
}
}
for (i = [0 : len(xArray) - 1]) {
@ -48,17 +51,9 @@ module intval_panel () {
}
onetoone(9, 14, 8.5);
bearing(54.5, 12, 6, width= 18, hole=false);
frame_counter_access();
//frame_counter_access(); //use the space
m_p_access();
//remove center
difference () {
//translate([19, -5, 0]) cube([60, 60, 60], center=true);
//translate([49, 0, 0]) rotate([0, 0, -165]) cube([30, 90, 60], center=true);
}
//remove front
remove_front();
//opto
//opto_mount_holes(42, 29.5, 20, 5.4);
translate([6, 18, 0]) rotate([0, 0, -13]) cube([15, 25, 40], center=true); //motor wind key hole
for (i = [0 : len(mm_x) - 1]) {
@ -66,6 +61,288 @@ module intval_panel () {
}
}
}
module l289N_holes (r = 3/2 - .2) {
$fn = 60;
DISTANCE = 36.5;
H = 50;
translate([0, 0, 0]) cylinder(r = r, h = H * 5, center = true);
translate([DISTANCE, 0, 0]) cylinder(r = r, h = H * 5, center = true);
translate([DISTANCE, DISTANCE, 0]) cylinder(r = r, h = H * 5, center = true);
translate([0, DISTANCE, 0]) cylinder(r = r, h = H * 5, center = true);
}
module l289N_hole_test () {
$fn = 40;
difference () {
cube([140, 40, 3], center = true);
cylinder(r = 3/2, h = 50, center = true);
translate([7, 0, 0]) cylinder(r = 3/2, h = 50, center = true);
translate([7 * 2, 0, 0]) cylinder(r = 3/2 - .1, h = 50, center = true);
translate([7 * 3, 0, 0]) cylinder(r = 3/2 - .2, h = 50, center = true);
translate([7 * 4, 0, 0]) cylinder(r = 3/2 - .3, h = 50, center = true);
}
}
module intval_panel_laser () {
$fn = 40;
difference () {
union () {
difference () {
translate ([0, 0, 8.5]) {
union () {
translate([12, -5, 0]) {
rotate([0, 0, -13]) {
rounded_cube([panel_2_x + 20, panel_2_y, 25.4/8], d = 20, center = true);
}
}
//reinforces
//translate([54, -12, -3]) rotate([0, 0, 89]) rounded_cube([110, 20, 4], 20, center = true);
//translate([-17, 2, -3]) rotate([0, 0, 72]) rounded_cube([94, 13, 4], 13, center = true);
}
}
for (i = [0 : len(xArray) - 1]) {
bolex_pin_inner_laser(xArray[i], yArray[i]);
}
}
//onetoone(26, 10, 4.5);
//extends for onetoone
}
//onetoone(9, 14, 8.5);
bearing_laser(54.5, 12, 6, width= 18, hole=false);
translate([-38, -1, 0]) rotate([0, 0, -13]) l289N_holes();
//translate ([6, -9, height + 3.5]) cylinder(r = bolt_inner, h = 50, center = true); //cover standoff hole
//frame_counter_access(); //use the space
m_p_access();
remove_front();
translate([6, 18, 0]) rotate([0, 0, -13]) cube([15, 25, 40], center=true); //motor wind key hole
for (i = [0 : len(mm_x) - 1]) {
translate([mm_x[i], mm_y[i], 0]) cylinder(r = bolt_inner, h = 100, center = true);
}
intval_laser_panel_cover();
}
}
module intval_panel_laser_debug () {
$fn = 40;
difference () {
union () {
difference () {
translate ([0, 0, 8.5]) {
union () {
translate([12 - 32.5, -5 + 9, 0]) {
rotate([0, 0, -13]) {
rounded_cube([panel_2_x + 20 + 65, panel_2_y, 25.4/8], d = 20, center = true);
}
}
//reinforces
//translate([54, -12, -3]) rotate([0, 0, 89]) rounded_cube([110, 20, 4], 20, center = true);
//translate([-17, 2, -3]) rotate([0, 0, 72]) rounded_cube([94, 13, 4], 13, center = true);
}
}
for (i = [0 : len(xArray) - 1]) {
bolex_pin_inner_laser(xArray[i], yArray[i]);
}
}
//onetoone(26, 10, 4.5);
//extends for onetoone
}
//onetoone(9, 14, 8.5);
bearing_laser(54.5, 12, 6, width= 18, hole=false);
translate([-38, -1, 0]) rotate([0, 0, -13]) l289N_holes();
//translate ([6, -9, height + 3.5]) cylinder(r = bolt_inner, h = 50, center = true); //cover standoff hole
//frame_counter_access(); //use the space
m_p_access();
remove_front();
translate([6, 18, 0]) rotate([0, 0, -13]) cube([15, 25, 40], center=true); //motor wind key hole
for (i = [0 : len(mm_x) - 1]) {
translate([mm_x[i], mm_y[i], 0]) cylinder(r = bolt_inner, h = 100, center = true);
}
intval_laser_panel_cover(DEBUG = true);
translate ([4, 12, 0]) {
translate([-51.5, -8.5, 0]) cylinder(r = 2.8/2, h = 100, center = true);
translate([-51.5 - 66, -8.5 + 15, 0]) cylinder(r = 2.8/2, h = 100, center = true);
translate([-51.5 + 11.5, -8 + 49, 0]) cylinder(r = 2.8/2, h = 100, center = true);
translate([-51.5 - 54.5, -8.5 + 49 + 16, 0]) cylinder(r = 2.8/2, h = 100, center = true);
}
}
}
module bolex_pin_laser (x, y) {
in = innerD;
translate ([x, y, 1]) {
difference () {
union () {
translate([0, 0, (height / 2) - 3]) cylinder(r = (outerD + 4) / 2, h = 2, center = true);
translate([0, 0, -1]) cylinder(r = outerD / 2, h = height - 2, center = true);
}
cylinder(r = in / 2, h = height, center = true);
translate([0, 0, (height / 2) - 1]) cylinder(r1 =4.5 / 2, r2 = 6.5 / 2, h = 2, center = true);
}
}
}
module intval_laser_standoffs () {
$fn = 40;
for (i = [0 : len(xArray) - 1]) {
bolex_pin_laser(xArray[i], yArray[i]);
}
}
module intval_laser_standoffs_plate () {
$fn = 40;
bolex_pin_laser(0, 0);
bolex_pin_laser(15, 0);
bolex_pin_laser(0, 15);
bolex_pin_laser(15, 15);
//decoys
translate([7, 7, 0]) decoys(23, 5.5, 6);
}
module bolex_pin_inner_laser (x, y) {
$fn = 40;
translate ([x, y, 1]) {
cylinder(r = innerD / 2, h = height * 2, center = true);
//translate([0, 0, (height / 2) - 1]) cylinder(r1 =4.5 / 2, r2 = 6.5 / 2, h = 2, center = true);
}
}
module bearing_laser (x, y, z, width= 8, hole = true) {
innerD = 8.05;
outerD = 22.1 - .4;
fuzz = 0.1;
translate ([x, y, z]) {
difference () {
cylinder(r = outerD / 2 + fuzz, h = width, center = true);
if (hole) {
cylinder(r = innerD / 2 - fuzz, h = width, center = true);
}
}
}
}
module intval_laser_panel_cover (LASER = false, DEBUG = false, ALL_RED = false) {
$fn = 60;
cover_h = 16 + 3 + 4;
MATERIAL = 25.4 / 8;
module top () {
difference () {
rotate([0, 0, -13]) {
rounded_cube([100, panel_2_y, MATERIAL], d = 20, center = true);
}
translate([53, 12, 0]) cylinder(r = 30, h = 60, center = true); //hole for motor mount
translate([22, 20, 0]) cylinder(r = 8, h = 60, center = true); // hole for moto mount bolt holder
translate([53, 42, 0]) cylinder(r = 15, h = 60, center = true); //removes pointy part
translate([-44, 8, -(cover_h / 2 ) - MATERIAL - 1]) rotate([0, 0, -13]) rotate([0, 90, 0]) back_side();
translate([2, 49, -(cover_h / 2 ) - MATERIAL - 1]) rotate([0, 0, -13]) rotate([90, 0, 0]) top_side();
translate([-22, -45, -(cover_h / 2 ) - MATERIAL - 1]) rotate([0, 0, -13]) rotate([90, 0, 0]) bottom_side();
for (i = [0 : len(xArray) - 1]) {
translate([xArray[i], yArray[i], 0]) cylinder(r = 7 / 2, h = height * 20, center = true); //Access for screwdriver
}
translate([-13.5, 26, 0]) rotate([0, 0, -13]) cube([28, 24, 60], center = true); //heatsink hole
translate ([8, -9, height + 3.5]) cylinder(r = bolt_inner - .5, h = 50, center = true); //standoff hole
//buttons
translate ([-44, -23, 0]) {
rotate ([0, 0, 90-13]) {
if (ALL_RED) {
translate([7, -32, 8]) cylinder(r = 3.5, h = 190, center = true);
translate([7, -19, 8]) cylinder(r = 3.5, h = 190, center = true);
} else {
translate([7, -32, 8]) cylinder(r = 3.1, h = 190, center = true);
translate([7, -19, 8]) cylinder(r = 3.1, h = 190, center = true);
}
translate([7, -5, 8]) cylinder(r = 3.5, h = 190, center = true);
}
}
}
}
module back_side () {
difference () {
translate([0, 1.75, 0]) cube([cover_h + 2 + (MATERIAL * 2) + 1 + 3, panel_2_y - 10, MATERIAL], center = true);
translate([-13 - 3.1, 20, 0]) cube([MATERIAL, 20, MATERIAL], center = true);
translate([-13 - 3.1, -20, 0]) cube([MATERIAL, 20, MATERIAL], center = true);
translate([13 + 3.1, 20, 0]) cube([MATERIAL, 20, MATERIAL], center = true);
translate([13 + 3.1, -20, 0]) cube([MATERIAL, 20, MATERIAL], center = true);
translate([10 , -22 ,0]) cube([10, 15, 30], center = true); //access for usb
translate([0, 50.5, 0]) cube([17.5, MATERIAL, MATERIAL], center = true);
translate([0, -50.5 + (1.75 / 2) + MATERIAL - 0.25, 0]) cube([17.5, MATERIAL, MATERIAL], center = true);
}
}
module top_side () {
difference () {
translate([-2.5, 0, 0]) cube([ panel_2_x - 41, cover_h + 2 + (MATERIAL * 2) + 1 + 3, MATERIAL], center = true);
translate([28, -13 - 3.1, 0]) cube([25, MATERIAL, MATERIAL], center = true);
translate([-28, -13 - 3.1, 0]) cube([25, MATERIAL, MATERIAL], center = true);
translate([28, 13 + 3.1, 0]) cube([25, MATERIAL, MATERIAL], center = true);
translate([-28, 13 + 3.1, 0]) cube([25, MATERIAL, MATERIAL], center = true);
translate([-35.5, -13 - 8.1, 0]) cube([MATERIAL, 25, MATERIAL], center = true); //side tabs
translate([-35.5, 13 + 8.1, 0]) cube([MATERIAL, 25, MATERIAL], center = true); //side tabs
}
}
module bottom_side () {
difference () {
translate([.25, 0, 0]) cube([ panel_2_x - 39.5, cover_h + 2 + (MATERIAL * 2) + 1 + 3, MATERIAL], center = true);
translate([25, -13 - 3.1, 0]) cube([25, MATERIAL, MATERIAL], center = true);
translate([-25, -13 - 3.1, 0]) cube([25, MATERIAL, MATERIAL], center = true);
translate([30, 13 + 3.1, 0]) cube([25, MATERIAL, MATERIAL], center = true);
translate([-30, 13 + 3.1, 0]) cube([25, MATERIAL, MATERIAL], center = true);
translate([-15, 1, 0]) cylinder(r = 6/2, h = 50, center = true); //hole for audio jack -> add countersink
translate([9, 1, 0]) cylinder(r = 8/2, h = 20, center = true); //hole for female DC power jack, 12vdc
translate([-33.5, 17.3, 0]) cube([MATERIAL, 17.5, MATERIAL], center = true);
translate([-33.5, -17.3, 0]) cube([MATERIAL, 17.5, MATERIAL], center = true);
}
}
if (LASER) {
projection() top();
if (!DEBUG) {
translate([-75, 0, 0]) rotate([0, 0, -13]) projection() back_side();
}
translate([0, 80, 0]) rotate([0, 0, -13]) projection() top_side();
translate([0, -80, 0]) rotate([0, 0, -13]) projection() bottom_side();
} else {
translate([0, 0, height + cover_h]) top();
if (!DEBUG) {
translate([-44, 8, height + (cover_h / 2 ) - 4.25]) rotate([0, 0, -13]) rotate([0, 90, 0]) back_side();
}
translate([2, 49, height + (cover_h / 2 ) - 4.25]) rotate([0, 0, -13]) rotate([90, 0, 0]) top_side();
translate([-22, -45, height + (cover_h / 2 ) - 4.25]) rotate([0, 0, -13]) rotate([90, 0, 0]) bottom_side();
}
}
module intval_laser_panel_cover_standoff (DECOYS = false) {
tight = 0.2;
cover_h = 21;
$fn = 40;
translate ([6, -9, height + 3.5]) {
difference() {
cylinder(r = bolt_inner + 1.4, h = cover_h - .5, center = true);
cylinder(r = bolt_inner - tight, h = cover_h, center = true);
}
if (DECOYS) {
decoys(12, -(cover_h / 2) + 2);
}
}
}
module remove_front () {
translate([87, 0, 4]) rotate([0, 0, 89]) cube([170, 40, 40], center = true);
@ -105,12 +382,13 @@ module intval_pins () {
}
}
module key () {
tighten = 0.25;
difference () {
cylinder(r = 6.7 / 2, h = 5, center = true, $fn = 15);
cylinder(r = 4.76 / 2, h = 5, center = true, $fn = 15);
cylinder(r = 6.7 / 2, h = 5, center = true);
cylinder(r = (4.76 -+ tighten) / 2, h = 5, center = true);
}
translate ([0, 0, -7.5]) {
cylinder(r = 6.7 / 2, h = 10, center = true, $fn = 15);
cylinder(r = 6.7 / 2, h = 10, center = true);
}
}
module keyHole () {
@ -152,41 +430,64 @@ module frame_counter_access () {
cylinder(r = 6.2, h = 4, center = true);
}
}
module bearing (x, y, z, width= 8, hole = true) {
module bearing (x, y, z, width= 8, hole = true, calval = 0) {
innerD = 8.05;
outerD = 22.1;
fuzz = 0.1;
translate ([x, y, z]) {
difference () {
cylinder(r = outerD / 2 + fuzz, h = width, center = true);
cylinder(r = outerD / 2 + fuzz + calval, h = width, center = true);
if (hole) {
cylinder(r = innerD / 2 - fuzz, h = width, center = true);
}
}
}
}
module motor_key (half = false) {
innerD = 7.85;
module motor_key (half = false, DECOYS = false, sides = 1) {
innerD = 7.85;
outer_d = 27.5 + 2;
notch_d = 10;
height = 7 + 5;
diff = 14 + 2.5;
$fn = 60;
difference () {
union () {
translate([one_to_one_x, one_to_one_y, 12.1]) cylinder(r = 12 / 2, h = 5, center = true);// padding against bearing
translate([one_to_one_x, one_to_one_y, diff]) cylinder(r=outer_d/2, h= height, center= true); //large cylinder
translate([one_to_one_x, one_to_one_y, 6]) cylinder(r=innerD/2, h= 10, center= true , $fn= 10);
key_end([0, 180, 0], [one_to_one_x, one_to_one_y, -2.5]); //thicker-than-key_end cylinder for inner bearing
translate([one_to_one_x, one_to_one_y, diff + 1]) cylinder(r=outer_d/2, h= height -2, center= true, $fn=200); //large cylinder
translate([one_to_one_x, one_to_one_y, 6]) cylinder(r=innerD/2, h= 10, center= true);
//key_end([0, 180, 0], [one_to_one_x, one_to_one_y, -2.5]); //thicker-than-key_end cylinder for inner bearing
key_end([0, 180, -20], [one_to_one_x, one_to_one_y, -3.5]); // longer for laser cut board
//key_end([0, 180, 0], [one_to_one_x, one_to_one_y, -4.5]); //experimental length
}
//1 notch
translate([one_to_one_x, one_to_one_y, diff]) {
translate ([-outer_d/2 - 2.5, 0, 0]) cylinder(r=notch_d/2, h= height, center= true, $fn=30); //notch
translate ([-outer_d/2 - 2.5, 0, 0]) cylinder(r=notch_d/2, h= height, center= true); //notch
}
translate([one_to_one_x, one_to_one_y, diff]) {
translate ([-outer_d/2 -.5, -3.5, 0]) rotate([0, 0, 100]) cube([15, 5, height], center = true); // smooth notch
translate ([-outer_d/2 -.5, 3.5, 0]) rotate([0, 0, -100]) cube([15, 5, height], center = true); // smooth notch
}
if (sides == 2) {
//2 notch
translate([one_to_one_x, one_to_one_y, diff]) {
translate ([outer_d/2 + 2.5, 0, 0]) cylinder(r=notch_d/2, h= height, center= true); //notch
}
translate([one_to_one_x, one_to_one_y, diff]) {
translate ([outer_d/2 +.5, -3.5, 0]) rotate([0, 0, -100]) cube([15, 5, height], center = true); // smooth notch
translate ([outer_d/2 +.5, 3.5, 0]) rotate([0, 0, 100]) cube([15, 5, height], center = true); // smooth notch
}
}
//slot for hobbled(?) end
translate([one_to_one_x, one_to_one_y, 20.5]) cylinder(r = 11.5/2, h = 10, center = true);
translate([one_to_one_x, one_to_one_y, 18]) {
difference () {
translate([0, 0, 0]) cylinder(r=3.1, h = 11, center = true, $fn = 24);
translate([5.4, 0, 0]) cube([6, 6, 11], center = true);
}
}
//translate([one_to_one_x, one_to_one_y, 20.5]) cylinder(r = 11.5/2, h = 10, center = true);
translate([one_to_one_x, one_to_one_y, 17.5]) {
difference() {
//cylinder(r = 7.5/2, h = 2, center = true);
@ -197,6 +498,10 @@ module motor_key (half = false) {
translate([one_to_one_x - 50 , one_to_one_y, -50]) cube([100, 100, 200]);
}
}
if (DECOYS) {
translate([one_to_one_x, one_to_one_y, 20.5]) decoys(24);
}
}
module motor_12v () {
motor_d = 37;
@ -220,76 +525,101 @@ module motor_mount () {
}
cylinder(r=hole_d/2, h=29, center = true); //center hole
//screw mounts
translate([0, 12.5, 0]) cylinder(r=screw_d/2, h=29, center = true);
translate([0, 12.5, 0]) cylinder(r=screw_d/2, h=29, center = true);
translate([0, -12.5, 0]) cylinder(r=screw_d/2, h=29, center = true);
//translate([10.5, 0, 0]) cylinder(r=screw_d/2, h=29, center = true);
//translate([0, 0, -10]) cube([100, 100, 100]);
//translate([10.5, 0, 0]) cylinder(r=screw_d/2, h=29, center = true);
//translate([0, 0, -10]) cube([100, 100, 100]);
}
//wings
//translate([-18, 0, 0]) cube([6, 4, 4], center= true);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[0], mm_y[0], 0], 100, height, 9);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[1], mm_y[1], 0], -10, height, 11);
}
module geared_motor_mount () {
module geared_motor (ROT_1 = 0, ROT_2 = 0) {
BODY_D = 37;
BODY_H = 42;
BASE_D = 12;
BASE_H = 6;
ROD_D = 6;
ROD_H = 15.5;
rotate([0, 0, ROT_1]) {
cylinder(r = BODY_D/2, h = BODY_H, center = true);
translate([0, BASE_D/2, -(BODY_H/2) - (BASE_H/2)]) {
cylinder(r = BASE_D/2, h = BASE_H, center = true);
}
translate([0, BASE_D/2, -(BODY_H/2) - (BASE_H/2) - (ROD_H/2)]) {
rotate([0, 0, ROT_2]) {
difference () {
cylinder(r = ROD_D/2, h = ROD_H, center = true);
translate([0, 5, -2]) cube([ROD_D, ROD_D, 12], center = true);
}
}
}
}
}
module geared_motor_mount (DECOYS = false) {
$fn = 60;
base_d = 45;
base_inner = 39;
base_inner = 38;
base_thickness = 3;
hole_d = 12.5;
screw_d = 4;
screw_distance = 31;
height = 6;
difference () {
difference () {
translate([0, 0, 2.5])cylinder(r=base_d/2, h=height + 5, center = true);
translate([0, 0, base_thickness + 2.5]) cylinder(r=base_inner/2, h=height + 5, center = true);
translate([-6, 0, 2.5]) cylinder(r=base_d/2, h=height + 5, center = true); //outer cylinder
translate([-6, 0, base_thickness + 2.5]) cylinder(r=base_inner/2, h=height + 5, center = true); //inder cylinder
}
cylinder(r=hole_d/2, h=29, center = true); //center hole
//screw holes
translate([0, screw_distance/2, 0]) cylinder(r=screw_d/2, h=29, center = true);
translate([0, -screw_distance/2, 0]) cylinder(r=screw_d/2, h=29, center = true);
//translate([10.5, 0, 0]) cylinder(r=screw_d/2, h=29, center = true);
//translate([0, 0, -10]) cube([100, 100, 100]);
}
translate([-6.5, 0, 0]) {
translate([0, screw_distance/2, 0]) cylinder(r=screw_d/2, h=29, center = true);
translate([0, -screw_distance/2, 0]) cylinder(r=screw_d/2, h=29, center = true);
}
translate([2, 19, 0]) cylinder(r=5, h = 100, center = true); //hole for panel bolt access
}
//wings
//translate([-18, 0, 0]) cube([6, 4, 4], center= true);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[0], mm_y[0], 0], 100, height, 9);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[1], mm_y[1], 0], -10, height, 11);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[0], mm_y[0], 0], mm_r[0], height, mm_l[0]);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[1], mm_y[1], 0], mm_r[1], height, mm_l[1]);
//translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[5] , mm_y[5], 0], mm_r[5], height, mm_l[5] - 1);
if (DECOYS) {
translate([-7, -6, 0]) decoys(40, -1, 4);
translate([-9, -2, 0]) rotate([0, 0, 49]) decoys(37, -1, 4);
}
}
module motor_mount_bottom () {
mount_d = 45.5;
base_d = 45.5;
module motor_mount_bottom (DECOYS = false) {
$fn = 60;
mount_d = 45;
base_d = 45;
outer_d = 28 + 2.3 + 4;
height = 19 + 3.5 + 4;
bolt_h = 22.3;
shelf_h = 6; //match to motor_mount
screw_d = 4;
module motor_mount_core () {
translate ([one_to_one_x, one_to_one_y, (height / 2 ) + 5.75]) {
difference() {
cylinder(r = mount_d / 2, h = height, center = true); //main block
translate([0, 0, (height / 2) - (shelf_h / 2)]) cylinder(r = base_d / 2, h = shelf_h, center = true); //shelf for motor_mount
translate([-6, 0, 0]) cylinder(r = mount_d / 2, h = height, center = true); //main block
translate([0, 0, (height / 2) - (shelf_h / 2)]) cylinder(r = base_d / 2 + 7, h = shelf_h, center = true); //shelf for motor_mount
cylinder(r = outer_d / 2, h = 50, center = true); //space for spinning
translate ([-one_to_one_x, -one_to_one_y, 0]) remove_front(); //flatten side
translate ([-one_to_one_x, -one_to_one_y, 0]) remove_front(); //flatten side
translate([-32, -17, -19]) cube([40, 40, 40], center= true); //hole for notch
translate([-42, 0, -19]) rotate([0, 0, -39]) cube([40, 40, 40], center= true); //hole for notch
translate([2.5, 19.5, 0]) cylinder(r=9/2, h = 60, center=true); // hole for panel bolt
//wings negative
//translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[0], mm_y[0], (height / 2) - (shelf_h / 2)], 100, shelf_h, 10, false);
//translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[1], mm_y[1], (height / 2) - (shelf_h / 2)], -42, shelf_h, 10, false);
translate([2.5, 19.5, 0]) cylinder(r=10/2, h = 60, center=true); // hole for panel bolt
translate([22.5, 19.5, 0]) cube([40, 40, 60], center = true); //remove front entirely
translate([-6.5, 0, 7.5]) {
translate([0, screw_distance/2, 0]) sphere(r=screw_d, center = true);
translate([0, -screw_distance/2, 0]) sphere(r=screw_d, center = true);
}
}
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[0], mm_y[0], -shelf_h / 2], 100, height - shelf_h, 9);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[1] , mm_y[1], -shelf_h / 2], -10, height - shelf_h, 11);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[5] , mm_y[5], -shelf_h / 2], -90, height - shelf_h, 11);
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[0], mm_y[0], -shelf_h / 2], mm_r[0], height - shelf_h, mm_l[0], tight = 0.2); //Bottom bolt holder
translate ([-one_to_one_x, -one_to_one_y, 0]) bolt_holder([mm_x[1] , mm_y[1], -shelf_h / 2], mm_r[1], height - shelf_h, mm_l[1], tight = 0.2); //Left bolt holder
translate ([-one_to_one_x, -one_to_one_y, -2]) bolt_holder([mm_x[5] , mm_y[5], -shelf_h / 2], mm_r[5], height - shelf_h - 4, mm_l[5]); //Top bolt holder
}
}
module microswitch_holder () {
difference () {
translate([29, -1, 14]) cube([36, 65, height - shelf_h - 4], center = true);//Base shape
@ -312,22 +642,35 @@ module motor_mount_bottom () {
translate ([58, -25, 15]) {
rotate([0, 0, 75]) cube([45, 30, 30], center= true); //bottom right outer
}
translate([mm_x[4], mm_y[4], 0]) cylinder(r = 6/2, h = 100, center = true); // extra bolt hole
translate([mm_x[4], mm_y[4], 0]) cylinder(r = bolt_inner, h = 100, center = true); // extra bolt hole
translate([mm_x[1], mm_y[1], 0]) cylinder(r = 4, h = 100, center = true); //clear out top left bolt hole
}
}
module top_addition () {
}
module panel_attachment () {
difference () {
union() {
translate([0, 0, 2]) cylinder(r = 7/2, h = height - shelf_h, center = true);
translate([3.5, 0, 0]) cube([7, 7, height - shelf_h - 4], center = true);
}
cylinder(r = 3.2/2, h = height, center = true);
}
}
translate([8, -9, (height - shelf_h) / 2 + 3.75]) panel_attachment();
motor_mount_core();
microswitch_holder();
microswitch_holder();
bolt_holder([mm_x[2], mm_y[2], ((height - shelf_h)/ 2) + 3.75], 0, height - shelf_h - 4, 6); //bottom left mount
bolt_holder([mm_x[3], mm_y[3], ((height - shelf_h)/ 2) + 3.75], 180, height - shelf_h - 4, 6); //bottom right mount
//microswitch([25.5, -14, 15]);
if (DECOYS) {
difference () {
translate([35, 0 , 0]) decoys(44, 8, 6);
}
translate([0, 0, 8]) cube([4, 4, 4], center = true);
translate([40, 55, 8]) cube([4, 4, 4], center = true);
}
}
module bolt_holder (position = [0, 0, 0], rotate_z = 0, h = 17, length = 4.5, hole = true) {
bolt_r = 6;
module bolt_holder (position = [0, 0, 0], rotate_z = 0, h = 17, length = 4.5, hole = true, tight = 0) {
bolt_r = 6;
translate (position) {
difference () {
union() {
@ -335,7 +678,7 @@ module bolt_holder (position = [0, 0, 0], rotate_z = 0, h = 17, length = 4.5, ho
rotate([0, 0, rotate_z]) translate([length/2, 0, 0]) cube([length, bolt_r * 2, h], center=true);
}
if (hole) {
cylinder(r = bolt_inner, h = h + 2, center = true);
cylinder(r = bolt_inner - tight, h = h + 2, center = true);
}
}
}
@ -350,25 +693,31 @@ module microswitch (position = [0, 0, 0], rotation = [0, 0, 0]) {
}
}
}
module l289N_mount() {
DISTANCE = 38;
H = 8;
module l289N_mount () {
$fn = 60;
DISTANCE = 36.5;
H = 4;
THICKNESS = 3;
module stand () {
difference () {
cylinder(r1 = 5, r2 = 4, h = H, center = true);
cylinder(r = 2, h = H, center = true);
cylinder(r1 = 4, r2 = 3, h = H, center = true);
cylinder(r = 1.5, h = H, center = true);
}
}
translate([0, 0, 0]) stand();
translate([DISTANCE, 0, 0]) stand();
translate([DISTANCE, DISTANCE, 0]) stand();
translate([0, DISTANCE, 0]) stand();
translate([DISTANCE/2, DISTANCE/2, -4]) rounded_cube([DISTANCE + 15, DISTANCE + 15, 4], 15, center = true);
difference () {
translate([DISTANCE/2, DISTANCE/2, -3]) rounded_cube([DISTANCE + 8, DISTANCE + 8, THICKNESS], 8, center = true); //base
translate([DISTANCE/2, DISTANCE/2, -3]) rounded_cube([DISTANCE - 5, DISTANCE - 5, THICKNESS], 10, center = true); //base
translate([0, 0, 0]) cylinder(r = 1.5, h = H * 5, center = true);
translate([DISTANCE, 0, 0]) cylinder(r = 1.5, h = H * 5, center = true);
translate([DISTANCE, DISTANCE, 0]) cylinder(r = 1.5, h = H * 5, center = true);
translate([0, DISTANCE, 0]) cylinder(r = 1.5, h = H * 5, center = true);
}
}
module pcb_mount() {
module pcb_mount () {
DISTANCE_X = 41;
DISTANCE_Y = 66;
OUTER = 10;
@ -387,17 +736,265 @@ module pcb_mount() {
translate([DISTANCE_X/2, DISTANCE_Y/2, -4]) rounded_cube([DISTANCE_X + OUTER, DISTANCE_Y + OUTER, 4], OUTER, center = true);
}
//l289N_mount();
module plunger () {
$fn = 60;
FINGER = 39;
CYL_D = 9;
WALL = 3;
difference () {
union () {
cylinder(r1 = CYL_D, r2 = CYL_D - 1, h = 30, center = true); //outer cylinder
difference () {
translate([0, 0, -9]) rotate([90, 0, 0]) rounded_cube([50, 12, 10], d = 5, center = true);
translate([23, 0, 9]) rotate([90, 0, 0]) cylinder(r = FINGER/2, h = 20, center = true);
translate([-23, 0, 9]) rotate([90, 0, 0]) cylinder(r = FINGER/2, h = 20, center = true);
}
}
translate([0, 0, 2]) cylinder( r = CYL_D - WALL, h = 30, center = true); //inner cylinder
cylinder(r = 7/2, h = 50, center = true); // button hole
}
//cylinder(r= 5, h = 50, center = true); button
}
module plunger_top () {
$fn = 60;
CYL_D = 9;
WALL = 3;
difference () {
union () {
cylinder(r = CYL_D - WALL - 0.015, h =6, center = true);
translate([0, 0, 2]) cylinder (r = CYL_D - 1, h = 2, center = true);
}
translate([0, 0, -2]) cylinder(r = CYL_D - WALL - 0.015 - 1, h =6, center = true);
//cylinder(r = 3/2, h = 50, center = true); // wire
cylinder(r = 3.9/2, h = 50, center = true); //3.5mm wire
}
}
module plunger_plate () {
translate([40, 0, -12]) rotate([180, 0, 0]) plunger_top();
plunger();
//decoys
translate([44,20,-13]) cube([4, 4, 4], center = true);
translate([44,-20,-13]) cube([4, 4, 4], center = true);
translate([-23,20,-13]) cube([4, 4, 4], center = true);
translate([-23,-20,-13]) cube([4, 4, 4], center = true);
}
module trinket_mount (decoys = false) {
$fn = 60;
TRINKET_L = 37.5;
TRINKET_W = 18;
difference () {
rounded_cube([42, 21, 3.5], d = 4, center = true); //body
translate([0, 0, 1]) cube([TRINKET_L, TRINKET_W, 1.5], center = true); //trinket
translate([0, 0, 0]) cube([TRINKET_L - 1, TRINKET_W - 1, 10], center = true); //trinket ridge
translate([20, 0, 1]) cube([9, 9, 1.5], center = true);
}
translate([(TRINKET_L / 2) -2, 0, -.75]) cube([4, TRINKET_W - 1, 2], center = true);//under usb
SPREAD = 14.25;
translate([(TRINKET_L / 2) -2, SPREAD/2, 1]) cylinder(r = 1.75/2, h = 2, center = true);
translate([(TRINKET_L / 2) -2, -SPREAD/2, 1]) cylinder(r = 1.75/2, h = 2, center = true);
//decoys
if (decoys){
translate([23,20,.25]) cube([4, 4, 4], center = true);
translate([23,-20,.25]) cube([4, 4, 4], center = true);
translate([-23,20,.25]) cube([4, 4, 4], center = true);
translate([-23,-20,.25]) cube([4, 4, 4], center = true);
}
}
module panel_cover (DECOYS = false) {
$fn = 60;
HEIGHT = 85;
WIDTH = 37;
z = 25 + 8 + 5;
translate([0, 0, (z/2) + 9.5]) {
difference () {
union () {
difference () {
rounded_cube([WIDTH, HEIGHT, z], d = 20, center = true); //main body of case
translate([0, 0, -1]) rounded_cube([WIDTH - 4, HEIGHT - 4, z-2], d = 18, center = true);
translate([-5, 35, 5]) rotate([0, 0, 15]) cube([50, 25, 400], center = true); //heatsink
translate([-10, 12, -9]) rotate([0, 0, 13]) cube([70, 40, 20], center = true); //L289N hole
translate([13, -36, -15]) rotate([0, 0, 13])cube([24, 45, 8], center = true); //trinket
//buttons
translate([7, -32, 8]) cylinder(r = 3.1, h = 190, center = true);
translate([7, -19, 8]) cylinder(r = 3.1, h = 190, center = true);
translate([7, -5, 8]) cylinder(r = 3.1, h = 190, center = true);
translate([-20, -30, 0]) rotate([90, 0, 90]) cylinder(r = 1.75, h = 10, center = true); //hole for trigger cable
translate([-20, -30, -19]) cube([15, 0.5, 40], center = true);
translate([-15, -20, 0]) rotate([90, 0, 90]) cylinder(r = 3.1, h = 19, center = true); //power
translate([-5, -12, 7]) cylinder(r= 2, h = z + 5, center= true); //LED
}
// translate([-5, -26.5, 0]) cylinder(r = 5, h = z, center = true);
}
translate([-5, -26.5, 0]) cylinder(r = 4, h = z + 10, center = true); //access hole for
}
}
//decoys
if (DECOYS){
DECOY_H = 40.5;
DECOY_W = 28;
translate([DECOY_W, 33, DECOY_H]) cube([4, 4, 4], center = true);
translate([DECOY_W, -40, DECOY_H]) cube([4, 4, 4], center = true);
translate([-DECOY_W, 20, DECOY_H]) cube([4, 4, 4], center = true);
translate([-DECOY_W, -40, DECOY_H]) cube([4, 4, 4], center = true);
translate([-DECOY_W, -10, DECOY_H]) cube([4, 4, 4], center = true);
translate([DECOY_W, -10, DECOY_H]) cube([4, 4, 4], center = true);
}
}
module button_nuts () {
difference () {
cylinder(r = 5, h = 2, center = true, $fn = 6);
cylinder(r = 3.1, h = 19, center = true, $fn = 60);
}
}
module button_nuts_plate (decoys = false) {
translate([0, 0, 0]) button_nuts();
translate([0, 11, 0]) button_nuts();
translate([11, 11, 0]) button_nuts();
translate([11, 0, 0]) button_nuts();
translate([22, 0, 0]) button_nuts();
translate([22, 11, 0]) button_nuts();
if (decoys){
translate([30, 24, 1]) cube([4, 4, 4], center = true);
translate([30, -14, 1]) cube([4, 4, 4], center = true);
translate([-10, 24, 1]) cube([4, 4, 4], center = true);
translate([-10, -14, 1]) cube([4, 4, 4], center = true);
}
}
module intval_electronics_mount (DECOYS = false) {
translate([-40 + 2, -1, 14]) rotate([0, 0, -13]) l289N_mount();
translate([-26 + 2, -19, 11.25]) rotate([0, 0, -180 - 13]) trinket_mount();
if (DECOYS) {
rotate([0, 0, -13]) translate([-19, -2, 0]) scale([.75, 1, 1]) rotate([0, 0, 45]) decoys(52, 12);
}
}
module key_cap () {
$fn = 40;
outerD = 22.1;
fuzz = 0.1;
difference () {
cylinder(r = outerD / 2 + fuzz + 1, h = 18, center = true);
translate([0, 0, -1]) cylinder(r = outerD / 2, h = 16, center = true);
}
decoys(23, 7);
}
module motor_cap (DECOYS = false, HALF = false) {
$fn = 60;
base_d = 47;
difference () {
translate([-6, 0, 40]) cylinder(r = base_d/2, h = 52, center = true);
translate([-6, 0, -5.75]) cylinder(r = base_d/2 - 1, h = 50, center = true);
translate([-6, 0, 39]) cylinder(r = base_d/2 - 3, h = 50, center = true);
translate([-25, 0, 19]) cube([10, 10, 15], center = true); //wire access
if (HALF){
translate([100, 0, 0]) cube([200, 200, 200], center = true);
}
}
if (DECOYS) {
translate([-6, 0, 0]) decoys(32, 64);
}
}
module bearing_calibrate (val = 0) {
mat = 25.4/8;
difference () {
cube([40, 40, mat], center = true);
bearing(0, 0, 0, hole = false, calval = val);
}
}
//translate([-11, -36, 11.5]) rotate([0, 0, -90]) trinket_mount();
//button_nuts_plate(true);
//plunger_plate();
//translate([-34, -8, 14]) l289N_mount();
//translate([-15, 10, 0]) decoys(30, 11.5);
//pcb_mount();
//motor_mount();
geared_motor_mount();
//translate([48.5, 12, 60]) geared_motor(-90);
//translate([54.5, 12, 33.5]) {
//translate([0, 0, 11]) geared_motor_mount();
//}
//motor_cap(true);
//motor_key();
//intval_panel();
//motor_key(DECOYS= true);
//intval_panel(); //OLD
//projection() l289N_hole_test();
//intval_laser_panel_cover(LASER=true, ALL_RED=true);
//projection() intval_panel_laser();
//intval_laser_standoffs();
//translate([-40, 0, 14]) rotate([0, 0, -13]) l289N_mount();
//translate([-40, -29, 11.5]) rotate([0, 0, -90 - 13]) trinket_mount();
//translate([0, 0, 4]) motor_mount_bottom();
//translate([54.5, 12, 33.5]) {
//geared_motor_mount();
//}
//intval_electronics_mount();
//rotate([0, 180, 0]) motor_key(DECOYS = true);
//difference () {
//import("/Users/dev/Documents/3d/intval2/intval2_geared_motor_key.stl");
//translate([0, -25, 0]) cube([50, 50, 50], center = true);
//}
//translate([-15, -8, 0]) rotate([0, 0, -13]) panel_cover(true);
//bearing (one_to_one_x, one_to_one_y, 5.5);
//difference () {
//translate([one_to_one_x, one_to_one_y, 31]) motor_mount();
//translate([one_to_one_x, one_to_one_y, 0]) cube([200, 200, 200]);
//}
//translate([0, 0, 40]) geared_motor(45, 45);
//motor_mount_bottom();
//translate([one_to_one_x, one_to_one_y, 63]) rotate([0, 180, 0]) motor_12v();
//translate([one_to_one_x, one_to_one_y, 63]) rotate([0, 180, 0]) motor_12v();
/* DEBUG */
//projection() intval_panel_laser_debug ();
//translate ([4, 12, 0]) translate([-74, 60, -25]) rotate([0, 0, -13 - 90]) import("/Users/dev/Downloads/UNO_R2_MOUNT.STL");
//bearing_calibrate();
/*
INTVAL 2 LASER PARTS
*/
//intval_laser_standoffs();
//intval_laser_standoffs_plate();
//intval_electronics_mount();
//motor_mount_bottom();
//intval_panel_laser();
//projection () intval_panel_laser();
//intval_laser_panel_cover(true, ALL_RED=true);
//intval_laser_panel_cover();
//intval_laser_panel_cover_standoff();
//key_cap();
//geared_motor_mount();
//motor_key();

226
scad/ready.scad Normal file
View File

@ -0,0 +1,226 @@
//!OpenSCAD
/* preprocessor */
module tube(o = 1, i = 0, h = 1, center = false, $fn = 12) {
$fn = $fn;
union () {
difference () {
cylinder(r = o, h = h, center = center);
cylinder(r = i, h = h, center = center);
}
}
}
module rounded_cube (cube_arr = [1, 1, 1], d = 0, center = false) {
off_x = 0;
off_y = 0;
r = d/2;
union () {
cube([cube_arr[0] - d, cube_arr[1], cube_arr[2]], center = center);
cube([cube_arr[0], cube_arr[1] - d, cube_arr[2]], center = center);
translate ([1 * (cube_arr[0] / 2) - r , 1 * (cube_arr[1] / 2)- r, 0]) cylinder(r = r, h = cube_arr[2], center = center);
translate ([-1 * (cube_arr[0] / 2) + r, -1 * (cube_arr[1] / 2) + r, 0]) cylinder(r = r, h = cube_arr[2], center = center);
translate ([1 * (cube_arr[0] / 2) - r, -1 * (cube_arr[1] / 2) + r, 0]) cylinder(r = r, h = cube_arr[2], center = center);
translate ([-1 * (cube_arr[0] / 2) + r, 1 * (cube_arr[1] / 2)- r, 0]) cylinder(r = r, h = cube_arr[2], center = center);
}
}
/*rounded_cube mikowski - avoid on web for triangulation errors\
NOT READY FOR PRIMETIME
module round_cube_minkowski (c = [1, 1, 1], diameter = 1) {
minkowski() {
cube([c[0] - diameter, c[1] - diameter, diameter(c[2])], center = true);
cylinder(r = diameter(diameter), h = c[2] / 2, center = true);
}
}
*/
module c_battery () {
/* C Cell battery, 26.1 × 50 */
x = 26.1;
x_fuzz = .3;
y = 50;
y_fuzz = 2;
cylinder(r = (x + x_fuzz) / 2, h = y + y_fuzz, center = true);
}
module sub_c_battery () {
/* Sub C Cell battery, 22.2 × 42.9 */
x = 22.2;
x_fuzz = .3;
y = 42.9;
y_fuzz = 2;
cylinder(r = (x + x_fuzz) / 2, h = y + y_fuzz, center = true);
}
module hex (r = 1, h = 1, center = false) {
cylinder(r = r, h = h, center = center, $fn = 6);
}
module triangle (a = 1, b = 1, c = 1, h = 1, center = false) {
}
module cone_45 (d = 1, center = false) {
cylinder(r1 = d/2, r2 = 0, h = d, center = center);
}
module decoys (d = 10, z = 0, number = 4, cube_size = 4, debug = false) {
for (i = [0: number]) {
rotate([0, 0, (360/number) * i]) translate([d, 0, z]) cube([cube_size, cube_size, cube_size], center = true);
if (debug && i == 0) {
rotate([0, 0, (360/number) * i]) translate([d, 0, z]) cube([cube_size * 5, cube_size* 5, cube_size], center = true);
}
}
}
//////////////////////////////////////////////////////////////////////////////////////////////
// Paraboloid module for OpenScad
//
// Copyright (C) 2013 Lochner, Juergen
// http://www.thingiverse.com/Ablapo/designs
//
// This program is free software. It is
// licensed under the Attribution - Creative Commons license.
// http://creativecommons.org/licenses/by/3.0/
//////////////////////////////////////////////////////////////////////////////////////////////
module paraboloid (y=10, f=5, rfa=0, fc=1, detail=44){
// y = height of paraboloid
// f = focus distance
// fc : 1 = center paraboloid in focus point(x=0, y=f); 0 = center paraboloid on top (x=0, y=0)
// rfa = radius of the focus area : 0 = point focus
// detail = $fn of cone
hi = (y+2*f)/sqrt(2); // height and radius of the cone -> alpha = 45° -> sin(45°)=1/sqrt(2)
x =2*f*sqrt(y/f); // x = half size of parabola
translate([0,0,-f*fc]) // center on focus
rotate_extrude(convexity = 10,$fn=detail ) // extrude paraboild
translate([rfa,0,0]) // translate for fokus area
difference(){
union(){ // adding square for focal area
projection(cut = true) // reduce from 3D cone to 2D parabola
translate([0,0,f*2]) rotate([45,0,0]) // rotate cone 45° and translate for cutting
translate([0,0,-hi/2])cylinder(h= hi, r1=hi, r2=0, center=true, $fn=detail); // center cone on tip
translate([-(rfa+x ),0]) square ([rfa+x , y ]); // focal area square
}
translate([-(2*rfa+x ), -1/2]) square ([rfa+x ,y +1] ); // cut of half at rotation center
}
}
//Spiral Notes
//-------------------------------------------------------------------
//Height = center to center height of the end spheres which form the spirals. Ends will need to be flattened by the user as desired. Actual height of the rendering is Height+2*baseRadius
//Radius = the maximum distance from the axis of the spiral (the z axis) to the center of the sphere(s) forming the spiral
//baseRadius = cross sectional radius of the spiral
//frequency = the number of complete revolutions about the axis made by the spiral, whole numbers will result in spirals whose tops end directly above their bases
//resolution = integer number of spheres, not to be confused with $fn. The greater the number of spheres, the smoother the spiral will be (also longer render times!). Recommended that this number be 8*frequency or greater.
//numSpirals = integer number of spirals used in the spiralMulti modules spaced evenly around the axis (3 spirals are spaced 120 degrees apart, 4 spirals: 90 degrees apart, etc.)
//Instructions
//------------------------------------------------------------------
//1. Place spiral.scad in the "libraries" folder of your openscad installation. Find the libraries folder by File -> Show Library Folder...
//2. Then create a new or open one of your existing scad files and include spiral.scad with the following code:
//use<spiral.scad>;
//3. Then call the modules in your files with code similar to the following:
//spiral(20,20,3,1,25);
//spiralCone(20,20,3,1,25);
//spiralEllipse(20,20,3,1,25);
//spiralMulti(20,20,3,1,25,3);
//spiralMultiCone(20,20,3,1,25,3);
//spiralMultiEllipse(40,60,3,1,32,3);
//-------------------------------------------------------------
//simple spiral
module spiral (height = 20, Radius = 20, baseRadius = 3, frequency = 1, resolution = 25, $fn=50) {
union(){
translate ([0,0,-(height/2)]) {
for(i=[0:resolution-2]){
hull(){
rotate ([0,0,frequency*360/(resolution-1)*i]) translate ([Radius,0,i*height/(resolution-1)]) sphere(r=baseRadius, center=true);
rotate ([0,0,frequency*360/(resolution-1)*(i+1)]) translate ([Radius,0,(i+1)*height/(resolution-1)]) sphere(r=baseRadius,center=true);
}
}
}
}
}
//cone spiral
module spiralCone(height=20,Radius=20,baseRadius=3,frequency=1,resolution=25, $fn=50) {
union(){
translate ([0,0,-(height/2)]) {
for(i=[0:resolution-2]){
hull(){
rotate ([0,0,frequency*360/(resolution-1)*i]) translate ([Radius-(i-1)*Radius/resolution,0,i*height/(resolution-1)]) sphere(r=baseRadius, center=true);
rotate ([0,0,frequency*360/(resolution-1)*(i+1)]) translate ([Radius-i*Radius/resolution,0,(i+1)*height/(resolution-1)]) sphere(r=baseRadius,center=true);
}
}
}
}
}
//ellipse spiral
module spiralEllipse(height=20,Radius=20,baseRadius=3,frequency=1,resolution=25, $fn=50) {
union(){
translate ([0,0,-(height/2)]) {
for(i=[0:resolution-2]){
hull(){
rotate ([0,0,frequency*360/(resolution-1)*i]) translate ([Radius*sqrt(1-(i/(resolution-1)*(i/(resolution-1)))),0,i*height/(resolution-1)]) sphere(r=baseRadius, center=true);
rotate ([0,0,frequency*360/(resolution-1)*(i+1)]) translate ([Radius*sqrt(1-((i+1)/(resolution-1)*((i+1)/(resolution-1)))),0,(i+1)*height/(resolution-1)]) sphere(r=baseRadius,center=true);
}
}
}
}
}
// Multiple spirals arranged radially around the axis
module spiralMulti(height=20,Radius=20,baseRadius=3,frequency=1,resolution=25,numSpirals=3,$fn=50) {
shiftAngle=360/numSpirals;
for(total=[0:numSpirals-1]) {
union(){
translate ([0,0,-(height/2)]) {
for(i=[0:resolution-2]){
hull(){
rotate ([0,0,frequency*360/(resolution-1)*i+shiftAngle*total]) translate ([Radius,0,i*height/(resolution-1)]) sphere(r=baseRadius, center=true);
rotate ([0,0,frequency*360/(resolution-1)*(i+1)+shiftAngle*total]) translate ([Radius,0,(i+1)*height/(resolution-1)]) sphere(r=baseRadius,center=true);
}
}
}
}
}
}
// Multiple spirals arranged radially around the axis tapering in towards the axis
module spiralMultiCone(height=20,Radius=20,baseRadius=3,frequency=1,resolution=25,numSpirals=3,$fn=50) {
shiftAngle=360/numSpirals;
for(total=[0:numSpirals-1]) {
union(){
translate ([0,0,-(height/2)]) {
for(i=[0:resolution-2]){
hull(){
rotate ([0,0,frequency*360/(resolution-1)*i+shiftAngle*total]) translate ([Radius-(i-1)*Radius/resolution,0,i*height/(resolution-1)]) sphere(r=baseRadius, center=true);
rotate ([0,0,frequency*360/(resolution-1)*(i+1)+shiftAngle*total]) translate ([Radius-i*Radius/resolution,0,(i+1)*height/(resolution-1)]) sphere(r=baseRadius,center=true);
}
}
}
}
}
}
//multiple ellipse spiral
module spiralMultiEllipse(height=20,Radius=20,baseRadius=3,frequency=1,resolution=25,numSpirals=3,$fn=50) {
shiftAngle=360/numSpirals;
for(total=[0:numSpirals-1]) {
union(){
translate ([0,0,-(height/2)]) {
for(i=[0:resolution-2]){
hull(){
rotate ([0,0,frequency*360/(resolution-1)*i+shiftAngle*total]) translate ([Radius*sqrt(1-(i/(resolution-1)*(i/(resolution-1)))),0,i*height/(resolution-1)]) sphere(r=baseRadius, center=true);
rotate ([0,0,frequency*360/(resolution-1)*(i+1)+shiftAngle*total]) translate ([Radius*sqrt(1-((i+1)/(resolution-1)*((i+1)/(resolution-1)))),0,(i+1)*height/(resolution-1)]) sphere(r=baseRadius,center=true);
}
}
}
}
}
}