Skip to content
Snippets Groups Projects
Commit c7bfa82d authored by Jingyan Ling's avatar Jingyan Ling
Browse files

soving brach

parent af935c4f
Branches
No related merge requests found
Showing
with 6148 additions and 3261 deletions
## ENGINEERING JOURNAL
### Jingyan Ling
### 08/26/2019
- Fixed issue:
- `roco_dsn` now reads `flip` argument to get correct pin locations
- Solving issue in progress:
- When multiple wires are connecting to single pin. Isolation box is not draw correctly
- Have Done:
- Redo `sesreader` so paths will not be continued to merge if it reach one of the pin location
- ![](journal_media/same_pin_intersect.png)
### 08/22/2019
- Try to solve issues:
......
No preview for this file type
No preview for this file type
......@@ -213,7 +213,7 @@ class Footprint(AST):
pad=module.pads[i]
pin_index=int(pad.name)
pin_at=np.array(pad.at)*unit_convert
# pin_at[1]*=-1
pin_at[1]*=-1
pin_at=list(pin_at)
pin_size=pad.size[0]*unit_convert
pin_type='Round[A]Pad_'+str(int(pin_size))+'_um'
......
#!/usr/bin/env python3
import copy
def find_wire(file_path):
import numpy as np
def find_wire(file_path,pin_loc):
if not file_path.endswith('.ses'):
file_path+='.ses'
ses=open(file_path,'r').read().splitlines()
......@@ -24,37 +25,65 @@ def find_wire(file_path):
onepath.append(pts)
path_list.append(onepath)
pin_loc_=[]
for module in pin_loc:
for pin in module:
pin=np.array(pin)*10000
pin=pin.astype(int)
pin=pin.tolist()
pin_loc_.append(pin)
merged_path_list=[]
while len(path_list)!=0:
merged_path=path_list[0]
path_list.remove(merged_path)
flag=True
s_merge_flag=True
e_merge_flag=True
while flag:
s=merged_path[0]
e=merged_path[-1]
m1_len=len(merged_path)
flag=False
if s in pin_loc_:
s_merge_flag=False
if e in pin_loc_:
e_merge_flag=False
for restpath in path_list:
s_=restpath[0]
e_=restpath[-1]
if s==s_ or s==e_ or e==s_ or e==e_:
m2_len=len(restpath)
if m1_len<3 or m2_len<3:
to_merge_copy=copy.deepcopy(restpath)
#update merge path
if s==s_:
if s==s_ and s_merge_flag:
merged_path.remove(s)
merged_path=list(reversed(merged_path))+(to_merge_copy)
if s==e_:
path_list.remove(restpath)
flag=True
break
if s==e_ and s_merge_flag:
merged_path.remove(s)
merged_path=to_merge_copy+(merged_path)
if e==s_:
path_list.remove(restpath)
flag=True
break
if e==s_ and e_merge_flag:
merged_path.remove(e)
merged_path=(merged_path)+(to_merge_copy)
if e==e_:
path_list.remove(restpath)
flag=True
break
if e==e_ and e_merge_flag:
merged_path.remove(e)
merged_path=to_merge_copy+(list(reversed(merged_path)))
path_list.remove(restpath)
flag=True
break
path_list.remove(restpath)
flag=True
merged_path_list.append(merged_path)
for path in merged_path_list:
......
journal_media/same_pin_intersect.png

146 KiB

No preview for this file type
No preview for this file type
......@@ -489,11 +489,11 @@ $SKPOLY
9
$TDCREATE
40
2458718.713009259
2458722.7063425924
9
$TDUPDATE
40
2458718.713009259
2458722.7063425924
9
$TDINDWG
40
......@@ -921,11 +921,11 @@ $PSTYLEMODE
9
$FINGERPRINTGUID
2
E47DED70-C539-11E9-978A-7470FDECECE4
36B5572E-C85D-11E9-978A-7470FDECECE4
9
$VERSIONGUID
2
E47DED72-C539-11E9-978A-7470FDECECE4
36B55730-C85D-11E9-978A-7470FDECECE4
9
$EXTNAMES
290
......
This diff is collapsed.
......@@ -53,7 +53,7 @@ $HANDLING
9
$TDUPDATE
40
2458718.713009259
2458722.7063425924
9
$HANDSEED
5
......
......@@ -137,7 +137,7 @@ class post_process():
dxf_file+='.dxf'
self.dxf_file=dxf_file
self._wiring=wiring_path
self.pin_at=pin_at
# self.pin_at=pin_at
self.wiring=[]
self.dwg=ezdxf.readfile(dxf_file)
self.msp=self.dwg.modelspace()
......@@ -147,6 +147,12 @@ class post_process():
self.cross_cut_size=cross_size#mm
self.trace_cut_width=0.25 #mm
self.convert_unitfrom_ses()
## flatten pin_at_array
self.pin_at=[]
for module in pin_at:
for pin in module:
self.pin_at.append(pin)
......@@ -161,6 +167,7 @@ class post_process():
raise Exception ('Isolation box size is required as long as trace width is not equal to zero')
else:
self.draw_complete_traces()
# self.draw_wires()
self.draw_rest_iso(self.iso_size,self.trace_cut_width)
self.dwg.saveas('dwg_w_circuit.dxf')
......@@ -209,10 +216,10 @@ class post_process():
for j in range(len(endpoints)):
ept=endpoints[j]
connect_flag=False
for module_pin in self.pin_at:
for pin in module_pin:
if distance_between_pts(ept,pin)<=(self.iso_size/2)*sqrt(2):
connect_flag=True
for pin in self.pin_at:
if distance_between_pts(ept,pin)<=(self.iso_size/2)*sqrt(2):
self.connected_pins.append(pin)
connect_flag=True
if not connect_flag:
if j==1:
k=-1
......@@ -261,13 +268,38 @@ class post_process():
path_index=wiring.index(path)
path_cp=copy.deepcopy(path)
constrain_s,constrain_e=True,True
if distance_between_pts(path[0],path[1])<(iso_size/2)*sqrt(2):
path.pop(0)
constrain_s=False
for pin in self.connected_pins:
if distance_between_pts(path[0],pin)==0:
if if_pts_are_vert_or_horz(path[0],path[1]) and distance_between_pts(path[1],pin)<self.iso_size/2:
path.pop(0)
constrain_s=False
elif (if_pts_are_vert_or_horz(path[0],path[1])!=True) and distance_between_pts(path[1],pin)<self.iso_size/2*sqrt(2):
path.pop(0)
constrain_s=False
elif distance_between_pts(path[0],pin)<self.iso_size*sqrt(2):
constrain_s=False
if if_pts_are_vert_or_horz(path[0],path[1]) and distance_between_pts(path[1],pin)<self.iso_size/2:
path.pop(0)
elif (if_pts_are_vert_or_horz(path[0],path[1])!=True) and distance_between_pts(path[1],pin)<self.iso_size/2*sqrt(2):
path.pop(0)
if len(path)>2:
if distance_between_pts(path[-1],path[-2])<(iso_size/2)*sqrt(2) :
path.pop(-1)
constrain_e=False
for pin in self.connected_pins:
if distance_between_pts(path[-1],pin)==0:
if if_pts_are_vert_or_horz(path[-1],path[-2]) and distance_between_pts(path[-2],pin)<self.iso_size/2:
path.pop(-1)
constrain_e=False
elif (if_pts_are_vert_or_horz(path[-1],path[2])!=True) and distance_between_pts(path[-2],pin)<self.iso_size/2*sqrt(2):
path.pop(-1)
constrain_e=False
elif distance_between_pts(path[-1],pin)<self.iso_size*sqrt(2):
constrain_e=False
if if_pts_are_vert_or_horz(path[-1],path[-2]) and distance_between_pts(path[-2],pin)<self.iso_size/2:
path.pop(-1)
elif (if_pts_are_vert_or_horz(path[-1],path[-2])!=True) and distance_between_pts(path[-2],pin)<self.iso_size/2*sqrt(2):
path.pop(-1)
for i in range(len(path)-1):
pt1=path[i][0],path[i][1]
pt2=path[i+1][0],path[i+1][1]
......@@ -358,57 +390,56 @@ class post_process():
s2=find_intersect(offl1_out,bi)
return helper_cut_list
def draw_cross_cut(self,size):
for module_pin in self.pin_at:
cross_cut(self.msp,size,module_pin)
for pin in self.pin_at:
cross_cut(self.msp,size,pin)
def find_iso_bry(self,contact_ept,further_ept,size,width,draw_layer,constrain=True):
tolerance=(size/2)*sqrt(2)
for module_pin in self.pin_at:
for pin in module_pin:
if distance_between_pts(contact_ept,pin) <= tolerance:
self.connected_pins.append(pin)
l=find_line_eq(contact_ept,further_ept)
parallel_traces=find_offset(l,width)
four_l_points=isolation_box_linepts(size,pin)
iso_points=isolation_box_linepts(size,pin,False)
#diagnal eatching helper cut
dis=[]
tolerance=(self.iso_size/2)*sqrt(2)
for pin in self.pin_at:
if distance_between_pts(contact_ept,pin) <= tolerance:
l=find_line_eq(contact_ept,further_ept)
parallel_traces=find_offset(l,width)
four_l_points=isolation_box_linepts(size,pin)
iso_points=isolation_box_linepts(size,pin,False)
#diagnal eatching helper cut
dis=[]
for point in iso_points:
dis_=distance_between_pts(further_ept,point)
dis.append(dis_)
diag_helper_cut_pt=iso_points[np.argmax(dis)]
######
contact_list=[]
for pl in parallel_traces:
contact=find_contact_iso_trace(pl,four_l_points,further_ept,constrain)
contact_list.append(contact)
draw_list=[contact_list[0]]
draw_temp=None
while len(iso_points)!=0:
dis_=[]
for point in iso_points:
dis_=distance_between_pts(further_ept,point)
dis.append(dis_)
diag_helper_cut_pt=iso_points[np.argmax(dis)]
######
contact_list=[]
for pl in parallel_traces:
contact=find_contact_iso_trace(pl,four_l_points,further_ept,constrain)
contact_list.append(contact)
draw_list=[contact_list[0]]
draw_temp=None
while len(iso_points)!=0:
dis_=[]
for point in iso_points:
dis=distance_between_pts(point,draw_list[-1])
dis_.append(dis)
closest_pt=iso_points[np.argmin(dis_)]
contact_l=np.round(find_line_eq(contact_list[0],contact_list[1]))
draw_l=np.round(find_line_eq(closest_pt,draw_list[-1]))
if tuple(contact_l)==tuple(draw_l) and point_is_in_two_pts(contact_list[1],closest_pt,draw_list[-1]):
draw_temp=closest_pt
else:
if not point_is_in_two_pts(closest_pt,contact_list[0],contact_list[1]):
draw_list.append(closest_pt)
iso_points.remove(closest_pt)
if type(draw_temp)!=type(None):
draw_list.append(draw_temp)
draw_list.append(contact_list[1])
dis=distance_between_pts(point,draw_list[-1])
dis_.append(dis)
closest_pt=iso_points[np.argmin(dis_)]
contact_l=np.round(find_line_eq(contact_list[0],contact_list[1]))
draw_l=np.round(find_line_eq(closest_pt,draw_list[-1]))
if tuple(contact_l)==tuple(draw_l) and point_is_in_two_pts(contact_list[1],closest_pt,draw_list[-1]):
draw_temp=closest_pt
else:
if not point_is_in_two_pts(closest_pt,contact_list[0],contact_list[1]):
draw_list.append(closest_pt)
iso_points.remove(closest_pt)
if type(draw_temp)!=type(None):
draw_list.append(draw_temp)
draw_list.append(contact_list[1])
for i in range(len(draw_list)-1):
self.msp.add_line(draw_list[i],draw_list[i+1],dxfattribs={'linetype':'DASHDOT', 'layer':draw_layer})
for i in range(len(draw_list)-1):
self.msp.add_line(draw_list[i],draw_list[i+1],dxfattribs={'linetype':'DASHDOT', 'layer':draw_layer})
return contact_list[0],contact_list[1],diag_helper_cut_pt
def find_path_intersects(self,width,contact_ept,further_ept,contacted_interval_index):
......@@ -437,28 +468,27 @@ class post_process():
def draw_rest_iso(self,iso_size,cut_width):
for module_pin in self.pin_at:
for pin in module_pin:
if not pin in self.connected_pins:
for pin in self.pin_at:
if not pin in self.connected_pins:
lines=isolation_box_linepts(iso_size,pin)
for l in lines:
self.msp.add_line(l[0],l[1],dxfattribs={'linetype':'DASHDOT', 'layer':'Circuit_Cut'})
outer_helper=[lines[0][1],lines[-1][-1]]
lines=isolation_box_linepts(iso_size-cut_width,pin)
for l in lines:
self.msp.add_line(l[0],l[1],dxfattribs={'linetype':'DASHDOT', 'layer':'Circuit_Etc'})
lines=isolation_box_linepts(iso_size,pin)
for l in lines:
self.msp.add_line(l[0],l[1],dxfattribs={'linetype':'DASHDOT', 'layer':'Circuit_Cut'})
outer_helper=[lines[0][1],lines[-1][-1]]
lines=isolation_box_linepts(iso_size-cut_width,pin)
for l in lines:
self.msp.add_line(l[0],l[1],dxfattribs={'linetype':'DASHDOT', 'layer':'Circuit_Etc'})
lines=isolation_box_linepts(iso_size,pin)
lines=isolation_box_linepts(iso_size-(cut_width*2),pin)
for l in lines:
self.msp.add_line(l[0],l[1],dxfattribs={'linetype':'DASHDOT', 'layer':'Circuit_Cut'})
inner_helper=[lines[0][1],lines[-1][-1]]
for i in range(len(outer_helper)):
self.msp.add_line(outer_helper[i],inner_helper[i],dxfattribs={
'layer':'Circuit_Cut',
'linetype':'DASHDOT'})
lines=isolation_box_linepts(iso_size-(cut_width*2),pin)
for l in lines:
self.msp.add_line(l[0],l[1],dxfattribs={'linetype':'DASHDOT', 'layer':'Circuit_Cut'})
inner_helper=[lines[0][1],lines[-1][-1]]
for i in range(len(outer_helper)):
self.msp.add_line(outer_helper[i],inner_helper[i],dxfattribs={
'layer':'Circuit_Cut',
'linetype':'DASHDOT'})
def find_contact_iso_trace(trace_line,iso_l_pts,further_ept,constrain=True):
inter_temp=[]
......@@ -505,15 +535,15 @@ def cross_cut(msp,cross_size,pin_loc):
cross_size= lenght of bounding box of the cross cut
"""
tipat=cross_size/2
for pt in pin_loc:
x=pt[0]
y=pt[1]
cross_s1=(x-tipat,y-tipat)
cross_e1=(x+tipat,y+tipat)
cross_s2=(x-tipat,y+tipat)
cross_e2=(x+tipat,y-tipat)
msp.add_line(cross_s1,cross_e1,dxfattribs={'layer':'Cut'})
msp.add_line(cross_s2,cross_e2,dxfattribs={'layer':'Cut'})
x=pin_loc[0]
y=pin_loc[1]
cross_s1=(x-tipat,y-tipat)
cross_e1=(x+tipat,y+tipat)
cross_s2=(x-tipat,y+tipat)
cross_e2=(x+tipat,y-tipat)
msp.add_line(cross_s1,cross_e1,dxfattribs={'layer':'Cut'})
msp.add_line(cross_s2,cross_e2,dxfattribs={'layer':'Cut'})
def distance_between_pts(pt1,pt2):
x1,y1=pt1[0],pt1[1]
......@@ -689,7 +719,15 @@ def if_pts_on_line(line_eq,pt):
if c*y==a*x+b:
return True
else: return False
def if_pts_are_vert_or_horz(pt1,pt2):
"""
return True if the line is vertical or horizontal
"""
[a,b,c,theta]=find_line_eq(pt1,pt2)
if c==0 or a==0:
return True
......@@ -307,13 +307,13 @@
(type smd_smd))))
(placement
(component J1
(place J1 125000 81000 front 0
(place J1 125000 81000 front 90
(PN mpu-9250.kicad_mod)))
(component U1
(place U1 114000 49000 front 270
(PN ESP12F-Devkit-V3.kicad_mod)))
(component T1
(place T1 68500 72000 front 90
(place T1 68500 72000 back 90
(PN touch_sensor.kicad_mod)))
(component L1
(place L1 65000 41000 front 90
......@@ -331,16 +331,16 @@
(path signal 120.0000000000 7620.0000000000 13570.0000000000 -7620.0000000000 13570.0000000000))
(outline
(path signal 120.0000000000 -7620.0000000000 13570.0000000000 -7620.0000000000 -11430.0000000000))
(pin Round[A]Pad_1524_um 1 -6350.0000000000 -10160.0000000000)
(pin Round[A]Pad_1524_um 2 -6350.0000000000 -7620.0000000000)
(pin Round[A]Pad_1524_um 3 -6350.0000000000 -5080.0000000000)
(pin Round[A]Pad_1524_um 4 -6350.0000000000 -2540.0000000000)
(pin Round[A]Pad_1524_um 5 -6350.0000000000 0.0000000000)
(pin Round[A]Pad_1524_um 6 -6350.0000000000 2540.0000000000)
(pin Round[A]Pad_1524_um 7 -6350.0000000000 5080.0000000000)
(pin Round[A]Pad_1524_um 8 -6350.0000000000 7620.0000000000)
(pin Round[A]Pad_1524_um 9 -6350.0000000000 10160.0000000000)
(pin Round[A]Pad_1524_um 10 -6350.0000000000 12700.0000000000))
(pin Round[A]Pad_1524_um 1 -6350.0000000000 10160.0000000000)
(pin Round[A]Pad_1524_um 2 -6350.0000000000 7620.0000000000)
(pin Round[A]Pad_1524_um 3 -6350.0000000000 5080.0000000000)
(pin Round[A]Pad_1524_um 4 -6350.0000000000 2540.0000000000)
(pin Round[A]Pad_1524_um 5 -6350.0000000000 -0.0000000000)
(pin Round[A]Pad_1524_um 6 -6350.0000000000 -2540.0000000000)
(pin Round[A]Pad_1524_um 7 -6350.0000000000 -5080.0000000000)
(pin Round[A]Pad_1524_um 8 -6350.0000000000 -7620.0000000000)
(pin Round[A]Pad_1524_um 9 -6350.0000000000 -10160.0000000000)
(pin Round[A]Pad_1524_um 10 -6350.0000000000 -12700.0000000000))
(image U1
(outline
(path signal 150.0000000000 11430.0000000000 22860.0000000000 3810.0000000000 22860.0000000000))
......@@ -366,36 +366,36 @@
(path signal 150.0000000000 -3810.0000000000 22860.0000000000 -12065.0000000000 22860.0000000000))
(outline
(path signal 150.0000000000 11430.0000000000 -25400.0000000000 -12700.0000000000 -25400.0000000000))
(pin Round[A]Pad_1524_um 1 -12065.0000000000 -19050.0000000000)
(pin Round[A]Pad_1524_um 2 -12065.0000000000 -16510.0000000000)
(pin Round[A]Pad_1524_um 3 -12065.0000000000 -13970.0000000000)
(pin Round[A]Pad_1524_um 4 -12065.0000000000 -11430.0000000000)
(pin Round[A]Pad_1524_um 5 -12065.0000000000 -8890.0000000000)
(pin Round[A]Pad_1524_um 6 -12065.0000000000 -6350.0000000000)
(pin Round[A]Pad_1524_um 7 -12065.0000000000 -3810.0000000000)
(pin Round[A]Pad_1524_um 8 -12065.0000000000 -1270.0000000000)
(pin Round[A]Pad_1524_um 9 -12065.0000000000 1270.0000000000)
(pin Round[A]Pad_1524_um 10 -12065.0000000000 3810.0000000000)
(pin Round[A]Pad_1524_um 11 -12065.0000000000 6350.0000000000)
(pin Round[A]Pad_1524_um 12 -12065.0000000000 8890.0000000000)
(pin Round[A]Pad_1524_um 13 -12065.0000000000 11430.0000000000)
(pin Round[A]Pad_1524_um 14 -12065.0000000000 13970.0000000000)
(pin Round[A]Pad_1524_um 15 -12065.0000000000 16510.0000000000)
(pin Round[A]Pad_1524_um 16 11430.0000000000 16510.0000000000)
(pin Round[A]Pad_1524_um 17 11430.0000000000 13970.0000000000)
(pin Round[A]Pad_1524_um 18 11430.0000000000 11430.0000000000)
(pin Round[A]Pad_1524_um 19 11430.0000000000 8890.0000000000)
(pin Round[A]Pad_1524_um 20 11430.0000000000 6350.0000000000)
(pin Round[A]Pad_1524_um 21 11430.0000000000 3810.0000000000)
(pin Round[A]Pad_1524_um 22 11430.0000000000 1270.0000000000)
(pin Round[A]Pad_1524_um 23 11430.0000000000 -1270.0000000000)
(pin Round[A]Pad_1524_um 24 11430.0000000000 -3810.0000000000)
(pin Round[A]Pad_1524_um 25 11430.0000000000 -6350.0000000000)
(pin Round[A]Pad_1524_um 26 11430.0000000000 -8890.0000000000)
(pin Round[A]Pad_1524_um 27 11430.0000000000 -11430.0000000000)
(pin Round[A]Pad_1524_um 28 11430.0000000000 -13970.0000000000)
(pin Round[A]Pad_1524_um 29 11430.0000000000 -16510.0000000000)
(pin Round[A]Pad_1524_um 30 11430.0000000000 -19050.0000000000))
(pin Round[A]Pad_1524_um 1 -12065.0000000000 19050.0000000000)
(pin Round[A]Pad_1524_um 2 -12065.0000000000 16510.0000000000)
(pin Round[A]Pad_1524_um 3 -12065.0000000000 13970.0000000000)
(pin Round[A]Pad_1524_um 4 -12065.0000000000 11430.0000000000)
(pin Round[A]Pad_1524_um 5 -12065.0000000000 8890.0000000000)
(pin Round[A]Pad_1524_um 6 -12065.0000000000 6350.0000000000)
(pin Round[A]Pad_1524_um 7 -12065.0000000000 3810.0000000000)
(pin Round[A]Pad_1524_um 8 -12065.0000000000 1270.0000000000)
(pin Round[A]Pad_1524_um 9 -12065.0000000000 -1270.0000000000)
(pin Round[A]Pad_1524_um 10 -12065.0000000000 -3810.0000000000)
(pin Round[A]Pad_1524_um 11 -12065.0000000000 -6350.0000000000)
(pin Round[A]Pad_1524_um 12 -12065.0000000000 -8890.0000000000)
(pin Round[A]Pad_1524_um 13 -12065.0000000000 -11430.0000000000)
(pin Round[A]Pad_1524_um 14 -12065.0000000000 -13970.0000000000)
(pin Round[A]Pad_1524_um 15 -12065.0000000000 -16510.0000000000)
(pin Round[A]Pad_1524_um 16 11430.0000000000 -16510.0000000000)
(pin Round[A]Pad_1524_um 17 11430.0000000000 -13970.0000000000)
(pin Round[A]Pad_1524_um 18 11430.0000000000 -11430.0000000000)
(pin Round[A]Pad_1524_um 19 11430.0000000000 -8890.0000000000)
(pin Round[A]Pad_1524_um 20 11430.0000000000 -6350.0000000000)
(pin Round[A]Pad_1524_um 21 11430.0000000000 -3810.0000000000)
(pin Round[A]Pad_1524_um 22 11430.0000000000 -1270.0000000000)
(pin Round[A]Pad_1524_um 23 11430.0000000000 1270.0000000000)
(pin Round[A]Pad_1524_um 24 11430.0000000000 3810.0000000000)
(pin Round[A]Pad_1524_um 25 11430.0000000000 6350.0000000000)
(pin Round[A]Pad_1524_um 26 11430.0000000000 8890.0000000000)
(pin Round[A]Pad_1524_um 27 11430.0000000000 11430.0000000000)
(pin Round[A]Pad_1524_um 28 11430.0000000000 13970.0000000000)
(pin Round[A]Pad_1524_um 29 11430.0000000000 16510.0000000000)
(pin Round[A]Pad_1524_um 30 11430.0000000000 19050.0000000000))
(image T1
(outline
(path signal 120.0000000000 0.0000000000 -12000.0000000000 12000.0000000000 -12000.0000000000))
......@@ -407,9 +407,9 @@
(path signal 120.0000000000 -12000.0000000000 12000.0000000000 -12000.0000000000 -12000.0000000000))
(outline
(path signal 120.0000000000 0.0000000000 -12000.0000000000 -12000.0000000000 -12000.0000000000))
(pin Round[A]Pad_1524_um 1 2540.0000000000 10160.0000000000)
(pin Round[A]Pad_1524_um 2 0.0000000000 10160.0000000000)
(pin Round[A]Pad_1524_um 3 -2540.0000000000 10160.0000000000))
(pin Round[A]Pad_1524_um 1 2540.0000000000 -10160.0000000000)
(pin Round[A]Pad_1524_um 2 0.0000000000 -10160.0000000000)
(pin Round[A]Pad_1524_um 3 -2540.0000000000 -10160.0000000000))
(image L1
(outline
(path signal 120.0000000000 -2540.0000000000 -1270.0000000000 -2540.0000000000 1270.0000000000))
......@@ -419,8 +419,8 @@
(path signal 120.0000000000 -2540.0000000000 -1270.0000000000 3810.0000000000 -1270.0000000000))
(outline
(path signal 120.0000000000 -2540.0000000000 1270.0000000000 3810.0000000000 1270.0000000000))
(pin Round[A]Pad_1524_um 1 -1270.0000000000 0.0000000000)
(pin Round[A]Pad_1524_um 2 2540.0000000000 0.0000000000))
(pin Round[A]Pad_1524_um 1 -1270.0000000000 -0.0000000000)
(pin Round[A]Pad_1524_um 2 2540.0000000000 -0.0000000000))
(image R1
(outline
(path signal 120.0000000000 -2540.0000000000 -1270.0000000000 -2540.0000000000 1270.0000000000))
......@@ -430,8 +430,8 @@
(path signal 120.0000000000 -2540.0000000000 -1270.0000000000 3810.0000000000 -1270.0000000000))
(outline
(path signal 120.0000000000 -2540.0000000000 1270.0000000000 3810.0000000000 1270.0000000000))
(pin Round[A]Pad_1524_um 1 -1270.0000000000 0.0000000000)
(pin Round[A]Pad_1524_um 2 2540.0000000000 0.0000000000))
(pin Round[A]Pad_1524_um 1 -1270.0000000000 -0.0000000000)
(pin Round[A]Pad_1524_um 2 2540.0000000000 -0.0000000000))
(padstack Round[A]Pad_1524_um
(shape
( circle F.Cu 1524))
......
......@@ -11,7 +11,7 @@
(via_costs 50)
(plane_via_costs 5)
(start_ripup_costs 100)
(start_pass_no 154)
(start_pass_no 175)
(layer_rule F.Cu
(active on)
(preferred_direction vertical)
......
......@@ -4,13 +4,13 @@
(placement
(resolution um 10)
(component J1
(place J1 1250000 810000 front 0)
(place J1 1250000 810000 front 90)
)
(component U1
(place U1 1140000 490000 front 270)
)
(component T1
(place T1 685000 720000 front 90)
(place T1 685000 720000 back 90)
)
(component L1
(place L1 650000 410000 front 90)
......@@ -31,97 +31,98 @@
)
(network_out
(net 3v3
(wire
(path F.Cu 15238
1311934 382534
1305100 375700
)
)
(wire
(path F.Cu 20000
1192122 702778
1252226 702778
1332958 622046
1332958 403558
1311934 382534
769978 720000
758735 708757
758735 589302
972337 375700
)
)
(wire
(path F.Cu 15238
1192122 702778
1186500 708400
769978 720000
786600 720000
)
)
(wire
(path F.Cu 15238
1184276 706176
1186500 708400
(path F.Cu 20000
972337 375700
972337 364221
988639 347919
1341856 347919
1404898 410961
1404898 757986
1388647 774237
1161836 774237
1146176 758577
1146176 748724
)
)
(wire
(path F.Cu 20000
600022 720000
643204 763182
1082902 763182
1139908 706176
1184276 706176
(path F.Cu 15238
1146176 748724
1148400 746500
)
)
(wire
(path F.Cu 15238
600022 720000
583400 720000
972337 375700
974900 375700
)
)
)
(net GND
(wire
(path F.Cu 20000
650000 450394
650000 623552
581176 692376
(path F.Cu 15238
786600 747625
786600 745400
)
)
(wire
(path F.Cu 20000
650000 435400
650000 450394
1173800 729878
1162602 718680
1136791 718680
1091982 763489
802464 763489
786600 747625
)
)
(wire
(path F.Cu 20000
650000 450394
1052590 450394
1101900 401084
(path F.Cu 15238
784376 747624
786600 745400
)
)
(wire
(path F.Cu 15238
1101900 401084
1101900 375700
(path F.Cu 20000
650000 435400
650000 631264
766360 747624
784376 747624
)
)
(wire
(path F.Cu 20000
1172837 733800
1121389 785248
584142 785248
555471 756577
555471 708161
571256 692376
581176 692376
1173800 729878
1247180 656498
1323903 656498
1358550 621851
1358550 581534
1178100 401084
)
)
(wire
(path F.Cu 15238
581176 692376
583400 694600
1178100 401084
1178100 375700
)
)
(wire
(path F.Cu 15238
1172837 733800
1186500 733800
1173800 729878
1173800 746500
)
)
)
......
......@@ -13,9 +13,9 @@ class brd_design():
self.savename=savename
self.module_list=[
['mpu-9250.kicad_mod','J1',[125000,81000],'front',0],
['mpu-9250.kicad_mod','J1',[125000,81000],'front',90],
['ESP12F-Devkit-V3.kicad_mod','U1',[114000,49000],'front',270],
['touch_sensor.kicad_mod','T1',[68500,72000],'front',90],
['touch_sensor.kicad_mod','T1',[68500,72000],'back',90],
['LED_D3.0mm.kicad_mod','L1',[65000,41000],'front',90],
['Resistor.kicad_mod','R1',[80000,41000],'front',270],
......@@ -145,16 +145,19 @@ class brd_design():
module=mod.from_file(self.libpath+img[0])
pin_at_arr=[]
module_at=np.array([img[2][0],img[2][1]])/1000
flip=1
orientation=img[4]
theta=orientation/180*np.pi
if img[3]=='back':
flip=-1
orientation=img[4]
for i in range(len(module.pads)):
pad=module.pads[i]
pin_at_relative=np.array(pad.at) ##mm
if orientation!=0:
x,y=pin_at_relative[0],pin_at_relative[1]
theta=orientation/180*np.pi
x_=x*np.cos(theta)-y*np.sin(theta)
y_=y*np.cos(theta)+x*np.sin(theta)
pin_at_relative=np.array([x_,y_])
x,y=pin_at_relative[0]*flip,-pin_at_relative[1]
x_=x*np.cos(theta)-y*np.sin(theta)
y_=y*np.cos(theta)+x*np.sin(theta)
pin_at_relative=np.array([x_,y_])
pin_at_abs=list(pin_at_relative+module_at)
pin_at_arr.append(pin_at_abs)
self.pins_at.append(pin_at_arr)
......@@ -166,8 +169,6 @@ class brd_design():
numOfRows = len(myDict)
keys = myDict[0].keys()
numOfCols = len(keys)
moduleCols = 4
netCols = 2
......
......@@ -32,7 +32,7 @@ def roco_add_ee(me_drawing,netlist_csv,module_libpath,dsnwritier_dir,
ready_for_autorouter=pre_process(me_drawing) #get dwg_for_autorouter.dxf
ee_design=brd_design(ready_for_autorouter.bry_ind,module_libpath,netlist_csv)#,dwgfile='dwg_for_autorouter_temp.dxf') #get paperbot_ee.dsn
subprocess.call(['java','-jar','freeRouting.jar','-de',ee_design.savename+'.dsn','-white','-s'])
wiring_path=find_wire(ee_design.savename) #read ses file
wiring_path=find_wire(ee_design.savename,ee_design.pins_at) #read ses file
post_process(me_drawing,wiring_path,ee_design.pins_at,trace_width,iso_size,cross_size) # draw for fabrication
# os.remove(ready_for_autorouter.savename)
......@@ -48,6 +48,6 @@ def test():
net_csv='/home/jingyan/Downloads/moduleList.csv'
old=read_old_paperbot(dwg_path) #get dwg_w_layer.dxf
me_dwg=old.savename
roco_add_ee(me_dwg,net_csv,module_libpath,dsnwritier_dir,0)
roco_add_ee(me_dwg,net_csv,module_libpath,dsnwritier_dir)
test()
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment