![]() |
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 1129 of file BoundedSurface.h.
|
inline |
True if angle lies within the arc's angular sweep (accounting for direction and wrap).
Definition at line 1604 of file BoundedSurface.h.
|
inline |
Map an angle known to lie within the sweep to a clamped parameter in [0, 1].
Definition at line 1617 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 1376 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 1808 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 1266 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 1307 of file BoundedSurface.h.
|
inline |
True when the knot vector is clamped, so the curve interpolates its first and last pole.
Definition at line 1218 of file BoundedSurface.h.
|
inline |
B-spline point at curve parameter parameter in [0, 1].
Definition at line 1335 of file BoundedSurface.h.
|
inline |
True if the curve carries non-unit weights (a rational B-spline).
Definition at line 1231 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 1345 of file BoundedSurface.h.
|
inline |
Definition at line 1436 of file BoundedSurface.h.
|
inline |
The flattened polyline in bsplineCache, computed here if the wire has not filled it.
Definition at line 1464 of file BoundedSurface.h.
|
inline |
Knot span index of parameter knotValue for the clamped knot vector.
Definition at line 1242 of file BoundedSurface.h.
|
inline |
Definition at line 1214 of file BoundedSurface.h.
|
inline |
Definition at line 1215 of file BoundedSurface.h.
|
inline |
Closest point on the curve to point, returning the clamped parameter in parameter.
Definition at line 1684 of file BoundedSurface.h.
|
inline |
dC/dt at parameter in [0, 1], unnormalised; tangentAt() is it normalised.
Definition at line 1559 of file BoundedSurface.h.
|
inline |
Squared distance from point to the curve.
Definition at line 1757 of file BoundedSurface.h.
|
inline |
Definition at line 1547 of file BoundedSurface.h.
Accumulate this curve's exact extent into a parametric axis-aligned bounding box.
Definition at line 1629 of file BoundedSurface.h.
As extendBounds, measured on the curve: a B-spline contributes its sampled polyline, not its pole hull.
Definition at line 1649 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 1668 of file BoundedSurface.h.
|
inline |
Definition at line 1207 of file BoundedSurface.h.
|
inline |
Definition at line 1208 of file BoundedSurface.h.
|
inline |
Definition at line 1164 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 1163 of file BoundedSurface.h.
|
inlinestatic |
Definition at line 1176 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 1195 of file BoundedSurface.h.
|
inlinestatic |
Full circle as one arc curve (counter-clockwise unless clockwise is set).
Definition at line 1188 of file BoundedSurface.h.
|
inlinestatic |
Definition at line 1167 of file BoundedSurface.h.
|
inline |
Point at curve parameter parameter in [0, 1] (0 at the start, 1 at the end).
Definition at line 1524 of file BoundedSurface.h.
|
inline |
Definition at line 1518 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 1804 of file BoundedSurface.h.
|
inline |
Reverse the curve's direction in place (start <-> end), keeping the same geometric image.
Definition at line 1943 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 1849 of file BoundedSurface.h.
|
inline |
Definition at line 1153 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 1765 of file BoundedSurface.h.
|
inline |
Whether a knot lies strictly inside (lowT, highT); such an interval is never called flat.
Definition at line 1360 of file BoundedSurface.h.
|
inline |
Definition at line 1536 of file BoundedSurface.h.
|
inline |
Definition at line 1210 of file BoundedSurface.h.
|
inline |
Unit tangent at parameter parameter, pointing in the direction of increasing parameter.
Definition at line 1576 of file BoundedSurface.h.
|
inline |
An upper bound on how far u travels along the curve between from and to.
Definition at line 1397 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 1480 of file BoundedSurface.h.
|
mutable |
The flattened on-curve polyline, both ends included; CurveWire::initialize fills it and reversing clears it.
Definition at line 1144 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::canonicalEnd |
Definition at line 1150 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::canonicalStart |
Definition at line 1149 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::center |
arc: circle centre (unused for lines)
Definition at line 1133 of file BoundedSurface.h.
| int o2::cad::surface::Curve2D::degree = 0 |
Definition at line 1139 of file BoundedSurface.h.
| double o2::cad::surface::Curve2D::endAngle = 0. |
arc: end angle [rad] (sweep = endAngle - startAngle)
Definition at line 1136 of file BoundedSurface.h.
Definition at line 1151 of file BoundedSurface.h.
| CurveKind o2::cad::surface::Curve2D::kind = CurveKind::Line |
Definition at line 1130 of file BoundedSurface.h.
| std::vector<double> o2::cad::surface::Curve2D::knots |
Definition at line 1142 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::lineEnd |
line: end point (unused for arcs)
Definition at line 1132 of file BoundedSurface.h.
| Vec2 o2::cad::surface::Curve2D::lineStart |
line: start point (unused for arcs)
Definition at line 1131 of file BoundedSurface.h.
| std::vector<Vec2> o2::cad::surface::Curve2D::poles |
Definition at line 1140 of file BoundedSurface.h.
| double o2::cad::surface::Curve2D::radius = 0. |
arc: circle radius
Definition at line 1134 of file BoundedSurface.h.
| double o2::cad::surface::Curve2D::startAngle = 0. |
arc: start angle [rad]
Definition at line 1135 of file BoundedSurface.h.
| std::vector<double> o2::cad::surface::Curve2D::weights |
Definition at line 1141 of file BoundedSurface.h.