src/compas_3gs/operations/volmeshoperations.py
def volmesh_cell_subdivide_barycentric(volmesh, ckey):
    """Subdivide a cell of a volmesh.

    """
    new_ckeys = []
    x, y, z = volmesh.cell_center(ckey)
    w = volmesh.add_vertex(x=x, y=y, z=z)

    halffaces = volmesh.cell_halffaces(ckey)

    for hfkey in halffaces:
        cell_halffaces = [volmesh.halfface_vertices(hfkey)]

        halfedges = volmesh.halfface_halfedges(hfkey)

        for u, v in halfedges:
            cell_halffaces.append([w, v, u])

        volmesh.delete_halfface(hfkey)
        new_ckeys.append(volmesh.add_cell(cell_halffaces))

    del volmesh.cell[ckey]

    return new_ckeys
Subdivide a cell of a volmesh.

    
Subdivide a cell of a volmesh.
Subdivide a cell of a volmesh .
def volmesh_cell_subdivide_barycentric(volmesh, ckey):
    new_ckeys = []
    x, y, z = volmesh.cell_center(ckey)
    w = volmesh.add_vertex(x=x, y=y, z=z)
    halffaces = volmesh.cell_halffaces(ckey)
    for hfkey in halffaces:
        cell_halffaces = [volmesh.halfface_vertices(hfkey)]
        halfedges = volmesh.halfface_halfedges(hfkey)
        for u, v in halfedges:
            cell_halffaces.append([w, v, u])
        volmesh.delete_halfface(hfkey)
        new_ckeys.append(volmesh.add_cell(cell_halffaces))
    del volmesh.cell[ckey]
    return new_ckeys
def volmesh_cell_subdivide_barycentric ( volmesh , ckey ) : new_ckeys = [ ] x , y , z = volmesh . cell_center ( ckey ) w = volmesh . add_vertex ( x = x , y = y , z = z ) halffaces = volmesh . cell_halffaces ( ckey ) for hfkey in halffaces : cell_halffaces = [ volmesh . halfface_vertices ( hfkey ) ] halfedges = volmesh . halfface_halfedges ( hfkey ) for u , v in halfedges : cell_halffaces . append ( [ w , v , u ] ) volmesh . delete_halfface ( hfkey ) new_ckeys . append ( volmesh . add_cell ( cell_halffaces ) ) del volmesh . cell [ ckey ] return new_ckeys
Subdivide a cell of a volmesh.
Subdivide a cell of a volmesh .
"""Subdivide a cell of a volmesh.

    """
volmesh
ckey