Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
strandstring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
strandstring
Commits
cf652686
Commit
cf652686
authored
6 years ago
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Factor out a commonly used expression
parent
f98ee3f6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
node_board/main.cpp
+8
-7
8 additions, 7 deletions
node_board/main.cpp
with
8 additions
and
7 deletions
node_board/main.cpp
+
8
−
7
View file @
cf652686
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment