Init repo with first model and README
This commit is contained in:
commit
0915b2b6dc
4 changed files with 57 additions and 0 deletions
37
laptop_holder.py
Normal file
37
laptop_holder.py
Normal 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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue