Skip to main content

Module nurb_curve

Module nurb_curve 

Source

Structs§

Helix
The screw motion a helix follows: rising pitch per turn through turns turns, turning as handedness says, and moving out from the axis by taper for every unit it rises — none for a helix on a cylinder.
HelixRow
One control row of a helix around frame.w() through frame.origin(): a point at distance r from the axis, raised by z above the row, lies at origin + (r + out) radial + (rise + z) w, weighted weight — none for a row at a span’s end, whose weight is one.
NurbCurve
A NURBS curve whose control points live in D-dimensional homogeneous space.
Within
Where a curve lies with respect to a convex polygon (see NurbCurve::within). Where a piece of the curve runs along the polygon’s boundary closer than the search resolves, it counts as touching, and as no point outside.

Enums§

Handedness
Which way a helix turns as it rises: right-handed, like an ordinary screw — counter-clockwise seen from where it rises to — or left-handed.

Traits§

Length
A curve with a length: in space, or in a plane.
ParameterRefinable
Bridges a NurbCurve<D>’s Cartesian evaluation (D = 4 -> 3-D points, D = 3 -> 2-D pcurve points) so NurbCurve::refine_parameter_at_point can be written once for both — stable Rust’s const generics cannot express C = D - 1 directly.

Functions§

arc_span
The middle control point of an arc through step degrees, at most a half turn either way: (weight, outwards). It lies where the tangents at the arc’s ends meet, outwards = 1 / (1 + cos step) along the sum of the unit directions to the ends, weighted cos(step / 2) — sqrt2_over_2 for a quarter turn. Revolves and helices both build their spans with it, so a helix’s quarter lies on the very circle a revolved quarter does.
bezier_knots
The knots of a single Bézier span of degree on [0, 1]: degree + 1 zeros, then as many ones.
cos_sin
(cos, sin) of degrees — exact at every quarter turn, so that a revolve through a right angle lands exactly on the plane it should, and a helix’s spans of a quarter turn sit on exactly the circle a revolve’s do.
embed_point
Homogeneous (w (origin + x e1 + y e2), w) for the homogeneous 2-D point cp = (w x, w y, w): linear in cp, so no division — the control point NurbCurve::embed makes of cp.
flatten_point
The homogeneous 3-D point cp = (w p, w) in the plane through origin along the orthonormal e1 and e2, homogeneous: (w x, w y, w) for x = (p - origin) . e1, y = (p - origin) . e2 — the inverse of embed_point for a point of the plane, and like it without division.
helix_rows
The control rows of a helix around frame.w(), from frame.u(), moving as helix says along w: 2 n + 1 rows for n equal spans of at most a quarter turn — a span’s ends at even indices, its middle in between.
loop_signed_area
The signed area the closed loop pcurves encloses, in order: positive counter-clockwise, negative clockwise (see the module docs).
sqrt2_over_2
sqrt(2) / 2, the weight of the middle control point that makes a rational quadratic a quarter of a circle exactly.
true_point_fractions
Where, within interval i of intervals between consecutive samples, a caller of interpolate_enclosing should locate its true points: these fractions of the way from one sample to the next.

Type Aliases§

NurbCurve2D
2-D parameter-space NURBS curve / pcurve (homogeneous control points in ℝ³).
NurbCurve3D
3-D NURBS curve (homogeneous control points in ℝ⁴).
WidestBetween
Where a fit’s widest point between stations was, of its last attempt: leg, fraction, point, width.