diff --git a/README.md b/README.md index 9e06d51..df40706 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,8 @@ uv run I needed a laptop holder that could hold 4 laptops (work, personal macbook, personal linux laptop, wife's laptop when she didn't need it). This is my first real model created with build123d. +### Headphone Holder + +![Headphone holder](./img/headphone_holder.png) + +This is a headphone holder with holes to screw into the rectangular leg of [my standing desk](https://www.amazon.com/dp/B0DX6XN1SJ?th=1). diff --git a/headphone_holder.py b/headphone_holder.py new file mode 100644 index 0000000..b9379fe --- /dev/null +++ b/headphone_holder.py @@ -0,0 +1,71 @@ +# /// script +# requires-python = ">=3.14" +# dependencies = ["ocp_vscode", "build123d"] +# /// + +from build123d import * +from ocp_vscode import * + +height = 1.0 * IN +hole_spacing = 1.5 * IN +x_padding = 0.25 * IN +y_padding = 0.25 * IN +thickness = 0.1 * IN +headphone_holder_thickness = 1.75 * IN +holder_roc = 3.75 * IN +bolt_diameter = 3 / 16 * IN +lip_length = 0.15 * IN +lip_thickness = 0.15 * IN + + +with BuildPart() as holder: + with BuildSketch() as sketch: + with BuildLine(): + l1 = Line((0, 0), (0, height)) + l2 = Line(l1 @ 1, (hole_spacing + 2 * x_padding, height)) + l3 = Line(l2 @ 1, (hole_spacing + 2 * x_padding, 0)) + l4 = RadiusArc(l1 @ 0, l3 @ 1, holder_roc) + make_face() + + with Locations( + (x_padding, height - y_padding), + (x_padding + hole_spacing, height - y_padding), + ): + Circle( + radius=bolt_diameter / 2, + mode=Mode.SUBTRACT, + align=(Align.CENTER, Align.MAX), + ) + extrude(amount=thickness) + fillet( + holder.edges().filter_by(Axis.Z).sort_by(Axis.Y)[-2:], radius=bolt_diameter / 2 + ) + with BuildSketch() as sketch: + with BuildLine(): + l1 = RadiusArc((0, 0), (hole_spacing + 2 * x_padding, 0), holder_roc) + offset(amount=lip_thickness, side=Side.LEFT) + make_face() + extrude(amount=headphone_holder_thickness + thickness) + + with BuildSketch( + Plane.XY.offset(headphone_holder_thickness + thickness) + ) as sketch2: + with BuildLine(): + l1 = RadiusArc((0, 0), (hole_spacing + 2 * x_padding, 0), holder_roc) + offset(amount=lip_thickness, side=Side.LEFT) + make_face() + with BuildSketch( + Plane.XY.offset(headphone_holder_thickness + thickness + lip_length) + ): + with BuildLine(): + l1 = RadiusArc( + (0, lip_length), + (hole_spacing + 2 * x_padding, lip_length), + holder_roc, + ) + offset(amount=lip_thickness, side=Side.LEFT) + make_face() + + loft() + show(holder) +export_stl(holder.part, "headphone_holder.stl") diff --git a/img/headphone_holder.png b/img/headphone_holder.png new file mode 100644 index 0000000..722e32b Binary files /dev/null and b/img/headphone_holder.png differ