Skip to content

Commit 3636a3e

Browse files
committed
Properly report errors from tabs
1 parent e0c312a commit 3636a3e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

kikit/panelize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from kikit import substrate
2929
from kikit import units
3030
from kikit.kicadUtil import getPageDimensionsFromAst
31-
from kikit.substrate import Substrate, linestringToKicad, extractRings
31+
from kikit.substrate import Substrate, linestringToKicad, extractRings, TabError
3232
from kikit.defs import PAPER_DIMENSIONS, STROKE_T, Layer, EDA_TEXT_HJUSTIFY_T, EDA_TEXT_VJUSTIFY_T, PAPER_SIZES
3333
from kikit.common import *
3434
from kikit.sexpr import isElement, parseSexprF, SExpr, Atom, findNode, parseSexprListF
@@ -399,6 +399,7 @@ def buildTabs(panel: "Panel", substrate: Substrate,
399399
tabs.append(t)
400400
cuts.append(c)
401401
except TabError as e:
402+
print("Caught")
402403
panel._renderLines(
403404
[constructArrow(annotation.origin, annotation.direction, fromMm(3), fromMm(1))],
404405
Layer.Margin)

kikit/substrate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,9 @@ def tab(self, origin, direction, width, partitionLine=None,
831831
"""
832832
self.orient()
833833

834+
if self.substrates.contains(Point(origin)) and not self.substrates.boundary.contains(Point(origin)):
835+
raise TabError(origin, direction, ["Tab annotation is placed inside the board. It has to be on edge or outside the board."])
836+
834837
origin = np.array(origin)
835838
direction = np.around(normalize(direction), 4)
836839
for geom in listGeometries(self.substrates):
@@ -936,7 +939,7 @@ def millFillets(self, millRadius):
936939
Add fillets to inner corners which will be produced by a mill with
937940
given radius.
938941
"""
939-
EPS = 1 # This number is intentionally near KiCAD's resolution of 1nm to not enclose narrow slots, but to preserve radius
942+
EPS = 50 # This number is intentionally near KiCAD's resolution of 1nm to not enclose narrow slots, but to preserve radius
940943
RES = 32
941944
if millRadius < EPS:
942945
return

0 commit comments

Comments
 (0)