pub struct FlatPatch { /* private fields */ }Expand description
The box around curves drawn in a plane, as a bilinear patch of it: a
plane point (x, y) lies at origin + x e1 + y e2, and the patch is
parametrized over [0, 1]² along (x, y) — or along (y, x) if
swapped, whichever makes its loops wind the way a face’s must.
The box encloses every curve: a NURBS curve stays within the convex hull
of its control points, and the box is the outer bounds of their
enclosures. A curve drawn in the plane is mapped into the patch’s
parameters by an affine map of its control points (FlatPatch::pcurve),
exact for any NURBS.
Implementations§
Source§impl FlatPatch
impl FlatPatch
Sourcepub fn around<'a>(
origin: Vector3,
e1: Vector3,
e2: Vector3,
curves: impl IntoIterator<Item = &'a NurbCurve2D>,
swapped: bool,
) -> GeopResult<Self>
pub fn around<'a>( origin: Vector3, e1: Vector3, e2: Vector3, curves: impl IntoIterator<Item = &'a NurbCurve2D>, swapped: bool, ) -> GeopResult<Self>
The patch of the plane (origin, e1, e2) around curves, given in
its coordinates.
Sourcepub fn past(&self, [low, high]: [Vector2; 2]) -> Self
pub fn past(&self, [low, high]: [Vector2; 2]) -> Self
The patch grown to reach past [low, high], a box in the plane’s
coordinates, on every side by its own larger size.
The box’s sides pass through the curves’ extreme points, and a line of another body lying in the plane through such a point, along the box’s side, runs along the patch’s boundary to within rounding: where the two enclosures miss each other by less than their widths, no search can tell that apart from an overlap. Where the patch ends is a free choice. Past the extent of everything that could lie in the plane, nothing lies along its sides, whatever the dimensions.
Sourcepub fn reach(&self) -> [Vector2; 2]
pub fn reach(&self) -> [Vector2; 2]
How far the patch reaches along the plane’s two axes: its lowest corner and its highest, in the plane’s coordinates.
Sourcepub fn pcurve(&self, curve: &NurbCurve2D) -> GeopResult<NurbCurve2D>
pub fn pcurve(&self, curve: &NurbCurve2D) -> GeopResult<NurbCurve2D>
curve, drawn in the plane, in the patch’s parameters.
Sourcepub fn surface(&self) -> GeopResult<NurbSurface3D>
pub fn surface(&self) -> GeopResult<NurbSurface3D>
The patch itself.