Compare commits

...

3 Commits

4 changed files with 288 additions and 11 deletions

View File

@ -0,0 +1,13 @@
include <./ef_m_mount_v3.scad>;
include <./common/common.scad>;
difference () {
union () {
ef_m_mount(thickness=2,grip = true);
translate([0, 0, -3]) cylinder(r = 38.5 / 2, h = 10, center = true, $fn = 360);
}
//guide
translate([0, 0, -3]) rotate([0, 0, 8.75]) translate([0, -26, 0]) cylinder(r = R(3), h = 4, center= true);
//center void
cylinder(r = 32 / 2, h = 30, center = true, $fn = 360);
}

View File

@ -4,7 +4,7 @@
include <./common/common.scad>; include <./common/common.scad>;
PART="cpc_9pin_plug"; PART="cpc_9pin_plugx";
PlugD = 15.75; PlugD = 15.75;
PlugH = 11.65; PlugH = 11.65;
@ -16,6 +16,7 @@ PlugGuideRetraction = 1.25;
PinSpacing = 3.85; PinSpacing = 3.85;
SocketD = PlugD + 0.2; SocketD = PlugD + 0.2;
SocketGuideD = PlugGuideD + 0.2;
CollarD = 19; CollarD = 19;
@ -58,6 +59,7 @@ module cpc_9pin_plug () {
difference () { difference () {
union () { union () {
cylinder(r = R(PlugD), h = PlugH, center = true); cylinder(r = R(PlugD), h = PlugH, center = true);
translate([0, 0, -(PlugH/2)+(2/2)]) cylinder(r = R(PlugD + 2), h = 2, center = true);
translate([0, 0, -PlugGuideRetraction/2]) { translate([0, 0, -PlugGuideRetraction/2]) {
for (i = [0 : len(GuideAngles) - 1]) { for (i = [0 : len(GuideAngles) - 1]) {
guide(PlugGuideD, PlugH - PlugGuideRetraction, GuideAngles[i], GuideWidths[i]); guide(PlugGuideD, PlugH - PlugGuideRetraction, GuideAngles[i], GuideWidths[i]);
@ -66,6 +68,7 @@ module cpc_9pin_plug () {
} }
plug_pin_voids(PinH); plug_pin_voids(PinH);
} }
} }
module cpc_9pin_plug_collar () { module cpc_9pin_plug_collar () {
@ -80,21 +83,36 @@ module cpc_9pin_plug_collar () {
} }
} }
module cpc_9pin_plug_back () {
//
}
module cpc_9pin_socket () { module cpc_9pin_socket () {
$fn = 200; $fn = 200;
D = 17; PinH = PlugH + 1;
OD = 28;
H = 25;
difference () { difference () {
union () { union () {
cylinder(r = OD / 2, h = H, center = true); cylinder(r = R(CollarD-1), h = PlugH, center = true);
//cube([12, 48, 3], center = true);
} }
//main void translate([0, 0, -9]) union () {
translate([0, 0, -3]) cylinder(r = (OD / 2) - 3, h = H, center = true); cylinder(r = R(SocketD), h = PlugH, center = true);
//connector void for (i = [0 : len(GuideAngles) - 1]) {
cylinder(r = D / 2, h = H * 2, center = true); guide(SocketGuideD, PlugH, GuideAngles[i], GuideWidths[i] + 0.1);
}
}
plug_pin_voids(PinH);
}
}
module debug () {
difference () {
union () {
cpc_9pin_plug();
translate([0, 0, 13]) cpc_9pin_socket();
}
translate([25, 0, 0]) cube([50, 50, 100], center = true);
} }
} }
@ -102,6 +120,10 @@ if (PART == "cpc_9pin_plug") {
cpc_9pin_plug(); cpc_9pin_plug();
} else if (PART == "cpc_9pin_plug_collar") { } else if (PART == "cpc_9pin_plug_collar") {
cpc_9pin_plug_collar(); cpc_9pin_plug_collar();
} else if (PART == "cpc_9pin_plug_back") {
cpc_9pin_plug_back();
} else if (PART == "cpc_9pin_socket") { } else if (PART == "cpc_9pin_socket") {
cpc_9pin_socket(); cpc_9pin_socket();
} else {
debug();
} }

132
scad/ef_m_mount_v3.scad Normal file
View File

@ -0,0 +1,132 @@
/*
*
* Canon EF-M lens-side mount
*
* Remix of Canon EF-M lens mount by Peter K. Johnson (PPK):
* https://www.thingiverse.com/thing:703383
*
* Added optional thickness parameter (default is 0) to add depth to the large
* circle.
* Added grip texture option to outer edge
*
* Created EF-M pinhole module which builds a variable focal length
* EF-M pinhole lens with a slot to accept a pinhole.
*
* brett stevens 2021.
*/
/*
// constants from Fotasy adapter mount
outer_diam_1 = 54;
outer_diam_2 = 46.8;
outer_diam_3 = 42.88;
inner_diam = 41.28;
// constants from Canon mount
outer_diam_1 = 58.0;
outer_diam_2 = 47.0;
outer_diam_3 = 43.0;
*/
outer_diam_1 = 58.0;
outer_diam_2 = 47.0;
outer_diam_3 = 43.0;
pin_hole_width = 2.2;
// Partial rotate extrude from: http://www.thingiverse.com/thing:34027
module pie_slice(radius, angle, step) {
for(theta = [0:step:angle-step]) {
rotate([0,0,0])
linear_extrude(height=radius*2, center=true)
polygon(
points = [
[0,0],
[radius*cos(theta+step), radius*sin(theta+step)],
[radius*cos(theta), radius*sin(theta)]
]
);
}
}
module partial_rotate_extrude(angle, radius, convex) {
intersection () {
rotate_extrude(convexity=convex) translate([radius,0,0]) children(0);
pie_slice(radius*2, angle, angle/5);
}
}
// Canon EF-M lens mount
module ef_m_bayonet_section(angle) {
partial_rotate_extrude(angle, outer_diam_3/2-0.1, 10)
polygon([[0,-2.2],[0,0],[1.6,0],[1.6,-1.6]]);
}
module ef_m_mount( thickness = 0, grip = false) {
$fa = 0.01;
$fn = 200;
union() {
difference() {
if (grip)
difference() {
translate([0, 0, -thickness])
cylinder(h=2+thickness, d=outer_diam_1);
{
for(i = [0:100-1])
{
rotate([0,0,i*360/100])
translate([outer_diam_1/2,0,-1.75-thickness])
cylinder(thickness+0.5+2,r=0.5);
}
}
}
else
translate([0, 0, -thickness])
cylinder(h=2+thickness, d=outer_diam_1);
rotate(a=[0, 0, -22])
translate([49/2, -pin_hole_width/2, 1.1])
cube([4, pin_hole_width, 1.1]);
rotate(a=[0, 0, -83])
translate([outer_diam_1/2-2.5, 0, 1.5])
cube([1.5, 1.5, 0.6]);
}
translate([0, 0, 2])
cylinder(h=1.6, d=outer_diam_2);
difference() {
translate([0, 0, 0])
cylinder(h=7.6, d=outer_diam_3);
translate([0, 0, 7.6])
rotate(a=[0, 0, 40])
partial_rotate_extrude(140, 34.5/2, 10)
polygon([[0,-1],[0,0.1],[2.5,0.1],[2.5,-1]]);
}
translate([0, 0, 7.6]) {
partial_rotate_extrude(3, outer_diam_3/2-.1, 10)
polygon([[0,-4],[0,0],[1.4,0],[1.4,-4]]);
ef_m_bayonet_section(58);
rotate(a=[0, 0, 131])
ef_m_bayonet_section(51);
rotate(a=[0, 0, 243])
ef_m_bayonet_section(51);
}
}
}
// Example with typical EF-M hole, but that part can be modified as needed for
// whatever final assembly is being made. There's a subtle alignment dot built
// into the base mount (on the camera side), but if a more visible one is desired
// on a larger assembly it should be at -83 degrees relative to the mount.
//difference() {
// ef_m_mount();
// translate([0,0,-1]) cylinder(h=10, d=32);
//}
$fn = 200;
overlap = 0.1;

110
scad/esp32_case.scad Normal file
View File

@ -0,0 +1,110 @@
include <./arduino.scad>;
include <./common/common.scad>;
DEBUG = false;
PART = "case_bottomx";
CaseX = 40;
CaseY = 75;
CaseZ = 30;
CaseD = 8;
CaseSplitZ = 25;
ESP32Position = [0, -7, -5];
ESP32Size = [25.85, 53.8, 1.5];
module pin_debug (pos = [0, 0, 0]) {
translate(pos) cube([.6, .6, 6.26], center = true);
}
module esp32_pins_debug (pos = [0, 0, 0]) {
PinSpacing = 2.5;
translate(pos) {
cube([2.5, 48, 2.5], center = true);
translate([0, -45/2, 0]) for (i = [0 : 18]) {
pin_debug([0, i * PinSpacing, -3]);
}
}
}
module esp32_debug () {
X = ESP32Size[0];
Y = ESP32Size[1];
Z = ESP32Size[2];
cube([X, Y, Z], center = true);
//micro usb
translate([0, (Y/2)-(5.65/2), (Z/2)+(3/2)]) cube([7.5, 5.65, 3], center = true);
//pins
esp32_pins_debug([(X/2)-(2.5/2), 0, -(2.5/2)-(Z/2)]);
esp32_pins_debug([-(X/2)+(2.5/2), 0, -(2.5/2)-(Z/2)]);
//esp32 chip
translate([0, -(Y/2)+(17.9/2)+5.4, (Z/2)+(3/2)]) cube([15.9, 17.9, 3], center = true);
//antenna
translate([0, -(Y/2)+(25.5/2)-0.85, (Z/2)+(.8/2)]) cube([17.8, 25.5, .8], center = true);
}
module debug () {
//translate(ESP32Position) rotate([180, 0, 0]) esp32_debug();
difference () {
case_bottom();
//translate([CaseX / 2, 0, 0]) cube([CaseX, CaseY + 1, CaseZ + 1], center = true);
}
}
/**
*
**/
module case_shell (pos = [0,0,0]) {
$fn = 50;
translate(pos) difference () {
intersection () {
rounded_cube([CaseX, CaseY, CaseZ], d = CaseD, center = true);
translate([0, 0, -CaseD/2]) rotate([90, 0, 0]) rounded_cube([CaseX, CaseZ + CaseD, CaseY], d = CaseD, center = true);
translate([0, 0, -CaseD/2]) rotate([0, 90, 0]) rounded_cube([CaseZ + CaseD, CaseY, CaseX], d = CaseD, center = true);
}
rounded_cube([CaseX - 6, CaseY - 6, CaseZ - 6], d = 6, center = true);
}
}
module esp32_mount (pos = [0, 0, 0]) {
X = ESP32Size[0];
Y = ESP32Size[1];
Z = 2;
translate([pos[0], pos[1], pos[2]-5]) difference () {
cube([X+3, Y+3, 10], center = true);
translate([0, 0, (10/2)-(2/2)+0.01]) cube([X, Y, Z], center = true);
translate([0, 0, 0]) cube([X-1, Y-1, 10], center = true);
//micro usb
translate([0, -(Y/2), 2.7]) cube([9, 7, 5], center = true);
//antenna
translate([0, (Y/2), 3]) cube([20, 25.5, 5], center = true);
}
}
module case_bottom () {
difference () {
case_shell();
translate([0, 0, CaseSplitZ]) cube([CaseX + 1, CaseY + 1, CaseZ],center = true);
//micro usb
translate([0, -(CaseY/2), -7.8]) cube([9, 7, 4], center = true);
translate([0, -(CaseY/2)-3, -7.8]) cube([12, 10, 7.7], center = true);
}
esp32_mount(ESP32Position);
}
module case_top () {
difference () {
case_shell();
translate([0, 0, CaseSplitZ-CaseZ]) cube([CaseX + 1, CaseY + 1, CaseZ],center = true);
}
}
if (PART == "case_bottom") {
case_bottom();
} else if (PART == "case_top") {
case_top();
} else {
debug();
}