src/compas_3gs/algorithms/duality.py
def volmesh_dual_network(volmesh, cls=None):
    """Computes the dual network dual of a volmesh.

    Parameters
    ----------
    volmesh : VolMesh
        A volmesh object.

    Returns
    -------
    network : Network
        The dual network object of the input volmesh.

    """
    if not cls:
        cls = Network

    dual_network = cls()

    for cell in volmesh.cells():
        x, y, z = volmesh.cell_centroid(cell)
        dual_network.add_node(key=cell, x=x, y=y, z=z)

        for nbr in volmesh.cell_neighbors(cell):
            if nbr in dual_network.edge[cell]:
                continue
            if nbr in dual_network.edge and cell in dual_network.edge[nbr]:
                continue
            dual_network.add_edge(cell, nbr)

    return dual_network
Computes the dual network dual of a volmesh.

    Parameters
    ----------
    volmesh : VolMesh
        A volmesh object.

    Returns
    -------
    network : Network
        The dual network object of the input volmesh.

    
Computes the dual network dual of a volmesh.
Parameters

volmesh : VolMesh
A volmesh object.

Returns

network : Network
The dual network object of the input volmesh.
Computes the dual network dual of a volmesh . Parameters volmesh : VolMesh A volmesh object . Returns network : Network The dual network object of the input volmesh .
def volmesh_dual_network(volmesh, cls=None):
    if not cls:
        cls = Network
    dual_network = cls()
    for cell in volmesh.cells():
        x, y, z = volmesh.cell_centroid(cell)
        dual_network.add_node(key=cell, x=x, y=y, z=z)
        for nbr in volmesh.cell_neighbors(cell):
            if nbr in dual_network.edge[cell]:
                continue
            if nbr in dual_network.edge and cell in dual_network.edge[nbr]:
                continue
            dual_network.add_edge(cell, nbr)
    return dual_network
def volmesh_dual_network ( volmesh , cls = None ) : if not cls : cls = Network dual_network = cls ( ) for cell in volmesh . cells ( ) : x , y , z = volmesh . cell_centroid ( cell ) dual_network . add_node ( key = cell , x = x , y = y , z = z ) for nbr in volmesh . cell_neighbors ( cell ) : if nbr in dual_network . edge [ cell ] : continue if nbr in dual_network . edge and cell in dual_network . edge [ nbr ] : continue dual_network . add_edge ( cell , nbr ) return dual_network
Computes the dual network dual of a volmesh.
Computes the dual network dual of a volmesh .
"""Computes the dual network dual of a volmesh.

    Parameters
    ----------
    volmesh : VolMesh
        A volmesh object.

    Returns
    -------
    network : Network
        The dual network object of the input volmesh.

    """
volmesh
cls