Skip to content

Commit 0223840

Browse files
committed
Add BOSL2 compatibility helper and refactor rear crossmember
Introduced a stub for the BOSL2 `parent_modules()` function in lifetrac_v25_params.scad to suppress OpenSCAD warnings when BOSL2 is not present. Refactored rear_crossmember.scad to use 2D square extrusion for the plate, clarified bolt hole and lightening hole placement, and improved variable naming for readability and maintainability.
1 parent 1027583 commit 0223840

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

LifeTrac-v25/mechanical_design/openscad/lifetrac_v25_params.scad

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
// This file contains only the constants needed for part design
44
// Full assembly uses lifetrac_v25.scad
55

6+
// -----------------------------------------------------------------------------
7+
// Compatibility helper
8+
// OpenSCAD throws warnings when the BOSL2 helper `parent_modules()` is missing.
9+
// We provide a stub that returns an empty list so part files can run cleanly
10+
// when opened directly without pulling in BOSL2.
11+
function parent_modules() = is_undef($parent_modules) ? [] : $parent_modules;
12+
613
// =============================================================================
714
// MATERIAL CONSTANTS
815
// =============================================================================

LifeTrac-v25/mechanical_design/parts/rear_crossmember.scad

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,29 @@ include <../openscad/lifetrac_v25_params.scad>
77
module rear_crossmember() {
88
back_height = MACHINE_HEIGHT * 0.55;
99
crossmember_width = TRACK_WIDTH + SANDWICH_SPACING + PANEL_THICKNESS * 2;
10-
11-
// Create plate with holes for bolting to side panels
10+
plate_thickness = PANEL_THICKNESS;
11+
12+
// Lay the plate flat in XY so projection captures all features
1213
difference() {
1314
// Main plate
14-
cube([crossmember_width, PANEL_THICKNESS, back_height], center=true);
15-
16-
// Bolt holes for mounting to side panels
17-
// 4 holes per side (left and right)
15+
linear_extrude(height=plate_thickness)
16+
square([crossmember_width, back_height], center=true);
17+
18+
// Bolt holes for mounting to side panels (4 per side)
1819
for (side = [-1, 1]) {
1920
x_pos = side * (crossmember_width/2 - 50);
20-
for (z = [back_height/4, back_height *3/4 - back_height/2]) {
21-
translate([x_pos, 0, z])
22-
rotate([90, 0, 0])
23-
cylinder(d=BOLT_DIA_1_2 + 2, h=PANEL_THICKNESS+4, center=true, $fn=32);
21+
for (z_pos = [back_height/4, back_height * 3/4]) {
22+
y_pos = z_pos - back_height/2; // shift because square is centered
23+
translate([x_pos, y_pos, plate_thickness/2])
24+
cylinder(d=BOLT_DIA_1_2 + 2, h=plate_thickness+4, center=true, $fn=32);
2425
}
2526
}
26-
27+
2728
// Lightening holes to reduce weight
2829
for (x = [-200, 0, 200]) {
29-
translate([x, 0, back_height/2 - 100])
30-
rotate([90, 0, 0])
31-
cylinder(d=60, h=PANEL_THICKNESS+4, center=true, $fn=32);
30+
y_pos = (back_height/2 - 100) - back_height/2; // place 100mm below top edge
31+
translate([x, y_pos, plate_thickness/2])
32+
cylinder(d=60, h=plate_thickness+4, center=true, $fn=32);
3233
}
3334
}
3435
}

0 commit comments

Comments
 (0)