matplotlib 3.5.1

ParametersReturnsBackRef
find_bezier_t_intersecting_with_closedpath(bezier_point_at_t, inside_closedpath, t0=0.0, t1=1.0, tolerance=0.01)

The intersection point t is approximated by two parameters t0, t1 such that t0 <= t <= t1.

Search starts from t0 and t1 and uses a simple bisecting algorithm therefore one of the end points must be inside the path while the other doesn't. The search stops when the distance of the points parametrized by t0 and t1 gets smaller than the given tolerance.

Parameters

bezier_point_at_t : callable

A function returning x, y coordinates of the Bezier at parameter t. It must have the signature:

bezier_point_at_t(t: float) -> tuple[float, float]
inside_closedpath : callable

A function returning True if a given point (x, y) is inside the closed path. It must have the signature:

inside_closedpath(point: tuple[float, float]) -> bool
t0, t1 : float

Start parameters for the search.

tolerance : float

Maximal allowed distance between the final points.

Returns

t0, t1 : float

The Bezier path parameters.

Find the intersection of the Bezier curve with a closed path.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

matplotlib.bezier.split_bezier_intersecting_with_closedpath

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/bezier.py#113
type: <class 'function'>
Commit: