pub struct RationalQuadraticBezier2 { /* private fields */ }Expand description
A rational quadratic Bezier segment with exact control points and weights.
Implementations§
Source§impl RationalQuadraticBezier2
impl RationalQuadraticBezier2
Sourcepub fn point_at_algebraic_parameter(
&self,
parameter: &BezierAlgebraicParameter2,
policy: &CurvePolicy,
) -> CurveResult<RationalBezierAlgebraicPointImage2>
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.
Sourcepub fn tangent_at_algebraic_parameter(
&self,
parameter: &BezierAlgebraicParameter2,
policy: &CurvePolicy,
) -> CurveResult<RationalBezierAlgebraicTangentImage2>
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.
Sourcepub fn second_derivative_at_algebraic_parameter(
&self,
parameter: &BezierAlgebraicParameter2,
policy: &CurvePolicy,
) -> CurveResult<RationalBezierAlgebraicTangentImage2>
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
impl RationalQuadraticBezier2
Sourcepub fn fit_exact_point_image(
&self,
policy: &CurvePolicy,
) -> CurveResult<Classification<BezierPointImageFitRelation>>
pub fn fit_exact_point_image( &self, policy: &CurvePolicy, ) -> CurveResult<Classification<BezierPointImageFitRelation>>
Fits this rational quadratic conic to one exact affine point when possible.
Sourcepub fn fit_exact_line_image(
&self,
policy: &CurvePolicy,
) -> CurveResult<Classification<BezierLineImageFitRelation>>
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
impl RationalQuadraticBezier2
Sourcepub fn signed_area_contribution(&self) -> CurveResult<Option<Real>>
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
impl RationalQuadraticBezier2
Sourcepub fn offset_preflight(
&self,
policy: &CurvePolicy,
) -> Classification<BezierOffsetPreflight2>
pub fn offset_preflight( &self, policy: &CurvePolicy, ) -> Classification<BezierOffsetPreflight2>
Runs exact source analysis for later rational-conic offset adapters.
Sourcepub fn offset_left_staged(
&self,
distance: Real,
policy: &CurvePolicy,
) -> CurveResult<Classification<BezierOffsetCandidate2>>
pub fn offset_left_staged( &self, distance: Real, policy: &CurvePolicy, ) -> CurveResult<Classification<BezierOffsetCandidate2>>
Attempts a staged certified left offset of this rational quadratic conic.
Sourcepub fn offset_right_staged(
&self,
distance: Real,
policy: &CurvePolicy,
) -> CurveResult<Classification<BezierOffsetCandidate2>>
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
impl RationalQuadraticBezier2
Sourcepub fn split_at_parameters(
&self,
parameters: &[BezierParameter2],
policy: &CurvePolicy,
) -> CurveResult<Classification<BezierSplitMaterialization2>>
pub fn split_at_parameters( &self, parameters: &[BezierParameter2], policy: &CurvePolicy, ) -> CurveResult<Classification<BezierSplitMaterialization2>>
Splits this conic at exact/algebraic Bezier parameters.
Sourcepub fn subcurve_between_exact(
&self,
start: &Real,
end: &Real,
policy: &CurvePolicy,
) -> CurveResult<RationalQuadraticBezier2>
pub fn subcurve_between_exact( &self, start: &Real, end: &Real, policy: &CurvePolicy, ) -> CurveResult<RationalQuadraticBezier2>
Materializes the exact conic subcurve over [start, end].
Sourcepub fn split_at_exact(
&self,
t: Real,
policy: &CurvePolicy,
) -> CurveResult<(RationalQuadraticBezier2, RationalQuadraticBezier2)>
pub fn split_at_exact( &self, t: Real, policy: &CurvePolicy, ) -> CurveResult<(RationalQuadraticBezier2, RationalQuadraticBezier2)>
Splits this rational quadratic at one represented parameter.
Source§impl RationalQuadraticBezier2
impl RationalQuadraticBezier2
Sourcepub fn try_new(
start: Point2,
control: Point2,
end: Point2,
start_weight: Real,
control_weight: Real,
end_weight: Real,
) -> Result<Self, CurveError>
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.
Sourcepub fn try_unit_end_weights(
start: Point2,
control: Point2,
end: Point2,
control_weight: Real,
) -> Result<Self, CurveError>
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.
Sourcepub const fn start_weight(&self) -> &Real
pub const fn start_weight(&self) -> &Real
Returns the start weight.
Sourcepub const fn control_weight(&self) -> &Real
pub const fn control_weight(&self) -> &Real
Returns the interior control weight.
Sourcepub const fn end_weight(&self) -> &Real
pub const fn end_weight(&self) -> &Real
Returns the end weight.
Sourcepub fn control_points(&self) -> [&Point2; 3]
pub fn control_points(&self) -> [&Point2; 3]
Returns the control points in polynomial order.
Sourcepub fn point_at(&self, t: Real, policy: &CurvePolicy) -> Classification<Point2>
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.
Sourcepub fn contains_point_at_parameter(
&self,
point: &Point2,
t: Real,
policy: &CurvePolicy,
) -> Classification<bool>
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.
Sourcepub fn parameters_for_point(
&self,
point: &Point2,
policy: &CurvePolicy,
) -> Classification<Vec<Real>>
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).
Sourcepub fn contains_point(
&self,
point: &Point2,
policy: &CurvePolicy,
) -> Classification<bool>
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.
Sourcepub fn relation_to_line(
&self,
line: &LineSeg2,
policy: &CurvePolicy,
) -> Classification<BezierLineRelation>
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).
Sourcepub fn relation_to_line_with_contacts(
&self,
line: &LineSeg2,
policy: &CurvePolicy,
) -> Classification<BezierLineContactRelation>
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.
Sourcepub fn axis_monotone_parameters(
&self,
axis: Axis2,
policy: &CurvePolicy,
) -> Classification<Vec<Real>>
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).
Sourcepub fn monotone_spans(
&self,
policy: &CurvePolicy,
) -> Classification<Vec<BezierMonotoneSpan>>
pub fn monotone_spans( &self, policy: &CurvePolicy, ) -> Classification<Vec<BezierMonotoneSpan>>
Decomposes the conic at all certified x/y quotient-derivative roots.
Sourcepub fn certified_bounds(&self, policy: &CurvePolicy) -> Classification<Aabb2>
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.
Sourcepub fn relation_to_rational_quadratic(
&self,
other: &Self,
policy: &CurvePolicy,
) -> Classification<BezierCurveRelation>
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.
Sourcepub fn graph_order_to_rational_quadratic_over_axis(
&self,
other: &RationalQuadraticBezier2,
shared_axis: Axis2,
policy: &CurvePolicy,
) -> Classification<BezierMonotoneGraphOrder>
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).
Sourcepub fn graph_order_to_quadratic_over_axis(
&self,
other: &QuadraticBezier2,
shared_axis: Axis2,
policy: &CurvePolicy,
) -> Classification<BezierMonotoneGraphOrder>
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).
Sourcepub fn graph_order_to_cubic_over_axis(
&self,
other: &CubicBezier2,
shared_axis: Axis2,
policy: &CurvePolicy,
) -> Classification<BezierMonotoneGraphOrder>
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).
Sourcepub fn relation_to_quadratic(
&self,
other: &QuadraticBezier2,
policy: &CurvePolicy,
) -> Classification<BezierCurveRelation>
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.
Sourcepub fn relation_to_cubic(
&self,
other: &CubicBezier2,
policy: &CurvePolicy,
) -> Classification<BezierCurveRelation>
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.
Sourcepub fn conic_kind(
&self,
policy: &CurvePolicy,
) -> Classification<RationalQuadraticConicKind>
pub fn conic_kind( &self, policy: &CurvePolicy, ) -> Classification<RationalQuadraticConicKind>
Classifies the represented conic family from the homogeneous weights.
Sourcepub fn structural_facts(&self) -> RationalQuadraticBezier2Facts
pub fn structural_facts(&self) -> RationalQuadraticBezier2Facts
Returns conservative structural facts for exact predicate scheduling.
Trait Implementations§
Source§impl Clone for RationalQuadraticBezier2
impl Clone for RationalQuadraticBezier2
Source§fn clone(&self) -> RationalQuadraticBezier2
fn clone(&self) -> RationalQuadraticBezier2
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RationalQuadraticBezier2
impl Debug for RationalQuadraticBezier2
Source§impl PartialEq for RationalQuadraticBezier2
impl PartialEq for RationalQuadraticBezier2
Source§fn eq(&self, other: &RationalQuadraticBezier2) -> bool
fn eq(&self, other: &RationalQuadraticBezier2) -> bool
self and other values to be equal, and is used by ==.