gustaf.create.edges.from_data#

gustaf.create.edges.from_data(gus_obj, data, scale=None, data_norm=None)[source]#

Creates edges from gustaf object with vertices. Data can be either multi-dim array-like data or a str describing a name of vertex_data that belongs to given gustaf object. len(gus_obj.vertices) number of edges will be created, where origin and end of each edge is created using the following scheme: [[vertices[0], vertices[0] + (array_data[0] * scale)], …]. By default, scaling value will be max([1, (aabb_diagonal_norm * 0.1 / max_data_norm)]). If there’s dimension mismatch between vertices and the data, will append zero paddings!

Parameters:
  • gus_obj (Vertices) – gus.Vertices or its derived classes

  • data (str or (n_vertices, d) array-like) – If str, will be considered as data and search for saved vertex_data.

  • scale (float) – Absolute value.

  • data_norm (float or array-like) – If float, will be considered as max_norm of the data. Else, searches for max value. Doesn’t enforce len to match.

Returns:

data_arrow

Return type:

Edges