Skip to content

Commit 05a7f62

Browse files
committed
merge main
2 parents 53077de + b82c5e8 commit 05a7f62

8 files changed

Lines changed: 24914 additions & 3750 deletions

File tree

export/MainCase/UsbCover.stl

Lines changed: 1983 additions & 1899 deletions
Large diffs are not rendered by default.

export/Mounting/SeatPostMount.stl

Lines changed: 1831 additions & 1831 deletions
Large diffs are not rendered by default.

export/Mounting/TopTubeMount.stl

Lines changed: 21072 additions & 0 deletions
Large diffs are not rendered by default.
-6 Bytes
Loading
-86 Bytes
Loading
-130 Bytes
Loading

src/MainCase/UsbCover.scad

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,35 @@ $fn = 64;
55
depth = UsbCover_depth+UsbCover_foot_length;
66

77

8-
module 2DBase(inset=0) {
8+
module 2DBase(inset=0, clearance=0) {
99
// inset is required for chamfer
1010
UsbCover_r1=UsbCover_r1-inset;
1111
UsbCover_r2=UsbCover_r2-inset;
1212
rMax=max(UsbCover_r1,UsbCover_r2);
1313

1414
// one side of the rounded rectangle
15+
translate([clearance, 0, 0])
1516
difference(){
16-
offset(r=UsbCover_r1) square([depth-UsbCover_r1*2-inset*2,UsbCover_width-UsbCover_r1*2-inset*2],center=true);
17-
translate([depth/4 + rMax/2,0])square([depth/2+rMax,UsbCover_width+rMax], center=true);
17+
offset(r=UsbCover_r1) square([depth-UsbCover_r1*2-inset*2,UsbCover_width-UsbCover_r1*2-inset*2-2*clearance],center=true);
18+
translate([depth/4 + rMax/2,0])square([depth/2+rMax,UsbCover_width+rMax-clearance], center=true);
1819
}
1920
// other side - slightly different radius
2021
difference(){
21-
offset(r=UsbCover_r2) square([depth-UsbCover_r2*2-inset*2,UsbCover_width-UsbCover_r2*2-inset*2],center=true);
22-
translate([-(depth/4 + rMax/2),0])square([depth/2+rMax,UsbCover_width+rMax], center=true);
22+
offset(r=UsbCover_r2) square([depth-UsbCover_r2*2-inset*2,UsbCover_width-UsbCover_r2*2-inset*2-2*clearance],center=true);
23+
translate([-(depth/4 + rMax/2),0])square([depth/2+rMax,UsbCover_width+rMax-clearance], center=true);
2324
}
2425
}
2526

26-
module 2DRail(inset=0)
27+
module 2DRail(inset=0, clearance=0)
2728
{
2829
// only the side rail
29-
translate([-depth/2+UsbCover_wing_width/2+UsbCover_wing_offset,0,0])square([UsbCover_wing_width-inset*2,UsbCover_width+2*UsbCover_wing_length-inset*2],center=true);
30+
translate([-depth/2+UsbCover_wing_width/2+UsbCover_wing_offset,0,0])square([UsbCover_wing_width-inset*2-clearance,UsbCover_width+2*(UsbCover_wing_length-clearance)-inset*2],center=true);
3031
}
3132

32-
module 2DTop(inset=0) {
33+
module 2DTop(inset=0, clearance=0) {
3334
// the top shape is the bottom shape with a cutoff at the edge
3435
difference() {
35-
2DBase(inset=inset);
36+
2DBase(inset=inset, clearance=clearance);
3637
translate([7.4,0])square([depth+UsbCover_r1,UsbCover_width+UsbCover_r1],center=true);
3738
}
3839
}
@@ -42,6 +43,8 @@ module UsbCoverMainBody(chamfer=0.5, clearance=0, counter_magnets=false) {
4243
// translation into world coordinates
4344

4445
if (clearance > 0) {
46+
// Positive clearance is used in the cutout of the MainCase.
47+
4548
// clearance by minkowski with cylinder
4649
minkowski(){
4750
UsbCoverMainBody(chamfer=0,clearance=0);
@@ -52,26 +55,30 @@ module UsbCoverMainBody(chamfer=0.5, clearance=0, counter_magnets=false) {
5255
}
5356

5457
} else {
58+
// Negative clearance is used in the correction of the actual UsbCover
59+
// part for printing smaller items to fit existing cases with not
60+
// enough actual clearance.
61+
5562
rotate([0,0,90])translate([depth/2,0,0]) {
5663
//rail with chamfer top and bottom
5764
hull() {
58-
linear_extrude(0.01){2DRail(inset=chamfer);}
59-
translate([0,0,chamfer])linear_extrude(epsilon){2DRail(inset=0);}
60-
translate([0,0,UsbCover_height-chamfer-epsilon])linear_extrude(epsilon){2DRail(inset=0);}
61-
translate([0,0,UsbCover_height-epsilon])linear_extrude(epsilon){2DRail(inset=chamfer);}
65+
linear_extrude(0.01){2DRail(inset=chamfer,clearance=-clearance);}
66+
translate([0,0,chamfer])linear_extrude(epsilon){2DRail(inset=0,clearance=-clearance);}
67+
translate([0,0,UsbCover_height-chamfer-epsilon])linear_extrude(epsilon){2DRail(inset=0,clearance=-clearance);}
68+
translate([0,0,UsbCover_height-epsilon])linear_extrude(epsilon){2DRail(inset=chamfer,clearance=-clearance);}
6269
}
6370
// bottom with chamfer up to grip
6471
hull()
6572
{
66-
linear_extrude(0.01){2DBase(inset=chamfer);}
67-
translate([0,0,chamfer])linear_extrude(epsilon){2DBase(inset=0);}
68-
translate([0,0,UsbCover_foot_height-epsilon])linear_extrude(epsilon){2DBase(inset=0);}
73+
linear_extrude(0.01){2DBase(inset=chamfer,clearance=-clearance);}
74+
translate([0,0,chamfer])linear_extrude(epsilon){2DBase(inset=0,clearance=-clearance);}
75+
translate([0,0,UsbCover_foot_height-epsilon])linear_extrude(epsilon){2DBase(inset=0,clearance=-clearance);}
6976
}
7077
// top with chamfer
7178
hull(){
72-
translate([0,0,UsbCover_foot_height])linear_extrude(epsilon){2DTop(inset=0);}
73-
translate([0,0,UsbCover_height-chamfer-epsilon])linear_extrude(epsilon){2DTop(inset=0);}
74-
translate([0,0,UsbCover_height-epsilon])linear_extrude(epsilon){2DTop(inset=chamfer);}
79+
translate([0,0,UsbCover_foot_height])linear_extrude(epsilon){2DTop(inset=0,clearance=-clearance);}
80+
translate([0,0,UsbCover_height-chamfer-epsilon])linear_extrude(epsilon){2DTop(inset=0,clearance=-clearance);}
81+
translate([0,0,UsbCover_height-epsilon])linear_extrude(epsilon){2DTop(inset=chamfer,clearance=-clearance);}
7582
}
7683
//top chamfers are moved down by slice thickness
7784
}
@@ -124,7 +131,7 @@ module 3DGripMould(){
124131

125132
module UsbCover(chamfer=0.5){
126133
difference(){
127-
UsbCoverMainBody(chamfer=chamfer);
134+
UsbCoverMainBody(chamfer=chamfer, clearance=-UsbCover_clearance_correction);
128135
3DGripMould();
129136
MagnetHoles();
130137
}

variables.scad

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ UsbCover_indent_width = 12;
9696
UsbCover_wing_offset = 2.2;
9797
UsbCover_wing_width = 2.6;
9898
UsbCover_wing_length = 2.0;
99+
UsbCover_clearance_correction = default_clearance; // printing a smaller-than-spec part for main cases that have not enough clearance themselves
99100

100101
MainCase_small_corner_radius = 5;
101102
MainCase_switch_offset_x = 25;

0 commit comments

Comments
 (0)