Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
libraries
Commits
90d7befd
Commit
90d7befd
authored
Aug 30, 2021
by
Neil Gershenfeld
Browse files
fix wire cylinder roundoff
parent
804ffb2b
Pipeline
#12195
passed with stage
in 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
python/pcb.py
View file @
90d7befd
...
...
@@ -1049,7 +1049,8 @@ def wire(pcb,width,*points):
x0
=
points
[
0
].
x
y0
=
points
[
0
].
y
z0
=
points
[
0
].
z
pcb
.
board
=
add
(
pcb
.
board
,
cylinder
(
x0
,
y0
,
z0
,
z0
,
width
/
2
))
roundoff
=
1e-6
pcb
.
board
=
add
(
pcb
.
board
,
cylinder
(
x0
,
y0
,
z0
-
roundoff
,
z0
+
roundoff
,
width
/
2
))
for
i
in
range
(
1
,
len
(
points
)):
x0
=
points
[
i
-
1
].
x
y0
=
points
[
i
-
1
].
y
...
...
@@ -1058,7 +1059,7 @@ def wire(pcb,width,*points):
y1
=
points
[
i
].
y
z1
=
points
[
i
].
z
pcb
.
board
=
add
(
pcb
.
board
,
line
(
x0
,
y0
,
x1
,
y1
,
z1
,
width
))
pcb
.
board
=
add
(
pcb
.
board
,
cylinder
(
x1
,
y1
,
z1
,
z1
,
width
/
2
))
pcb
.
board
=
add
(
pcb
.
board
,
cylinder
(
x1
,
y1
,
z1
-
roundoff
,
z1
+
roundoff
,
width
/
2
))
return
pcb
def
wirer
(
pcb
,
width
,
*
points
):
...
...
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