edge_subdiv_interpolator
EdgeSubdivInterpolator
edge_divider = EdgeEquidistantDivider()
instance-attribute
__init__()
apply_to_graph(graph, edge_length_max, node_attr='scalars')
Subdivides edges in a graph whose lengths are greater than a specified maximum length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph |
Graph
|
Dgm graph object. |
required |
edge_length_max |
float
|
The maximum length allowed for graph edges. |
required |
node_attr |
str
|
Graph node attribute that will be also interpolated. Defaults to "scalars". |
'scalars'
|
Returns:
| Type | Description |
|---|---|
ndarray
|
ndarray[N, 3]: Array containing the node coordinates. |
ndarray
|
ndarray[N, ]: Array containing the node attribute (scalars). |
get_edge_divider()
interpolate(nodes_coords, nodes_scalars, edges, edges_length, edge_length_max)
Introduce new points and scalar value using edge subdivition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes_coords |
ndarray[N, 3]
|
Coords of the points. |
required |
nodes_scalars |
ndarray[N] or [N, M]
|
Scalar or multiple scalars. |
required |
edges |
ndarray[K, 2]
|
Connections. |
required |
edges_length |
ndarray[K]
|
Edges length. |
required |
edge_length_max |
float
|
Max allowed edge length. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[ndarray, ndarray]
|
Coords and scalars of old and new points. |