chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fairphone-case: CaseBase_rhsflip: make a global (nfc)
[reprap-play.git]
/
fairphone-case.scad
diff --git
a/fairphone-case.scad
b/fairphone-case.scad
index 44b30a2082dfe4a27397a0a272e70a092062540b..a8c393f197eb1922fa7f8a8b83075137a115d641 100644
(file)
--- a/
fairphone-case.scad
+++ b/
fairphone-case.scad
@@
-1,6
+1,6
@@
// -*- C -*-
// -*- C -*-
-phone = [
145.0, 7
5.0 ];
+phone = [
75.0, 14
5.0 ];
bumper = [ 0.250, 0.250 ];
// ^ One side. Overall size is increased by twice this.
bumper = [ 0.250, 0.250 ];
// ^ One side. Overall size is increased by twice this.
@@
-48,17
+48,17
@@
lid_lip = 1.75;
$fa = 5;
$fs = 0.1;
$fa = 5;
$fs = 0.1;
-button_l_fudge = 4.
5
;
+button_l_fudge = 4.
4
;
strut_min_at_end = 1.5;
// ---------- calculated ----------
strut_min_at_end = 1.5;
// ---------- calculated ----------
-phone_
height =
(phone + bumper*2)[0];
-phone_
width =
(phone + bumper*2)[1];
+phone_
width =
(phone + bumper*2)[0];
+phone_
height =
(phone + bumper*2)[1];
-echo(camera_pos_tl + bumper,
- camera_pos_br + bumper);
+
//
echo(camera_pos_tl + bumper,
+
//
camera_pos_br + bumper);
// ----- could be changed -----
lid_buttoncover_gap = lid_gap_x;
// ----- could be changed -----
lid_buttoncover_gap = lid_gap_x;
@@
-203,9
+203,9
@@
module ButtonPlan(l, deep, cut){
}
module CaseBase_rhsflip(yn=[0,1]) {
}
module CaseBase_rhsflip(yn=[0,1]) {
- for (
rhs
=yn) {
+ for (
$rhsflip
=yn) {
translate([phone_width/2, 0, 0])
translate([phone_width/2, 0, 0])
- mirror([
rhs
,0,0])
+ mirror([
$rhsflip
,0,0])
translate([-phone_width/2, 0, 0])
children();
}
translate([-phone_width/2, 0, 0])
children();
}
@@
-258,14
+258,24
@@
module AroundEdges(fill_zstart, fill_th, fill_downwards=0){
[phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
}
[phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
}
-module SideButton(y,l){
+module SideButton(y, y_ref_sign, l){
+ // y_ref_sign:
+ // +1 measured from top of actual phone to top of button
+ // -1 measured from bottom of actual phone to bottom of button
+ // 0 y is centre of button in coordinate system
$button_l= l;
$button_l= l;
- translate([0, -y, 0])
+ eff_y = y_ref_sign > 0 ? -bumper [1] -y -l/2 :
+ y_ref_sign < 0 ? (-phone -bumper)[1] +y +l/2 :
+ y;
+ echo(eff_y);
+ translate([0, eff_y, 0])
children();
}
module Buttons(){
children();
}
module Buttons(){
- CaseBase_rhsflip([1]) SideButton(19.650, 8.8) children(); // power
+ CaseBase_rhsflip([1]) SideButton(15.580, +1, 8.9) children(); // power
+ CaseBase_rhsflip([1]) SideButton(48.700, -1, 8.920) children(); // camera
+ CaseBase_rhsflip([0]) SideButton(30.800, +1, 21.96) children(); // volume
}
module Struts(x_start, z_min, th){
}
module Struts(x_start, z_min, th){