def decouple_outout_cutin_fn(outer_mesh, inner_mesh): from forward.mesh import (check_intersecting_fn, cut_inner_fn, decouple_outout_fn, clean_mesh_fn) intersections = check_intersecting_fn(outer_mesh, inner_mesh) while(intersections): outer_mesh = decouple_outout_fn(outer_mesh, inner_mesh) outer_mesh = cut_inner_fn(outer_mesh, inner_mesh) outer_mesh = clean_mesh_fn(outer_mesh) intersections = check_intersecting_fn(outer_mesh, inner_mesh) return outer_mesh
def iter_decoupling_fn(outer_mesh, inner_mesh): from forward.mesh import (check_intersecting_fn, cut_inner_fn, decouple_outout_fn, clean_mesh_fn) intersections = check_intersecting_fn(outer_mesh, inner_mesh) while(intersections): for i in range(0, 3): intersections = check_intersecting_fn(outer_mesh, inner_mesh) if intersections: outer_mesh = decouple_outout_fn(outer_mesh, inner_mesh) else: break outer_mesh = cut_inner_fn(outer_mesh, inner_mesh) outer_mesh = clean_mesh_fn(outer_mesh) return outer_mesh
def decouple_surfaces_fn(outer_mesh, inner_mesh): # This function loops until outer_mesh and inner_mesh # have no intersections. # At each iteration it pushes outer_mesh out, cuts parts of # the inner_mesh away, and cleans the mesh. # The pushing out is also iterative. # from forward.mesh import ( iter_push_out_fn, check_intersecting_fn, cut_inner_fn, clean_mesh_fn) for i in range(0, 2): intersections = check_intersecting_fn(outer_mesh, inner_mesh) if intersections: outer_mesh = iter_push_out_fn(outer_mesh, inner_mesh, iterations=3) outer_mesh = cut_inner_fn(outer_mesh, inner_mesh) outer_mesh = clean_mesh_fn(outer_mesh) else: break return outer_mesh
def decouple_and_cut_inner_fn(outer_mesh, inner_mesh): outer_mesh = decouple_outout_fn(outer_mesh, inner_mesh) outer_mesh = cut_inner_fn(outer_mesh, inner_mesh) return outer_mesh