The example_elastic_shape_optimization.py runs delaunay edge flipping to keep the deforming mesh nice during inverse design:
|
def delaunay_edge_flip(positions_np, tri_indices_np, ref_positions_np=None): |
The flipping is done on the CPU with numpy code. It's not really a bottleneck currently, but it nevertheless could be done in warp.
Meanwhile, there's possibly a subtle bug in the current implementation which could lead to unexpected behavior. The edge-triangle adjacency is constructed outside the flipping loop and not updated. I didn't look for a minimal example breaking it because the plan was to rewrite in warp anyway, but I'm fairly convinced it could fail.
The example_elastic_shape_optimization.py runs delaunay edge flipping to keep the deforming mesh nice during inverse design:
warp/warp/examples/fem/example_elastic_shape_optimization.py
Line 149 in 4cb1423
The flipping is done on the CPU with numpy code. It's not really a bottleneck currently, but it nevertheless could be done in warp.
Meanwhile, there's possibly a subtle bug in the current implementation which could lead to unexpected behavior. The edge-triangle adjacency is constructed outside the flipping loop and not updated. I didn't look for a minimal example breaking it because the plan was to rewrite in warp anyway, but I'm fairly convinced it could fail.