@@ -68,6 +68,61 @@ def get_normal_points(cx, cy, cos_t, sin_t, length):
68
68
return x1 , y1 , x2 , y2
69
69
70
70
71
+ # deprecated routines (moved to `.Path`)
72
+
73
+
74
+ @cbook .deprecated ("3.3" )
75
+ def inside_circle (cx , cy , r ):
76
+ """
77
+ Return a function that checks whether a point is in a circle with center
78
+ (*cx*, *cy*) and radius *r*.
79
+
80
+ The returned function has the signature::
81
+
82
+ f(xy: Tuple[float, float]) -> bool
83
+ """
84
+ r2 = r ** 2
85
+
86
+ def _f (xy ):
87
+ x , y = xy
88
+ return (x - cx ) ** 2 + (y - cy ) ** 2 < r2
89
+ return _f
90
+
91
+
92
+ def split_path_inout (path , inside , tolerance = 0.01 , reorder_inout = False ):
93
+ """
94
+ Divide a path into two segments at the point where ``inside(x, y)``
95
+ becomes False.
96
+ """
97
+ cbook .warn_deprecated ("3.3" ,
98
+ message = "split_path_inout is now a method of "
99
+ "`matplotlib.path.Path`" )
100
+ return path .split_path_inout (inside , tolerance , reorder_inout )
101
+
102
+
103
+ def make_path_regular (path ):
104
+ """
105
+ If the ``codes`` attribute of `.Path` *p* is None, return a copy of *p*
106
+ with ``codes`` set to (MOVETO, LINETO, LINETO, ..., LINETO); otherwise
107
+ return *p* itself.
108
+ """
109
+ cbook .warn_deprecated ("3.3" ,
110
+ message = "make_path_regular is now a method of "
111
+ "`matplotlib.path.Path`" )
112
+ return path .make_path_regular ()
113
+
114
+
115
+ def concatenate_paths (paths ):
116
+ """Concatenate a list of paths into a single path."""
117
+ cbook .warn_deprecated ("3.3" ,
118
+ message = "concatenate_paths is deprecated, please "
119
+ "use `matplotlib.path.Path.concatenate_paths` "
120
+ "instead, which correctly respects subclasses." )
121
+ vertices = np .concatenate ([p .vertices for p in paths ])
122
+ codes = np .concatenate ([make_path_regular (p ).codes for p in paths ])
123
+ return Path (vertices , codes )
124
+
125
+
71
126
# BEZIER routines
72
127
73
128
# subdividing bezier curve
0 commit comments