Commit 118ddbdb authored by Erik Strand's avatar Erik Strand

First electrically complete board design

parent b791e9ab
......@@ -18,7 +18,7 @@ public:
min_cut_thickness_px_(to_px(min_cut_thickness_))
{
png_writer_.allocate(width_px_, height_px_);
png_writer_.set_all_pixels(255);
png_writer_.set_all_pixels_black();
}
int32_t to_px(double x) {
......@@ -95,59 +95,83 @@ int main() {
// SOIC dims
double const pad_width = 0.6;
double const pad_height = 2.4;
//double const soic_width = 5;
double const soic_height = 7;
double const soic_pitch = 1.27;
// SOIC pads
double const soic_pos_x = min_trace_thickness + min_cut_thickness;
double const soic_x_min = min_trace_thickness + min_cut_thickness;
double const soic_x_max = soic_x_min + 3 * soic_pitch + pad_width;
double const soic_btm_y = 0.5 * (height - soic_height);
double const soic_top_y = height - soic_btm_y;
for (int32_t i = 0; i < 4; ++i) {
pad_x_min = soic_pos_x + i * soic_pitch;
pad_x_min = soic_x_min + i * soic_pitch;
pad_x_max = pad_x_min + pad_width;
pad_y_max = soic_btm_y + pad_height;
board.draw_pad(pad_x_min, pad_x_max, soic_btm_y, pad_y_max);
board.draw_rectangle(pad_x_min, pad_x_max, soic_btm_y, pad_y_max);
pad_y_min = soic_top_y - pad_height;
board.draw_pad(pad_x_min, pad_x_max, pad_y_min, soic_top_y);
board.draw_rectangle(pad_x_min, pad_x_max, pad_y_min, soic_top_y);
}
// Data/VCC divider
pad_x_min += pad_width + min_cut_thickness + min_trace_thickness;
pad_x_max = pad_x_min + min_cut_thickness;
pad_y_min = soic_btm_y - min_cut_thickness;
pad_y_max = soic_top_y + min_cut_thickness;
std::cout << "Power trace is " << width - pad_x_max << "mm\n";
board.draw_rectangle(pad_x_min, pad_x_max, pad_y_min, pad_y_max, 0);
// Ground/data divider
pad_x_min = min_trace_thickness;
pad_x_max = pad_x_min + min_cut_thickness;
board.draw_rectangle(pad_x_min, pad_x_max, soic_btm_y, soic_top_y, 0);
// Ground pad links
pad_x_min += min_cut_thickness + 0.5 * (pad_width - min_trace_thickness);
pad_x_max = pad_x_min + min_trace_thickness;
pad_y_min = soic_btm_y - min_cut_thickness;
pad_y_max = soic_btm_y;
board.draw_rectangle(pad_x_min, pad_x_max, pad_y_min, pad_y_max, 255);
// Data and power pad links
pad_y_min = soic_top_y - pad_height - min_cut_thickness;
pad_y_max = soic_top_y + min_cut_thickness;
board.draw_rectangle(pad_x_min, pad_x_max, pad_y_min, pad_y_max, 255);
pad_x_min += soic_pitch;
pad_x_max += soic_pitch;
board.draw_rectangle(pad_x_min, pad_x_max, pad_y_min, pad_y_max, 255);
// Cable attachment dividers
// Ground pads and traces
double const cable_pad_width = (width - 2 * min_cut_thickness) / 3;
pad_x_min = cable_pad_width;
pad_x_max = pad_x_min + min_cut_thickness;
board.draw_rectangle(pad_x_min, pad_x_max, 0, soic_btm_y - min_cut_thickness, 0);
pad_x_min += cable_pad_width + min_cut_thickness;
pad_x_max = pad_x_min + min_cut_thickness;
board.draw_rectangle(pad_x_min, pad_x_max, 0, soic_btm_y - 2 * min_cut_thickness, 0);
double const cable_pad_height = soic_btm_y - min_cut_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,
cable_pad_height,
cable_pad_height + min_cut_thickness);
board.draw_rectangle(0,
cable_pad_width,
soic_top_y + 2 * min_cut_thickness + min_trace_thickness,
height);
// Data pads and traces
double const data_pad_x_min = cable_pad_width + min_cut_thickness;
double const data_pad_x_max = data_pad_x_min + cable_pad_width;
board.draw_rectangle(data_pad_x_min, data_pad_x_max, 0, cable_pad_height);
board.draw_rectangle(data_pad_x_max,
soic_x_max + min_cut_thickness + min_trace_thickness,
cable_pad_height - min_cut_thickness,
cable_pad_height);
board.draw_rectangle(soic_x_max + min_cut_thickness,
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),
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,
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),
data_pad_x_max,
soic_top_y + min_cut_thickness,
soic_top_y + min_cut_thickness + min_trace_thickness);
board.draw_rectangle(data_pad_x_min, data_pad_x_max, soic_top_y + min_cut_thickness, height);
// VCC pads and traces
double const vcc_pad_x_min = 2 * (cable_pad_width + min_cut_thickness);
board.draw_rectangle(vcc_pad_x_min,
width,
0,
cable_pad_height - min_cut_thickness - min_trace_thickness);
board.draw_rectangle(width - min_trace_thickness, width, 0, height);
board.draw_rectangle(vcc_pad_x_min,
width,
height - cable_pad_height,
height);
double const vcc_pin_x = soic_x_min + soic_pitch + 0.5 * (pad_width - min_trace_thickness);
board.draw_rectangle(vcc_pin_x,
width,
soic_top_y - pad_height - min_cut_thickness - min_trace_thickness,
soic_top_y - pad_height - min_cut_thickness);
board.draw_rectangle(vcc_pin_x,
vcc_pin_x + min_trace_thickness,
soic_top_y - pad_height - min_cut_thickness,
soic_top_y);
board.save("node_board_traces.png");
......
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