SurfaceCurvature
Referencespublic class SurfaceCurvature : IDisposable, IEquatable<SurfaceCurvature>, IComparable<SurfaceCurvature>
Maintains computed information for principal surface curvature evaluation.
Constructors
public SurfaceCurvature()
Default constructs a new surface curvature object. Both kappa1 and kappa2 are zero.
Finalizer
Properties
The Gaussian curvature is kappa1*kappa2.
Remarks: If this is set, the Gausian curvature is returned. Otherwise, the quiet NaN is returned.
True if either of kappa1 or kappa2 is not a valid finite value.
If set, the maximum of kapp1 and kappa2 returned. Otherwise, the quiet NaN is returned.
If a principal curvature value is zero or the principal curvatures have opposite signs, then the maximum radius of curvature is infinite RhinoMath.InfiniteRadius is returned. Otherwise the maximum radius of curvature is 1/min(fabs(kappa1),fabs(kappa2)).
The mean curvature is (kappa1+kappa2)/2.
Remarks: If this is set, the signed mean curvature is returned. Otherwise, the quiet NaN is returned.
If set, the minimum of kappa1 and kappa2 returned. Otherwise, the quiet NaN is returned.
The minimum radius of curvature is 1/max(fabs(kappa1),fabs(kappa2)). Infinite radius values are returned as RhinoMath.InfiniteRadius.
Gets the normal direction of the surface at the u,v parameter where the surface curvature was evaluated.
Gets the point at the u,v parameter where the surface curvature was evaluated.
Methods
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Parameters:
| other (SurfaceCurvature) | An object to compare with this instance. |
Returns: A value that indicates the relative order of the objects being compared. The return value has these meanings: Less than zero - this instance precedes other in the sort order. Zero - this instance occurs in the same position in the sort order as other. Greater than zero - this instance follows other in the sort order.
Create a SurfaceCurvature from explicit principal curvatures and the geometric frame at the evaluation point. Use this when you have already computed curvature data from a non-RhinoCommon surface representation (planes, spheres, cylinders, cones, etc.).
Parameters:
| kappa1 (double) | Principal curvature with maximum absolute value. Must be a finite number. |
| kappa2 (double) | Principal curvature with minimum absolute value. Must be a finite number. |
| uv (Point2d) | The (u,v) parameter where the curvature was evaluated. |
| frame (Plane) | Orthonormal frame at the evaluation point. The origin is the surface point, the X axis is the principal direction associated with kappa1, the Y axis is the principal direction associated with kappa2, and the Z axis is the surface normal. |
Returns: A SurfaceCurvature instance.
Exceptions:
| ArgumentException | Thrown when a curvature value is not finite, the uv parameter is invalid, or the frame is not a valid plane. |
public static SurfaceCurvature CreateFromGaussianAndMeanCurvatures(double gaussianCurvature, double meanCurvature)
Create a SurfaceCurvature from a gaussian and mean curvature values using the relationship between the principal curvatures, gaussian and mean: kappa1 = mean + sqrt(mean*mean - gaussian) kappa2 = mean - sqrt(mean*mean - gaussian) If the radicand is negative, we assume we're dealing with a bit of numerical noise or estimates and set the principal curvatures: kappa1 = kappa2 = sign(mean)*sqrt(gaussian)
Create a SurfaceCurvature from the principal curvature values. The principal curvature values are the most fundamental curvature properties of a surface. Other curvatures are calculated from them.
public static SurfaceCurvature CreateFromSubD(SubD subd, SubDComponentParameter parameter, ExtraordinaryVertexCurvature extraordinaryVertexCurvature)
Create a SurfaceCurvature by evaluating a SubD's surface (its limit surface) at a surface parameter, choosing what to report exactly on an extraordinary vertex.
Remarks: With SubD.ExtraordinaryVertexCurvature.SectorAverage the result at an extraordinary vertex is an average of the curvature around it, so Direction(int) is unset: an average has no single principal direction. Point and Normal are the vertex's own and are exact.
Parameters:
| subd (SubD) | The SubD to evaluate. |
| parameter (SubDComponentParameter) | The surface parameter to evaluate. |
| extraordinaryVertexCurvature (SubD.ExtraordinaryVertexCurvature) | What to report when the parameter is exactly on an extraordinary vertex, where the limit surface has no curvature of its own. This changes nothing anywhere else, including inside such a vertex's corner quad. |
Returns: A SurfaceCurvature if successful, null otherwise.
Create a SurfaceCurvature by evaluating a SubD's surface (its limit surface) at a surface parameter.
Remarks: A SubD limit surface is C1 but generally not C2 exactly on an extraordinary vertex, so it has no curvature there and this returns null. Everywhere else, including throughout the corner quad of an extraordinary vertex, the curvature exists. Use the overload that takes a SubD.ExtraordinaryVertexCurvature to get an estimate at those vertices instead of nothing. UVPoint is the face corner parameter, since that is what parameterizes a SubD surface. See SubDComponentParameter.FaceCornerParameters.
Parameters:
| subd (SubD) | The SubD to evaluate. |
| parameter (SubDComponentParameter) | The surface parameter to evaluate. |
Returns: A SurfaceCurvature if successful, null otherwise.
Create a SurfaceCurvature from by evaluating surface and a u,v parameter.
Gets the principal curvature direction vector at the u,v parameter where the surface curvature was evaluated..
Parameters:
| direction (int) | Direction index, valid values are 0 and 1. |
Returns: The specified direction vector.
Indicates whether the current object is equal to another object of the same type.
Parameters:
| other (object) | An object to compare with this object. |
Returns: true if the current object is equal to the other parameter; otherwise, false.
Overrides: Object.Equals
Indicates whether the current object is equal to another object of the same type.
Parameters:
| other (SurfaceCurvature) | An object to compare with this object. |
Returns: true if the current object is equal to the other parameter; otherwise, false.
GetHashCode
#Returns a runtime-stable hash code for this object.
Returns: A non-unique integer that represents this SurfaceCurvature.
Overrides: Object.GetHashCode
Gets the principal curvature values: kappa1 - Principal curvature with maximum absolute value. kappa2 - Principal curvature with minimum absolute value.
Parameters:
| direction (int) | Kappa index, valid values are 0 (kappa1) and 1 (kappa2). |
Calculate one of the four typical curvature values associated with the two principal curvatures and frequently used in false color curvature analysis.
Parameters:
| curvatureStyle (CurvatureStyle) | Specifies which type curvature value to calculate from the principal curvatures. The Gausian curvature can be positive or negative. The other curvatures are unsigned. |
Returns: If curvature style and the principal curvatures are valid, the specified type of curvature value is returned. Infinite radii are returned as RhinoMath.InfiniteRadius. Otherwise, the quiet NaN is returned.