From 84546403eae1846d49d309056a7b3f33ef8148a6 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 22 Mar 2012 05:33:59 -0300 Subject: [PATCH] bacon/case/case.fpd: added the middle part (untested) --- bacon/case/case.fpd | 105 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 100 insertions(+), 5 deletions(-) diff --git a/bacon/case/case.fpd b/bacon/case/case.fpd index eeb7133..c7d0d4a 100644 --- a/bacon/case/case.fpd +++ b/bacon/case/case.fpd @@ -89,6 +89,79 @@ frame top_surface { } +/* ----- Middle part ------------------------------------------------------- */ + + +frame mid_rrect { + base: vec @(red, red) + + RRECT_SETUP(edge_, base, width-2*red, length-2*red, ro_edge) + + usb_ur: vec edge_ur(-usb_roff, 0mm) + usb_ul: vec usb_ur(-usb_w, 0mm) + usb_ll: vec usb_ul(0mm, -usb_d+red) + usb_lr: vec usb_ur(0mm, -usb_d-red) + + line edge_llx edge_lrx + line edge_ulx usb_ul + + line usb_ul usb_ll /* USB bay */ + line usb_ll usb_lr + line usb_lr usb_ur + + line usb_ur edge_urx + line edge_lly edge_uly + line edge_lry edge_ury +} + + +frame mid_outline { + set red = 0mm + frame mid_rrect @ +} + + +frame mid_ridge { + loop if = 1, mid_ridge + + frame mid_outline @ + set red = topborder + frame mid_rrect @ +} + + +frame mid_pcb { + loop if = 1, mid_pcb + + frame mid_outline @ + set red = topborder+topridge + frame mid_rrect @ +} + + +frame post { + vec @(r, 0mm) + circ @ . +} + + +frame mid_body { + loop if = 1, mid_body + + frame mid_outline @ + + bc: vec @(width/2, batt_y) + br: vec bc(batt_d/2, 0mm) + circ bc br + + set r = post_do/2 + vec @(post_x, cvr_f+cvr_d+post_y) + frame post . + vec @(width-post_x, cvr_f+cvr_d+post_y) + frame post . +} + + /* ----- Main -------------------------------------------------------------- */ @@ -96,11 +169,15 @@ package "top-$part-$z" unit mm table - { part, z, top_surface, top_window, top_pcb, top_ridge } - { "top_surface", 2.5, 1, 0, 0, 0 } - { "top_window", 1.5, 0, 1, 0, 0 } -// { "top_pcb", 0.5, 0, 0, 1, 0 } - { "top_ridge", 0.5, 0, 0, 0, 1 } + { part, z, top_surface, top_window, top_pcb, top_ridge, + mid_ridge, mid_pcb, mid_body } + { "top_surface", 2.5, 1, 0, 0, 0, 0, 0, 0 } + { "top_window", 1.5, 0, 1, 0, 0, 0, 0, 0 } +// { "top_pcb", 0.5, 0, 0, 1, 0, 0, 0, 0 } + { "top_ridge", 0.5, 0, 0, 0, 1, 0, 0, 0 } + { "mid_ridge", 0.5, 0, 0, 0, 0, 1, 0, 0 } + { "mid_pcb", 1.0, 0, 0, 0, 0, 0, 1, 0 } + { "mid_body", 1.0, 0, 0, 0, 0, 0, 0, 1 } table { pcbw, pcbl, pcbgap } @@ -116,6 +193,20 @@ table { cmp_x0, cmp_y0, cmp_x1, cmp_y1, cmp_r } { 6.5mm, 1.0mm, 19.5mm, 30.0mm, 2.0mm } +table + /* usb_roff = offset from right outer case edge */ + { usb_w, usb_d, usb_roff } + { 8.5mm, 6.0mm, 4.0mm } + +table + /* post_y is from the edge of the battery bay. post_x is from the edge */ + { batt_d, batt_y, post_do, post_di, post_y, post_x } + { 20.2mm, 12.1mm, 4.1mm, 4.0mm, 5.0mm, 4.5mm } + +table + { cvr_w, cvr_d, cvr_f, cvr_play } + { 20.0mm, 15.0mm, 5.0mm, 0.1 mm } + set width = pcbw+2*(pcbgap+topridge+topborder) set length = pcbl+2*(pcbgap+topridge+topborder) @@ -134,6 +225,10 @@ frame top_pcb @ frame top_window @ frame top_surface @ +frame mid_ridge @ +frame mid_pcb @ +frame mid_body @ + measx top_outline.edge_ul -> top_outline.edge_ur 4mm measy top_outline.edge_ll -> top_outline.edge_ul 4mm measx top_pcb.pcb_ul -> top_pcb.pcb_ur 3mm