NurbsCurveFitParameters

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

Constructors

NurbsCurveFitParameters

#Since v5.0
public NurbsCurveFitParameters()
Initializes a new instance of the NurbsCurveFitParameters class.

NurbsCurveFitParameters

#Since v9.0
public NurbsCurveFitParameters(NurbsCurveFitParameters other)
Creates a new instance of the NurbsCurveFitParameters class as a copy of an existing instance.
other (NurbsCurveFitParameters)The instance to copy

Finalizer

~NurbsCurveFitParameters

#
~NurbsCurveFitParameters()
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().

Properties

ApplyTangentMatchingAtKinks

#Since v9.0
public bool ApplyTangentMatchingAtKinks { get; set; }
If true, the TangentMatching setting is applied at kinks. Otherwise, TangentMatching applies only to the ends of curves.

ClampedControlPointCount

#Since v9.0
public int ClampedControlPointCount { get; }
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

#Since v9.0
public bool Closed { get; set; }
Number of total control points if the NURBS curve will be periodic. This number is >= PointCount() and includes periodic duplicates.

ConstrainedPointCount

#Since v9.0
public int ConstrainedPointCount { get; }
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).
Number of constrained points.

CurvatureBiasCoefficient

#Since v9.0
public double CurvatureBiasCoefficient { get; set; }
When CurvatureBiasIntensity == NurbsCurveFitParameters.Intensity::Custom, this value is used as the curvature bias parameter.

CurvatureBiasIntensity

#Since v9.0
public NurbsCurveFitParameters.Intensity CurvatureBiasIntensity { get; set; }
Curvature bias is used to make the fit curve stay close to regions of relatively high curvature. Use CurvatureBiasCoefficient() to convert this enum to the the value passed to the optimizer.

DefaultDegree

#Since v9.0
public static int DefaultDegree { get; }
The default degree of the fit

DefaultSampleCount

#Since v9.0
public static int DefaultSampleCount { get; }
Default number of points to sample from input curves and pass to the fitter that creates the output NURBS curve.

Degree

#Since v9.0
public int Degree { get; set; }
The degree of the resulting curve

KinkAngleDegrees

#Since v9.0
public double KinkAngleDegrees { get; set; }
The angle, in degrees, used to determine if when an abrupt change in tangent or curvature vector direction is a kink.

KinkAngleRadians

#Since v9.0
public double KinkAngleRadians { get; set; }
The angle, in radians, used to determine if when an abrupt change in tangent or curvature vector direction is a kink.

KinkSplitting

#Since v9.0
public NurbsCurveFitParameters.KinkSplit KinkSplitting { get; set; }
Gets or sets the kink splitting behavior used when fitting a NURBS curve. See also NurbsCurveFitParameters.KinkSplit
Remarks: This property determines how the curve fitting algorithm handles kinks or sharp changes in direction. Adjusting this value can influence the smoothness and accuracy of the resulting curve. Choose an appropriate value based on whether preserving or smoothing out kinks is desired for your application.

MaximumDegree

#Since v9.0
public static int MaximumDegree { get; }
The maximum degree of the fit

MaximumPointCount

#Since v9.0
public static int MaximumPointCount { get; }
Gets the maximum number of points supported for NURBS curve fitting operations.

MaximumSampleCount

#Since v9.0
public static int MaximumSampleCount { get; }
Maximum number of points to sample from input curves and pass to the fitter that creates the output NURBS curve.

MinimumClampedPointCount

#Since v9.0
public static int MinimumClampedPointCount { get; }
The minimum clamped point count

MinimumClosedPointCount

#Since v9.0
public static int MinimumClosedPointCount { get; }
The minimum closed point count

MinimumDegree

#Since v9.0
public static int MinimumDegree { get; }
The minimum degree of the fit

MinimumSampleCount

#Since v9.0
public static int MinimumSampleCount { get; }
Minimum number of points to sample from input curves and pass to the fitter that creates the output NURBS curve.

OptimizeCurve

#Since v9.0
public bool OptimizeCurve { get; set; }
If OptimizeCurve = false, then all options below are ignored and the Greville interpolant is returned. Rhino 1 - Rhino 8 Rebuild command created a result similar to what's created when m_bOptimizeCurve = false.

PeriodicControlPointCount

#Since v9.0
public int PeriodicControlPointCount { get; }
Number of total control points if the NURBS curve will be periodic. This number is >= PointCount() and includes periodic duplicates.

PointCount

#Since v9.0
public int PointCount { get; set; }
Number of distinct control points in the NURBS curve fit. If a range of point counts is possible, this is the minimum number.

PointCountRange

#Since v9.0
public IndexPair PointCountRange { get; set; }
Gets or sets the point count range as an IndexPair.

PointCountRangeMaximum

#Since v9.0
public int PointCountRangeMaximum { get; }
Maximum number of distinct control points in the NURBS curve fit.

PointCountRangeMinimum

#Since v9.0
public int PointCountRangeMinimum { get; }
Minimum number of distinct control points in the NURBS curve fit.

PointCountRangeTolerance

#Since v9.0
public double PointCountRangeTolerance { get; }
When a range of point counts is permitted and PointCountRangeTolerance greater than 0, then searching for the NURBS curve fit terminates if the separation is less than or equal to PointCountRangeTolerance.
The desired or target separation value used when a ranged of point counts is permitted.

SampleCount

#Since v9.0
public int SampleCount { get; }
This is the number of points the NURBS curve is fit through. Is it common for these points to be sampled from an input curve.

SmoothingCoefficient

#Since v9.0
public double SmoothingCoefficient { get; set; }
When SmoothingIntensity == NurbsCurveFitParameters.Intensity::Custom, this value is used as the smoothing parameter.

SmoothingIntensity

#Since v9.0
public NurbsCurveFitParameters.Intensity SmoothingIntensity { get; set; }
Smoothing penalty used to make triples of consecutive control polygon points colinear. Use SmoothingCoefficient() to convert this enum to the the value passed to the optimizer.

SubDFriendly

#Since v9.0
public bool SubDFriendly { get; set; }
Gets or sets the SubDFriendly property. When true, the resulting curve will be more likely to have good subdivision surface properties, such as fewer kinks and more even parameterization. This is accomplished by using a more aggressive kink splitting strategy and by using the SmoothingCoefficient to bias the fit towards smoother curves.

TangentMatching

#Since v9.0
public NurbsCurveFitParameters.TangentMatch TangentMatching { get; set; }
Gets ot Sets the TangentMatching value

UniformityCoefficient

#Since v9.0
public double UniformityCoefficient { get; set; }
When UniformityIntensity == NurbsCurveFitParameters.Intensity::Custom, this value is used as the uniformity parameter.

UniformityIntensity

#Since v9.0
public NurbsCurveFitParameters.Intensity UniformityIntensity { get; set; }
Uniformity penalty used to make the distance between control points more equal. Use UniformityCoefficient() to convert this enum to the the value passed to the optimizer.

VariablePointCount

#Since v9.0
public int VariablePointCount { get; }
Returns true if the best fit in a range of point counts should be returned.

Methods

Clone

#Since v9.0
public object Clone()
Supports the ICloneable inteface and creates a new NurbsCurveFitParameters object with the same property values as this instance.

Dispose

#Since v5.0
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.

Dispose

#
protected virtual void Dispose(bool disposing)
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

disposing (bool)true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.

GetCurvatureBiasCoefficientFromIntensity

#Since v9.0
public double GetCurvatureBiasCoefficientFromIntensity(Intensity intensity)
Returns the Curvature bias coefficient that corresponds to a given NurbsCurveFitParameters.Intensity value.
intensity (NurbsCurveFitParameters.Intensity)

GetCurvatureBiasIntensityFromCoefficient

#Since v9.0
public NurbsCurveFitParameters.Intensity GetCurvatureBiasIntensityFromCoefficient(double coefficient)
Returns the NurbsCurveFitParameters.Intensity value that corresponds to a given curvature bias coefficient.
coefficient (double)

GetPointCountRange

#Since v9.0
public void GetPointCountRange(out int minimum, out int maximum, out double tolerance)
Get the point count range and tolerance.
minimum (out int)
maximum (out int)
tolerance (out double)

GetSmoothingCoefficientFromIntensity

#Since v9.0
public double GetSmoothingCoefficientFromIntensity(Intensity intensity)
Returns the smoothing coefficient that corresponds to a given NurbsCurveFitParameters.Intensity value.
intensity (NurbsCurveFitParameters.Intensity)

GetSmoothingIntensityFromCoefficient

#Since v9.0
public NurbsCurveFitParameters.Intensity GetSmoothingIntensityFromCoefficient(double coefficient)
Returns the NurbsCurveFitParameters.Intensity value that corresponds to a given smoothing coefficient.
coefficient (double)

GetUniformityCoefficientFromIntensity

#Since v9.0
public double GetUniformityCoefficientFromIntensity(Intensity intensity)
Returns the uniformity coefficient that corresponds to a given NurbsCurveFitParameters.Intensity value.
intensity (NurbsCurveFitParameters.Intensity)

GetUniformityIntensityFromCoefficient

#Since v9.0
public NurbsCurveFitParameters.Intensity GetUniformityIntensityFromCoefficient(double coefficient)
Returns the NurbsCurveFitParameters.Intensity value that corresponds to a given uniformity coefficient.
coefficient (double)

MaximumPointCountForDegree

#Since v9.0
public static int MaximumPointCountForDegree(int degree, bool bClosed, bool bSubDFriendly)
Given a point count and periodic setting, determine the maximum degree.
degree (int)Degree of output NURBS curve.
bClosed (bool)True if the output NURBS curve will be closed.
bSubDFriendly (bool)True if the output NURBS curve will be SubDFriendly.
Maximum permitted degree.

MinimumPointCountForDegree

#Since v9.0
public static int MinimumPointCountForDegree(int degree, bool bClosed, bool bSubDFriendly)
Give a degree and periodic setting, determine the minimum point count.
degree (int)Degree of output NURBS curve.
bClosed (bool)True if the output NURBS curve will be closed.
bSubDFriendly (bool)True if the output NURBS curve will be SubDFriendly.
Minimum permitted point count.

SetPointCountRange

#Since v9.0
public void SetPointCountRange(int minimum, int maximum, double tolerance)
Set the point count range and tolerance.
minimum (int)
maximum (int)
tolerance (double)

SetPointCountRange

#Since v9.0
public void SetPointCountRange(int minimum, int maximum)
Set the point count range and tolerance.
minimum (int)
maximum (int)

ValidInput

#
public static bool ValidInput(long sample_point_count, int degree, int control_point_count, bool bClosed, Interval curve_domain)
returns true if the input values are within the acceptable ranges for NURBS curve fitting. If false is returned, the input values should be adjusted before calling the curve fitting function. See also MinimumPointCountForDegree() and MaximumPointCountForDegree().
sample_point_count (long)
degree (int)
control_point_count (int)
bClosed (bool)
curve_domain (Interval)