Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rocoelectrical
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rocoelec
rocoelectrical
Commits
2f45f6b1
Commit
2f45f6b1
authored
5 years ago
by
Jingyan Ling
Browse files
Options
Downloads
Patches
Plain Diff
bakcup before change logic
parent
95c1bbc9
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+35
-0
35 additions, 0 deletions
README.md
paperbot_ee_autoroute/roco_ee_dwg_processing.py
+69
-53
69 additions, 53 deletions
paperbot_ee_autoroute/roco_ee_dwg_processing.py
with
104 additions
and
53 deletions
README.md
+
35
−
0
View file @
2f45f6b1
## ENGINEERING JOURNAL
### Jingyan Ling
### 08/15/2019
-
Solving issue: Connection between isolation box and parallel traces
~~~
input: endpoints of a path (each endpoints has i+1 for finding a line), iso_size, trace_width
output: intersect points*2 , draw isolation box in the process
input= contact_ept, further_ept, size, width
for pin_loc in all pin locations:
if the distance between endpoint1 and pin_loc is less than tolerance:
l=line(contact_ept,further_ept)
parallel_traces=find_offset(l,width)
iso_l_pts=isolation_box_linepts(size,pin_loc)
contact_list=[]
for l in parallel_traces:
contact=find_contact_iso_trace(l,iso_l_pts,further_ept)
contact_list.append(contact)
draw_list=[]
draw_list.append(contact_list[0])
while len(iso_boundary)!=0:
for points in iso_boundary:
find a point that is closest to last point of draw_list
if not such point is inside of two contacts:
draw_list.append(points)
iso_boundary.remove(point)
~~~
### 08/14/2019
-
Preparing software demo
...
...
This diff is collapsed.
Click to expand it.
paperbot_ee_autoroute/roco_ee_dwg_processing.py
+
69
−
53
View file @
2f45f6b1
...
...
@@ -55,64 +55,64 @@ class post_process():
'
linetype
'
:
'
DASHDOT
'
})
def
parallel_trace
(
self
,
width
):
# for path in self.wiring:
path
=
self
.
wiring
[
0
]
for
i
in
range
(
len
(
path
)
-
1
):
pt1
=
path
[
i
][
0
],
path
[
i
][
1
]
pt2
=
path
[
i
+
1
][
0
],
path
[
i
+
1
][
1
]
l1
=
find_line_eq
(
pt1
,
pt2
)
if
i
<
len
(
path
)
-
2
:
#before last line
pt3
=
path
[
i
+
2
][
0
],
path
[
i
+
2
][
1
]
l2
=
find_line_eq
(
pt2
,
pt3
)
#filter bi-sector
_bi
=
find_angle_bisector
(
l1
,
l2
)
for
sector
in
_bi
:
if
if_two_pt_on_diff_side
(
sector
,
pt1
,
pt3
):
bi
=
sector
for
path
in
self
.
wiring
:
# path=self.wiring[0]
for
i
in
range
(
len
(
path
)
-
1
):
pt1
=
path
[
i
][
0
],
path
[
i
][
1
]
pt2
=
path
[
i
+
1
][
0
],
path
[
i
+
1
][
1
]
if
i
==
0
:
# if the first point
s1
,
s2
=
self
.
find_iso_bry
(
width
,
pt1
,
pt2
)
offl1_in
,
offl1_out
=
find_offset
(
l1
,
width
)
l1
=
find_line_eq
(
pt1
,
pt2
)
if
i
<
len
(
path
)
-
2
:
#before last line
pt3
=
path
[
i
+
2
][
0
],
path
[
i
+
2
][
1
]
l2
=
find_line_eq
(
pt2
,
pt3
)
#filter bi-sector
_bi
=
find_angle_bisector
(
l1
,
l2
)
for
sector
in
_bi
:
if
if_two_pt_on_diff_side
(
sector
,
pt1
,
pt3
):
bi
=
sector
if
i
==
0
:
# if the first point
s1
,
s2
=
self
.
find_iso_bry
(
width
,
pt1
,
pt2
)
offl1_in
,
offl1_out
=
find_offset
(
l1
,
width
)
# if l1[2]==0:
# s1=[pt1[0]-width/2,pt1[1]]
# s2=[pt1[0]+width/2,pt1[1]]
# else:
# s1=[pt1[0],offl1_in[0]*pt1[0]+offl1_in[1]]
# s2=[pt1[0],offl1_out[0]*pt1[0]+offl1_out[1]]
offl2_in
,
offl2_out
=
find_offset
(
l2
,
width
)
e1
=
find_intersect
(
offl1_in
,
bi
)
e2
=
find_intersect
(
offl1_out
,
bi
)
else
:
e1
,
e2
=
self
.
find_iso_bry
(
width
,
pt2
,
pt1
)
# if l1[2]==0:
#
s
1=[pt
1
[0]-width/2,pt
1
[1]]
#
s
2=[pt
1
[0]+width/2,pt
1
[1]]
#
e
1=[pt
2
[0]-width/2,pt
2
[1]]
#
e
2=[pt
2
[0]+width/2,pt
2
[1]]
# else:
# s1=[pt1[0],offl1_in[0]*pt1[0]+offl1_in[1]]
# s2=[pt1[0],offl1_out[0]*pt1[0]+offl1_out[1]]
offl2_in
,
offl2_out
=
find_offset
(
l2
,
width
)
e1
=
find_intersect
(
offl1_in
,
bi
)
e2
=
find_intersect
(
offl1_out
,
bi
)
else
:
e1
,
e2
=
self
.
find_iso_bry
(
width
,
pt2
,
pt1
)
# if l1[2]==0:
# e1=[pt2[0]-width/2,pt2[1]]
# e2=[pt2[0]+width/2,pt2[1]]
# else:
# e1=[pt2[0],offl1_in[0]*pt2[0]+offl1_in[1]]
# e2=[pt2[0],offl1_out[0]*pt2[0]+offl1_out[1]]
# e1=[pt2[0],offl1_in[0]*pt2[0]+offl1_in[1]]
# e2=[pt2[0],offl1_out[0]*pt2[0]+offl1_out[1]]
self
.
msp
.
add_line
(
s1
,
e1
,
dxfattribs
=
{
'
layer
'
:
'
Circuit
'
,
'
linetype
'
:
'
DASHDOT
'
})
self
.
msp
.
add_line
(
s2
,
e2
,
dxfattribs
=
{
'
layer
'
:
'
Circuit
'
,
'
linetype
'
:
'
DASHDOT
'
})
self
.
msp
.
add_line
(
s1
,
e1
,
dxfattribs
=
{
'
layer
'
:
'
Circuit
'
,
'
linetype
'
:
'
DASHDOT
'
})
self
.
msp
.
add_line
(
s2
,
e2
,
dxfattribs
=
{
'
layer
'
:
'
Circuit
'
,
'
linetype
'
:
'
DASHDOT
'
})
if
i
<
len
(
path
)
-
2
:
if
list
(
e1
)
==
list
(
find_intersect
(
offl2_out
,
bi
)):
offl1_out
,
offl1_in
=
find_offset
(
l2
,
width
)
else
:
offl1_in
,
offl1_out
=
find_offset
(
l2
,
width
)
s1
=
find_intersect
(
offl1_in
,
bi
)
s2
=
find_intersect
(
offl1_out
,
bi
)
if
i
<
len
(
path
)
-
2
:
if
list
(
e1
)
==
list
(
find_intersect
(
offl2_out
,
bi
)):
offl1_out
,
offl1_in
=
find_offset
(
l2
,
width
)
else
:
offl1_in
,
offl1_out
=
find_offset
(
l2
,
width
)
s1
=
find_intersect
(
offl1_in
,
bi
)
s2
=
find_intersect
(
offl1_out
,
bi
)
def
draw_cross_cut
(
self
,
size
):
for
module_pin
in
self
.
pin_at
:
...
...
@@ -143,6 +143,22 @@ class post_process():
return
draw_pt1
,
draw_pt2
def
find_contact_iso_trace
(
trace_line
,
iso_l_pts
,
further_ept
):
inter_temp
=
[]
for
l_pts
in
iso_l_pts
:
pt1
=
l_pts
[
0
]
pt2
=
l_pts
[
1
]
l
=
find_line_eq
(
pt1
,
pt2
)
inter
=
find_intersect
(
l
,
trace_line
)
if
type
(
inter
)
!=
type
(
None
):
if
inter
[
0
]
>=
pt1
[
0
]
and
inter
[
0
]
<=
pt2
[
0
]
and
inter
[
1
]
>=
pt1
[
1
]
and
inter
[
1
]
<=
pt2
[
1
]:
inter_temp
.
append
(
inter
)
dis_arr
=
[]
for
p
in
inter_temp
:
dis
=
sqrt
((
p
[
0
]
-
further_ept
[
0
])
**
2
+
(
p
[
1
]
-
further_ept
[
1
])
**
2
)
dis_arr
.
append
(
dis
)
contact
=
inter_temp
[
np
.
argmin
(
dis_arr
)]
return
contact
def
isolation_box_linepts
(
box_size
,
pt
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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