better phone shape, combined model improved

This commit is contained in:
Ricardo (XenGi) Band 2022-03-02 20:26:05 +01:00
commit 7341b4e76e
No known key found for this signature in database
GPG key ID: 1A9D657D06B5820E
4 changed files with 39 additions and 5 deletions

View file

@ -84,12 +84,29 @@ def cli(layout, variant, stl, emf, amf, detail, config_file):
)
}
columns = 13
alps_thickness = 0.78
alps_height = 4
alps_width = 6
pcb_thickness = 1
bottom_cover_thickness = 0.5
pcb_margin_y = 3
pcb_margin_x = (PCB_WIDTH - (columns * config.getfloat("key_mat", "key_width", fallback=9) + (columns - 1) * config.getfloat("key_mat", "padding", fallback=1))) / 2 + (config.getfloat("key_mat", "key_width", fallback=9) - 6) / 2
key_mat_width = 13 * config.getfloat("key_mat", "key_width", fallback=9) + 12 * config.getfloat("key_mat", "padding", fallback=1) + 2 * config.getfloat("key_mat", "margin", fallback=1)
full_model = components["lower_case"] + translate(v=((config.getfloat("phone", "width") - PCB_WIDTH) / 2, config.getfloat("phone", "corner_radius") / 2, 0.5))(
# TODO: fix x of pcb
full_model = components["lower_case"] + translate(v=((config.getfloat("phone", "width") - PCB_WIDTH) / 2, config.getfloat("phone", "corner_radius") / 2, bottom_cover_thickness))(
components["pcb"]
) + translate(v=((config.getfloat("phone", "width") - key_mat_width) / 2, 3 + config.getfloat("key_mat", "margin", fallback=1) + (config.getfloat("key_mat", "key_height", fallback=6) - 4) / 2 , 1.78))(
) + translate(v=(
pcb_margin_x + config.getfloat("phone", "corner_radius", fallback=10) / 2 - config.getfloat("key_mat", "margin", fallback=1) - (config.getfloat("key_mat", "key_width", fallback=9) - alps_width) / 2,
pcb_margin_y + config.getfloat("phone", "corner_radius", fallback=10) / 2 - config.getfloat("key_mat", "margin", fallback=1) - (config.getfloat("key_mat", "key_height", fallback=6) - alps_height) / 2,
alps_thickness + pcb_thickness + bottom_cover_thickness))(
components["key_mat"]
)
# config.getfloat("phone", "width") - key_mat_width) / 2,
# 3 + config.getfloat("key_mat", "margin", fallback=1) + (config.getfloat("key_mat", "key_height", fallback=6) - 4) / 2 ,
# 1.78
scad_render_to_file(
full_model,