buffalo_wings.airfoil.BezierCurve1D

class buffalo_wings.airfoil.BezierCurve1D(*, coefficients)[source]

Bases: object

One-dimensional Bezier curve.

Methods

demote_degree(*[, count, continuity])

Lower the Bezier degree with constrained least-squares demotion.

evaluate(u)

Evaluate the one-dimensional Bezier curve.

evaluate_u(u)

Evaluate the first derivative of the one-dimensional curve.

evaluate_uu(u)

Evaluate the second derivative of the one-dimensional curve.

promote_degree(*[, count])

Raise the Bezier degree without changing the represented curve.

Attributes

coefficients

Return the stored Bernstein coefficients.

degree

Return the Bezier degree.

property coefficients: buffalo_core.typing.FloatArray

Return the stored Bernstein coefficients.

This property exposes the stored read-only (n,) Bernstein coefficient array.

property degree: int

Return the Bezier degree.

This property reports the polynomial degree of the one-dimensional Bezier curve.

evaluate(u)[source]

Evaluate the one-dimensional Bezier curve.

Parameters:

u (buffalo_core.typing.FloatInput) – Parameter values, typically in [0, 1].

Returns:

Curve values at u with the same broadcasted shape as the normalized input.

Return type:

buffalo_core.typing.FloatArray

evaluate_u(u)[source]

Evaluate the first derivative of the one-dimensional curve.

Parameters:

u (buffalo_core.typing.FloatInput) – Parameter values, typically in [0, 1].

Returns:

First derivative values at u with the same broadcasted shape as the normalized input.

Return type:

buffalo_core.typing.FloatArray

evaluate_uu(u)[source]

Evaluate the second derivative of the one-dimensional curve.

Parameters:

u (buffalo_core.typing.FloatInput) – Parameter values, typically in [0, 1].

Returns:

Second derivative values at u with the same broadcasted shape as the normalized input.

Return type:

buffalo_core.typing.FloatArray

promote_degree(*, count=1)[source]

Raise the Bezier degree without changing the represented curve.

This operation is exact.

Parameters:

count (int, default 1) – Number of degree-elevation steps to apply.

Returns:

Elevated one-dimensional Bezier curve.

Return type:

BezierCurve1D

demote_degree(*, count=1, continuity='NOT_CONNECTED')[source]

Lower the Bezier degree with constrained least-squares demotion.

This operation is intentionally approximate. It solves a constrained least-squares degree-reduction problem and does not guarantee exact preservation of the original curve, except in the special cases where the original curve is exactly reducible to the requested lower degree.

Parameters:
  • count (int, default 1) – Number of degree-reduction steps to apply.

  • continuity ({"NOT_CONNECTED", "C0", "C1", "C2"},) – default=”NOT_CONNECTED” Symmetric endpoint continuity to preserve during each demotion step. "NOT_CONNECTED" leaves the endpoints unconstrained. "C0", "C1", and "C2" preserve endpoint value, value-plus-first-derivative, and value-plus-first-two-derivatives, respectively, when the current degree allows it.

Returns:

Reduced-degree one-dimensional Bezier curve produced by a constrained least-squares approximate demotion.

Return type:

BezierCurve1D