@@ -3,9 +3,6 @@ include <common.scad>
33include < cassette_dimensions.scad>
44include < BOSL2/std.scad>
55
6- // TODO locating features on cover
7- // TODO mounting tabs on cover
8-
96module cc_cover_handle() {
107 move([
118 - CC_VISIBLE_DEPTH + DELTA,
@@ -40,6 +37,9 @@ function cc_cover_plane(dist) =
4037 )
4138 round_corners(shape, radius = radii, $ fn= fn_where_needed);
4239
40+ // %polygon(cc_cover_plane(CC_VISIBLE_DEPTH));
41+ // polygon(cc_cover_plane(0));
42+
4343module cc_bottom_corner_mask() {
4444 // Rounding for bottom corners
4545 // Needs to be applied after skin(), because it causes different
@@ -69,7 +69,78 @@ module cc_bottom_corner_mask() {
6969 }
7070}
7171
72- // cc_bottom_corner_mask();
72+ // cc_bottom_corner_mask();
73+
74+ module cc_cover_top_bezel() {
75+ move([
76+ DELTA,
77+ scr_fwd_height - CC_BEZEL_WIDTH - CC_COVER_FIT,
78+ CC_BEZEL_POSITION
79+ ])
80+ cuboid([
81+ BODY_WALL + CC_BEZEL_EXTRA_DEPTH,
82+ CC_BEZEL_WIDTH,
83+ cc_mask_width - 2 * CC_BEZEL_POSITION
84+ ],
85+ anchor = LEFT + BOTTOM + FRONT
86+ );
87+ }
88+
89+ module cc_cover_side_bezel() {
90+ move([
91+ DELTA,
92+ CC_BEZEL_POSITION,
93+ CC_COVER_FIT
94+ ])
95+ // Use diff, not difference, so we can position the gaps and the ball with the same operation
96+ diff() {
97+ bezel_side_height = scr_fwd_height - 2 * CC_BEZEL_POSITION;
98+
99+ // Bezel side body
100+ cuboid([
101+ BODY_WALL + CC_BEZEL_EXTRA_DEPTH,
102+ bezel_side_height,
103+ CC_BEZEL_WIDTH
104+ ],
105+ anchor = LEFT + BOTTOM + FRONT
106+ );
107+
108+ // Mounting points (two sets of two gaps and and a ball)
109+ move([DELTA, bezel_side_height / 2 , - DELTA]) // move mount points relative to bezel body
110+ ycopies(CC_MOUNT_DISTANCE + CC_MOUNT_LENGTH + CC_MOUNT_GAP) { // two pairs of mounting points per bezel side
111+ ycopies(CC_MOUNT_LENGTH + CC_MOUNT_GAP) // two gaps around each mounting point
112+ // Gaps around mounting points, to make them flexible
113+ tag("remove" ) cuboid([
114+ BODY_WALL + CC_BEZEL_EXTRA_DEPTH + 2 * DELTA,
115+ CC_MOUNT_GAP,
116+ CC_BEZEL_WIDTH + 2 * DELTA
117+ ],
118+ anchor = LEFT + BOTTOM
119+ );
120+
121+ // Mounting point ball
122+ move([
123+ BODY_WALL - CC_MOUNT_BALL_FIT, // ball starts right behind the wall, with a small delta to make the fit tight
124+ 0 ,
125+ CC_MOUNT_BALL_R - CC_COVER_INTERFERENCE //
126+ ])
127+ bottom_half(z = CC_COVER_INTERFERENCE - CC_MOUNT_BALL_R + DELTA)
128+ sphere (
129+ r = CC_MOUNT_BALL_R,
130+ anchor = LEFT
131+ );
132+ }
133+ }
134+ }
135+
136+ module cc_cover_mounts() {
137+ cc_cover_top_bezel();
138+
139+ zflip_copy(z = cc_mask_width / 2 )
140+ cc_cover_side_bezel();
141+ }
142+
143+ // cc_cover_mounts();
73144
74145module cc_cover_object() {
75146 // Position the forward face
@@ -96,23 +167,23 @@ module cc_cover_object() {
96167 skin(faces, slices = 10 );
97168}
98169
170+ // cc_cover_object();
171+
99172module cc_cover() {
100173 // Angle and move the cover together with the corner mask
101174 move([kbd_back_x, kbd_back_y, CC_MASK_LEFT_Z]) // move to position relative to the model
102175 zrot(- SCR_FWD_A) // angle relative to the model
103176 difference () {
104177 union () {
105178 cc_cover_object();
179+ cc_cover_mounts();
106180 cc_cover_handle();
107181 }
108182
109183 cc_bottom_corner_mask();
110184 }
111185}
112186
113- // %polygon(cc_cover_plane(CC_VISIBLE_DEPTH));
114- // polygon(cc_cover_plane(0));
115-
116187// use <body.scad>
117188// xrot(90) {
118189// %body(true);
0 commit comments