Init repo with first model and README

This commit is contained in:
Alex Selimov 2026-09-04 06:53:32 -04:00
commit 0915b2b6dc
4 changed files with 57 additions and 0 deletions

20
README.md Normal file
View file

@ -0,0 +1,20 @@
# CAD Models
This repo contains a collection of random CAD models I've created mainly using build123d.
## How to run
```
uv run <model.py file>
```
## Model descriptions
### Laptop Holder
![Vertical Laptop holder with 4 slots](./img/laptop_holder.png)
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.

BIN
img/laptop_holder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

37
laptop_holder.py Normal file
View file

@ -0,0 +1,37 @@
# /// script
# requires-python = ">=3.14"
# dependencies = ["ocp_vscode", "build123d"]
# ///
from build123d import *
from ocp_vscode import *
### USER INPUTS ###
base_thickness = 25.4 * MM
wall_thickness = 9 * MM
slots = [i * MM for i in [22, 22, 20, 20]]
slot_height = 60 * MM
width = 355.7 / 3 * MM # width of macbook pro
###################
with BuildPart() as holder: # noqa: SIM117
with BuildSketch() as sketch:
length = wall_thickness * (len(slots) + 1) + sum(slots)
height = slot_height + base_thickness
Rectangle(length, height)
offset = wall_thickness
for slot in slots:
with Locations((offset - length / 2, base_thickness - height / 2)):
Rectangle(
slot, slot_height, mode=Mode.SUBTRACT, align=(Align.MIN, Align.MIN)
)
Circle(slot / 2, mode=Mode.SUBTRACT, align=(Align.MIN, Align.CENTER))
offset += wall_thickness + slot
extrude(amount=width)
fillet(
holder.edges().group_by(Axis.Y)[-1].filter_by(Axis.Z),
radius=wall_thickness / 2.5,
)
show(holder)
export_stl(holder.part, "laptop_holder.stl")

BIN
laptop_holder.stl Normal file

Binary file not shown.