MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / split_de_casteljau

Function split_de_casteljau

lib/matplotlib/bezier.py:179–194  ·  view source on GitHub ↗

Split a Bézier segment defined by its control points *beta* into two separate segments divided at *t* and return their control points.

(beta, t)

Source from the content-addressed store, hash-verified

177
178
179def split_de_casteljau(beta, t):
180 """
181 Split a Bézier segment defined by its control points *beta* into two
182 separate segments divided at *t* and return their control points.
183 """
184 beta = np.asarray(beta)
185 beta_list = [beta]
186 while True:
187 beta = _de_casteljau1(beta, t)
188 beta_list.append(beta)
189 if len(beta) == 1:
190 break
191 left_beta = [beta[0] for beta in beta_list]
192 right_beta = [beta[-1] for beta in reversed(beta_list)]
193
194 return left_beta, right_beta
195
196
197def find_bezier_t_intersecting_with_closedpath(

Calls 1

_de_casteljau1Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…