def add_hatch_boundaries_adjacent(msp, offset): x, y = offset external = Shape2d(square(SIZE)) outermost = Shape2d(square(SIZE - 2)) outermost.translate((1, 1)) default0 = Shape2d(square(2)) default0.translate((2, 2)) default1 = Shape2d(square(2)) default1.translate((6, 2)) add_hatch( msp, external=[external], outermost=[outermost], default=[default0, default1], hatch_style=const.HATCH_STYLE_NESTED, offset=offset, ) add_hatch(msp, external=[external], outermost=[outermost], default=[default0, default1], hatch_style=const.HATCH_STYLE_OUTERMOST, offset=(x + DX, y)) add_hatch(msp, external=[external], outermost=[outermost], default=[default0, default1], hatch_style=const.HATCH_STYLE_IGNORE, offset=(x + DX + DX, y))
def add_top_zero_bottom_mlines(msp, vertices, closed: bool = False, style: str = 'Standard'): shape = Shape2d(vertices) msp.add_mline(shape.vertices, dxfattribs={ 'style_name': style, 'justification': const.MLINE_BOTTOM, 'closed': closed, }) shape.translate((0, 20, 0)) msp.add_mline(shape.vertices, dxfattribs={ 'style_name': style, 'justification': const.MLINE_ZERO, 'closed': closed, }) shape.translate((0, 20, 0)) msp.add_mline(shape.vertices, dxfattribs={ 'style_name': style, 'justification': const.MLINE_TOP, 'closed': closed, })
def add_top_zero_bottom_mlines(msp, vertices, closed: bool = False, style: str = "Standard"): shape = Shape2d(vertices) msp.add_mline( shape.vertices, close=closed, dxfattribs={ "style_name": style, "justification": const.MLINE_BOTTOM, }, ) shape.translate((0, 20, 0)) msp.add_mline( shape.vertices, close=closed, dxfattribs={ "style_name": style, "justification": const.MLINE_ZERO, }, ) shape.translate((0, 20, 0)) msp.add_mline( shape.vertices, close=closed, dxfattribs={ "style_name": style, "justification": const.MLINE_TOP, }, )
def __init__(self, vertices: Iterable[Vertex]): self.shape = Shape2d(vertices)