Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Erik Strand
strandstring
Commits
a964b725
Commit
a964b725
authored
May 11, 2019
by
Erik Strand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend pad divisions a little off the board
This ensures that the pads get completely divided.
parent
de115378
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
4 deletions
+26
-4
node_board/main.cpp
node_board/main.cpp
+26
-4
No files found.
node_board/main.cpp
View file @
a964b725
...
...
@@ -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
);
...
...
@@ -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"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment