11"""
2- A module providing some utility functions regarding Bezier path manipulation.
2+ A module providing some utility functions regarding Bézier path manipulation.
33"""
44
55from functools import lru_cache
@@ -94,7 +94,7 @@ def _de_casteljau1(beta, t):
9494
9595def split_de_casteljau (beta , t ):
9696 """
97- Split a Bezier segment defined by its control points *beta* into two
97+ Split a Bézier segment defined by its control points *beta* into two
9898 separate segments divided at *t* and return their control points.
9999 """
100100 beta = np .asarray (beta )
@@ -113,7 +113,7 @@ def split_de_casteljau(beta, t):
113113def find_bezier_t_intersecting_with_closedpath (
114114 bezier_point_at_t , inside_closedpath , t0 = 0. , t1 = 1. , tolerance = 0.01 ):
115115 """
116- Find the intersection of the Bezier curve with a closed path.
116+ Find the intersection of the Bézier curve with a closed path.
117117
118118 The intersection point *t* is approximated by two parameters *t0*, *t1*
119119 such that *t0* <= *t* <= *t1*.
@@ -126,7 +126,7 @@ def find_bezier_t_intersecting_with_closedpath(
126126 Parameters
127127 ----------
128128 bezier_point_at_t : callable
129- A function returning x, y coordinates of the Bezier at parameter *t*.
129+ A function returning x, y coordinates of the Bézier at parameter *t*.
130130 It must have the signature::
131131
132132 bezier_point_at_t(t: float) -> tuple[float, float]
@@ -146,7 +146,7 @@ def find_bezier_t_intersecting_with_closedpath(
146146 Returns
147147 -------
148148 t0, t1 : float
149- The Bezier path parameters.
149+ The Bézier path parameters.
150150 """
151151 start = bezier_point_at_t (t0 )
152152 end = bezier_point_at_t (t1 )
@@ -180,7 +180,7 @@ def find_bezier_t_intersecting_with_closedpath(
180180
181181class BezierSegment :
182182 """
183- A d-dimensional Bezier segment.
183+ A d-dimensional Bézier segment.
184184
185185 Parameters
186186 ----------
@@ -199,7 +199,7 @@ def __init__(self, control_points):
199199
200200 def __call__ (self , t ):
201201 """
202- Evaluate the Bezier curve at point(s) t in [0, 1].
202+ Evaluate the Bézier curve at point(s) *t* in [0, 1].
203203
204204 Parameters
205205 ----------
@@ -239,15 +239,15 @@ def degree(self):
239239 @property
240240 def polynomial_coefficients (self ):
241241 r"""
242- The polynomial coefficients of the Bezier curve.
242+ The polynomial coefficients of the Bézier curve.
243243
244244 .. warning:: Follows opposite convention from `numpy.polyval`.
245245
246246 Returns
247247 -------
248248 (n+1, d) array
249249 Coefficients after expanding in polynomial basis, where :math:`n`
250- is the degree of the bezier curve and :math:`d` its dimension.
250+ is the degree of the Bézier curve and :math:`d` its dimension.
251251 These are the numbers (:math:`C_j`) such that the curve can be
252252 written :math:`\sum_{j=0}^n C_j t^j`.
253253
@@ -308,12 +308,12 @@ def axis_aligned_extrema(self):
308308def split_bezier_intersecting_with_closedpath (
309309 bezier , inside_closedpath , tolerance = 0.01 ):
310310 """
311- Split a Bezier curve into two at the intersection with a closed path.
311+ Split a Bézier curve into two at the intersection with a closed path.
312312
313313 Parameters
314314 ----------
315315 bezier : (N, 2) array-like
316- Control points of the Bezier segment. See `.BezierSegment`.
316+ Control points of the Bézier segment. See `.BezierSegment`.
317317 inside_closedpath : callable
318318 A function returning True if a given point (x, y) is inside the
319319 closed path. See also `.find_bezier_t_intersecting_with_closedpath`.
@@ -324,7 +324,7 @@ def split_bezier_intersecting_with_closedpath(
324324 Returns
325325 -------
326326 left, right
327- Lists of control points for the two Bezier segments.
327+ Lists of control points for the two Bézier segments.
328328 """
329329
330330 bz = BezierSegment (bezier )
@@ -461,13 +461,13 @@ def check_if_parallel(dx1, dy1, dx2, dy2, tolerance=1.e-5):
461461
462462def get_parallels (bezier2 , width ):
463463 """
464- Given the quadratic Bezier control points *bezier2*, returns
465- control points of quadratic Bezier lines roughly parallel to given
464+ Given the quadratic Bézier control points *bezier2*, returns
465+ control points of quadratic Bézier lines roughly parallel to given
466466 one separated by *width*.
467467 """
468468
469469 # The parallel Bezier lines are constructed by following ways.
470- # c1 and c2 are control points representing the begin and end of the
470+ # c1 and c2 are control points representing the start and end of the
471471 # Bezier line.
472472 # cm is the middle point
473473
@@ -485,7 +485,7 @@ def get_parallels(bezier2, width):
485485 cos_t2 , sin_t2 = cos_t1 , sin_t1
486486 else :
487487 # t1 and t2 is the angle between c1 and cm, cm, c2. They are
488- # also a angle of the tangential line of the path at c1 and c2
488+ # also an angle of the tangential line of the path at c1 and c2
489489 cos_t1 , sin_t1 = get_cos_sin (c1x , c1y , cmx , cmy )
490490 cos_t2 , sin_t2 = get_cos_sin (cmx , cmy , c2x , c2y )
491491
@@ -535,7 +535,7 @@ def get_parallels(bezier2, width):
535535
536536def find_control_points (c1x , c1y , mmx , mmy , c2x , c2y ):
537537 """
538- Find control points of the Bezier curve passing through (*c1x*, *c1y*),
538+ Find control points of the Bézier curve passing through (*c1x*, *c1y*),
539539 (*mmx*, *mmy*), and (*c2x*, *c2y*), at parametric values 0, 0.5, and 1.
540540 """
541541 cmx = .5 * (4 * mmx - (c1x + c2x ))
@@ -545,8 +545,8 @@ def find_control_points(c1x, c1y, mmx, mmy, c2x, c2y):
545545
546546def make_wedged_bezier2 (bezier2 , width , w1 = 1. , wm = 0.5 , w2 = 0. ):
547547 """
548- Being similar to get_parallels, returns control points of two quadratic
549- Bezier lines having a width roughly parallel to given one separated by
548+ Being similar to ` get_parallels` , returns control points of two quadratic
549+ Bézier lines having a width roughly parallel to given one separated by
550550 *width*.
551551 """
552552
@@ -556,7 +556,7 @@ def make_wedged_bezier2(bezier2, width, w1=1., wm=0.5, w2=0.):
556556 c3x , c3y = bezier2 [2 ]
557557
558558 # t1 and t2 is the angle between c1 and cm, cm, c3.
559- # They are also a angle of the tangential line of the path at c1 and c3
559+ # They are also an angle of the tangential line of the path at c1 and c3
560560 cos_t1 , sin_t1 = get_cos_sin (c1x , c1y , cmx , cmy )
561561 cos_t2 , sin_t2 = get_cos_sin (cmx , cmy , c3x , c3y )
562562
0 commit comments