-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
I'm looking for a solution to reuse my custom cutout. I need this to position the holes for the electronic connectors that are bolted on. This code generates such a cutout, however I don't know how to place it in the template.
// Parameters:
// Required:
// p(0) = connector opening diameter
// p(1) = horizontal distance between two screw openings
// p(3) = wall thickness
// Optional:
// p(4) = count of screw openings arround connector <4>
module connector_w_screws( hole_dm, screw_dist, screw_dm, wall_thickness , screws_cnt = 4) {
wall_thickness = wall_thickness + .01;
translate([-(2*screw_dm + screw_dist)/2,-(2*screw_dm + screw_dist)/2,-wall_thickness / 2 ])
{
difference() {
plate_l = screw_dm + screw_dist ;
cube( [plate_l, plate_l, wall_thickness ]); // base plate
translate( [plate_l/2, plate_l/2, -0.01] )
cylinder( d = hole_dm, h = wall_thickness + 0.02); // connector opening
trans_screw = [
[screw_dm/2, screw_dm/2, -.01],
[screw_dm/2 + screw_dist, screw_dm/2 + screw_dist, -.01],
[screw_dm/2 + screw_dist, screw_dm/2, -0.01],
[screw_dm/2, screw_dm/2 + screw_dist, -0.01]
];
// screws openings:
for (i=[0:screws_cnt-1])
{
translate(trans_screw[i] )
cylinder( d = screw_dm, h = wall_thickness + .02);
}
}
}
}
connector_w_screws( 24, 26, 4, 1.8);
Metadata
Metadata
Assignees
Labels
No labels