Commit cf652686 authored by Erik Strand's avatar Erik Strand

Factor out a commonly used expression

parent f98ee3f6
......@@ -124,10 +124,11 @@ int main() {
// Ground pads and traces
double const cable_pad_width = (width - 2 * min_cut_thickness) / 3;
double const cable_pad_height = soic_btm_y - min_cut_thickness;
double const bridge_offset = 0.5 * (pad_width - min_trace_thickness);
board.draw_rectangle(0, cable_pad_width, 0, cable_pad_height);
board.draw_rectangle(0, min_trace_thickness, 0, height);
board.draw_rectangle(soic_x_min + 0.5 * (pad_width - min_trace_thickness),
soic_x_min + 0.5 * (pad_width - min_trace_thickness) + min_trace_thickness,
board.draw_rectangle(soic_x_min + bridge_offset,
soic_x_min + bridge_offset + min_trace_thickness,
cable_pad_height,
cable_pad_height + min_cut_thickness);
board.draw_rectangle(0,
......@@ -147,15 +148,15 @@ int main() {
soic_x_max + min_cut_thickness + min_trace_thickness,
cable_pad_height,
soic_btm_y + pad_height + min_cut_thickness);
board.draw_rectangle(soic_x_min + 0.5 * (pad_width - min_trace_thickness),
board.draw_rectangle(soic_x_min + bridge_offset,
soic_x_max + min_cut_thickness + min_trace_thickness,
soic_btm_y + pad_height + min_cut_thickness,
soic_btm_y + pad_height + min_cut_thickness + min_trace_thickness);
board.draw_rectangle(soic_x_min + 0.5 * (pad_width - min_trace_thickness),
soic_x_min + 0.5 * (pad_width - min_trace_thickness) + min_trace_thickness,
board.draw_rectangle(soic_x_min + bridge_offset,
soic_x_min + bridge_offset + min_trace_thickness,
soic_btm_y + pad_height + min_cut_thickness,
soic_top_y + min_cut_thickness);
board.draw_rectangle(soic_x_min + 0.5 * (pad_width - min_trace_thickness),
board.draw_rectangle(soic_x_min + bridge_offset,
data_pad_x_max,
soic_top_y + min_cut_thickness,
soic_top_y + min_cut_thickness + min_trace_thickness);
......@@ -180,7 +181,7 @@ int main() {
width,
soic_top_y - pad_height - min_cut_thickness,
height - cable_pad_height);
double const vcc_pin_x = soic_x_min + soic_pitch + 0.5 * (pad_width - min_trace_thickness);
double const vcc_pin_x = soic_x_min + soic_pitch + bridge_offset;
board.draw_rectangle(vcc_pin_x,
width,
soic_top_y - pad_height - min_cut_thickness - min_trace_thickness,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment