...
 
Commits (2)
......@@ -28,6 +28,10 @@ public:
}
void set_pixel(int32_t x, int32_t y, uint8_t value = 255) {
x = std::max(-2 * min_cut_thickness_px_, x);
x = std::min(width_px_ + 2 * min_cut_thickness_px_, x);
y = std::max(-2 * min_cut_thickness_px_, y);
y = std::min(height_px_ + 2 * min_cut_thickness_px_, y);
png_writer_.set_pixel(2 * min_cut_thickness_px_ + x,
2 * min_cut_thickness_px_ + height_px_ - y - 1,
value);
......@@ -36,10 +40,6 @@ public:
void draw_int_rectangle(
int32_t x_min, int32_t x_max, int32_t y_min, int32_t y_max, uint8_t value = 255
) {
x_min = std::max(0, x_min);
x_max = std::min(width_px_, x_max);
y_min = std::max(0, y_min);
y_max = std::min(height_px_, y_max);
for (int32_t x = x_min; x < x_max; ++x) {
for (int32_t y = y_min; y < y_max; ++y) {
set_pixel(x, y, value);
......@@ -96,7 +96,7 @@ int main() {
// board params
// width is deduced later
double const height = 14;
double const height = 18;
double const ppmm = 50; // equivalent to 1270 ppi
double const min_cut_thickness = 0.38;
double const min_trace_thickness = 0.35;
......@@ -197,6 +197,28 @@ int main() {
soic_top_y - pad_height - min_cut_thickness,
soic_top_y);
// Extend pad divisions
board.draw_rectangle(cable_pad_width,
cable_pad_width + min_cut_thickness,
-min_cut_thickness,
0,
0);
board.draw_rectangle(cable_pad_width,
cable_pad_width + min_cut_thickness,
height,
height + min_cut_thickness,
0);
board.draw_rectangle(width - cable_pad_width - min_cut_thickness,
width - cable_pad_width,
-min_cut_thickness,
0,
0);
board.draw_rectangle(width - cable_pad_width - min_cut_thickness,
width - cable_pad_width,
height,
height + min_cut_thickness,
0);
board.save("node_board_traces.png");
board.save_outline("node_board_outline.png");
......