Skip to main content

RationalQuadraticBezier2

Struct RationalQuadraticBezier2 

Source
pub struct RationalQuadraticBezier2 { /* private fields */ }
Expand description

A rational quadratic Bezier segment with exact control points and weights.

Implementations§

Source§

impl RationalQuadraticBezier2

Source

pub fn point_at_algebraic_parameter( &self, parameter: &BezierAlgebraicParameter2, policy: &CurvePolicy, ) -> CurveResult<RationalBezierAlgebraicPointImage2>

Evaluates this rational quadratic’s affine point at an isolated algebraic parameter.

Each coordinate is represented as N(t)/D(t) using the homogeneous Bernstein numerator and weight denominator. Denominator-domain certification is delegated to hypersolve’s rational-image package, so projective boundary uncertainty stays report-bearing instead of being sampled into affine space. This is the rational Bezier analogue of the polynomial image construction above; see Yap (1997) for the exact-object boundary and Farin (2002) for the homogeneous conic equations.

Source

pub fn tangent_at_algebraic_parameter( &self, parameter: &BezierAlgebraicParameter2, policy: &CurvePolicy, ) -> CurveResult<RationalBezierAlgebraicTangentImage2>

Evaluates this rational quadratic’s affine derivative vector at an isolated algebraic parameter.

The derivative coordinate is (N'D - ND') / D^2. The squared denominator preserves tangent direction while giving the exact rational image package a domain predicate that rejects denominator-zero projective boundaries explicitly.

Source

pub fn second_derivative_at_algebraic_parameter( &self, parameter: &BezierAlgebraicParameter2, policy: &CurvePolicy, ) -> CurveResult<RationalBezierAlgebraicTangentImage2>

Evaluates this rational quadratic’s affine second derivative vector.

For one coordinate R(t) = N(t)/D(t), the retained numerator is (A'(t)D(t) - 2A(t)D'(t)) over D(t)^3, where A(t) = N'(t)D(t) - N(t)D'(t). This is the differentiated quotient identity for homogeneous rational Beziers described by Farin, Curves and Surfaces for CAGD (5th ed., 2002). The result remains a represented rational image of the algebraic parameter, preserving Yap’s construction/decision boundary instead of sampling the conic.

Source§

impl RationalQuadraticBezier2

Source

pub fn fit_exact_point_image( &self, policy: &CurvePolicy, ) -> CurveResult<Classification<BezierPointImageFitRelation>>

Fits this rational quadratic conic to one exact affine point when possible.

Source

pub fn fit_exact_line_image( &self, policy: &CurvePolicy, ) -> CurveResult<Classification<BezierLineImageFitRelation>>

Fits this rational quadratic conic to its exact endpoint line image when possible.

Source§

impl RationalQuadraticBezier2

Source

pub fn signed_area_contribution(&self) -> CurveResult<Option<Real>>

Returns this rational quadratic’s exact signed-area boundary contribution.

The contribution is the Green integral 1/2 * integral((Nx dNy - Ny dNx) / W^2), where Nx, Ny, and W are the weighted Bernstein numerator and denominator polynomials. The implementation keeps the conic in homogeneous form until the final exact rational integral, following Yap’s exact-geometric-computation boundary from “Towards Exact Geometric Computation” (1997). The homogeneous rational Bezier identities follow Farin, Curves and Surfaces for Computer-Aided Geometric Design (5th ed., 2002).

None means the current exact object model cannot certify a finite affine integral: this happens when the weights do not have one proven nonzero sign, or when a symbolic transcendental branch reports a domain boundary. It is deliberately not a sampled fallback.

Source§

impl RationalQuadraticBezier2

Source

pub fn offset_preflight( &self, policy: &CurvePolicy, ) -> Classification<BezierOffsetPreflight2>

Runs exact source analysis for later rational-conic offset adapters.

Source

pub fn offset_left_staged( &self, distance: Real, policy: &CurvePolicy, ) -> CurveResult<Classification<BezierOffsetCandidate2>>

Attempts a staged certified left offset of this rational quadratic conic.

Source

pub fn offset_right_staged( &self, distance: Real, policy: &CurvePolicy, ) -> CurveResult<Classification<BezierOffsetCandidate2>>

Attempts a staged certified right offset of this rational quadratic conic.

Source§

impl RationalQuadraticBezier2

Source

pub fn split_at_parameters( &self, parameters: &[BezierParameter2], policy: &CurvePolicy, ) -> CurveResult<Classification<BezierSplitMaterialization2>>

Splits this conic at exact/algebraic Bezier parameters.

Source

pub fn subcurve_between_exact( &self, start: &Real, end: &Real, policy: &CurvePolicy, ) -> CurveResult<RationalQuadraticBezier2>

Materializes the exact conic subcurve over [start, end].

Source

pub fn split_at_exact( &self, t: Real, policy: &CurvePolicy, ) -> CurveResult<(RationalQuadraticBezier2, RationalQuadraticBezier2)>

Splits this rational quadratic at one represented parameter.

Source§

impl RationalQuadraticBezier2

Source

pub fn try_new( start: Point2, control: Point2, end: Point2, start_weight: Real, control_weight: Real, end_weight: Real, ) -> Result<Self, CurveError>

Constructs a rational quadratic segment after rejecting provably zero weights.

Source

pub fn try_unit_end_weights( start: Point2, control: Point2, end: Point2, control_weight: Real, ) -> Result<Self, CurveError>

Constructs the common conic form with endpoint weights equal to one.

Source

pub const fn start(&self) -> &Point2

Returns the start point.

Source

pub const fn control(&self) -> &Point2

Returns the interior control point.

Source

pub const fn end(&self) -> &Point2

Returns the end point.

Source

pub const fn start_weight(&self) -> &Real

Returns the start weight.

Source

pub const fn control_weight(&self) -> &Real

Returns the interior control weight.

Source

pub const fn end_weight(&self) -> &Real

Returns the end weight.

Source

pub fn control_points(&self) -> [&Point2; 3]

Returns the control points in polynomial order.

Source

pub fn weights(&self) -> [&Real; 3]

Returns the weights in polynomial order.

Source

pub fn point_at(&self, t: Real, policy: &CurvePolicy) -> Classification<Point2>

Evaluates the rational segment at affine parameter t.

The numerator and denominator are evaluated in homogeneous Bernstein form: (sum B_i(t) w_i P_i) / (sum B_i(t) w_i). A zero denominator is a projective boundary, so this API returns explicit uncertainty instead of inventing an affine point.

Source

pub fn contains_point_at_parameter( &self, point: &Point2, t: Real, policy: &CurvePolicy, ) -> Classification<bool>

Classifies whether point equals this conic at parameter t.

This is a parameterized predicate rather than an existential conic solve. It first evaluates the homogeneous rational point, then certifies affine equality through the active curve policy. Returning uncertainty at denominator boundaries keeps projective singularities explicit in the style advocated by Yap’s exact geometric computation model.

Source

pub fn parameters_for_point( &self, point: &Point2, policy: &CurvePolicy, ) -> Classification<Vec<Real>>

Returns all certified affine parameters where point lies on this conic.

This is the existential point-on-conic solver for rational quadratics. Each coordinate equation is kept in homogeneous form as N_axis(t) - point_axis * D(t) = 0, so the rational structure is preserved until exact candidate parameters are certified by re-evaluating the conic. That follows Yap’s requirement to keep exact geometric objects explicit until a predicate boundary; see Yap, “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997). The weighted Bernstein numerator/denominator identities follow the rational Bezier treatment in Farin, Curves and Surfaces for Computer-Aided Geometric Design (5th ed., 2002).

Source

pub fn contains_point( &self, point: &Point2, policy: &CurvePolicy, ) -> Classification<bool>

Classifies whether point lies anywhere on this finite conic segment.

Denominator boundaries are reported as uncertainty instead of being projected into affine space. Use Self::parameters_for_point when the certified parameters themselves are needed by downstream topology.

Source

pub fn relation_to_line( &self, line: &LineSeg2, policy: &CurvePolicy, ) -> Classification<BezierLineRelation>

Classifies this rational quadratic against a supporting line.

The signed distance numerator of a rational Bezier to a line is a polynomial Bezier with control values w_i * orient(line, P_i). Solving that numerator preserves the homogeneous conic structure instead of sampling or flattening the curve. This is the rational Bezier form of the line-incidence predicates described by Farin (2002), with branch decisions routed through exact scalar signs per Yap (1997).

Source

pub fn relation_to_line_with_contacts( &self, line: &LineSeg2, policy: &CurvePolicy, ) -> Classification<BezierLineContactRelation>

Classifies represented conic/supporting-line contacts as crossings or tangencies.

The signed affine line predicate for a rational quadratic is the weighted Bernstein numerator sum B_i(t) w_i orient(line, P_i). A root becomes a finite conic contact only when the homogeneous denominator is certified nonzero at the same parameter; denominator zeros remain explicit projective-boundary uncertainty. Represented contacts are then labelled from the exact derivative of that numerator. This follows Yap’s exact geometric computation boundary; see Yap, “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997). The rational Bezier numerator/denominator identities are from Farin, Curves and Surfaces for CAGD (5th ed., 2002), and unrepresented roots remain Sederberg-Nishita Bezier-clipping brackets.

Source

pub fn axis_monotone_parameters( &self, axis: Axis2, policy: &CurvePolicy, ) -> Classification<Vec<Real>>

Returns quotient-derivative roots that split this conic into monotone spans.

For a rational coordinate N(t) / D(t), extrema occur where N'(t)D(t) - N(t)D'(t) = 0 and D(t) != 0. The cubic terms cancel for rational quadratics, leaving an exact quadratic root problem. This keeps the homogeneous numerator/denominator visible as recommended by Yap (1997), and follows the rational Bezier derivative identity in Farin (2002).

Source

pub fn monotone_spans( &self, policy: &CurvePolicy, ) -> Classification<Vec<BezierMonotoneSpan>>

Decomposes the conic at all certified x/y quotient-derivative roots.

Source

pub fn certified_bounds(&self, policy: &CurvePolicy) -> Classification<Aabb2>

Returns a certified rational-conic bounding box from endpoints and extrema.

Non-equal same-sign weights also include the Euclidean control point as a conservative hull witness. A uniformly negative homogeneous lift is sign-normalized to the positive case, preserving the rational Bezier convex-hull guarantee when algebraic extrema are present while still avoiding topology decisions from approximate samples.

Source

pub fn relation_to_rational_quadratic( &self, other: &Self, policy: &CurvePolicy, ) -> Classification<BezierCurveRelation>

Classifies a coarse relation between two rational quadratic conics.

This is deliberately not a full conic/conic solver. It certifies exact homogeneous-control identity, same-sign convex-hull disjointness, certified point and endpoint line-segment images, and shared endpoints, then leaves overlapping boxes unresolved for a later resultant or subdivision predicate. Keeping that boundary explicit follows Yap’s exact-computation separation between cheap structural facts and complete topology solvers.

Source

pub fn graph_order_to_rational_quadratic_over_axis( &self, other: &RationalQuadraticBezier2, shared_axis: Axis2, policy: &CurvePolicy, ) -> Classification<BezierMonotoneGraphOrder>

Classifies graph order against another matching-weight conic over one shared axis.

This is the rational quadratic analogue of polynomial Bezier graph ordering. It first certifies that both conics share the same homogeneous weights, that those weights have one nonzero sign, that the requested Euclidean coordinate is identical, and that this coordinate is strictly monotone. The remaining coordinate then reduces to one weighted Bernstein numerator over the common denominator. Strict order is sign-normalized by the denominator sign, so uniformly negative homogeneous weights report the same Euclidean order as their positive projective image. This follows Yap’s exact geometric computation boundary; see Yap, “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997). The rational homogeneous Bezier model is Farin, Curves and Surfaces for CAGD (5th ed., 2002), and retained crossing brackets use Sederberg and Nishita, “Curve intersection using Bezier clipping” (1990).

Source

pub fn graph_order_to_quadratic_over_axis( &self, other: &QuadraticBezier2, shared_axis: Axis2, policy: &CurvePolicy, ) -> Classification<BezierMonotoneGraphOrder>

Classifies graph order against a polynomial quadratic.

Equal homogeneous weights collapse a rational quadratic Bezier to the polynomial quadratic with the same Euclidean controls. This method exposes that exact collapse as the mixed conic/polynomial graph-order bridge, then delegates to the polynomial predicate. For non-equal same-sign weights, it also certifies strict graph order when one coordinate is exactly shared and the degree-4 homogeneous Bernstein numerator for the remaining coordinate has one strict sign. Non-strict mixed quartic roots are retained as represented parameters or isolating spans instead of being sampled. This preserves Yap’s exact geometric computation boundary; see Yap, “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997). The rational Bezier identities are from Farin, Curves and Surfaces for CAGD (5th ed., 2002), and the Bernstein sign argument is the Sederberg-Nishita Bezier clipping criterion (1990).

Source

pub fn graph_order_to_cubic_over_axis( &self, other: &CubicBezier2, shared_axis: Axis2, policy: &CurvePolicy, ) -> Classification<BezierMonotoneGraphOrder>

Classifies graph order against a polynomial cubic.

Equal same-sign nonzero weights certify that the rational conic is exactly the polynomial quadratic with the same Euclidean control points, so the predicate delegates to the degree-normalized polynomial quadratic/cubic graph order. For non-equal same-sign weights, this also certifies strict order when one coordinate is exactly shared and the degree-5 homogeneous Bernstein numerator for the remaining coordinate has one strict sign. Non-strict mixed quintic roots are retained as represented parameters or isolating spans. The branch boundary follows Yap, “Towards Exact Geometric Computation,” Computational Geometry 7.1-2 (1997); the rational identities follow Farin, Curves and Surfaces for CAGD (5th ed., 2002), and strict Bernstein sign exclusion follows Sederberg-Nishita Bezier clipping (1990).

Source

pub fn relation_to_quadratic( &self, other: &QuadraticBezier2, policy: &CurvePolicy, ) -> Classification<BezierCurveRelation>

Classifies a coarse relation between this conic and a polynomial quadratic.

A same-sign rational Bezier segment sign-normalizes to the positive case and lies in the convex hull of its Euclidean control points, so a disjoint hull box is a certified miss. This is the convex-hull predicate for rational Beziers described by Farin (2002), used only when exact signs prove the weights share one nonzero sign in the EGC sense of Yap (1997). Equal weights collapse the homogeneous conic to the polynomial quadratic with the same control polygon.

Source

pub fn relation_to_cubic( &self, other: &CubicBezier2, policy: &CurvePolicy, ) -> Classification<BezierCurveRelation>

Classifies a coarse relation between this conic and a polynomial cubic.

Degree-mismatched overlaps are intentionally not solved here; the predicate certifies hull disjointness and shared endpoints, then returns BezierCurveRelation::Unresolved for cases needing a complete curve/curve root solver.

Source

pub fn conic_kind( &self, policy: &CurvePolicy, ) -> Classification<RationalQuadraticConicKind>

Classifies the represented conic family from the homogeneous weights.

Source

pub fn structural_facts(&self) -> RationalQuadraticBezier2Facts

Returns conservative structural facts for exact predicate scheduling.

Trait Implementations§

Source§

impl Clone for RationalQuadraticBezier2

Source§

fn clone(&self) -> RationalQuadraticBezier2

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RationalQuadraticBezier2

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RationalQuadraticBezier2

Source§

fn eq(&self, other: &RationalQuadraticBezier2) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RationalQuadraticBezier2

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.