Remove deletion (not yet stable in KiCad python interface)
This commit is contained in:
@ -358,10 +358,10 @@ STEP = '-'
|
|||||||
continue
|
continue
|
||||||
rectangle[x_pos][y_pos] = self.REASON_STEP
|
rectangle[x_pos][y_pos] = self.REASON_STEP
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Check if vias would not overlap and if in same outline then apply at minimum 60% of self.step
|
Check if vias would not overlap and if in same outline then apply at minimum 60% of self.step
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def CheckViaDistance(self, p, via, outline):
|
def CheckViaDistance(self, p, via, outline):
|
||||||
p2 = VECTOR2I(via.GetPosition())
|
p2 = VECTOR2I(via.GetPosition())
|
||||||
|
|
||||||
@ -377,6 +377,7 @@ STEP = '-'
|
|||||||
Add via along outline (SHAPE_LINE_CHAIN), starting at offset (fraction between 0.0 and 1.0)
|
Add via along outline (SHAPE_LINE_CHAIN), starting at offset (fraction between 0.0 and 1.0)
|
||||||
Avoid placing vias to close to via present in all_vias
|
Avoid placing vias to close to via present in all_vias
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def AddViasAlongOutline(self, outline, outline_parent, all_vias, offset=0):
|
def AddViasAlongOutline(self, outline, outline_parent, all_vias, offset=0):
|
||||||
via_placed = 0
|
via_placed = 0
|
||||||
step = max(self.step, self.size+self.clearance)
|
step = max(self.step, self.size+self.clearance)
|
||||||
@ -421,7 +422,6 @@ STEP = '-'
|
|||||||
wxPrint("No areas to fill")
|
wxPrint("No areas to fill")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# Size the polygons so the vias fit inside
|
# Size the polygons so the vias fit inside
|
||||||
poly_set.Inflate(int(-(1*self.clearance + 0.5*self.size)), 12, SHAPE_POLY_SET.CHAMFER_ALL_CORNERS)
|
poly_set.Inflate(int(-(1*self.clearance + 0.5*self.size)), 12, SHAPE_POLY_SET.CHAMFER_ALL_CORNERS)
|
||||||
|
|
||||||
@ -457,10 +457,10 @@ STEP = '-'
|
|||||||
|
|
||||||
return via_placed
|
return via_placed
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Main function which does the via placement or deletion
|
Main function which does the via placement or deletion
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def Run(self):
|
def Run(self):
|
||||||
|
|
||||||
VIA_GROUP_NAME = "ViaStitching {}".format(self.netname)
|
VIA_GROUP_NAME = "ViaStitching {}".format(self.netname)
|
||||||
@ -477,13 +477,18 @@ STEP = '-'
|
|||||||
Launch the process
|
Launch the process
|
||||||
"""
|
"""
|
||||||
if self.delete_vias:
|
if self.delete_vias:
|
||||||
|
# Do not perform a real delete since exposed function in python are not safe for deletion
|
||||||
|
wx.MessageBox(
|
||||||
|
"To delete vias:\n - select one of the generated via to select the group of vias named {}\n - hit delete key\n - That's all !".format(VIA_GROUP_NAME), "Information")
|
||||||
|
|
||||||
|
"""
|
||||||
if self.pcb_group is not None:
|
if self.pcb_group is not None:
|
||||||
all_vias = [track for track in self.pcb.GetTracks() if (track.GetClass() == "PCB_VIA" and track.GetNetname() == self.netname)]
|
all_vias = [track for track in self.pcb.GetTracks() if (track.GetClass() == "PCB_VIA" and track.GetNetname() == self.netname)]
|
||||||
|
|
||||||
for via in all_vias:
|
for via in all_vias:
|
||||||
if via.GetParentGroup() is not None and via.GetParentGroup().GetName() == VIA_GROUP_NAME:
|
if via.GetParentGroup() is not None and via.GetParentGroup().GetName() == VIA_GROUP_NAME:
|
||||||
via.DeleteStructure()
|
via.DeleteStructure()
|
||||||
|
|
||||||
|
"""
|
||||||
return # no need to run the rest of logic
|
return # no need to run the rest of logic
|
||||||
|
|
||||||
if self.pcb_group is None:
|
if self.pcb_group is None:
|
||||||
|
Reference in New Issue
Block a user