class GrPolygon(AST): tag = 'gr_poly' schema = { '0': { 'pts': xy_schema('pts'), }, 'layer': text, 'width': number, 'tstamp': hex, 'status': hex } def __init__(self, pts, layer='Edge.Cuts', width=None, tstamp=None, status=None): super(self.__class__, self).__init__(pts=pts, layer=layer, width=width, tstamp=tstamp, status=status)
class Dimension(AST): tag = 'dimension' schema = { '0': { '_attr': 'value', '_parser': number }, '1': { '_tag': 'width', '_parser': number }, 'layer': text, 'text': GrText, 'feature1': { 'pts': xy_schema('feature1') }, 'feature2': { 'pts': xy_schema('feature2') }, 'crossbar': { 'pts': xy_schema('crossbar') }, 'arrow1a': { 'pts': xy_schema('arrow1a') }, 'arrow1b': { 'pts': xy_schema('arrow1b') }, 'arrow2a': { 'pts': xy_schema('arrow2a') }, 'arrow2b': { 'pts': xy_schema('arrow2b') }, 'tstamp': hex } def __init__(self, value, width, layer='F.SilkS', text=None, feature1=None, feature2=None, crossbar=None, arrow1a=None, arrow1b=None, arrow2a=None, arrow2b=None, tstamp=None): super(self.__class__, self).__init__(value=value, width=width, layer=layer, text=text, feature1=feature1, feature2=feature2, crossbar=crossbar, arrow1a=arrow1a, arrow1b=arrow1b, arrow2a=arrow2a, arrow2b=arrow2b, tstamp=tstamp)
class Zone(AST): tag = 'zone' schema = { 'net': integer, 'net_name': text, 'layer': text, 'tstamp': hex, 'hatch': { '0': { '_attr': 'hatch_type', '_parser': Literal('none') | 'edge' | 'full' }, '1': { '_attr': 'hatch_size', '_parser': number } }, 'priority': number, 'connect_pads': { 'clearance': number, '1': { '_attr': 'connect_pads', '_tag': False, '_parser': Literal('yes') | 'no' | 'thru_hole_only' } }, 'min_thickness': number, 'fill': { '0': extend_schema(yes_no('fill')['0'], _tag=False, _optional=True), 'mode': { '_attr': 'fill_mode', '_parser': Literal('segment') | 'polygon' }, 'arc_segments': integer, 'thermal_gap': number, 'thermal_bridge_width': number, 'smoothing': Literal('none') | 'chamfer' | 'fillet', 'radius': number }, 'keepout': { 'tracks': allowed('keepout_tracks'), 'vias': allowed('keepout_vias'), 'copperpour': allowed('keepout_copperpour') }, 'polygon': { 'pts': xy_schema('polygon') }, 'filled_polygon': { 'pts': xy_schema('filled_polygon') }, 'fill_segments': { 'pts': xy_schema('fill_segments') } } def __init__(self, net=None, net_name=None, layer=None, tstamp=None, hatch_type='edge', hatch_size=0.5, priority=None, connect_pads=None, clearance=None, min_thickness=None, fill=True, fill_mode=None, arc_segments=None, thermal_gap=None, thermal_bridge_width=None, smoothing=None, radius=None, keepout_tracks=None, keepout_vias=None, keepout_copperpour=None, polygon=None, filled_polygon=None, fill_segments=None): super(self.__class__, self).__init__(net=net, net_name=net_name, layer=layer, tstamp=tstamp, hatch_type=hatch_type, hatch_size=hatch_size, priority=priority, connect_pads=connect_pads, clearance=clearance, min_thickness=min_thickness, fill=fill, fill_mode=fill_mode, arc_segments=arc_segments, thermal_gap=thermal_gap, thermal_bridge_width=thermal_bridge_width, smoothing=smoothing, radius=radius, keepout_tracks=keepout_tracks, keepout_vias=keepout_vias, keepout_copperpour=keepout_copperpour, polygon=polygon, filled_polygon=filled_polygon, fill_segments=fill_segments)