Skip to content

Conversation

@dotWee
Copy link

@dotWee dotWee commented Dec 3, 2025

This pull request adds a configurable OpenSCAD script for generating a customizable USB/SD/microSD rack plate.

The new script introduces parameters for rack dimensions, slot arrangements, safety features, and structural elements, enabling flexible design for 3D printing or fabrication.

Test it out on the OpenSCAD Playground

image

Copilot AI review requested due to automatic review settings December 3, 2025 12:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new parametric OpenSCAD script for generating customizable USB/SD/microSD storage rack plates with standard rack mounting holes. The design supports configurable rack dimensions (10" or 6" width), flexible storage slot arrangements with three positioning zones (left/middle/right), and optional structural reinforcement ribs.

Key Changes:

  • Adds complete plate generation system with rounded corners and mounting holes
  • Implements configurable storage slots with stacking options and safety stops
  • Includes structural rib support with chamfered edges for rack mounting compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

module chamfered_rib(width, thickness, depth, chamfer) {
difference() {
cube([width, thickness, depth]);
translate([depth - depth * 2, -tolerance, depth])
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expression depth - depth * 2 simplifies to -depth, which creates a negative X translation. This will incorrectly position the chamfer cube. Consider replacing with the intended expression, likely just -depth or adjusting the calculation based on the desired geometry.

Suggested change
translate([depth - depth * 2, -tolerance, depth])
translate([-depth, -tolerance, depth])

Copilot uses AI. Check for mistakes.
translate([depth - depth * 2, -tolerance, depth])
rotate([0, 45, 0])
cube([depth * 1.5, thickness + 2*tolerance, depth * 1.5]);
translate([width - depth + depth, -tolerance, 0])
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expression width - depth + depth simplifies to just width, making the -depth + depth portion redundant. This should be simplified to translate([width, -tolerance, 0]) or corrected if a different offset was intended.

Suggested change
translate([width - depth + depth, -tolerance, 0])
translate([width, -tolerance, 0])

Copilot uses AI. Check for mistakes.
}

module structural_ribs() {
usable_width = (rack_width == 152.4) ? 120.65 * 0.9 : 221.5 * 0.9;
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic numbers for rack specifications are scattered across multiple functions. Consider extracting these values into named constants at the top of the file (e.g., rack_6inch_usable_width, rack_10inch_hole_spacing) to improve maintainability and reduce duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +249 to +253
hole_spacing_x = (rack_width == 152.4) ? 136.526 : 236.525;
hole_left_x = (rack_width - hole_spacing_x) / 2;
hole_right_x = (rack_width + hole_spacing_x) / 2;
slot_len = (rack_width == 152.4) ? 6.5 : 10.0;
slot_height = (rack_width == 152.4) ? 3.25 : 7.0;
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic numbers for rack specifications are scattered across multiple functions. Consider extracting these values into named constants at the top of the file (e.g., rack_6inch_usable_width, rack_10inch_hole_spacing) to improve maintainability and reduce duplication.

Copilot uses AI. Check for mistakes.
Comment on lines +163 to +164
translate([x_pos, y_pos, -1])
cube([usb_w, usb_h, front_thickness + this_cut_depth]);
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number -1 for Z-position is duplicated across all storage cut functions. Consider extracting this into a named constant (e.g., cut_z_offset = -1) to clarify its purpose and enable easier adjustment.

Copilot uses AI. Check for mistakes.
Comment on lines +172 to +173
translate([x_pos, center_y - sd_h/2, -1])
cube([sd_w, sd_h, front_thickness + this_cut_depth]);
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number -1 for Z-position is duplicated across all storage cut functions. Consider extracting this into a named constant (e.g., cut_z_offset = -1) to clarify its purpose and enable easier adjustment.

Copilot uses AI. Check for mistakes.
Comment on lines +189 to +190
translate([x_pos, y_pos, -1])
cube([msd_w, msd_h, front_thickness + this_cut_depth]);
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic number -1 for Z-position is duplicated across all storage cut functions. Consider extracting this into a named constant (e.g., cut_z_offset = -1) to clarify its purpose and enable easier adjustment.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant