cellcomplex.property_topomesh.optimization.property_topomesh_edge_flip_optimization

cellcomplex.property_topomesh.optimization.property_topomesh_edge_flip_optimization(topomesh, omega_energies={'neighborhood': 0.65, 'regularization': 0.15}, simulated_annealing=True, display=False, image_edges=None, verbose=False, debug=False, loglevel=0, **kwargs)[source]

Perform a topological optimization of a PropertyTopomesh using edge flips.

An energy functional is iteratively minimized by successively flipping edges of the triangular topomesh. Edge flips that allow a decrease of the energy while keeping the structure valid topologically and geometrically are applied in ascending order of energy variation. To avoid local minima of energy it is possible to apply energy increasing flips in a simulated annealing procedure.

Parameters
  • topomesh (cellcomplex.property_topomesh.PropertyTopomesh) – The structure on which to perform the optimization

  • omega_energies (dict) –

    The weights (float) associated to each energy term:
    • regularization energy optimizing triangle eccentricity

    • length energy minimizing total edge length

    • neighborhood energy optimizing vertex valency towards 6

    • image energy optimizing adjacencies to observed ones

  • simulated_annealing (bool) – Whether to allow or not energy increasing edge flips in the process

  • image_edges (numpy.ndarray) – The list of pairs of vertices used as reference if image energy is used

Returns

n_flips – Number of edges flipped in the last iteration

Return type

int

Note

The PropertyTopomesh passed as argument is updated.

Warning

The PropertyTopomesh must be a triangular topomesh (cellcomplex.property_topomesh.analysis.is_triangular())