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 iter_push_out_fn(outer_mesh, inner_mesh, iterations=5): # This function loops until there are no # intersections between two surfaces. # It cuts away the inner surface and # uses decouple_outout: # # "Treat 1st file as outer, 2nd file as inner component. ## "Resolve overlaps by moving outers triangles outwards." ## "Constrain the min distance between the components > d." # # at each iteration. from forward.mesh import (check_intersecting_fn, decouple_outout_fn) for i in range(0, iterations): intersecting = check_intersecting_fn(outer_mesh, inner_mesh) if intersecting: outer_mesh = decouple_outout_fn(outer_mesh, inner_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