summaryrefslogtreecommitdiff
path: root/gerbonara/cad/kicad/graphical_primitives.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-06-29 19:47:31 +0200
committerjaseg <git@jaseg.de>2023-06-29 19:47:31 +0200
commit56d55fda5d5424644e5914c73cfee392f8739bbb (patch)
tree38dd0a4d976b6d61fd876e0ebc8f541df8c1de45 /gerbonara/cad/kicad/graphical_primitives.py
parent467e482bf435fce83900fb446761dded4ffd7b31 (diff)
downloadgerbonara-56d55fda5d5424644e5914c73cfee392f8739bbb.tar.gz
gerbonara-56d55fda5d5424644e5914c73cfee392f8739bbb.tar.bz2
gerbonara-56d55fda5d5424644e5914c73cfee392f8739bbb.zip
kicad: Extend query API
Diffstat (limited to 'gerbonara/cad/kicad/graphical_primitives.py')
-rw-r--r--gerbonara/cad/kicad/graphical_primitives.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gerbonara/cad/kicad/graphical_primitives.py b/gerbonara/cad/kicad/graphical_primitives.py
index 8e2d325..752c9bc 100644
--- a/gerbonara/cad/kicad/graphical_primitives.py
+++ b/gerbonara/cad/kicad/graphical_primitives.py
@@ -143,6 +143,7 @@ class Rectangle:
end: Rename(XYCoord) = None
layer: Named(str) = None
width: Named(float) = None
+ stroke: Stroke = field(default_factory=Stroke)
fill: FillMode = False
tstamp: Timestamp = None
@@ -155,6 +156,7 @@ class Rectangle:
yield rect
if self.width:
+ # FIXME stroke support
yield from rect.outline_objects(aperture=ap.CircleAperture(self.width, unit=MM))
@@ -164,6 +166,7 @@ class Circle:
end: Rename(XYCoord) = None
layer: Named(str) = None
width: Named(float) = None
+ stroke: Stroke = field(default_factory=Stroke)
fill: FillMode = False
tstamp: Timestamp = None
@@ -173,6 +176,7 @@ class Circle:
arc = go.Arc.from_circle(self.center.x, self.center.y, r, aperture=aperture, unit=MM)
if self.width:
+ # FIXME stroke support
yield arc
if self.fill:
@@ -190,6 +194,7 @@ class Arc:
tstamp: Timestamp = None
def render(self, variables=None):
+ # FIXME stroke support
if not self.width:
return
@@ -212,6 +217,7 @@ class Polygon:
def render(self, variables=None):
reg = go.Region([(pt.x, pt.y) for pt in self.pts.xy], unit=MM)
+ # FIXME stroke support
if self.width and self.width >= 0.005 or self.stroke.width and self.stroke.width > 0.005:
yield from reg.outline_objects(aperture=ap.CircleAperture(self.width, unit=MM))