aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-07-06 17:56:16 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-07-06 17:56:16 +0200
commit98f4d3d694433071ac8cb0b747a3ebc6d6433646 (patch)
tree73acac001526a577411b2a9a41e29709d6283ad9
downloadwebcam_fmount-98f4d3d694433071ac8cb0b747a3ebc6d6433646.tar.gz
initial
-rw-r--r--.gitignore2
-rw-r--r--Makefile43
-rw-r--r--webcam_fmount.scad97
3 files changed, 142 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..928e078
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.gcode
+*.stl
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..39a3000
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+SCAD=openscad
+
+STLOPTS= --export-format binstl
+PNGOPTS= --colorscheme BeforeDawn --viewall --autocenter --imgsize 800,800 \
+ --render
+
+STLDIR = stlout
+PNGDIR = pngout
+
+SRC = $(wildcard *.scad)
+
+STL = $(addprefix $(STLDIR)/,$(SRC:.scad=.stl))
+PNG = $(addprefix $(PNGDIR)/,$(SRC:.scad=.png))
+
+.PHONY: _default
+_default: stl
+
+.PHONY: all
+all: clean stl png
+
+.PHONY: stl
+stl: $(STLDIR) $(STL)
+
+$(STLDIR)/%.stl: %.scad
+ @echo [ STL ] $<
+ @$(SCAD) $(STLOPTS) -o $@ $<
+
+png: $(PNGDIR) $(PNG)
+
+$(PNGDIR)/%.png: %.scad
+ @echo [ PNG ] $<
+ @$(SCAD) $(PNGOPTS) -o $@ $<
+
+$(PNGDIR):
+ @mkdir -p $(PNGDIR)/
+
+$(STLDIR):
+ @mkdir -p $(STLDIR)/
+
+.PHONY: clean
+clean:
+ @rm -rf $(STLDIR)/
+ @rm -rf $(PNGDIR)/
diff --git a/webcam_fmount.scad b/webcam_fmount.scad
new file mode 100644
index 0000000..5d9bbd7
--- /dev/null
+++ b/webcam_fmount.scad
@@ -0,0 +1,97 @@
+$fn=50;
+
+// diameter (not radius!)
+throat = 44.5;
+inner = 47.5;
+outer = 57;
+
+lip_width = 1.7;
+lip_height = 1.9;
+lip_positions = [[50,-35], [55,-155], [55,-270]];
+lip_offset = 0.8;
+
+flange_height = 10;
+
+module rounding_circle(radius, corner_radius, angle) {
+ rotate_extrude() {
+ translate([radius, angle>=180?corner_radius:0]) difference() {
+ rotate([0,0,angle]) square(corner_radius);
+ circle(corner_radius);
+ }
+ }
+}
+
+module lip(angle, offs) {
+ rotate([0,0,offs]) translate([0,0,lip_height/2])
+ rotate_extrude(angle=angle)
+ translate([inner/2 +0.1 - lip_width/2,0,0]) square([lip_width,lip_height], center=true);
+}
+
+module nikon_f_flange() {
+ difference() {
+ linear_extrude(flange_height) difference() {
+ circle(outer/2);
+ circle(inner/2);
+ }
+ translate([0,0,flange_height-1]) rounding_circle(29,1,0);
+ }
+
+ translate([0,0,flange_height - lip_height - lip_offset]) {
+ for (i = lip_positions) {
+ lip(i[0],i[1]);
+ }
+ }
+
+}
+
+screw_distance = 18.6;
+mount_base = 13.3;
+mount_wall = 1.2;
+sensor_distance = 46.5;
+
+base_thickness = 4;
+// if the sensor pertrudes from the mounting plane
+sensor_offset = 1;
+
+module screwpost_2d() {
+ r = 2;
+ screw=1;
+ difference() {
+ union() {
+ circle(r);
+ translate([0,-r]) square([(screw_distance-mount_base)/2,2*r]);
+ }
+ circle(screw);
+ }
+}
+
+module mount_base_2d() {
+ difference() {
+ square(mount_base,center=true);
+ offset(-mount_wall) square(mount_base, center=true);
+ }
+}
+
+module sensor_mount() {
+ mount_base_2d();
+ translate([-screw_distance/2,0]) screwpost_2d();
+ translate([ screw_distance/2,0]) rotate([0,0,180]) screwpost_2d();
+}
+
+
+translate([0,0,base_thickness]) {
+ h = sensor_distance-flange_height-base_thickness;
+ difference() {
+ hull() {
+ linear_extrude(0.01) square(mount_base, center=true);
+ translate([0,0,h]) linear_extrude(0.01) circle(d=outer);
+ }
+ hull() {
+ linear_extrude(0.01) offset(-mount_wall)square(mount_base, center=true);
+ translate([0,0,h]) linear_extrude(0.01) circle(d=inner);
+ }
+ }
+}
+
+translate([0,0,-sensor_offset]) linear_extrude(base_thickness + sensor_offset) sensor_mount();
+translate([0,0,sensor_distance-flange_height]) nikon_f_flange();