1-current generation

medianshape.simplicial.currentgen.push_curves_on_mesh(mesh_points, mesh_edges, curves, is_closed=False, valid_points=None)[source]

Pushes curves described as sets of points to a simplicial complex K (mesh). For a single curve, it finds the closest points with respect to each point in the curve. Then, it connects the closest vertices with shortest paths which consist of edges in K.

Parameters:
  • mesh_points (float) – points in K.
  • mesh_edges (int) – edges in K in the form of [p1_idx p2_idx] where p1_idx and p2_idx are indices of points in an edge.
  • curves (float) – a set of curves in which each curve is described by a set of points.
  • is_closed (bool) – indicates if the input curves are closed or not.
  • valid_points (int) – an indice list of points that are valid to be a part of the current in K.
Returns:

vertices, paths, input_currents – indices of closest vertices, curves as lists of edges, current vectors

medianshape.simplicial.currentgen.push_curve_on_mesh(mesh_points, mesh_edges, curve_points, is_closed=False, valid_points=None)[source]

Pushes a curve described as a set of points to a simplicial complex K (mesh). For a single curve, it finds the closest points with respect to each point in the curve. Then, it connects the closest vertices with shortest paths which consist of edges in K.

Parameters:
  • mesh_points (float) – points in K.
  • mesh_edges (int) – edges in K in the form of [p1_idx p2_idx] where p1_idx and p2_idx are indices of points in an edge.
  • curves (float) – a curve which is described by a set of points.
  • is_closed (bool) – indicates if the curve is closed or not.
  • valid_points (int) – an indice list of points that are valid to be a part of the current in K.
Returns:

closest_vertices, path, input_current – indices of closest vertices, a curve as lists of edges, a current vector

medianshape.simplicial.currentgen.find_closest_vertices(mesh_points, points, valid_points=None)[source]

Finds the closes vertices in K for a given set of points.

medianshape.simplicial.currentgen.find_closest_vertex(mesh_points, point, selected_points, valid_points=None)[source]

Finds the closest vertice in K for a given point.

medianshape.simplicial.currentgen.find_path(mesh_points, mesh_edges, path_points, is_closed=False)[source]

Finds a path in K which connects given vertices in K. The path is descrived by a list of edges in K.

medianshape.simplicial.currentgen.get_edge_vector(mesh_edges, edges)[source]

Given a set of edges in K, it generates a corresponding edge vector.

medianshape.simplicial.currentgen.get_vertex_vector(mesh_points, point_indices)[source]

Given a set of points in K, it generates a corresponding point vector.