add ready_to_print module + doc updates

This commit is contained in:
Pierre Lecomte 2023-05-24 16:39:48 +02:00
parent 316b4acb35
commit 3716a751bb

View File

@ -1,17 +1,23 @@
/* /*
* Open SMA design for cylindrical microphone capsules * Open SMA design for cylindrical microphone capsules
* Copyright 2023 Pierre Lecomte - sekisushai@gmail.com * Copyright 2023 Pierre Lecomte - sekisushai@gmail.com
*
* The open SMA configuration is realized by means of microphone holding parts (in yellow) connected to each other with thin metal rods (in blue).
* The SMA is fixed to a mic stand by the mean of a threaded part, attached to neighbouring microphones (in red)
*
*/ */
include <threads.scad>; // To visualize the whole SMA
//$fn=128;
open_sma(); open_sma();
// To render only one attach or the support, ready to print
//ready_to_print(5);
// EDIT BELOW // EDIT BELOW
//$fn=128; //for final render
/*[ Array parameters ]*/ /*[ Array parameters ]*/
// Last parameter is for support attach. // Last parameters [r, theta, phi] are for the threaded mic stand support.
// sphere radius (mm): // sphere radius (mm):
r = [100, 100, 100, 100, 34, 150]; r = [100, 100, 100, 100, 34, 150];
@ -22,7 +28,7 @@ theta = [0, 109.471, 109.471, 109.471, 70.5284, 180];
// microphone azimuth coordinates (°): // microphone azimuth coordinates (°):
phi = [0, 240, 120, 0, 180, 0]; phi = [0, 240, 120, 0, 180, 0];
// connection matrix // connection matrix : For the i-th microphone, the neighbouring microphones number are listed in the i-th row (i starts at 0).
neighbors = neighbors =
[ [
[1, 2, 3, 4], //0 [1, 2, 3, 4], //0
@ -34,6 +40,7 @@ neighbors =
]; ];
// DO NOT EDIT BELOW HERE // DO NOT EDIT BELOW HERE
include <threads.scad>;
module attach(id_mic, rmic=3.82, rstud=1.75, color="yellow"){ module attach(id_mic, rmic=3.82, rstud=1.75, color="yellow"){
rtp = [r[id_mic], theta[id_mic], phi[id_mic]]; rtp = [r[id_mic], theta[id_mic], phi[id_mic]];
@ -76,8 +83,6 @@ module attach(id_mic, rmic=3.82, rstud=1.75, color="yellow"){
} }
} }
support();
// treaded attach // treaded attach
module support(stud=1.75){ module support(stud=1.75){
id_mic = len(r)-1; id_mic = len(r)-1;
@ -105,6 +110,7 @@ module support(stud=1.75){
rotate([0, rtp[1], rtp[2]]) rotate([0, rtp[1], rtp[2]])
translate([0, 0, -10]) translate([0, 0, -10])
cylinder(r=6,h=20, center=false); cylinder(r=6,h=20, center=false);
} }
for(i=[0:len(neighbors[id_mic])-1]){ for(i=[0:len(neighbors[id_mic])-1]){
neighbor = neighbor =
@ -122,11 +128,14 @@ module support(stud=1.75){
cylinder(r=stud,h=25); cylinder(r=stud,h=25);
}; };
}; };
translate(center) translate(center)
rotate([0, rtp[1], rtp[2]]) rotate([0, rtp[1], rtp[2]])
translate([0,0,-30]) translate([0,0,-30])
render() render()
english_thread(3/8,16,2,internal=true); /*
Change here the type of threaded hole for mounting on a mic stand. See threads.scad file for help
*/
english_thread(3/8,16,2,internal=true);
} }
} }
@ -150,9 +159,22 @@ function cart2sph(vec)
function sph2cart(vec) function sph2cart(vec)
= [vec[0]*sin(vec[1])*cos(vec[2]), vec[0]*sin(vec[1])*sin(vec[2]), vec[0]*cos(vec[1])]; = [vec[0]*sin(vec[1])*cos(vec[2]), vec[0]*sin(vec[1])*sin(vec[2]), vec[0]*cos(vec[1])];
// draw the whole array with attach and studs and support
module open_sma(){ module open_sma(){
for (i = [0:len(theta)-2]){ for (i = [0:len(theta)-2]){
attach(i); attach(i);
studs(i); studs(i);
}; };
}; support();
};
module ready_to_print(i){
mirror([0, 0, -1])
translate([0, 0, -r[i]])
rotate([0, -theta[i], 0])
rotate([0, 0, -phi[i]])
if (i != len(r)-1)
attach(i);
else
support();
}