Exemplo n.º 1
0
def tag_faces(_shape, _color, shape_name):
    """ tag the faces of a shape
    in this example, this easy to see which faces of the 2 shapes we need to glue together
    so by reading the tagged faces, its easy to find the correct index for the
    list `facesA` (5) and `facesB` (4)
    :param _shape: the shape to tag
    :param color: a string, to colors the faces the `_shape` we're exploring
    :param shape_name: name to tag the faces the `_shape`
    """
    for n, f in enumerate(_shape):
        # centroid of the face
        center_pt = center_boundingbox(f)
        # displays the face in the viewer
        display.DisplayShape(f, color=_color, transparency=0.5)
        # tag the face in the viewer
        display.DisplayMessage(center_pt, "{0}_nr_{1}".format(shape_name, n))
def tag_edge(_edge, msg, _color=(1, 0, 0)):
    """ tag an edge
    """
    pt = center_boundingbox(_edge)
    display.DisplayMessage(pt, msg, None, _color, False)