Rhino C++ API  9.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ON_NurbsCurveFitParameters Class Reference

The NURBS curve fit tool creates a NURBS curve that approximates an existing curve. The ON_NurbsCurveFitParameters class contains the paramters that determine NURBS curve properties (degree, point count, ...) and other fitting contstraints. More...

#include <opennurbs_plus_rebuild.h>

Public Types

enum  : int {
  MinimumDegree = 1, MaximumDegree = 11, DefaultDegree = 3, MinimumClampedPointCount = 2,
  MinimumClosedPointCount = 3, MaximumPointCount = 3000, DefaultSampleCount = ON_PointPairing::DefaultPointCount, MinimumSampleCount = (ON_NurbsCurveFitParameters::DefaultSampleCount / 10),
  MaximumSampleCount = (10 * ON_NurbsCurveFitParameters::DefaultSampleCount)
}
 
enum  Intensity : unsigned char {
  Intensity::None = 0, Intensity::Low = 1, Intensity::Moderate = 2, Intensity::Medium = 3,
  Intensity::High = 4, Intensity::Extreme = 5, Intensity::Custom = 6
}
 The Intensity enum is used to select a predefined or a custom value for the smoothing, uniformity, and curvature bias coefficients. More...
 
enum  KinkSplit : unsigned char {
  KinkSplit::None = 0, KinkSplit::AtG1Changes = 1, KinkSplit::AtLargeG2Changes = 2, KinkSplit::AtMediumG2Changes = 3,
  KinkSplit::AtSmallG2Changes = 4
}
 The KinkSplit enum is used to determine how target curve kinks (abrupt changes in target or curvature) are handled during rebuilding. More...
 
enum  TangentMatch : unsigned char { TangentMatch::None = 0, TangentMatch::AtStart = 1, TangentMatch::AtEnd = 2, TangentMatch::AtStartAndEnd = 3 }
 The TangentMatch enum is used to constrain the tangents of the rebuilt curve to match those of the target curve. More...
 

Public Member Functions

 ON_NurbsCurveFitParameters ()=default
 
 ON_NurbsCurveFitParameters (const ON_NurbsCurveFitParameters &)=default
 
 ~ON_NurbsCurveFitParameters ()=default
 
bool ApplyTangentMatchingAtKinks () const
 Control when tangent matching is applied at kinks. Note that this setting does somthing only when some tangent matching option is true and the input curve has kinks. More...
 
int ClampedControlPointCount () const
 
bool Closed () const
 
int ConstrainedPointCount () const
 If Closed() is true, the number of constrained points is (TangentMatchStart() || TangentMatchEnd() ? 1 : 0) More...
 
double CurvatureBiasCoefficient () const
 
ON_NurbsCurveFitParameters::Intensity CurvatureBiasIntensity () const
 Curvature bias adds a bias to fit target points with relatively higher curvatures more closely. Use CurvatureBiasCoefficient() to get the numerical coefficient used in the objective function. Use SetCurvatureBiasCoefficient() to set a custom curvature bias coefficient. More...
 
int Degree () const
 
void GetPointCountRange (int &minimum_point_count, int &maximum_point_count, double &tolerance) const
 
const ON_SHA1_Hash Hash (bool bHashTangentMatching, bool bHashKinkSplitting) const
 Returns a hash of the options that control the output curve geometry. These options are: degree (degree of the output curves), point_count (number of user control points in the output curves), sample_point_count (number of points sampled from the input curves). smoothing When bShowTangentOptions is true, end tangent matching settings are hashed. When bShowSplitAtKinksOption is true, kink parameters are hashed. This hash is useful for determing when previously calculated output curves need to be updated by comparing the hash current options and the hash of options used to calculate the output curves. More...
 
double KinkAngleDegrees () const
 
double KinkAngleRadians () const
 
const ON_CurveKinkDefinition KinkDefinition () const
 When kink splitting is enabled, the kink definition determines what type of target curve tangent of curvature change is considered to be a kink. More...
 
ON_NurbsCurveFitParameters::KinkSplit KinkSplitting () const
 
ON_NurbsCurveFitParametersoperator= (const ON_NurbsCurveFitParameters &)=default
 
bool OptimizeCurve () const
 
int PeriodicControlPointCount () const
 
int PointCount () const
 Number of distinct control points in the NURBS curve fit. If a range of point counts is possible, this is the minimum number. More...
 
const ON_2dex PointCountRange () const
 Get the point count range as an ON_2dex. More...
 
int PointCountRangeMaximum () const
 
int PointCountRangeMinimum () const
 
double PointCountRangeTolerance () const
 When a range of point counts is permitted and PointCountRangeTolerance() > 0, then searching for the NURBS curve fit terminates if the separation is &lt= PointCountRangeTolerance(). More...
 
class ON_ProgressReporterProgressReporter () const
 
int SampleCount () const
 
void SetApplyTangentMatchingAtKinks (bool bApplyTangentMatchingAtKinks)
 Control when tangent matching is applied at kinks. Note that this setting does somthing only when some tangent matching option is true and the input curve has kinks. More...
 
void SetClosed (bool bClosed)
 Generally, it is best to call SetClosed() once before setting any other options and to leave it unchanged while the other options are adjusted. This is because the relationship betweem the point count and degree options are different for periodic and non-periodic NURBS curves. If every curve created with these options will be closed, then call SetClosed(true). Otherwise call SetClosed(false). More...
 
void SetCurvatureBiasCoefficient (double curvature_bias_coefficient)
 Specify a curvature bias coefficient. Positive curvature bias coefficients make the fit curve relatively closer to the target curve in regions where the target curve has relatively higher curvature. In general, use the smallest value that gives the desired result. More...
 
void SetCurvatureBiasIntensity (ON_NurbsCurveFitParameters::Intensity curvature_bias_intensity)
 Use one of ON_NurbsCurveFitParameters::Intensity enum values to specify a curvature bias. This method is provided to make it easier to provide an interface that lets a user select reasonable values for the curvature bias coefficient without having to understand the objective function. Positive curvature bias coefficients make the fit curve closer to regions in the target curve with relatively higher curvature. In general, use the smallest value that gives the desired result. More...
 
void SetDegree (int degree)
 
void SetKinkAngleDegrees (double kink_angle_degrees)
 
void SetKinkAngleRadians (double kink_angle_radians)
 
void SetKinkSplitting (ON_NurbsCurveFitParameters::KinkSplit kink_splitting)
 
void SetOptimizeCurve (bool bOptimizeCurve)
 
void SetPointCount (int point_count)
 Sets the point count and, if necessary, reduces the degree so that degree that degree <= ON_NurbsCurveFitParameters::MaximumDegree(point_count, Closed()). More...
 
void SetPointCountRange (int minimum_point_count, int maximum_point_count)
 Use SetPointCountRange() if you want the NURBS curve fit with the smallest separation having the point count in the specified range. More...
 
void SetPointCountRange (int minimum_point_count, int maximum_point_count, double tolerance)
 Use SetPointCountRange() if you want the NURBS curve fit with the smallest separation having the point count in the specified range. This version of SetPointCountRange() lets you also specify a tolerance. More...
 
void SetProgressReporter (class ON_ProgressReporter *progress_reporter)
 
void SetSampleCount (int sample_count)
 
void SetSmoothingCoefficient (double smoothing_coefficient)
 Specify a smoothing coefficient. More...
 
void SetSmoothingIntensity (ON_NurbsCurveFitParameters::Intensity smoothing_intensity)
 Use one of the one of ON_NurbsCurveFitParameters::Intensity enum values to specify a smoothing coefficient. This method is provided to make it easier to provide an interface that lets a user select reasonable values for the smoothing penalty without having to understand the objective fuction calculation. More...
 
void SetSubDFriendly (bool bSubDFriendly)
 
void SetTangentMatching (ON_NurbsCurveFitParameters::TangentMatch tangent_matching)
 
void SetTerminator (class ON_Terminator *terminator)
 
void SetUniformityCoefficient (double uniformity_coefficient)
 Specify a uniformity coefficient. Positive uniformity coefficients make the distances between control points more uniform. In general, use the smallest value that gives the desired result. More...
 
void SetUniformityIntensity (ON_NurbsCurveFitParameters::Intensity uniformity_intensity)
 Use one of ON_NurbsCurveFitParameters::Intensity enum values to specify a uniformity coefficient. This method is provided to make it easier to provide an interface that lets a user select reasonable values for the uniformity coefficient without having to understand the optimization calculation. Positive uniformity coefficients make the distances between control points more uniform. In general, use the smallest value that gives the desired result. More...
 
double SmoothingCoefficient () const
 
ON_NurbsCurveFitParameters::Intensity SmoothingIntensity () const
 The smoothing penalty in the objective function penalizes triplets of contiguous control points that are not colinear and equally spaced. Use SmoothingCoefficient() to get the numerical coefficient used in the objective function. Use SetSmoothingCoefficient() to set a custom smoothing coefficient. More...
 
bool SubDFriendly () const
 
ON_NurbsCurveFitParameters::TangentMatch TangentMatching () const
 
bool TerminationRequested () const
 
class ON_TerminatorTerminator () const
 
double UniformityCoefficient () const
 
ON_NurbsCurveFitParameters::Intensity UniformityIntensity () const
 The uniformity penalty in the objective function penalizes variation in the distances between control points. Use UniformityCoefficient() to get the numerical coefficient used in the objective function. Use SetUniformityCoefficient() to set a custom uniformity penalty coefficient. More...
 
bool VariablePointCount () const
 

Static Public Member Functions

static ON_NurbsCurveFitParameters::Intensity IntensityFromInt (int intensity_as_int, ON_NurbsCurveFitParameters::Intensity invalid_input_result)
 
static ON_NurbsCurveFitParameters::KinkSplit KinkSplitFromInt (int kink_split_as_int, ON_NurbsCurveFitParameters::KinkSplit invalid_input_result)
 Convert an integer value to the ON_NurbsCurveFitParameters::KinkSplit enum with the same value. More...
 
static int MaximumDegreeForPointCount (int point_count, bool bClosed, bool bSubDFreiendly)
 Given a point count and periodic setting, determine the maximum degree. More...
 
static int MinimumPointCountForDegree (int degree, bool bClosed, bool bSubDFreiendly)
 Give a degree and periodic setting, determine the minimum point count. More...
 
static ON_NurbsCurveFitParameters::TangentMatch TangentMatchFromInt (int tangent_match_as_int, ON_NurbsCurveFitParameters::TangentMatch invalid_input_result)
 Convert an integer value to the ON_NurbsCurveFitParameters::TangentMatch enum with the same value. More...
 
static bool ValidInput (size_t sample_point_count, unsigned degree, unsigned control_point_count, bool bClosed, ON_Interval curve_domain)
 

Static Public Attributes

static constexpr double ExtremeCurvatureBiasCoefficient = 10.0
 Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High. More...
 
static constexpr double ExtremeSmoothingCoefficient = 10.0
 Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Extreme. More...
 
static constexpr double ExtremeUniformityCoefficient = 10.0
 Uniformity coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High. More...
 
static constexpr double HighCurvatureBiasCoefficient = 1.0
 Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High. More...
 
static constexpr double HighSmoothingCoefficient = 1.0
 Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High. More...
 
static constexpr double HighUniformityCoefficient = 1.0
 Uniformity coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High. More...
 
static constexpr double LowCurvatureBiasCoefficient = 0.001
 Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Low. More...
 
static constexpr double LowSmoothingCoefficient = 0.001
 Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Low. More...
 
static constexpr double LowUniformityCoefficient = 0.001
 
static constexpr double MaximumCurvatureBiasCoefficient = 10.0
 Maximum permitted curvature bias coefficient. More...
 
static constexpr double MaximumSmoothingCoefficient = 10.0
 Maximum permitted smoothing coefficient. More...
 
static constexpr double MaximumUniformityCoefficient = 10.0
 Maximum permitted uniformity coefficient. More...
 
static constexpr double MediumCurvatureBiasCoefficient = 0.1
 Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Medium. More...
 
static constexpr double MediumSmoothingCoefficient = 0.1
 Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Medium. More...
 
static constexpr double MediumUniformityCoefficient = 0.1
 Uniformity coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Medium. More...
 
static constexpr double ModerateCurvatureBiasCoefficient = 0.01
 Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Moderate. More...
 
static constexpr double ModerateSmoothingCoefficient = 0.01
 Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Moderate. More...
 
static constexpr double ModerateUniformityCoefficient = 0.01
 

Detailed Description

The NURBS curve fit tool creates a NURBS curve that approximates an existing curve. The ON_NurbsCurveFitParameters class contains the paramters that determine NURBS curve properties (degree, point count, ...) and other fitting contstraints.

Copyright (c) 1993-2025 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : int
Enumerator
MinimumDegree 
MaximumDegree 
DefaultDegree 
MinimumClampedPointCount 
MinimumClosedPointCount 
MaximumPointCount 
DefaultSampleCount 
MinimumSampleCount 

Minimum number of points to sample from input curves and pass to the fitter that creates the output NURBS curve.

MaximumSampleCount 

Maximum number of points to sample from input curves and pass to the fitter that creates the output NURBS curve.

◆ Intensity

enum ON_NurbsCurveFitParameters::Intensity : unsigned char
strong

The Intensity enum is used to select a predefined or a custom value for the smoothing, uniformity, and curvature bias coefficients.

Enumerator
None 
Low 
Moderate 
Medium 
High 
Extreme 
Custom 

◆ KinkSplit

enum ON_NurbsCurveFitParameters::KinkSplit : unsigned char
strong

The KinkSplit enum is used to determine how target curve kinks (abrupt changes in target or curvature) are handled during rebuilding.

Enumerator
None 

All target curve kinks are ignored and rebuilt curves will be G2.

AtG1Changes 

The rebuilt curve is permitted have a tangent change at locations where the target curve has tangent changes. Curvature changes in the target curve are ignored.

AtLargeG2Changes 

The rebuilt curve is permitted have a tangent or curvature changes at locations where the target curve has a tangent or large curvature changes.

AtMediumG2Changes 

The rebuilt curve is permitted have a tangent or curvature changes at locations where the target curve has a tangent or medium curvature changes.

AtSmallG2Changes 

The rebuilt curve is permitted have a tangent or curvature changes at locations where the target curve has a tangent or small curvature changes. This option is the most sensitive to splitting at any tangent or curvature kink.

◆ TangentMatch

enum ON_NurbsCurveFitParameters::TangentMatch : unsigned char
strong

The TangentMatch enum is used to constrain the tangents of the rebuilt curve to match those of the target curve.

Enumerator
None 

Ignore target curve start and end tangent directions.

AtStart 

Match the target curve start tangent direction.

AtEnd 

Match the target curve end tangent direction.

AtStartAndEnd 

Match the target curve start and end tangent direction.

Constructor & Destructor Documentation

◆ ON_NurbsCurveFitParameters() [1/2]

ON_NurbsCurveFitParameters::ON_NurbsCurveFitParameters ( )
default

◆ ~ON_NurbsCurveFitParameters()

ON_NurbsCurveFitParameters::~ON_NurbsCurveFitParameters ( )
default

◆ ON_NurbsCurveFitParameters() [2/2]

ON_NurbsCurveFitParameters::ON_NurbsCurveFitParameters ( const ON_NurbsCurveFitParameters )
default

Member Function Documentation

◆ ApplyTangentMatchingAtKinks()

bool ON_NurbsCurveFitParameters::ApplyTangentMatchingAtKinks ( ) const

Control when tangent matching is applied at kinks. Note that this setting does somthing only when some tangent matching option is true and the input curve has kinks.

Returns
If true, the TangentMatchStart() and TangentMatchEnd() settings are applied at kinks. Otherwise, the tangent matching applies only to the ends of curves.

◆ ClampedControlPointCount()

int ON_NurbsCurveFitParameters::ClampedControlPointCount ( ) const

Number of control points if the NURBS curve will be clamped. Number of total control points if the NURBS curve will be periodic. This number is >= PointCount() Includes SubDFriendly constrained points and the duplicated point for a clamped closed curve.

◆ Closed()

bool ON_NurbsCurveFitParameters::Closed ( ) const
Returns
True if every curve created with these options will be periodic.

◆ ConstrainedPointCount()

int ON_NurbsCurveFitParameters::ConstrainedPointCount ( ) const

If Closed() is true, the number of constrained points is (TangentMatchStart() || TangentMatchEnd() ? 1 : 0)

  • (TangentMatchStart()?1:0)
  • (TangentMatchEnd()?1:0). If Closed() is false, the number of constrained points is 2
  • (SubDFriendly() ? 2 : 0)
  • (TangentMatchStart()?1:0)
  • (TangentMatchEnd()?1:0).
Returns
Number of constrained points.

◆ CurvatureBiasCoefficient()

double ON_NurbsCurveFitParameters::CurvatureBiasCoefficient ( ) const

◆ CurvatureBiasIntensity()

ON_NurbsCurveFitParameters::Intensity ON_NurbsCurveFitParameters::CurvatureBiasIntensity ( ) const

Curvature bias adds a bias to fit target points with relatively higher curvatures more closely. Use CurvatureBiasCoefficient() to get the numerical coefficient used in the objective function. Use SetCurvatureBiasCoefficient() to set a custom curvature bias coefficient.

Returns
The intensity of the curvature bias in the objective function.

◆ Degree()

int ON_NurbsCurveFitParameters::Degree ( ) const

◆ GetPointCountRange()

void ON_NurbsCurveFitParameters::GetPointCountRange ( int &  minimum_point_count,
int &  maximum_point_count,
double &  tolerance 
) const

◆ Hash()

const ON_SHA1_Hash ON_NurbsCurveFitParameters::Hash ( bool  bHashTangentMatching,
bool  bHashKinkSplitting 
) const

Returns a hash of the options that control the output curve geometry. These options are: degree (degree of the output curves), point_count (number of user control points in the output curves), sample_point_count (number of points sampled from the input curves). smoothing When bShowTangentOptions is true, end tangent matching settings are hashed. When bShowSplitAtKinksOption is true, kink parameters are hashed. This hash is useful for determing when previously calculated output curves need to be updated by comparing the hash current options and the hash of options used to calculate the output curves.

Parameters
bHashTangentMatchingIf the set of input curves contain at least one that is open, then pass true to include end tangent matching settings in the hash.
bHashKinkSplittingIf the set of input curves have kinks, then pass true to include kink splitting settings in the hash.
Returns
A hash of the options that control the output curve geometry.

◆ IntensityFromInt()

static ON_NurbsCurveFitParameters::Intensity ON_NurbsCurveFitParameters::IntensityFromInt ( int  intensity_as_int,
ON_NurbsCurveFitParameters::Intensity  invalid_input_result 
)
static

◆ KinkAngleDegrees()

double ON_NurbsCurveFitParameters::KinkAngleDegrees ( ) const

◆ KinkAngleRadians()

double ON_NurbsCurveFitParameters::KinkAngleRadians ( ) const

◆ KinkDefinition()

const ON_CurveKinkDefinition ON_NurbsCurveFitParameters::KinkDefinition ( ) const

When kink splitting is enabled, the kink definition determines what type of target curve tangent of curvature change is considered to be a kink.

Returns
Current kink definition.

◆ KinkSplitFromInt()

static ON_NurbsCurveFitParameters::KinkSplit ON_NurbsCurveFitParameters::KinkSplitFromInt ( int  kink_split_as_int,
ON_NurbsCurveFitParameters::KinkSplit  invalid_input_result 
)
static

Convert an integer value to the ON_NurbsCurveFitParameters::KinkSplit enum with the same value.

Parameters
kink_split_as_int
invalid_input_resultIf kink_split_as_int does not match an KinkSplit enum value, then this value is returned.
Returns

◆ KinkSplitting()

ON_NurbsCurveFitParameters::KinkSplit ON_NurbsCurveFitParameters::KinkSplitting ( ) const

Returns
Types of target curve kinks that get separate rebuilding on either side of the kink.

◆ MaximumDegreeForPointCount()

static int ON_NurbsCurveFitParameters::MaximumDegreeForPointCount ( int  point_count,
bool  bClosed,
bool  bSubDFreiendly 
)
static

Given a point count and periodic setting, determine the maximum degree.

Parameters
point_countNumber of indpendent control points in the output NURBS curve.
bClosedTrue if the output NURBS curve will be periodic.
Returns
Maximum permitted degree.

◆ MinimumPointCountForDegree()

static int ON_NurbsCurveFitParameters::MinimumPointCountForDegree ( int  degree,
bool  bClosed,
bool  bSubDFreiendly 
)
static

Give a degree and periodic setting, determine the minimum point count.

Parameters
degreeDegree of output NURBS curve.
bClosedTrue if the output NURBS curve will be closed.
Returns
Minimum permitted point count.

◆ operator=()

ON_NurbsCurveFitParameters& ON_NurbsCurveFitParameters::operator= ( const ON_NurbsCurveFitParameters )
default

◆ OptimizeCurve()

bool ON_NurbsCurveFitParameters::OptimizeCurve ( ) const

◆ PeriodicControlPointCount()

int ON_NurbsCurveFitParameters::PeriodicControlPointCount ( ) const

Number of total control points if the NURBS curve will be periodic. This number is >= PointCount() and includes periodic duplicates.

◆ PointCount()

int ON_NurbsCurveFitParameters::PointCount ( ) const

Number of distinct control points in the NURBS curve fit. If a range of point counts is possible, this is the minimum number.

Returns
Number of distinct control points in the NURBS curve fit.

◆ PointCountRange()

const ON_2dex ON_NurbsCurveFitParameters::PointCountRange ( ) const

◆ PointCountRangeMaximum()

int ON_NurbsCurveFitParameters::PointCountRangeMaximum ( ) const
Returns
Maximum number of distinct control points in the NURBS curve fit.

◆ PointCountRangeMinimum()

int ON_NurbsCurveFitParameters::PointCountRangeMinimum ( ) const
Returns
Minimum number of distinct control points in the NURBS curve fit.

◆ PointCountRangeTolerance()

double ON_NurbsCurveFitParameters::PointCountRangeTolerance ( ) const

When a range of point counts is permitted and PointCountRangeTolerance() > 0, then searching for the NURBS curve fit terminates if the separation is &lt= PointCountRangeTolerance().

Returns
The desired or target separation value used when a ranged of point counts is permitted.

◆ ProgressReporter()

class ON_ProgressReporter* ON_NurbsCurveFitParameters::ProgressReporter ( ) const

◆ SampleCount()

int ON_NurbsCurveFitParameters::SampleCount ( ) const

◆ SetApplyTangentMatchingAtKinks()

void ON_NurbsCurveFitParameters::SetApplyTangentMatchingAtKinks ( bool  bApplyTangentMatchingAtKinks)

Control when tangent matching is applied at kinks. Note that this setting does somthing only when some tangent matching option is true and the input curve has kinks.

Parameters
bApplyTangentMatchAtKinksIf true, the TangentMatchStart() and TangentMatchEnd() settings are applied at kinks. Otherwise, the tangent matching applies only to the ends of curves.

◆ SetClosed()

void ON_NurbsCurveFitParameters::SetClosed ( bool  bClosed)

Generally, it is best to call SetClosed() once before setting any other options and to leave it unchanged while the other options are adjusted. This is because the relationship betweem the point count and degree options are different for periodic and non-periodic NURBS curves. If every curve created with these options will be closed, then call SetClosed(true). Otherwise call SetClosed(false).

Parameters
bClosedPass true if every curve created with these options will be closed. Otherwise, pass false.

◆ SetCurvatureBiasCoefficient()

void ON_NurbsCurveFitParameters::SetCurvatureBiasCoefficient ( double  curvature_bias_coefficient)

Specify a curvature bias coefficient. Positive curvature bias coefficients make the fit curve relatively closer to the target curve in regions where the target curve has relatively higher curvature. In general, use the smallest value that gives the desired result.

Parameters
uniformity_coefficientValid values are in the range 0 <= uniformity_coefficient <= ON_NurbsCurveFitParameters::MaximumCurvatuerBiasCoefficient. If curvature_bias_coefficient is not valid, then curvature bias is set to ON_NurbsCurveFitParameters::Uniformity::None.

◆ SetCurvatureBiasIntensity()

void ON_NurbsCurveFitParameters::SetCurvatureBiasIntensity ( ON_NurbsCurveFitParameters::Intensity  curvature_bias_intensity)

Use one of ON_NurbsCurveFitParameters::Intensity enum values to specify a curvature bias. This method is provided to make it easier to provide an interface that lets a user select reasonable values for the curvature bias coefficient without having to understand the objective function. Positive curvature bias coefficients make the fit curve closer to regions in the target curve with relatively higher curvature. In general, use the smallest value that gives the desired result.

Parameters
curvature_bias_intensityOne of ON_NurbsCurveFitParameters::Intensity enum values. If ON_NurbsCurveFitParameters::Intensity::Custom is passed in and a preexisting custom curvature bias has not been specified using SetCurvatureBiasCoefficient(), then CurvatureBiasIntensity() is set to none. If you want to set a custom uniformity coefficient, use SetCurvatureBiasCoefficient(x).

◆ SetDegree()

void ON_NurbsCurveFitParameters::SetDegree ( int  degree)

◆ SetKinkAngleDegrees()

void ON_NurbsCurveFitParameters::SetKinkAngleDegrees ( double  kink_angle_degrees)

◆ SetKinkAngleRadians()

void ON_NurbsCurveFitParameters::SetKinkAngleRadians ( double  kink_angle_radians)

◆ SetKinkSplitting()

void ON_NurbsCurveFitParameters::SetKinkSplitting ( ON_NurbsCurveFitParameters::KinkSplit  kink_splitting)

Parameters
kink_splittingSpecifies what type of target curve kinks get separate rebuilding on either side of the kink.

◆ SetOptimizeCurve()

void ON_NurbsCurveFitParameters::SetOptimizeCurve ( bool  bOptimizeCurve)

◆ SetPointCount()

void ON_NurbsCurveFitParameters::SetPointCount ( int  point_count)

Sets the point count and, if necessary, reduces the degree so that degree that degree <= ON_NurbsCurveFitParameters::MaximumDegree(point_count, Closed()).

Parameters
point_count

◆ SetPointCountRange() [1/2]

void ON_NurbsCurveFitParameters::SetPointCountRange ( int  minimum_point_count,
int  maximum_point_count 
)

Use SetPointCountRange() if you want the NURBS curve fit with the smallest separation having the point count in the specified range.

Parameters
minimum_point_count
maximum_point_count

◆ SetPointCountRange() [2/2]

void ON_NurbsCurveFitParameters::SetPointCountRange ( int  minimum_point_count,
int  maximum_point_count,
double  tolerance 
)

Use SetPointCountRange() if you want the NURBS curve fit with the smallest separation having the point count in the specified range. This version of SetPointCountRange() lets you also specify a tolerance.

Parameters
minimum_point_count
maximum_point_count
tolerancetolerance >= 0. If you are willing to accept any separation below a certain value, pass that value as tolerance. Otherwise pass 0.0.

◆ SetProgressReporter()

void ON_NurbsCurveFitParameters::SetProgressReporter ( class ON_ProgressReporter progress_reporter)

◆ SetSampleCount()

void ON_NurbsCurveFitParameters::SetSampleCount ( int  sample_count)

◆ SetSmoothingCoefficient()

void ON_NurbsCurveFitParameters::SetSmoothingCoefficient ( double  smoothing_coefficient)

Specify a smoothing coefficient.

Parameters
smoothing_coefficientValid values are in the range 0 <= smoothing_coefficient <= ON_NurbsCurveFitParameters::MaximumCustomSmoothingCoefficient. If smoothing_coefficient is not valid, then smoothing intensity is set to ON_NurbsCurveFitParameters::Smoothing::None.

◆ SetSmoothingIntensity()

void ON_NurbsCurveFitParameters::SetSmoothingIntensity ( ON_NurbsCurveFitParameters::Intensity  smoothing_intensity)

Use one of the one of ON_NurbsCurveFitParameters::Intensity enum values to specify a smoothing coefficient. This method is provided to make it easier to provide an interface that lets a user select reasonable values for the smoothing penalty without having to understand the objective fuction calculation.

Parameters
smoothing_intensityOne of ON_NurbsCurveFitParameters::Intensity enum values. If ON_NurbsCurveFitParameters::Intensity::Custom is passed in and a preexisting custom smoothing penalty has not been specified using SetSmoothingCoefficient(), then SmothingIntensity() is set to none. If you want to set a custom smoothing coefficient, use SetSmoothingCoefficient(smoothing_coefficient).

◆ SetSubDFriendly()

void ON_NurbsCurveFitParameters::SetSubDFriendly ( bool  bSubDFriendly)

◆ SetTangentMatching()

void ON_NurbsCurveFitParameters::SetTangentMatching ( ON_NurbsCurveFitParameters::TangentMatch  tangent_matching)

◆ SetTerminator()

void ON_NurbsCurveFitParameters::SetTerminator ( class ON_Terminator terminator)

◆ SetUniformityCoefficient()

void ON_NurbsCurveFitParameters::SetUniformityCoefficient ( double  uniformity_coefficient)

Specify a uniformity coefficient. Positive uniformity coefficients make the distances between control points more uniform. In general, use the smallest value that gives the desired result.

Parameters
uniformity_coefficientValid values are in the range 0 <= uniformity_coefficient <= ON_NurbsCurveFitParameters::MaximumUniformityCoefficient. If uniformity_coefficient is not valid, then uniformity is set to ON_NurbsCurveFitParameters::Uniformity::None.

◆ SetUniformityIntensity()

void ON_NurbsCurveFitParameters::SetUniformityIntensity ( ON_NurbsCurveFitParameters::Intensity  uniformity_intensity)

Use one of ON_NurbsCurveFitParameters::Intensity enum values to specify a uniformity coefficient. This method is provided to make it easier to provide an interface that lets a user select reasonable values for the uniformity coefficient without having to understand the optimization calculation. Positive uniformity coefficients make the distances between control points more uniform. In general, use the smallest value that gives the desired result.

Parameters
uniformity_intensityOne of ON_NurbsCurveFitParameters::Intensity enum values. If ON_NurbsCurveFitParameters::Intensity::Custom is passed in and a preexisting custom uniformity penalty has not been specified using SetUniformityCoefficient(), then UniformityIntensity() is set to none. If you want to set a custom uniformity coefficient, use SetUniformityCoefficient(x).

◆ SmoothingCoefficient()

double ON_NurbsCurveFitParameters::SmoothingCoefficient ( ) const
Returns
The value of the smoothing penalty coefficient used in the objective function. 0 indicates no smoothing penalty. Values > 0 and <= ON_NurbsCurveFitParameters::MaximumCustomSmoothingCoefficient indicate a smoothing penalty will be applied. NaN indicates invalid settings and no smoothing penalty will be applied. Note that a smoothing penalty only applies when ther are 3 or more control points in the NURBS curve fit.

◆ SmoothingIntensity()

ON_NurbsCurveFitParameters::Intensity ON_NurbsCurveFitParameters::SmoothingIntensity ( ) const

The smoothing penalty in the objective function penalizes triplets of contiguous control points that are not colinear and equally spaced. Use SmoothingCoefficient() to get the numerical coefficient used in the objective function. Use SetSmoothingCoefficient() to set a custom smoothing coefficient.

Returns
The intensity of the smoothing penalty in the objective function.

◆ SubDFriendly()

bool ON_NurbsCurveFitParameters::SubDFriendly ( ) const

◆ TangentMatchFromInt()

static ON_NurbsCurveFitParameters::TangentMatch ON_NurbsCurveFitParameters::TangentMatchFromInt ( int  tangent_match_as_int,
ON_NurbsCurveFitParameters::TangentMatch  invalid_input_result 
)
static

Convert an integer value to the ON_NurbsCurveFitParameters::TangentMatch enum with the same value.

Parameters
tangent_match_as_int
invalid_input_resultIf tangent_match_as_int does not match an TangentMatch enum value, then this value is returned.
Returns

◆ TangentMatching()

ON_NurbsCurveFitParameters::TangentMatch ON_NurbsCurveFitParameters::TangentMatching ( ) const

◆ TerminationRequested()

bool ON_NurbsCurveFitParameters::TerminationRequested ( ) const

◆ Terminator()

class ON_Terminator* ON_NurbsCurveFitParameters::Terminator ( ) const

◆ UniformityCoefficient()

double ON_NurbsCurveFitParameters::UniformityCoefficient ( ) const
Returns
The value of the uniformity penalty coefficient used in the objective function. 0 indicates no uniformity penalty. Values > 0 and <= ON_NurbsCurveFitParameters::MaximumCustomUniformityCoefficient indicate uniformity penalty will be applied. NaN indicates invalid settings and no uniformity penalty will be applied. Note that uniformity penalty only applies when there are 3 or more control points in the NURBS curve fit.

◆ UniformityIntensity()

ON_NurbsCurveFitParameters::Intensity ON_NurbsCurveFitParameters::UniformityIntensity ( ) const

The uniformity penalty in the objective function penalizes variation in the distances between control points. Use UniformityCoefficient() to get the numerical coefficient used in the objective function. Use SetUniformityCoefficient() to set a custom uniformity penalty coefficient.

Returns
The intensity of the uniformity penalty in the objective function.

◆ ValidInput()

static bool ON_NurbsCurveFitParameters::ValidInput ( size_t  sample_point_count,
unsigned  degree,
unsigned  control_point_count,
bool  bClosed,
ON_Interval  curve_domain 
)
static

◆ VariablePointCount()

bool ON_NurbsCurveFitParameters::VariablePointCount ( ) const
Returns
Returns true if the best fit in a range of point counts should be returned.

Member Data Documentation

◆ ExtremeCurvatureBiasCoefficient

constexpr double ON_NurbsCurveFitParameters::ExtremeCurvatureBiasCoefficient = 10.0
staticconstexpr

Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High.

◆ ExtremeSmoothingCoefficient

constexpr double ON_NurbsCurveFitParameters::ExtremeSmoothingCoefficient = 10.0
staticconstexpr

Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Extreme.

◆ ExtremeUniformityCoefficient

constexpr double ON_NurbsCurveFitParameters::ExtremeUniformityCoefficient = 10.0
staticconstexpr

Uniformity coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High.

◆ HighCurvatureBiasCoefficient

constexpr double ON_NurbsCurveFitParameters::HighCurvatureBiasCoefficient = 1.0
staticconstexpr

Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High.

◆ HighSmoothingCoefficient

constexpr double ON_NurbsCurveFitParameters::HighSmoothingCoefficient = 1.0
staticconstexpr

Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High.

◆ HighUniformityCoefficient

constexpr double ON_NurbsCurveFitParameters::HighUniformityCoefficient = 1.0
staticconstexpr

Uniformity coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::High.

◆ LowCurvatureBiasCoefficient

constexpr double ON_NurbsCurveFitParameters::LowCurvatureBiasCoefficient = 0.001
staticconstexpr

Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Low.

◆ LowSmoothingCoefficient

constexpr double ON_NurbsCurveFitParameters::LowSmoothingCoefficient = 0.001
staticconstexpr

Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Low.

◆ LowUniformityCoefficient

constexpr double ON_NurbsCurveFitParameters::LowUniformityCoefficient = 0.001
staticconstexpr

<summary<coefficient> Uniformity coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Low.

◆ MaximumCurvatureBiasCoefficient

constexpr double ON_NurbsCurveFitParameters::MaximumCurvatureBiasCoefficient = 10.0
staticconstexpr

Maximum permitted curvature bias coefficient.

◆ MaximumSmoothingCoefficient

constexpr double ON_NurbsCurveFitParameters::MaximumSmoothingCoefficient = 10.0
staticconstexpr

Maximum permitted smoothing coefficient.

◆ MaximumUniformityCoefficient

constexpr double ON_NurbsCurveFitParameters::MaximumUniformityCoefficient = 10.0
staticconstexpr

Maximum permitted uniformity coefficient.

◆ MediumCurvatureBiasCoefficient

constexpr double ON_NurbsCurveFitParameters::MediumCurvatureBiasCoefficient = 0.1
staticconstexpr

Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Medium.

◆ MediumSmoothingCoefficient

constexpr double ON_NurbsCurveFitParameters::MediumSmoothingCoefficient = 0.1
staticconstexpr

Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Medium.

◆ MediumUniformityCoefficient

constexpr double ON_NurbsCurveFitParameters::MediumUniformityCoefficient = 0.1
staticconstexpr

Uniformity coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Medium.

◆ ModerateCurvatureBiasCoefficient

constexpr double ON_NurbsCurveFitParameters::ModerateCurvatureBiasCoefficient = 0.01
staticconstexpr

Curvature bias coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Moderate.

◆ ModerateSmoothingCoefficient

constexpr double ON_NurbsCurveFitParameters::ModerateSmoothingCoefficient = 0.01
staticconstexpr

Smoothing coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Moderate.

◆ ModerateUniformityCoefficient

constexpr double ON_NurbsCurveFitParameters::ModerateUniformityCoefficient = 0.01
staticconstexpr

<summary<coefficient> Uniformity coefficient that corresponds to ON_NurbsCurveFitParameters::Intensity::Moderate.