コード例 #1
0
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))
コード例 #2
0
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,
                  })
コード例 #3
0
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,
        },
    )
コード例 #4
0
 def __init__(self, vertices: Iterable[Vertex]):
     self.shape = Shape2d(vertices)