SurfaceCurvature

References
Maintains computed information for principal surface curvature evaluation.

Constructors

SurfaceCurvature

#Since v9.0
public SurfaceCurvature()
Default constructs a new surface curvature object. Both kappa1 and kappa2 are zero.

Finalizer

~SurfaceCurvature

#
~SurfaceCurvature()
Passively releases the unmanaged pointer.

Properties

Gaussian

#Since v5.0
public double Gaussian { get; }
The Gaussian curvature is kappa1*kappa2.
Remarks: If this is set, the Gausian curvature is returned. Otherwise, the quiet NaN is returned.

IsNaN

#Since v9.0
public bool IsNaN { get; }
True if either of kappa1 or kappa2 is NaN.

IsSet

#Since v9.0
public bool IsSet { get; }
True if kappa1 and kappa2 are both valid finite values.

IsUnset

#Since v9.0
public bool IsUnset { get; }
True if either of kappa1 or kappa2 is not a valid finite value.

IsZero

#Since v9.0
public bool IsZero { get; }
True if both kappa1 and kappa2 are zero.

MaximumPrincipalCurvature

#Since v9.0
public double MaximumPrincipalCurvature { get; }
If set, the maximum of kapp1 and kappa2 returned. Otherwise, the quiet NaN is returned.

MaximumRadius

#Since v9.0
public double MaximumRadius { get; }
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)).

Mean

#Since v5.0
public double Mean { get; }
The mean curvature is (kappa1+kappa2)/2.
Remarks: If this is set, the signed mean curvature is returned. Otherwise, the quiet NaN is returned.

MinimumPrincipalCurvature

#Since v9.0
public double MinimumPrincipalCurvature { get; }
If set, the minimum of kappa1 and kappa2 returned. Otherwise, the quiet NaN is returned.

MinimumRadius

#Since v9.0
public double MinimumRadius { get; }
The minimum radius of curvature is 1/max(fabs(kappa1),fabs(kappa2)). Infinite radius values are returned as RhinoMath.InfiniteRadius.

Normal

#Since v5.0
public Vector3d Normal { get; }
Gets the normal direction of the surface at the u,v parameter where the surface curvature was evaluated.

Point

#Since v5.0
public Point3d Point { get; }
Gets the point at the u,v parameter where the surface curvature was evaluated.

UVPoint

#Since v5.0
public Point2d UVPoint { get; }
Gets the u,v parameter where the surface curvature was evaluated.

Methods

CompareTo

#Since v9.0
public int CompareTo(SurfaceCurvature other)
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.
other (SurfaceCurvature)An object to compare with this instance.
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

#Since v9.0
public static SurfaceCurvature Create(double kappa1, double kappa2, Point2d uv, Plane frame)
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.).
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.
A SurfaceCurvature instance.
ArgumentExceptionThrown when a curvature value is not finite, the uv parameter is invalid, or the frame is not a valid plane.

CreateFromGaussianAndMeanCurvatures

#Since v9.0
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)
gaussianCurvature (double)Gaussian curvature = kappa1*kappa2 (product of principal curvatures).
meanCurvature (double)Mean curvature = (kappa1+kappa2)/2 (average of principal curvatures).
A SurfaceCurvature if successful, null otherwise.

CreateFromPrincipalCurvatures

#Since v9.0
public static SurfaceCurvature CreateFromPrincipalCurvatures(double kappa1, double kappa2)
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.
kappa1 (double)
kappa2 (double)
A SurfaceCurvature if successful, null otherwise.

CreateFromSubD

#Since v9.0
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.
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.
A SurfaceCurvature if successful, null otherwise.

CreateFromSubD

#Since v9.0
public static SurfaceCurvature CreateFromSubD(SubD subd, SubDComponentParameter parameter)
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.
subd (SubD)The SubD to evaluate.
parameter (SubDComponentParameter)The surface parameter to evaluate.
A SurfaceCurvature if successful, null otherwise.

CreateFromSurface

#Since v9.0
public static SurfaceCurvature CreateFromSurface(Surface surface, double u, double v)
Create a SurfaceCurvature from by evaluating surface and a u,v parameter.
surface (Surface)The surface to evaluate.
u (double)A U parameter.
v (double)A V parameter.
A SurfaceCurvature if successful, null otherwise.

Direction

#Since v5.0
public Vector3d Direction(int direction)
Gets the principal curvature direction vector at the u,v parameter where the surface curvature was evaluated..
direction (int)Direction index, valid values are 0 and 1.
The specified direction vector.

Dispose

#Since v9.0
public void Dispose()
Actively releases the unmanaged pointer.

Equals

#Since v9.0
public override bool Equals(object other)
Indicates whether the current object is equal to another object of the same type.
other (object)An object to compare with this object.
true if the current object is equal to the other parameter; otherwise, false.
Object.Equals

Equals

#Since v9.0
public bool Equals(SurfaceCurvature other)
Indicates whether the current object is equal to another object of the same type.
other (SurfaceCurvature)An object to compare with this object.
true if the current object is equal to the other parameter; otherwise, false.

GetHashCode

#
public override int GetHashCode()
Returns a runtime-stable hash code for this object.
A non-unique integer that represents this SurfaceCurvature.

Kappa

#Since v5.0
public double Kappa(int direction)
Gets the principal curvature values: kappa1 - Principal curvature with maximum absolute value. kappa2 - Principal curvature with minimum absolute value.
direction (int)Kappa index, valid values are 0 (kappa1) and 1 (kappa2).

KappaValue

#Since v9.0
[ConstOperation] public double KappaValue(CurvatureStyle curvatureStyle)
Calculate one of the four typical curvature values associated with the two principal curvatures and frequently used in false color curvature analysis.
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.
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.

OsculatingCircle

#Since v5.0
[ConstOperation] public Circle OsculatingCircle(int direction)
Computes the osculating circle along the given direction.
direction (int)Direction index, valid values are 0 and 1.
The osculating circle in the given direction or Circle.Unset on failure.