mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-15 07:54:03 +02:00
Merge branch 'master' of projects.qi-hardware.com:wernermisc
This commit is contained in:
commit
e228723187
59
bacon/case/Makefile
Normal file
59
bacon/case/Makefile
Normal file
@ -0,0 +1,59 @@
|
||||
CAE_TOOLS = /home/qi/cae-tools
|
||||
CAMEO = $(CAE_TOOLS)/cameo
|
||||
SPOOL = $(CAE_TOOLS)/spool/spool
|
||||
CNGT = $(CAE_TOOLS)/cngt/cngt
|
||||
GP2RML = $(CAE_TOOLS)/gp2rml/gp2rml
|
||||
|
||||
X0 = 5
|
||||
Y0 = 5
|
||||
Z1 = -44
|
||||
PIECE = -5 -5 30 55
|
||||
PIECE_Z = 5.5
|
||||
Z_STEP = 2
|
||||
CLEARANCE = 5
|
||||
SPEED_XY = 1
|
||||
SPEED_Z = 1
|
||||
OVERSHOOT = 0.2
|
||||
|
||||
PARAMS = X0=$(X0)mm Y0=$(Y0)mm Z1=$(Z1)mm PIECE_Z=$(PIECE_Z)mm
|
||||
|
||||
.PHONY: all plot mill pos cng clean
|
||||
|
||||
all: mill.rml
|
||||
|
||||
case.gp:
|
||||
fped -g case.fpd || { rm -f $@; exit 1; }
|
||||
|
||||
top.gp: case.gp
|
||||
$(CAMEO)/fped2d2z.pl -r 0=-$(OVERSHOOT) top $^ >$@ || \
|
||||
{ rm -f $@; exit 1; }
|
||||
|
||||
top-piece.gp: top.gp
|
||||
./genpiece.pl -r $(PIECE) $< >$@ || { rm -f $@; exit 1; }
|
||||
|
||||
top-area.gp: top-piece.gp top.gp cam.sh Makefile
|
||||
./cam.sh PART=top CAMEO=$(CAMEO)/cameo $(PARAMS) >$@ || \
|
||||
{ rm -f $@; exit 1; }
|
||||
|
||||
mill.gp: top-area.gp Makefile
|
||||
$(CAMEO)/zstack.pl $(Z1) $(Z_STEP) $< >$@ || \
|
||||
{ rm -f $@; exit 1; }
|
||||
|
||||
mill.rml: mill.gp Makefile
|
||||
$(GP2RML) $(CLEARANCE) $(SPEED_XY) $(SPEED_Z) $< >$@ || \
|
||||
{ rm -f $@; exit 1; }
|
||||
|
||||
plot: mill.gp
|
||||
echo 'splot "mill.gp" with lines' | gnuplot -persist
|
||||
|
||||
mill: mill.rml
|
||||
PORT=/dev/ttyUSB0 $(SPOOL) $<
|
||||
|
||||
pos:
|
||||
$(CNGT) 0
|
||||
|
||||
cng: mill.gp
|
||||
$(CNGT) $(Z1) 10 $<
|
||||
|
||||
clean:
|
||||
rm -f case.gp top-piece.gp top.gp top-area.gp mill.gp mill.rml
|
25
bacon/case/cam.sh
Executable file
25
bacon/case/cam.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
while [ "$1" ]; do
|
||||
eval "$1"
|
||||
shift
|
||||
done
|
||||
|
||||
: ${MILL:=125mil}
|
||||
: ${OVERLAP:=0.3mm}
|
||||
: ${X0:=0mm}
|
||||
: ${Y0:=0mm}
|
||||
: ${Z1:=0mm}
|
||||
: ${PIECE_Z:=0mm}
|
||||
: ${CAMEO:=cameo}
|
||||
|
||||
echo Z1 is $Z1 1>&2
|
||||
|
||||
$CAMEO <<EOF
|
||||
gnuplot $MILL $PART-piece.gp
|
||||
gnuplot $MILL $PART.gp
|
||||
align 1 $X0 $Y0
|
||||
z 0 ${Z1}
|
||||
z -${PIECE_Z}
|
||||
area $OVERLAP
|
||||
write $PART-area.gp
|
||||
EOF
|
145
bacon/case/case.fpd
Normal file
145
bacon/case/case.fpd
Normal file
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Draw a rounded edge in one quadrant
|
||||
*
|
||||
* Draw a arc from corner point vc plus rector ra to vc+rb. vc+ra is stored
|
||||
* in va and vc+rb is stored in vb.
|
||||
*/
|
||||
|
||||
#define Q(va, vb, vc, ra, rb) \
|
||||
va: vec vc ra; \
|
||||
vb: vec vc rb; \
|
||||
vc##_center: vec va rb; \
|
||||
arc vc##_center va vb
|
||||
|
||||
/*
|
||||
* Rectangle with rounded corners.
|
||||
*
|
||||
* pfx is the prefix for all the names generated by this macro. origin is the
|
||||
* lower left corner. w and h are the width and height. r is the radius of the
|
||||
* corners.
|
||||
*/
|
||||
|
||||
#define RRECT_SETUP(pfx, origin, w, h, r) \
|
||||
pfx##ll: vec origin(0mm, 0mm); \
|
||||
pfx##lr: vec pfx##ll(w, 0mm); \
|
||||
pfx##ul: vec pfx##ll(0mm, h); \
|
||||
pfx##ur: vec pfx##ll(w, h); \
|
||||
Q(pfx##lly, pfx##llx, pfx##ll, (0mm, r), (r, 0mm)); \
|
||||
Q(pfx##lrx, pfx##lry, pfx##lr, (-r, 0mm), (0mm, r)); \
|
||||
Q(pfx##ulx, pfx##uly, pfx##ul, (r, 0mm), (0mm, -r)); \
|
||||
Q(pfx##ury, pfx##urx, pfx##ur, (0mm, -r), (-r, 0mm))
|
||||
|
||||
#define RRECT_DRAW_LINES(pfx) \
|
||||
line pfx##llx pfx##lrx; \
|
||||
line pfx##ulx pfx##urx; \
|
||||
line pfx##lly pfx##uly; \
|
||||
line pfx##lry pfx##ury
|
||||
|
||||
#define RRECT(pfx, origin, w, h, r) \
|
||||
RRECT_SETUP(pfx, origin, w, h, r); \
|
||||
RRECT_DRAW_LINES(pfx)
|
||||
|
||||
|
||||
/* ----- Top part ---------------------------------------------------------- */
|
||||
|
||||
|
||||
frame top_outline {
|
||||
RRECT(edge_, @, width, length, ro_edge)
|
||||
}
|
||||
|
||||
frame top_window {
|
||||
loop if = 1, top_window
|
||||
|
||||
set off = topborder+topridge
|
||||
|
||||
frame top_outline @
|
||||
|
||||
win_orig: vec @(off+pcbgap+win_x0, off)
|
||||
RRECT(win_, win_orig, win_x1-win_x0, length-2*off, win_r)
|
||||
|
||||
cmp_orig: vec @(off+pcbgap+cmp_x0, off+pcbgap+cmp_y0)
|
||||
RRECT(cmp_, cmp_orig, cmp_x1-cmp_x0, cmp_y1-cmp_y0, cmp_r)
|
||||
}
|
||||
|
||||
frame top_pcb {
|
||||
loop if = 1, top_pcb
|
||||
|
||||
set off = topborder+topridge
|
||||
|
||||
frame top_outline @
|
||||
ll: vec @(off, off)
|
||||
RRECT(pcb_, ll, width-2*off, length-2*off, ri_ridge)
|
||||
}
|
||||
|
||||
frame top_ridge {
|
||||
loop if = 1, top_ridge
|
||||
|
||||
set inside = topborder+topridge
|
||||
|
||||
ro: vec @(topborder, topborder)
|
||||
RRECT(ridge_o_, ro, width-2*topborder, length-2*topborder, ro_ridge)
|
||||
ri: vec ro(topridge, topridge)
|
||||
RRECT(ridge_i_, ri, width-2*inside, length-2*inside, ri_ridge)
|
||||
}
|
||||
|
||||
frame top_surface {
|
||||
loop if = 1, top_surface
|
||||
|
||||
frame top_outline @
|
||||
}
|
||||
|
||||
|
||||
/* ----- Main -------------------------------------------------------------- */
|
||||
|
||||
|
||||
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, 0, 0, 0, 1 }
|
||||
|
||||
table
|
||||
{ pcbw, pcbl, pcbgap }
|
||||
{ 20mm, 45mm, 0.2mm }
|
||||
|
||||
table
|
||||
/* window position relative to left edge of PCB */
|
||||
{ topridge, topborder, win_x0, win_x1, win_r }
|
||||
{ 1.0mm, 1.0mm, 1.0mm, 5.0mm, 1.6mm }
|
||||
|
||||
table
|
||||
/* component area position relative to lower left corner of PCB */
|
||||
{ cmp_x0, cmp_y0, cmp_x1, cmp_y1, cmp_r }
|
||||
{ 7.0mm, 1.0mm, 20.0mm, 30.0mm, 2.0mm }
|
||||
|
||||
set width = pcbw+2*(pcbgap+topridge+topborder)
|
||||
set length = pcbl+2*(pcbgap+topridge+topborder)
|
||||
|
||||
set ri_ridge = 2.0mm
|
||||
set ro_ridge = ri_ridge+topridge
|
||||
|
||||
/*
|
||||
* ro_edge is an outer edge, so we can make the radius smaller than ro_ridge,
|
||||
* for added strength and less fruity esthetics.
|
||||
*/
|
||||
|
||||
set ro_edge = 1.5mm
|
||||
|
||||
frame top_ridge @
|
||||
frame top_pcb @
|
||||
frame top_window @
|
||||
frame top_surface @
|
||||
|
||||
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
|
||||
measy top_pcb.pcb_ll -> top_pcb.pcb_ul 3mm
|
||||
|
||||
measx top_ridge.ridge_o_ul -> top_ridge.ridge_o_ur 4mm
|
||||
measy top_ridge.ridge_o_ll -> top_ridge.ridge_o_ul 4mm
|
||||
measx top_ridge.ridge_i_ul -> top_ridge.ridge_i_ur 3mm
|
||||
measy top_ridge.ridge_i_ll -> top_ridge.ridge_i_ul 3mm
|
29
bacon/case/genpiece.pl
Executable file
29
bacon/case/genpiece.pl
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
if ($ARGV[0] eq "-r") {
|
||||
shift @ARGV;
|
||||
$reverse = 1;
|
||||
}
|
||||
|
||||
$x0 = shift @ARGV;
|
||||
$y0 = shift @ARGV;
|
||||
$x1 = shift @ARGV;
|
||||
$y1 = shift @ARGV;
|
||||
|
||||
while (<>) {
|
||||
$z{$1} = 1 if /\s+(-?\d+(\.\d*)?)\s*$/;
|
||||
$zmax = $1 if $1 > $zmax || !defined $zmax;
|
||||
}
|
||||
|
||||
if ($reverse) {
|
||||
($x0, $y0) = ($y0, $x0);
|
||||
($x1, $y1) = ($y1, $x1);
|
||||
}
|
||||
|
||||
for (keys %z) {
|
||||
print "$x0 $y0 $_\n";
|
||||
print "$x1 $y0 $_\n";
|
||||
print "$x1 $y1 $_\n";
|
||||
print "$x0 $y1 $_\n";
|
||||
print "$x0 $y0 $_\n\n";
|
||||
}
|
@ -38,11 +38,11 @@ unit mm
|
||||
|
||||
table
|
||||
{ B, CB, CF, CL, CR }
|
||||
{ 45mm, 25mm, 10mm, 5mm, 15mm }
|
||||
{ 45mm, 25mm, 10mm, 5mm, 13mm }
|
||||
|
||||
table
|
||||
{ HL, HW }
|
||||
{ 9*100mil, 2*100mil }
|
||||
{ 10*100mil, 2*100mil }
|
||||
|
||||
table
|
||||
{ FB, FT }
|
||||
|
2
m1r4/dsv/EXTRA
Normal file
2
m1r4/dsv/EXTRA
Normal file
@ -0,0 +1,2 @@
|
||||
N: usbpwr
|
||||
D: http://www.usb.org/developers/whitepapers/power_delivery_motherboards.pdf
|
@ -13,7 +13,7 @@ BOM = milkymist_one_bom_r4.csv
|
||||
all: dsv
|
||||
|
||||
dsv: BOOKSHELF
|
||||
../../../eda-tools/dsv/dsv setup BOOKSHELF
|
||||
../../../eda-tools/dsv/dsv setup BOOKSHELF EXTRA
|
||||
|
||||
BOOKSHELF: $(BOM) bomshelf SUPPLEMENT
|
||||
./bomshelf $< >$@ || { rm -f $@; exit 1; }
|
||||
|
Loading…
Reference in New Issue
Block a user