#[non_exhaustive]pub enum ProfileSegment {
Line {
start: [f64; 2],
end: [f64; 2],
},
Arc {
start: [f64; 2],
mid: [f64; 2],
end: [f64; 2],
},
Circle {
center: [f64; 2],
radius: f64,
},
Ellipse {
center: [f64; 2],
major: [f64; 2],
ratio: f64,
},
EllipseArc {
center: [f64; 2],
major: [f64; 2],
ratio: f64,
start_param: f64,
end_param: f64,
},
BSpline {
control_points: Vec<[f64; 2]>,
periodic: bool,
},
Nurbs {
degree: u32,
knots: Vec<f64>,
control_points: Vec<[f64; 2]>,
weights: Vec<f64>,
periodic: bool,
},
}Expand description
One segment of a closed 2D profile wire, in sketch-plane coordinates (millimetres). Arcs are encoded as three on-curve points so consumers never have to agree on a winding convention.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Line
Arc
Circular arc through three points (start → mid → end).
Circle
Ellipse
Full ellipse. major is the vector from the center to a major-axis
vertex; the minor radius is |major| * ratio with ratio in (0, 1].
EllipseArc
Elliptical arc between two parameter angles (radians, counter-clockwise in the ellipse frame where the major axis is at parameter 0).
BSpline
Cubic B-spline through the given control points. A periodic spline closes smoothly on itself; an open one runs first → last control point.
Nurbs
A B-spline of any degree over its own knots, rational when it has
weights: an exact conic arc, a spline drawn through points. An open
one’s knots are clamped (control points + degree + 1 of them), so
it runs first → last control point; a periodic one is a uniform ring
over its control points closing smoothly on itself, and its knots
are not used.