Пример #1
0
def mesh_select_edge(mesh, message="Select a mesh edge"):
    """Select one edge of a mesh.

    Parameters
    ----------
    mesh : compas.datastructures.Mesh
        A mesh object.
    message : str ("Select a mesh edge.")
        The message to display to the user.

    Returns
    -------
    tuple
        The key of the selected edge.

    See Also
    --------
    * :func:`mesh_select_edges`

    """
    return EdgeSelector.select_edge(mesh)
Пример #2
0
def network_select_edges(network, message="Select network edges"):
    """Select edges of a network.

    Parameters
    ----------
    network : compas.datastructures.Network
        The network object.
    message : str ("Select network edges.")
        The message to display to the user.

    Returns
    -------
    list
        The keys of the selected edges. Each key is a *uv* pair.

    See Also
    --------
    * :func:`network_select_edge`

    """
    return EdgeSelector.select_edges(network)
Пример #3
0
def mesh_select_edges(mesh, message="Select mesh edges"):
    """Select edges of a mesh.

    Parameters
    ----------
    mesh : compas.datastructures.Mesh
        A mesh object.
    message : str ("Select mesh edges.")
        The message to display to the user.

    Returns
    -------
    list
        The keys of the selected edges.

    See Also
    --------
    * :func:`mesh_select_vertices`
    * :func:`mesh_select_faces`

    """
    return EdgeSelector.select_edges(mesh)
Пример #4
0
def network_select_edge(network, message="Select a network edge"):
    """Select one edge of a network.

    Parameters
    ----------
    network : compas.datastructures.Network
        A network object.
    message : str ("Select a network edge.")
        The message to display to the user.

    Returns
    -------
    tuple
        The key of the selected edge.
    None
        If no edge was selected.

    See Also
    --------
    * :func:`network_select_edges`

    """
    return EdgeSelector.select_edge(network)
Пример #5
0
artist.clear_layer()
artist.draw_vertices(color=vertexcolor)
artist.draw_edges(color=edgecolor)
artist.redraw()

# select mesh vertices
# update the attributes
# redraw mesh if successful
while True:
    selected = VertexSelector.select_vertices(mesh)
    if not selected:
        break

    if VertexModifier.update_vertex_attributes(mesh, selected):
        artist.clear_layer()
        artist.draw_vertices(color=vertexcolor)
        artist.draw_edges(color=edgecolor)

# select mesh edges
# update the attributes
# redraw mesh if successful
while True:
    selected = EdgeSelector.select_edges(mesh)
    if not selected:
        break
    if EdgeModifier.update_edge_attributes(mesh, selected):
        artist.clear_layer()
        artist.draw_vertices(color=vertexcolor)
        artist.draw_edges(color=edgecolor)
Пример #6
0
def volmesh_select_edges(volmesh):
    """"""
    return EdgeSelector.select_edges(volmesh)