utilities

utils

save_to_json

Save the provided data to json on the filepath, with the given name

load_from_json

Loads json from the filepath

flattened_list_of_dictionary

Turns the dictionary into a flat list

interrupt

Interrupts the flow of the code while it is running.

point_list_to_dict

Turns a list of compas.geometry.Point into a dictionary, so that it can be saved to Json.

get_closest_mesh_normal_to_pt

Finds the closest vertex normal to the point.

get_closest_pt_index

Finds the index of the closest point of 'pt' in the point cloud 'pts'.

get_closest_pt

Finds the closest point of 'pt' in the point cloud 'pts'.

plot_networkx_graph

Plots the graph G

get_mesh_vertex_coords_with_attribute

Finds the coordinates of all the vertices that have an attribute with key=attr that equals the value.

get_dict_key_from_value

Return the key of a dictionary that stores the val

get_closest_mesh_normal_to_pt

Finds the closest vertex normal to the point.

smooth_vectors

Smooths the vector iteratively, with the given number of iterations and strength per iteration

get_normal_of_path_on_xy_plane

Finds the normal of the curve that lies on the xy plane at the point with index k