mirror of
https://github.com/Proteus-Typer/model-a.git
synced 2025-07-06 16:16:43 +00:00
Compare commits
17 Commits
5be0911e77
...
main
Author | SHA1 | Date | |
---|---|---|---|
9a2344c970 | |||
d905b99d46 | |||
f37a4d8d00 | |||
c87a32b745 | |||
7669678599 | |||
92f4e4ab32 | |||
8ee471d48e | |||
a08afe6775 | |||
79e5c3d5b0 | |||
c9c10d1c4a | |||
52a0e374d0 | |||
6f2e04b9b9 | |||
ab741ae02f | |||
69496f92f6 | |||
b31efd2c07 | |||
4a90e385e9 | |||
0a81747299 |
0
.gitattributes
vendored
Normal file
0
.gitattributes
vendored
Normal file
2
.gitignore
vendored
2
.gitignore
vendored
@ -174,3 +174,5 @@ poetry.toml
|
||||
pyrightconfig.json
|
||||
|
||||
.lint
|
||||
*right*stl
|
||||
*left*stl
|
||||
|
17
.vscode/extensions.json
vendored
Normal file
17
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
|
||||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
||||
|
||||
// List of extensions which should be recommended for users of this workspace.
|
||||
"recommendations": [
|
||||
"emeraldwalk.RunOnSave",
|
||||
"ms-vscode.makefile-tools",
|
||||
"ms-python.python",
|
||||
"mtsmfm.vscode-stl-viewer",
|
||||
"sndst00m.vscode-native-svg-preview",
|
||||
],
|
||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||
"unwantedRecommendations": [
|
||||
|
||||
]
|
||||
}
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -7,5 +7,6 @@
|
||||
"isAsync": true,
|
||||
"cmd": "make"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
9
LICENSE.md
Normal file
9
LICENSE.md
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 Roberto Alsina <roberto.alsina@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
3
Makefile
3
Makefile
@ -7,7 +7,8 @@ all: $(STL_FILES) lint
|
||||
|
||||
lint: .lint
|
||||
|
||||
.lint: **.py
|
||||
.lint: *.py components/*.py
|
||||
black *.py */*.py
|
||||
flake8
|
||||
touch .lint
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Homemade Computer Project To Be Named Later
|
||||
# Model-A Homemade Computer Project
|
||||
|
||||
Here are the files used to build the case for my homemade
|
||||
computer. You can see a lot about it in [this article](http://ralsina.me/weblog/posts/so-i-built-a-laptop.html) (or at least about it as it was in early march 2023)
|
||||
@ -44,6 +44,7 @@ The basic concepts work, as proven by me building the damned things. But still:
|
||||
* The component library is very limited (just the things I am using in my build)
|
||||
|
||||
None of those things is an insurmountable problem, and I am working on them,
|
||||
and I have plans to fix it all. Eventually. Some day.
|
||||
and I have plans to fix it all. Eventually. Some day. I only do this on
|
||||
lunch breaks and weekends folks.
|
||||
|
||||
In the meantime, if you want to use any of this and need a hand, just contact me at roberto.alsina@gmail.com and I'll try to help.
|
||||
In the meantime, if you want to use any of this and need a hand, just contact me at roberto.alsina@gmail.com and I'll try to help.
|
||||
|
1
base.py
1
base.py
@ -1,4 +1,5 @@
|
||||
import cadquery as cq
|
||||
|
||||
# from cq_warehouse.drafting import Draft
|
||||
|
||||
import components.audio_plug as audio_plug
|
||||
|
BIN
base_left.stl
BIN
base_left.stl
Binary file not shown.
BIN
base_right.stl
BIN
base_right.stl
Binary file not shown.
@ -25,7 +25,9 @@ def init():
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": kbd_pillar_offset_1,
|
||||
"shape": cq.Sketch().push(kbd_pillar_positions).circle(kbd_pillar_radius_1, mode="a"),
|
||||
"shape": cq.Sketch()
|
||||
.push(kbd_pillar_positions)
|
||||
.circle(kbd_pillar_radius_1, mode="a"),
|
||||
},
|
||||
# Taller pillars with holes for self-tapping screws
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ ti_radius = 2.35
|
||||
ti_depth = 6.25
|
||||
|
||||
# M3 hex nut dimensions
|
||||
m3_hn_diam = 5.5
|
||||
m3_hn_diam = 6.2
|
||||
m3_hn_hole = 3
|
||||
m3_hn_thickness = 2.5
|
||||
|
||||
@ -125,7 +125,7 @@ hl_ring_radius = 5 # M3
|
||||
hl_hinge_offset = max(p[1] for p in mounting_pillar_positions) + 6
|
||||
hl_hinge_width = 25
|
||||
# Base + this lid
|
||||
hl_full_thickness = 43
|
||||
hl_full_thickness = 45
|
||||
|
||||
|
||||
## Dimensions for the simple lid
|
||||
@ -141,4 +141,6 @@ screen_pillars.pillar_width = 12
|
||||
screen_pillars.pillar_height = 12
|
||||
screen_pillars.screw_head_radius = 3
|
||||
screen_pillars.screw_radius = 1.8
|
||||
screen_pillars.screw_head_depth = base_thickness - 13 # (screw thread length - threaded insert depth)
|
||||
screen_pillars.screw_head_depth = (
|
||||
base_thickness - 13
|
||||
) # (screw thread length - threaded insert depth)
|
||||
|
@ -231,7 +231,7 @@ def model():
|
||||
|
||||
# Screen mount
|
||||
model = (
|
||||
# 1st layer
|
||||
# Frame that contains the screen
|
||||
model.workplaneFromTagged("base")
|
||||
.center(0, -32)
|
||||
.workplane(offset=dim.hl_full_thickness / 2 - dim.shell_t)
|
||||
@ -246,7 +246,7 @@ def model():
|
||||
.vertices()
|
||||
.fillet(2)
|
||||
)
|
||||
.extrude(-2 - dim.scr_thickness)
|
||||
.extrude(-1 - dim.scr_thickness)
|
||||
# Hole for screws
|
||||
.workplaneFromTagged("screen_plane")
|
||||
.workplane(offset=1)
|
||||
@ -259,7 +259,7 @@ def model():
|
||||
.hole(dim.m3_hn_hole, depth=10)
|
||||
# Holes for captured nuts
|
||||
.workplaneFromTagged("screen_plane")
|
||||
.workplane(offset=1)
|
||||
.workplane(offset=1.5) # This is INSIDE THE LID
|
||||
.rect(
|
||||
dim.scr_w + 2 * dim.hl_bezel_width - dim.m3_hn_diam - 1,
|
||||
dim.scr_h + 2 * dim.hl_bezel_height - dim.m3_hn_diam - 1,
|
||||
@ -297,7 +297,10 @@ def model():
|
||||
(0, 0),
|
||||
(0, keyboard.kbd_front_thickness),
|
||||
(dim.shell_t, keyboard.kbd_front_thickness),
|
||||
(keyboard.kbd_actual_height + dim.shell_t, keyboard.kbd_back_thickness),
|
||||
(
|
||||
keyboard.kbd_actual_height + dim.shell_t,
|
||||
keyboard.kbd_back_thickness,
|
||||
),
|
||||
(keyboard.kbd_actual_height + dim.shell_t, dim.base_thickness),
|
||||
(dim.height, dim.base_thickness),
|
||||
(dim.height, 0),
|
||||
|
BIN
hinged_lid.stl
BIN
hinged_lid.stl
Binary file not shown.
341
hinged_lid.svg
341
hinged_lid.svg
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 186 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +1,4 @@
|
||||
cadquery
|
||||
git+https://github.com/gumyr/cq_warehouse.git#egg=cq_warehouse
|
||||
flake8
|
||||
black
|
||||
|
107
simple_lid.py
Normal file
107
simple_lid.py
Normal file
@ -0,0 +1,107 @@
|
||||
import cadquery as cq
|
||||
|
||||
import dimensions as dim
|
||||
from utils import extrude_shape2, hex_vents, punch_hole, export
|
||||
|
||||
|
||||
def model():
|
||||
# Create the basic shape of the case lid
|
||||
model = (
|
||||
cq.Workplane("XY")
|
||||
# Hollow box
|
||||
.box(dim.width, dim.sl_height, dim.sl_thickness)
|
||||
.edges("|Z and >Y")
|
||||
.fillet(2)
|
||||
)
|
||||
|
||||
# Make many holes
|
||||
vent = hex_vents(size=6, width=dim.width * 0.9, height=dim.sl_height * 0.9)[0]
|
||||
model = punch_hole(
|
||||
model=model,
|
||||
face=">Z",
|
||||
w=dim.width,
|
||||
h=dim.sl_height,
|
||||
x_offset=0.05 * dim.width,
|
||||
y_offset=0.05 * dim.sl_height,
|
||||
hole=vent,
|
||||
depth=dim.sl_thickness,
|
||||
)
|
||||
|
||||
# Add screw holes
|
||||
for position in dim.mounting_pillar_positions:
|
||||
model = (
|
||||
model.faces(">Z")
|
||||
.workplane(centerOption="CenterOfBoundBox")
|
||||
.center(
|
||||
-dim.width / 2 + position[0],
|
||||
dim.sl_height / 2 - position[1] - dim.shell_t,
|
||||
)
|
||||
.placeSketch(cq.Sketch().circle(dim.m4_top / 2 + 1.5))
|
||||
.extrude(-dim.sl_thickness)
|
||||
.faces(">Z")
|
||||
.workplane(centerOption="CenterOfBoundBox")
|
||||
.center(
|
||||
-dim.width / 2 + position[0],
|
||||
dim.sl_height / 2 - position[1] - dim.shell_t,
|
||||
)
|
||||
.cskHole(dim.m4_bottom, dim.m4_top, 82, depth=None)
|
||||
)
|
||||
|
||||
# Add front lip
|
||||
|
||||
model = (
|
||||
model.faces(">Z")
|
||||
.workplane(centerOption="CenterOfBoundBox")
|
||||
.center(0, -dim.sl_height / 2 + dim.sl_lip_thickness / 2)
|
||||
.placeSketch(
|
||||
cq.Sketch().trapezoid(dim.width - 2 * dim.shell_t, dim.sl_lip_thickness, 90)
|
||||
)
|
||||
.extrude(-dim.sl_front_lip - dim.sl_thickness)
|
||||
)
|
||||
|
||||
return model
|
||||
|
||||
|
||||
def decorative_cover():
|
||||
# A decorative thingie to cover the ugly seam in the middle
|
||||
model = cq.Workplane("XY").box(10, dim.sl_height, 1).edges("|Z").fillet(1)
|
||||
vent = hex_vents(
|
||||
size=6, width=dim.width * 0.9, height=dim.sl_height * 0.9, density=0.775
|
||||
)[0]
|
||||
|
||||
model = extrude_shape2(
|
||||
model=model,
|
||||
face=">Z",
|
||||
w=dim.width,
|
||||
h=dim.sl_height,
|
||||
x_offset=0.05 * dim.width,
|
||||
y_offset=0.05 * dim.sl_height,
|
||||
hole=vent,
|
||||
depth=3,
|
||||
)
|
||||
return model
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
model = model()
|
||||
export(model, "simple_lid.stl")
|
||||
|
||||
cover = decorative_cover()
|
||||
export(cover, "simple_lid_cover.stl")
|
||||
|
||||
export(
|
||||
model,
|
||||
"simple_lid.svg",
|
||||
opt={
|
||||
"projectionDir": (0, 0, 1),
|
||||
},
|
||||
)
|
||||
|
||||
export(
|
||||
model.faces(">X").workplane(offset=-dim.width / 2).split(keepTop=True),
|
||||
"simple_lid_right.stl",
|
||||
)
|
||||
export(
|
||||
model.faces(">X").workplane(offset=-dim.width / 2).split(keepBottom=True),
|
||||
"simple_lid_left.stl",
|
||||
)
|
Binary file not shown.
Binary file not shown.
@ -26,7 +26,7 @@ mounting_pillar_positions = [(x, -y) for x, y in dim.mounting_pillar_positions[:
|
||||
|
||||
mounting_pillars = (
|
||||
cq.Sketch()
|
||||
.push(dim.mounting_pillar_positions)
|
||||
.push(mounting_pillar_positions)
|
||||
.trapezoid(screen_pillars.pillar_width, screen_pillars.pillar_height, 90, mode="a")
|
||||
.circle(dim.ti_radius, mode="s")
|
||||
.clean()
|
||||
|
BIN
tandy_lid.stl
BIN
tandy_lid.stl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user