Data Structures | |
| struct | ExtremumResult |
| Result of a single extremum computation. More... | |
| struct | Result |
| Result of extrema computation containing all found extrema. Non-copyable to enforce use of const reference from Perform(). More... | |
| struct | Config |
| Configuration for extrema computation. More... | |
Precision Constants | |
Centralized tolerance and precision values used throughout the ExtremaPC package. These replace magic numbers to improve code clarity and maintainability. | |
| enum class | Status { OK , NotDone , InfiniteSolutions , NoSolution , NumericalError } |
| Status of extrema computation. More... | |
| enum class | SearchMode { MinMax , Min , Max } |
| Search mode for extrema computation. Controls which extrema to find, enabling performance optimizations. More... | |
| using | Domain1D = MathUtils::Domain1D |
| 1D parameter domain for curves (alias for MathUtils::Domain1D). | |
| constexpr double | THE_DEFAULT_TOLERANCE = Precision::Confusion() |
| Default tolerance for root finding and distance comparison. Used when no explicit tolerance is provided. | |
| constexpr double | THE_PARAM_TOLERANCE = Precision::PConfusion() |
| Tolerance for parameter domain comparison (cache validation). Uses PConfusion which is appropriate for parametric space. | |
| constexpr double | THE_NEIGHBOR_STEP_RATIO = 0.01 |
| Ratio of parameter range for neighbor point sampling. Used to evaluate if an endpoint is a local extremum. | |
| constexpr double | THE_INTERVAL_EXPAND_RATIO = 0.05 |
| Ratio of parameter range for search interval expansion. Used in grid-based methods to expand candidate intervals. | |
| constexpr double | THE_REFINEMENT_STEP_RATIO = 0.001 |
| Ratio of parameter range for refinement step. Used in iterative refinement algorithms. | |
| constexpr double | THE_NEWTON_XTOL_FACTOR = 0.01 |
| Multiplier for X (parameter) tolerance in Newton refinement. | |
| constexpr double | THE_NEWTON_FTOL_FACTOR = 0.001 |
| Multiplier for F (function) tolerance in Newton refinement. | |
| constexpr double | THE_HINT_SEARCH_RADIUS = 0.1 |
| Default search radius for hint-based search (fraction of parameter range). | |
| constexpr double | THE_RANGE_NARROWING_FACTOR = 0.25 |
| Factor for narrowing parameter range during refinement iterations. | |
| constexpr double | THE_MAX_SKIP_THRESHOLD = 0.9 |
| Threshold for skipping max candidates that are clearly worse. If estimated distance < best * threshold, skip candidate. | |
| constexpr double | THE_NEAR_ZERO_F_FACTOR = 10.0 |
| Multiplier for near-zero F detection during grid scan. F values smaller than tolerance * this factor are considered near-zero. | |
| constexpr double | THE_FALLBACK_F_FACTOR = 100.0 |
| Multiplier for fallback F tolerance when Newton fails. Used to accept grid points as approximate solutions. | |
| constexpr int | THE_MAX_NEWTON_ITERATIONS = 20 |
| Maximum number of Newton iterations for refinement. | |
| constexpr int | THE_REFINEMENT_NB_SAMPLES = 20 |
| Number of samples for iterative grid refinement fallback. | |
| constexpr int | THE_REFINEMENT_NB_PASSES = 3 |
| Number of refinement passes when Newton fails. | |
| constexpr int | THE_BEZIER_MIN_SAMPLES = 24 |
| Minimum number of samples for Bezier curves. | |
| constexpr int | THE_BEZIER_DEGREE_MULTIPLIER = 3 |
| Multiplier for degree to compute Bezier samples: samples = max(min, multiplier * (degree + 1)). | |
| constexpr int | THE_OTHER_CURVE_NB_SAMPLES = 64 |
| Default number of samples for general (other) curves. | |
| constexpr int | THE_BSPLINE_FALLBACK_SAMPLES = 32 |
| Fallback number of samples for BSpline curves when curve is null. | |
| constexpr int | THE_BSPLINE_SPAN_MULTIPLIER = 2 |
| Multiplier for BSpline curve samples per knot span: samples = multiplier * (degree + 1). For a degree 3 curve: 2*4 = 8 samples per span. This is higher than the surface counterpart because curves are 1D and require finer sampling to detect extrema reliably. Surfaces use degree+2 per direction, resulting in (degree+2)^2 samples per cell, which provides adequate coverage. | |
| template<typename CurveEvaluator> | |
| void | AddEndpointExtrema (Result &theResult, const gp_Pnt &theP, const Domain1D &theDomain, const CurveEvaluator &theEval, double theTol, SearchMode theMode) |
| Adds endpoint extrema to result for bounded curves. | |
1D parameter domain for curves (alias for MathUtils::Domain1D).
|
strong |
Search mode for extrema computation. Controls which extrema to find, enabling performance optimizations.
| Enumerator | |
|---|---|
| MinMax | Find all extrema (both minima and maxima) - default. |
| Min | Find only minimum distance (enables early termination in BVH). |
| Max | Find only maximum distance. |
|
strong |
Status of extrema computation.
|
inline |
Adds endpoint extrema to result for bounded curves.
This function adds the curve endpoints as extrema when:
An endpoint is considered a local minimum if the distance to a neighboring point on the curve is greater than the distance to the endpoint. An endpoint is considered a local maximum if the distance to a neighboring point is less than the distance to the endpoint.
| CurveEvaluator | Type with Value(double) method returning gp_Pnt |
| theResult | result to add endpoints to |
| theP | query point |
| theDomain | parameter domain |
| theEval | curve evaluator |
| theTol | tolerance for duplicate detection |
| theMode | search mode |
|
constexpr |
Multiplier for degree to compute Bezier samples: samples = max(min, multiplier * (degree + 1)).
|
constexpr |
Minimum number of samples for Bezier curves.
|
constexpr |
Fallback number of samples for BSpline curves when curve is null.
|
constexpr |
Multiplier for BSpline curve samples per knot span: samples = multiplier * (degree + 1). For a degree 3 curve: 2*4 = 8 samples per span. This is higher than the surface counterpart because curves are 1D and require finer sampling to detect extrema reliably. Surfaces use degree+2 per direction, resulting in (degree+2)^2 samples per cell, which provides adequate coverage.
|
constexpr |
Default tolerance for root finding and distance comparison. Used when no explicit tolerance is provided.
|
constexpr |
Multiplier for fallback F tolerance when Newton fails. Used to accept grid points as approximate solutions.
|
constexpr |
Default search radius for hint-based search (fraction of parameter range).
|
constexpr |
Ratio of parameter range for search interval expansion. Used in grid-based methods to expand candidate intervals.
|
constexpr |
Maximum number of Newton iterations for refinement.
|
constexpr |
Threshold for skipping max candidates that are clearly worse. If estimated distance < best * threshold, skip candidate.
|
constexpr |
Multiplier for near-zero F detection during grid scan. F values smaller than tolerance * this factor are considered near-zero.
|
constexpr |
Ratio of parameter range for neighbor point sampling. Used to evaluate if an endpoint is a local extremum.
|
constexpr |
Multiplier for F (function) tolerance in Newton refinement.
|
constexpr |
Multiplier for X (parameter) tolerance in Newton refinement.
|
constexpr |
Default number of samples for general (other) curves.
|
constexpr |
Tolerance for parameter domain comparison (cache validation). Uses PConfusion which is appropriate for parametric space.
|
constexpr |
Factor for narrowing parameter range during refinement iterations.
|
constexpr |
Number of refinement passes when Newton fails.
|
constexpr |
Number of samples for iterative grid refinement fallback.
|
constexpr |
Ratio of parameter range for refinement step. Used in iterative refinement algorithms.