kicad_sch render: Fix nightly import and wire rendering
This commit is contained in:
parent
227d4ed1cd
commit
04c4b3ff0c
4 changed files with 7 additions and 6 deletions
|
|
@ -97,7 +97,7 @@ class Stroke:
|
|||
class Dasher:
|
||||
def __init__(self, obj):
|
||||
if obj.stroke:
|
||||
w = obj.stroke.width if obj.stroke.width is not None else 0.254
|
||||
w = obj.stroke.width if obj.stroke.width not in (None, 0, 0.0) else 0.254
|
||||
t = obj.stroke.type
|
||||
else:
|
||||
w = obj.width or 0
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ def kicad_mid_to_center_arc(mid, start, end):
|
|||
cy = ((p1[0] - p2[0]) * cd - (p2[0] - p3[0]) * bc) / det
|
||||
|
||||
radius = math.sqrt((cx - p1[0])**2 + (cy - p1[1])**2)
|
||||
return ((cx, cy), radius)
|
||||
return (cx, cy), radius
|
||||
|
||||
|
||||
@sexp_type('hatch')
|
||||
|
|
|
|||
|
|
@ -260,6 +260,7 @@ class HierarchicalLabel(TextMixin):
|
|||
class Pin:
|
||||
name: str = '1'
|
||||
uuid: UUID = field(default_factory=UUID)
|
||||
alternate: Named(str) = None
|
||||
|
||||
|
||||
# Suddenly, we're doing syntax like this is yaml or something.
|
||||
|
|
@ -354,7 +355,7 @@ class SymbolInstance:
|
|||
pins: List(Pin) = field(default_factory=list)
|
||||
# AFAICT this property, too, is completely redundant. It ultimately just lists paths and references of at most
|
||||
# three other uses of the same symbol in this schematic.
|
||||
instances: Named(List(SymbolCrosslinkProject)) = field(default_factory=list)
|
||||
instances: Named(Array(SymbolCrosslinkProject)) = field(default_factory=list)
|
||||
_ : SEXP_END = None
|
||||
schematic: object = None
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from .base_types import *
|
|||
from ...utils import rotate_point, Tag, arc_bounds
|
||||
from ...newstroke import Newstroke
|
||||
from .schematic_colors import *
|
||||
from .primitives import center_arc_to_kicad_mid
|
||||
from .primitives import kicad_mid_to_center_arc
|
||||
|
||||
|
||||
PIN_ETYPE = AtomChoice(Atom.input, Atom.output, Atom.bidirectional, Atom.tri_state, Atom.passive, Atom.free,
|
||||
|
|
@ -259,7 +259,7 @@ class Arc:
|
|||
fill: Fill = field(default_factory=Fill)
|
||||
|
||||
def bounding_box(self, default=None):
|
||||
(cx, cy), r = center_arc_to_kicad_mid(self.mid, self.start, self.end)
|
||||
(cx, cy), r = kicad_mid_to_center_arc(self.mid, self.start, self.end)
|
||||
x1, y1 = self.start.x, self.start.y
|
||||
x2, y2 = self.mid.x-x1, self.mid.y-x2
|
||||
x3, y3 = (self.end.x - x1)/2, (self.end.y - y1)/2
|
||||
|
|
@ -268,7 +268,7 @@ class Arc:
|
|||
|
||||
|
||||
def to_svg(self, colorscheme=Colorscheme.KiCad):
|
||||
(cx, cy), r = center_arc_to_kicad_mid(self.mid, self.start, self.end)
|
||||
(cx, cy), r = kicad_mid_to_center_arc(self.mid, self.start, self.end)
|
||||
|
||||
x1r = self.start.x - cx
|
||||
y1r = self.start.y - cy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue