Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of pi_3_model_b_holes #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions misc_boards.scad
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ include <misc_parts.scad>;
// used to avoid the manifold problem.
interf = 0.1;

//------------------------------------------------------------------------
// m25_standard_hole Standard fit M2.5 hole size definition
//------------------------------------------------------------------------
module m25_standard_hole() {
circle(r=(2.75 / 2), $fn=16);
}

//------------------------------------------------------------------------
// Move copies of children to positions in passed array
//------------------------------------------------------------------------
module array_holes(pos) {
for (pos=pos) {
translate(pos) children();
}
}

//------------------------------------------------------------------------
// 1602A LCD panel 16x2 characters.
//------------------------------------------------------------------------
Expand Down Expand Up @@ -235,8 +251,16 @@ module board_raspberrypi_model_b_v2() {
//------------------------------------------------------------------------
module raspberrypi_model_b_v2_holes() {
x = 56; y = 85;
translate([(x - 18), 25.5]) circle(r=(2.9 / 2), $fn=16);
translate([12.5, (y - 5)]) circle(r=(2.9 / 2), $fn=16);
holes=[
[(x - 18), 25.5],
[12.5, (y - 5)]
];

if ($children > 0) {
array_holes(pos=holes) children();
} else {
array_holes(pos=holes) m25_standard_hole();
}
}

//------------------------------------------------------------------------
Expand Down Expand Up @@ -279,11 +303,19 @@ module board_raspberrypi_model_a_plus_rev1_1() {
// Holes for the Raspberry Pi Model A+ rev.1.1.
//------------------------------------------------------------------------
module raspberrypi_model_a_plus_rev1_1_holes() {
x = 56;
translate([3.5, 3.5]) circle(r=(2.75 / 2), $fn=16);
translate([(x - 3.5), 3.5]) circle(r=(2.75 / 2), $fn=16);
translate([3.5, 3.5 + 58]) circle(r=(2.75 / 2), $fn=16);
translate([(x - 3.5), 3.5 + 58]) circle(r=(2.75 / 2), $fn=16);
off=3.5;
x=49 + off;
y=58 + off;
holes=[
[off,off], [x, off],
[off, y], [x, y]
];

if ($children > 0) {
array_holes(pos=holes) children();
} else {
array_holes(pos=holes) m25_standard_hole();
}
}


Expand Down Expand Up @@ -325,12 +357,12 @@ module board_raspberrypi_3_model_b() {
//------------------------------------------------------------------------
// Holes for Raspberry Pi 3 Model B v.1.2.
//------------------------------------------------------------------------

module raspberrypi_3_model_b_holes() {
x = 56;
translate([3.5, 3.5]) circle(r=(2.75 / 2), $fn=16);
translate([(x - 3.5), 3.5]) circle(r=(2.75 / 2), $fn=16);
translate([3.5, 3.5 + 58]) circle(r=(2.75 / 2), $fn=16);
translate([(x - 3.5), 3.5 + 58]) circle(r=(2.75 / 2), $fn=16);
if ($children > 0)
raspberrypi_model_a_plus_rev1_1_holes() children();
else
raspberrypi_model_a_plus_rev1_1_holes();
}

//------------------------------------------------------------------------
Expand Down