![]() |
Project
|
One trimmed boundary curve in a surface's (u, v) domain: a line segment, a circular arc or a clamped (rational) B-spline. More...
#include <BoundedSurface.h>
Public Member Functions | |
| bool | isArc () const |
| bool | isBSpline () const |
| double | sweep () const |
| bool | valid () const |
| Vec2 | pointAtAngle (double angle) const |
| Vec2 | pointAt (double parameter) const |
| Point at curve parameter parameter in [0, 1] (0 at the start, 1 at the end). | |
| Vec2 | startPoint () const |
| Vec2 | endPoint () const |
| Vec2 | derivativeAt (double parameter) const |
| dC/dt at parameter in [0, 1], unnormalised; tangentAt() is it normalised. | |
| Vec2 | tangentAt (double parameter) const |
| Unit tangent at parameter parameter, pointing in the direction of increasing parameter. | |
| bool | angleInSweep (double angle) const |
| True if angle lies within the arc's angular sweep (accounting for direction and wrap). | |
| double | angleParameter (double angle) const |
| Map an angle known to lie within the sweep to a clamped parameter in [0, 1]. | |
| void | extendBounds (Vec2 &lower, Vec2 &upper) const |
| Accumulate this curve's exact extent into a parametric axis-aligned bounding box. | |
| void | extendTightBounds (Vec2 &lower, Vec2 &upper) const |
| As extendBounds, measured on the curve: a B-spline contributes its sampled polyline, not its pole hull. | |
| template<typename Include > | |
| void | includeAnalyticExtremes (const Include &include) const |
| Endpoints plus an arc's axis-extreme points inside the sweep: the exact extent of a line or an arc. | |
| Vec2 | closestPoint (const Vec2 &point, double ¶meter) const |
| Closest point on the curve to point, returning the clamped parameter in parameter. | |
| double | distanceSq (const Vec2 &point) const |
| Squared distance from point to the curve. | |
| double | signedAreaContribution () const |
| double | representationTolerance () const |
| How far this curve's representation can sit from the curve, in parametric units: kBSplineFlatness for a B-spline, else 0. | |
| bool | bsplineBandOrCrossings (const Vec2 &point, double bandSq, int &crossings) const |
| int | rightwardCrossings (const Vec2 &point, const Vec2 &canonicalStart, const Vec2 &canonicalEnd) const |
| Rightward crossings of a horizontal ray from point, with the caller's canonical endpoints so that seams stay consistent. | |
| void | reverseInPlace () |
| Reverse the curve's direction in place (start <-> end), keeping the same geometric image. | |
B-spline evaluation helpers (kind == BSpline) | |
| double | bsplineT0 () const |
| double | bsplineT1 () const |
| bool | bsplineIsClamped () const |
| True when the knot vector is clamped, so the curve interpolates its first and last pole. | |
| bool | bsplineRational () const |
| True if the curve carries non-unit weights (a rational B-spline). | |
| int | bsplineSpan (double knotValue) const |
| Knot span index of parameter knotValue for the clamped knot vector. | |
| void | bsplineBasis (int span, double knotValue, std::vector< double > &basis, std::vector< double > &basisDeriv) const |
| Non-zero degree-p basis functions and first derivatives at knotValue in span (The NURBS Book, DersBasisFuns). | |
| void | bsplineEval (double knotValue, Vec2 &pointOut, Vec2 &derivativeOut) const |
| Vec2 | bsplinePointAt (double parameter) const |
| B-spline point at curve parameter parameter in [0, 1]. | |
| void | bsplineSampleInto (std::vector< Vec2 > &samples, double flatnessSq=kBSplineFlatnessSq, int maxDepth=16) const |
| Adaptively sample the B-spline into an on-curve polyline, subdividing until each chord is flat to sqrt(flatnessSq). | |
| bool | spansInteriorKnot (double lowT, double highT) const |
| Whether a knot lies strictly inside (lowT, highT); such an interval is never called flat. | |
| void | appendInteriorKnots (double from, double to, std::vector< double > &breakpoints) const |
| Append the interior knots in (from, to), in the curve's [0, 1] parameter; none for a line or an arc. | |
| double | uVariation (double from, double to) const |
| An upper bound on how far u travels along the curve between from and to. | |
| void | bsplineSampleRecursive (double t0, double t1, const Vec2 &p0, const Vec2 &p1, double flatnessSq, int depth, std::vector< Vec2 > &samples) const |
| const std::vector< Vec2 > & | bsplineSamples () const |
| The flattened polyline in bsplineCache, computed here if the wire has not filled it. | |
Static Public Member Functions | |
| static Curve2D | makeLine (const Vec2 &start, const Vec2 &end) |
| static Curve2D | makeArc (const Vec2 &arcCenter, double arcRadius, double arcStartAngle, double arcEndAngle) |
| static Curve2D | makeCircle (const Vec2 &arcCenter, double arcRadius, bool clockwise=false) |
| Full circle as one arc curve (counter-clockwise unless clockwise is set). | |
| static Curve2D | makeBSpline (int splineDegree, std::vector< Vec2 > splinePoles, std::vector< double > splineWeights, std::vector< double > splineKnots) |
Public Attributes | |
| CurveKind | kind = CurveKind::Line |
| Vec2 | lineStart |
| line: start point (unused for arcs) | |
| Vec2 | lineEnd |
| line: end point (unused for arcs) | |
| Vec2 | center |
| arc: circle centre (unused for lines) | |
| double | radius = 0. |
| arc: circle radius | |
| double | startAngle = 0. |
| arc: start angle [rad] | |
| double | endAngle = 0. |
| arc: end angle [rad] (sweep = endAngle - startAngle) | |
B-spline data (kind == BSpline): poles, optional weights and a clamped knot vector; the curve parameter runs on [0, 1]. @{ | |
| int | degree = 0 |
| std::vector< Vec2 > | poles |
| std::vector< double > | weights |
| std::vector< double > | knots |
| std::vector< Vec2 > | bsplineCache |
| The flattened on-curve polyline, both ends included; CurveWire::initialize fills it and reversing clears it. | |
Loop-canonical endpoints: the seam vertices the curve's neighbours agree on, substituted at the polyline's ends | |
| Vec2 | canonicalStart |
| Vec2 | canonicalEnd |
| bool | hasCanonicalEndpoints = false |
| void | setCanonicalEndpoints (const Vec2 &start, const Vec2 &end) |
| Vec2 | loopStart () const |
| Vec2 | loopEnd () const |
One trimmed boundary curve in a surface's (u, v) domain: a line segment, a circular arc or a clamped (rational) B-spline.
Definition at line 981 of file BoundedSurface.h.
|
inline |
True if angle lies within the arc's angular sweep (accounting for direction and wrap).
Definition at line 1456 of file BoundedSurface.h.
|
inline |
Map an angle known to lie within the sweep to a clamped parameter in [0, 1].
Definition at line 1469 of file BoundedSurface.h.
|
inline |
Append the interior knots in (from, to), in the curve's [0, 1] parameter; none for a line or an arc.
Definition at line 1228 of file BoundedSurface.h.
|
inline |
B-spline only: true if point is within sqrt(bandSq) of the polyline, else adds its rightward crossings. One walk of the polyline with the arithmetic of closestPoint and rightwardCrossings.
Definition at line 1660 of file BoundedSurface.h.
|
inline |
Non-zero degree-p basis functions and first derivatives at knotValue in span (The NURBS Book, DersBasisFuns).
Definition at line 1118 of file BoundedSurface.h.
|
inline |
Evaluate the (rational) B-spline point pointOut and its knot-parameter derivative derivativeOut at knot parameter knotValue.
Definition at line 1159 of file BoundedSurface.h.
|
inline |
True when the knot vector is clamped, so the curve interpolates its first and last pole.
Definition at line 1070 of file BoundedSurface.h.
|
inline |
B-spline point at curve parameter parameter in [0, 1].
Definition at line 1187 of file BoundedSurface.h.
|
inline |
True if the curve carries non-unit weights (a rational B-spline).
Definition at line 1083 of file BoundedSurface.h.
|
inline |
Adaptively sample the B-spline into an on-curve polyline, subdividing until each chord is flat to sqrt(flatnessSq).
Definition at line 1197 of file BoundedSurface.h.
|
inline |
Definition at line 1288 of file BoundedSurface.h.
|
inline |
The flattened polyline in bsplineCache, computed here if the wire has not filled it.
Definition at line 1316 of file BoundedSurface.h.
|
inline |
Knot span index of parameter knotValue for the clamped knot vector.
Definition at line 1094 of file BoundedSurface.h.
|
inline |
Definition at line 1066 of file BoundedSurface.h.
|
inline |
Definition at line 1067 of file BoundedSurface.h.
|
inline |
Closest point on the curve to point, returning the clamped parameter in parameter.
Definition at line 1536 of file BoundedSurface.h.
|
inline |
dC/dt at parameter in [0, 1], unnormalised; tangentAt() is it normalised.
Definition at line 1411 of file BoundedSurface.h.
|
inline |
Squared distance from point to the curve.
Definition at line 1609 of file BoundedSurface.h.
|
inline |
Definition at line 1399 of file BoundedSurface.h.
Accumulate this curve's exact extent into a parametric axis-aligned bounding box.
Definition at line 1481 of file BoundedSurface.h.
As extendBounds, measured on the curve: a B-spline contributes its sampled polyline, not its pole hull.
Definition at line 1501 of file BoundedSurface.h.
|
inline |
Endpoints plus an arc's axis-extreme points inside the sweep: the exact extent of a line or an arc.
Definition at line 1520 of file BoundedSurface.h.
|
inline |
Definition at line 1059 of file BoundedSurface.h.
|
inline |
Definition at line 1060 of file BoundedSurface.h.
|
inline |
Definition at line 1016 of file BoundedSurface.h.
|
inline |
Where this curve begins and ends as far as the loop is concerned: the canonical seam vertex when a wire has fixed one, and the curve's own endpoint when it stands alone.
Definition at line 1015 of file BoundedSurface.h.
|
inlinestatic |
Definition at line 1028 of file BoundedSurface.h.
|
inlinestatic |
Clamped (rational) B-spline curve of degree splineDegree. splineWeights may be empty for a non-rational curve; splineKnots must be the clamped flat knot vector.
Definition at line 1047 of file BoundedSurface.h.
|
inlinestatic |
Full circle as one arc curve (counter-clockwise unless clockwise is set).
Definition at line 1040 of file BoundedSurface.h.
|
inlinestatic |
Definition at line 1019 of file BoundedSurface.h.
|
inline |
Point at curve parameter parameter in [0, 1] (0 at the start, 1 at the end).
Definition at line 1376 of file BoundedSurface.h.
|
inline |
Definition at line 1370 of file BoundedSurface.h.
|
inline |
How far this curve's representation can sit from the curve, in parametric units: kBSplineFlatness for a B-spline, else 0.
Definition at line 1656 of file BoundedSurface.h.
|
inline |
Reverse the curve's direction in place (start <-> end), keeping the same geometric image.
Definition at line 1795 of file BoundedSurface.h.
|
inline |
Rightward crossings of a horizontal ray from point, with the caller's canonical endpoints so that seams stay consistent.
Definition at line 1701 of file BoundedSurface.h.
|
inline |
Definition at line 1005 of file BoundedSurface.h.
|
inline |
Exact contribution of this directed curve to the enclosed signed area, i.e. (1/2) * integral of (u dv - v du) along the curve (Green's theorem).
Definition at line 1617 of file BoundedSurface.h.
|
inline |
Whether a knot lies strictly inside (lowT, highT); such an interval is never called flat.
Definition at line 1212 of file BoundedSurface.h.
|
inline |
Definition at line 1388 of file BoundedSurface.h.
|
inline |
Definition at line 1062 of file BoundedSurface.h.
|
inline |
Unit tangent at parameter parameter, pointing in the direction of increasing parameter.
Definition at line 1428 of file BoundedSurface.h.
|
inline |
An upper bound on how far u travels along the curve between from and to.
Definition at line 1249 of file BoundedSurface.h.
|
inline |
Basic structural validity (finite data, positive radius for arcs, well-formed clamped knot vector for B-splines).
Definition at line 1332 of file BoundedSurface.h.
|
mutable |
The flattened on-curve polyline, both ends included; CurveWire::initialize fills it and reversing clears it.
Definition at line 996 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::canonicalEnd |
Definition at line 1002 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::canonicalStart |
Definition at line 1001 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::center |
arc: circle centre (unused for lines)
Definition at line 985 of file BoundedSurface.h.
| int o2::cad::surface::Curve2D::degree = 0 |
Definition at line 991 of file BoundedSurface.h.
| double o2::cad::surface::Curve2D::endAngle = 0. |
arc: end angle [rad] (sweep = endAngle - startAngle)
Definition at line 988 of file BoundedSurface.h.
| bool o2::cad::surface::Curve2D::hasCanonicalEndpoints = false |
Definition at line 1003 of file BoundedSurface.h.
| CurveKind o2::cad::surface::Curve2D::kind = CurveKind::Line |
Definition at line 982 of file BoundedSurface.h.
| std::vector<double> o2::cad::surface::Curve2D::knots |
Definition at line 994 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::lineEnd |
line: end point (unused for arcs)
Definition at line 984 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::lineStart |
line: start point (unused for arcs)
Definition at line 983 of file BoundedSurface.h.
| std::vector<Vec2> o2::cad::surface::Curve2D::poles |
Definition at line 992 of file BoundedSurface.h.
| double o2::cad::surface::Curve2D::radius = 0. |
arc: circle radius
Definition at line 986 of file BoundedSurface.h.
| double o2::cad::surface::Curve2D::startAngle = 0. |
arc: start angle [rad]
Definition at line 987 of file BoundedSurface.h.
| std::vector<double> o2::cad::surface::Curve2D::weights |
Definition at line 993 of file BoundedSurface.h.