CurveKinkDefinition
A "kink" in a curve is a unit tangent discontinuity or a vector curvature discontinuity. This class is used to determine which types and magnitudes of unit tangent discontinuities and vector curvature discontinuities should are a "kink." It also provides functions for determining if there is a kink at a specific curve parameter.
Constructors
public CurveKinkDefinition()
Construct a new instance with default values.
public CurveKinkDefinition(double kinkAngleDegrees, double curvatureKinkRadiusRatio, bool kinkAtTangentChange, bool kinkAtCurvatureChange)
Create a CurveKinkDefinition with specified settings.
Parameters:
| kinkAngleDegrees (double) | 0 <= kinkAngleDegrees <= 180. Values > 180 are treated as 180 and other values outside the [0,180] are treated as ON_CurveKinkDefinition::DefaultPolylineTangentKinkAngleDegrees. If a curve is a polyline and the angle (in degrees) between the tangents at a tangent discontinuity is > polyline_tangent_kink_angle_degrees, then that discontinuity is treated as a kink. In particular, passing 180.0 disables tangent discontinuity checks for polyline curves. |
| curvatureKinkRadiusRatio (double) | 0 <= curvatureKinkRadiusRatio <= 1. Values > 1 are treated as 1 and other values outside the [0,1] are treated as ON_CurveKinkDefinition::DefaultCurvatureKinkRadiusRatio. If the ratio (minimum radius of curvature)/(maximum radius of curvature) at a curvature discontinuity is < curvature_kink_radius_ratio, then that discontinuity is treated as a kink. In particular, passing 0.0 disables curvature radius discontinuity checks. |
| kinkAtTangentChange (bool) | true if tangent discontinuities should be tested to determine if the tangent discontinuity is a kink. false to ignore tangent discontinuities. |
| kinkAtCurvatureChange (bool) | true if curvature discontinuities should be tested to determine if the curvature discontinuity is a kink. false to ignore curvature discontinuities. |
Finalizer
~CurveKinkDefinition
#~CurveKinkDefinition()
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
Properties
If the ratio (minimum radius of curvature)/(maximum radius of curvature) at a curvature discontinuity is < CurvatureKinkRadiusRatio, then that curvature discontinuity is treated as a kink. In particular, if CurvatureKinkRadiusRatio = 0, then curvature radius discontinuity checks are disabled.
Returns: The ratio used to test for curvature vector kinks.
If the curvature <= CurvatureKinkZeroTolerance, then it is treated as zero curvature. Put another way, if (radius of curvature) * CurvatureKinkZeroTolerance >= 1, then the radius is treated as infinite. If CurvatureKinkZeroTolerance > 0, then the curvature kink test is scale dependent. If CurvatureKinkZeroTolerance = 0, then the curvature kink test is indpendent of scale.
The angle, in degrees, used to determine if when an abrupt change in tangent or curvature vector direction is a kink.
Returns: The tangent or curvature kink angle in degrees.
Returns true if curvature discontinuities should be tested when finding kinks. The angle used vector curvature direction discontinuities is KinkAngleDegrees(). The ratio used for radius of curvature discontinuities is CurvatureKinkRadiusRatio().
Methods
public bool ComputeCurvatureRadiusRatio(Vector3d curvatureFromBelow, Vector3d curvatureFromAbove, out double radiusOfCurvatureRatio, out double curvatureVectorAngleDegrees)
Calculates the curvature radius ratio and the angle between the two curvature vectors.
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
Dispose
#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.
Parameters:
| disposing (bool) | true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer. |
True if there is a curvature discontinuity at curve(t) that passes the curvature kink test.
True if the angle between curvature_from_below and curvature_from_above is > KinkAngleDegrees or the ratio min/max < CurvatureKinkRadiusRatio, where min and max are the minimum and maximum lengths of curvatureFromBelow and v. Both of these tests are scale independent. If an input curvature vector has length <= CurvatureKinkZeroTolerance, then that curvature is treated as zero. When is CurvatureKinkZeroTolerance > 0, the test is scale dependent. The default value is chosen to work reasonably well for most models at most scales.
Returns true if the curvature vector is considered to be zero given the CurvatureKinkZeroTolerance
Parameters:
| curvature (double) |
Returns true if the curvature vector is considered to be zero given the CurvatureKinkZeroTolerance
Parameters:
| curvature (Vector3d) |
True if there is a kink at curve(t).
True if there is a tangent discontinuity at curve(t) and the agnle between the two tangents is > KinkAngleDegrees