Closed pozitron57 closed 11 months ago
Sometimes lamp and source are designated as follows:
For the lamp, I used the code
class Lamp2(Source): ''' Incandescent Lamp 2 ''' def __init__(self, *d, **kwargs): super().__init__(*d, **kwargs) r=0.5 self.segments.append(Segment( [(r-r/2**.5, -r/2**.5), (r+r/2**.5, r/2**.5)])) self.segments.append(Segment( [(r-r/2**.5, r/2**.5), (r+r/2**.5, -r/2**.5)]))
and for the Terminal:
class Terminal(Element): def __init__(self, *d, r: float = 0.18, open: bool = False, **kwargs): super().__init__(*d, **kwargs) fill = 'bg' self.anchors['start'] = (0, 0) self.anchors['center'] = (0, 0) self.anchors['end'] = (0, 0) self.params['drop'] = (0, 0) self.params['theta'] = 0 self.params['zorder'] = 4 self.params['fill'] = fill self.segments.append(SegmentCircle((0, 0), r)) kx=1.0 ky=2.0 self.segments.append(Segment( [ (-kx*r, -ky*r), ( kx*r, ky*r), ]))
Added in ac7f7c3. Thanks!
Sometimes lamp and source are designated as follows:
For the lamp, I used the code
and for the Terminal: