pre-bemis
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
// Parametric Box with Lid
|
||||
// A customizable storage box for 3D printing
|
||||
|
||||
// === Box Parameters ===
|
||||
width = 60; // [20:200] Width in mm
|
||||
depth = 40; // [20:200] Depth in mm
|
||||
height = 30; // [10:150] Height in mm
|
||||
wall_thickness = 2; // [1:0.5:5] Wall thickness in mm
|
||||
|
||||
// === Lid Parameters ===
|
||||
include_lid = true; // Include a separate lid
|
||||
lid_height = 8; // [5:30] Lid height in mm
|
||||
lid_tolerance = 0.3; // [0.1:0.1:0.8] Gap for lid fit
|
||||
|
||||
// === Style Options ===
|
||||
corner_radius = 3; // [0:10] Corner rounding radius
|
||||
add_grip = true; // Add grip indents to lid
|
||||
|
||||
// === Internal ===
|
||||
$fn = 32; // Smoothness
|
||||
|
||||
// Rounded box module
|
||||
module rounded_box(w, d, h, r) {
|
||||
if (r > 0) {
|
||||
hull() {
|
||||
for (x = [r, w-r]) {
|
||||
for (y = [r, d-r]) {
|
||||
translate([x, y, 0])
|
||||
cylinder(h = h, r = r);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cube([w, d, h]);
|
||||
}
|
||||
}
|
||||
|
||||
// Main box body
|
||||
module box_body() {
|
||||
difference() {
|
||||
rounded_box(width, depth, height, corner_radius);
|
||||
|
||||
// Hollow inside
|
||||
translate([wall_thickness, wall_thickness, wall_thickness])
|
||||
rounded_box(
|
||||
width - 2*wall_thickness,
|
||||
depth - 2*wall_thickness,
|
||||
height, // Open top
|
||||
max(0, corner_radius - wall_thickness)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Lid
|
||||
module lid() {
|
||||
inner_w = width - 2*wall_thickness - 2*lid_tolerance;
|
||||
inner_d = depth - 2*wall_thickness - 2*lid_tolerance;
|
||||
lip_height = lid_height * 0.6;
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
// Top cap
|
||||
rounded_box(width, depth, wall_thickness, corner_radius);
|
||||
|
||||
// Inner lip
|
||||
translate([wall_thickness + lid_tolerance, wall_thickness + lid_tolerance, -lip_height + wall_thickness])
|
||||
rounded_box(inner_w, inner_d, lip_height, max(0, corner_radius - wall_thickness));
|
||||
}
|
||||
|
||||
// Grip indents
|
||||
if (add_grip) {
|
||||
for (x = [width * 0.3, width * 0.7]) {
|
||||
translate([x, -1, wall_thickness/2])
|
||||
rotate([-90, 0, 0])
|
||||
cylinder(h = 5, r = 3, $fn = 16);
|
||||
translate([x, depth - 4, wall_thickness/2])
|
||||
rotate([-90, 0, 0])
|
||||
cylinder(h = 5, r = 3, $fn = 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Render
|
||||
box_body();
|
||||
|
||||
if (include_lid) {
|
||||
// Position lid next to box for printing
|
||||
translate([width + 10, 0, lid_height - wall_thickness])
|
||||
rotate([180, 0, 0])
|
||||
lid();
|
||||
}
|
||||
95
rpi-case/.claude/skills/openscad/examples/phone_stand.scad
Normal file
95
rpi-case/.claude/skills/openscad/examples/phone_stand.scad
Normal file
@@ -0,0 +1,95 @@
|
||||
// Adjustable Phone/Tablet Stand
|
||||
// Parametric stand with customizable angle and size
|
||||
|
||||
// === Device Parameters ===
|
||||
device_width = 80; // [50:200] Device width in mm
|
||||
device_thickness = 12; // [6:20] Device thickness (with case)
|
||||
|
||||
// === Stand Parameters ===
|
||||
stand_angle = 65; // [45:85] Viewing angle in degrees
|
||||
stand_depth = 80; // [50:150] Base depth in mm
|
||||
stand_height = 100; // [60:200] Back support height in mm
|
||||
|
||||
// === Construction ===
|
||||
material_thickness = 4; // [2:0.5:8] Material thickness
|
||||
slot_depth = 15; // [10:30] How deep device sits in slot
|
||||
|
||||
// === Features ===
|
||||
cable_hole = true; // Add cable pass-through hole
|
||||
cable_diameter = 15; // [8:25] Cable hole diameter
|
||||
add_feet = true; // Add anti-slip feet
|
||||
|
||||
// === Quality ===
|
||||
$fn = 48;
|
||||
|
||||
module stand_profile() {
|
||||
// 2D profile of the stand side
|
||||
polygon([
|
||||
[0, 0], // Front bottom
|
||||
[stand_depth, 0], // Back bottom
|
||||
[stand_depth, material_thickness], // Back bottom inner
|
||||
[stand_depth - material_thickness, material_thickness], // Base top back
|
||||
[slot_depth + material_thickness, material_thickness], // Base top front (behind slot)
|
||||
[slot_depth + material_thickness, slot_depth * tan(90 - stand_angle) + material_thickness], // Slot back
|
||||
[material_thickness, slot_depth * tan(90 - stand_angle) + material_thickness + device_thickness / sin(stand_angle)], // Slot front top
|
||||
[0, slot_depth * tan(90 - stand_angle) + material_thickness], // Front face bottom of slot
|
||||
[0, 0] // Close
|
||||
]);
|
||||
}
|
||||
|
||||
module back_support() {
|
||||
// Back angled support
|
||||
translate([stand_depth - material_thickness, 0, material_thickness]) {
|
||||
rotate([0, -90 + stand_angle, 0]) {
|
||||
cube([stand_height, device_width, material_thickness]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module cable_cutout() {
|
||||
if (cable_hole) {
|
||||
translate([stand_depth/2, device_width/2, -1])
|
||||
cylinder(h = material_thickness + 2, d = cable_diameter);
|
||||
}
|
||||
}
|
||||
|
||||
module foot() {
|
||||
cylinder(h = 2, d1 = 10, d2 = 8);
|
||||
}
|
||||
|
||||
module stand() {
|
||||
difference() {
|
||||
union() {
|
||||
// Left side
|
||||
linear_extrude(material_thickness)
|
||||
stand_profile();
|
||||
|
||||
// Right side
|
||||
translate([0, device_width - material_thickness, 0])
|
||||
linear_extrude(material_thickness)
|
||||
stand_profile();
|
||||
|
||||
// Base plate
|
||||
cube([stand_depth, device_width, material_thickness]);
|
||||
|
||||
// Front lip
|
||||
cube([material_thickness, device_width, slot_depth * tan(90 - stand_angle) + material_thickness]);
|
||||
|
||||
// Back support
|
||||
back_support();
|
||||
}
|
||||
|
||||
// Cable hole
|
||||
cable_cutout();
|
||||
}
|
||||
|
||||
// Feet
|
||||
if (add_feet) {
|
||||
translate([10, 10, 0]) foot();
|
||||
translate([10, device_width - 10, 0]) foot();
|
||||
translate([stand_depth - 10, 10, 0]) foot();
|
||||
translate([stand_depth - 10, device_width - 10, 0]) foot();
|
||||
}
|
||||
}
|
||||
|
||||
stand();
|
||||
Reference in New Issue
Block a user