Skip to content

puncturedfem.split_edge

Split the edge e at the parameter t_split and returns the resulting edges.

If t_split is a list of parameters, the edge is split at each parameter in the list. If num_edges is provided, the edge is split into num_edges equal parts.

Parameters:

Name Type Description Default
e Edge

The edge to split.

required
t_split float, list of floats, or np.ndarray, optional

The parameter(s) at which to split the edge. If a list of floats is provided, the edge is split at each parameter in the list. If a float is provided, the edge is split at that parameter. If None, num_edges must be provided. The default is None.

None
num_edges int, optional

The number of equal parts to split the edge into. If None, t_split must be provided. The default is None.

None

Returns:

Type Description
list[Edge], tuple[Edge, Edge]

If t_split is a list of floats, the resulting edges are returned in a list. If t_split is a float, the resulting edges are returned as a tuple. If num_edges is provided, the resulting edges are returned in a list.

Raises:

Type Description
ValueError

If t_split and num_edges are both None. If num_edges is less than 2. If t_split is not a float, list of floats, or np.ndarray.