Rhino C++ API  8.7
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_SurfaceCurvature Class Reference

#include <opennurbs_point.h>

Public Member Functions

const ON_SurfaceCurvature FlipSurfaceOrientation () const
 The sign of the principal curvatures are with respect to a choice of surface orientation. This function returns the principal curvatures of the surface with opposite choice of orientation. More...
 
double GaussianCurvature () const
 The Gaussian curvature is k1*k2. More...
 
bool IsNan () const
 
Returns
True if either of k1 or k2 is a nan.
More...
 
bool IsSet () const
 
Returns
True if k1 and k2 are both valid finite values.
More...
 
bool IsUnset () const
 
Returns
True if either of k1 or k2 is not a valid finite value.
More...
 
bool IsZero () const
 
Returns
True if k1 and k2 are both zero.
More...
 
double KappaValue (ON::curvature_style kappa_style) const
 Calculate one of the four typical curvature values associated with the two principal curvatures and frequently used in false color curvature analysis. More...
 
double MaximumPrincipalCurvature () const
 
double MaximumRadius () const
 If a principal curvature value is zero or the principal curvatures have opposite signs, then the maximum radius of curvature is infinite and ON_SurfaceCurvature::InfinteRadius is returned. Otherwise the maximum radius of curvature is 1/min(fabs(k1),fabs(k2)). More...
 
double MeanCurvature () const
 The mean curvature is (k1+k2)/2. More...
 
double MinimumPrincipalCurvature () const
 
double MinimumRadius () const
 The minimum radius of curvature is 1/max(fabs(k1),fabs(k2)). Infinte radius values are returned as ON_SurfaceCurvature::InfinteRadius. More...
 

Static Public Member Functions

static int Compare (const ON_SurfaceCurvature &lhs, const ON_SurfaceCurvature &rhs)
 Dictionary compare k1 and k2. Values with nans sort last. More...
 
static int CompareGaussianCurvature (const ON_SurfaceCurvature &lhs, const ON_SurfaceCurvature &rhs)
 Compare lhs.GaussianCurvature() and rhs.GaussianCurvature(). Values with nans sort last. More...
 
static int CompareMaximumAndMinimumPrincipalCurvatures (const ON_SurfaceCurvature &lhs, const ON_SurfaceCurvature &rhs)
 Dictionary compare lhs.MaximumPrincipalCurvature() and rhs.MaximumPrincipalCurvature(). Values with nans sort last. More...
 
static int CompareMaximumPrincipalCurvature (const ON_SurfaceCurvature &lhs, const ON_SurfaceCurvature &rhs)
 Compare lhs.MaximumPrincipalCurvature() and rhs.MaximumPrincipalCurvature(). Values with nans sort last. More...
 
static int CompareMaximumRadius (const ON_SurfaceCurvature &lhs, const ON_SurfaceCurvature &rhs)
 Compare lhs.MaximumRadius() and rhs.MaximumRadius(). Values with nans sort last. More...
 
static int CompareMeanCurvature (const ON_SurfaceCurvature &lhs, const ON_SurfaceCurvature &rhs)
 Compare lhs.MeanCurvature() and rhs.MeanCurvature(). Values with nans sort last. More...
 
static int CompareMinimumPrincipalCurvature (const ON_SurfaceCurvature &lhs, const ON_SurfaceCurvature &rhs)
 Compare lhs.MinimumPrincipalCurvature() and rhs.MinimumPrincipalCurvature(). Values with nans sort last. More...
 
static int CompareMinimumRadius (const ON_SurfaceCurvature &lhs, const ON_SurfaceCurvature &rhs)
 Compare lhs.MinimumRadius() and rhs.MinimumRadius(). Values with nans sort last. More...
 
static const ON_SurfaceCurvature CreateFromGaussianAndMeanCurvatures (double gaussian_curvature, double mean_curvature)
 Create an ON_SurfaceCurvature from a gaussian and mean curvature values using the relationsip between the principal curvatures, gaussian and mean. k1 = mean + sqrt(mean*mean - gaussian) k2 = 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 k1 = k2 = sign(mean)*sqrt(gaussian) More...
 
static const ON_SurfaceCurvature CreateFromPrincipalCurvatures (double k1, double k2)
 Create an ON_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. For example gaussian curvature = k1 * k2 and mean curvature = (k1 + k2)/2. More...
 

Public Attributes

double k1
 
double k2
 principal curvatures More...
 

Static Public Attributes

static const double InfinteRadius
 Value used to indicate a radius of curvature is infinite (1e300). More...
 
static const ON_SurfaceCurvature Nan
 k1 = k2 = ON_DBL_QNAN More...
 
static const ON_SurfaceCurvature Zero
 k1 = k2 = 0 More...
 

Detailed Description

ON_SurfaceCurvature

Member Function Documentation

◆ Compare()

static int ON_SurfaceCurvature::Compare ( const ON_SurfaceCurvature lhs,
const ON_SurfaceCurvature rhs 
)
static

Dictionary compare k1 and k2. Values with nans sort last.

Parameters
lhs
rhs
Returns
-1, 0 or +1.

◆ CompareGaussianCurvature()

static int ON_SurfaceCurvature::CompareGaussianCurvature ( const ON_SurfaceCurvature lhs,
const ON_SurfaceCurvature rhs 
)
static

Compare lhs.GaussianCurvature() and rhs.GaussianCurvature(). Values with nans sort last.

Parameters
lhs
rhs
Returns
-1, 0 or +1.

◆ CompareMaximumAndMinimumPrincipalCurvatures()

static int ON_SurfaceCurvature::CompareMaximumAndMinimumPrincipalCurvatures ( const ON_SurfaceCurvature lhs,
const ON_SurfaceCurvature rhs 
)
static

Dictionary compare lhs.MaximumPrincipalCurvature() and rhs.MaximumPrincipalCurvature(). Values with nans sort last.

Parameters
lhs
rhs
Returns
-1, 0 or +1.

◆ CompareMaximumPrincipalCurvature()

static int ON_SurfaceCurvature::CompareMaximumPrincipalCurvature ( const ON_SurfaceCurvature lhs,
const ON_SurfaceCurvature rhs 
)
static

Compare lhs.MaximumPrincipalCurvature() and rhs.MaximumPrincipalCurvature(). Values with nans sort last.

Parameters
lhs
rhs
Returns
-1, 0 or +1.

◆ CompareMaximumRadius()

static int ON_SurfaceCurvature::CompareMaximumRadius ( const ON_SurfaceCurvature lhs,
const ON_SurfaceCurvature rhs 
)
static

Compare lhs.MaximumRadius() and rhs.MaximumRadius(). Values with nans sort last.

Parameters
lhs
rhs
Returns
-1, 0 or +1.

◆ CompareMeanCurvature()

static int ON_SurfaceCurvature::CompareMeanCurvature ( const ON_SurfaceCurvature lhs,
const ON_SurfaceCurvature rhs 
)
static

Compare lhs.MeanCurvature() and rhs.MeanCurvature(). Values with nans sort last.

Parameters
lhs
rhs
Returns
-1, 0 or +1.

◆ CompareMinimumPrincipalCurvature()

static int ON_SurfaceCurvature::CompareMinimumPrincipalCurvature ( const ON_SurfaceCurvature lhs,
const ON_SurfaceCurvature rhs 
)
static

Compare lhs.MinimumPrincipalCurvature() and rhs.MinimumPrincipalCurvature(). Values with nans sort last.

Parameters
lhs
rhs
Returns
-1, 0 or +1.

◆ CompareMinimumRadius()

static int ON_SurfaceCurvature::CompareMinimumRadius ( const ON_SurfaceCurvature lhs,
const ON_SurfaceCurvature rhs 
)
static

Compare lhs.MinimumRadius() and rhs.MinimumRadius(). Values with nans sort last.

Parameters
lhs
rhs
Returns
-1, 0 or +1.

◆ CreateFromGaussianAndMeanCurvatures()

static const ON_SurfaceCurvature ON_SurfaceCurvature::CreateFromGaussianAndMeanCurvatures ( double  gaussian_curvature,
double  mean_curvature 
)
static

Create an ON_SurfaceCurvature from a gaussian and mean curvature values using the relationsip between the principal curvatures, gaussian and mean. k1 = mean + sqrt(mean*mean - gaussian) k2 = 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 k1 = k2 = sign(mean)*sqrt(gaussian)

Parameters
gaussian_curvature

Gaussian curvature = k1*k2 (product of principal curvatures).

Parameters
mean_curvatureMean curvature = (k1+k2)/2 (average of principal curvatures).
Returns
A surface curvature with GaussianCurvature() = gaussian_curvature and MeanCurvature() = gaussian_curvature.

◆ CreateFromPrincipalCurvatures()

static const ON_SurfaceCurvature ON_SurfaceCurvature::CreateFromPrincipalCurvatures ( double  k1,
double  k2 
)
static

Create an ON_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. For example gaussian curvature = k1 * k2 and mean curvature = (k1 + k2)/2.

Parameters
k1
k2
Returns
An ON_SurfaceCurvature with the specified principal curvatures.

◆ FlipSurfaceOrientation()

const ON_SurfaceCurvature ON_SurfaceCurvature::FlipSurfaceOrientation ( ) const

The sign of the principal curvatures are with respect to a choice of surface orientation. This function returns the principal curvatures of the surface with opposite choice of orientation.

Returns
ON_SurfaceCurvature::CreateFromPrincipalCurvatures(-this->k2, -this->k1);

◆ GaussianCurvature()

double ON_SurfaceCurvature::GaussianCurvature ( ) const

The Gaussian curvature is k1*k2.

Returns
If this is set, the Gausian curvature is returned. Otherwise ON_DBL_QNAN is returned.

◆ IsNan()

bool ON_SurfaceCurvature::IsNan ( ) const

Returns
True if either of k1 or k2 is a nan.

◆ IsSet()

bool ON_SurfaceCurvature::IsSet ( ) const

Returns
True if k1 and k2 are both valid finite values.

◆ IsUnset()

bool ON_SurfaceCurvature::IsUnset ( ) const

Returns
True if either of k1 or k2 is not a valid finite value.

◆ IsZero()

bool ON_SurfaceCurvature::IsZero ( ) const

Returns
True if k1 and k2 are both zero.

◆ KappaValue()

double ON_SurfaceCurvature::KappaValue ( ON::curvature_style  kappa_style) const

Calculate one of the four typical curvature values associated with the two principal curvatures and frequently used in false color curvature analysis.

Parameters
kappa_styleSpecifies which type curvature (Gaussian, mean, ...) value to calculate from the principal curvatures. The Gausian curvature can be positive or negative. The other curvatures are are >= 0. In particular, ON::curvature_style::mean_curvature return fabs(this->MeanCurvature()).
Returns
If kappa_style and the principal curvatures are valid, the specified type of curvature value is returned. Infinte radii are returned as ON_SurfaceCurvature::InfinteRadius. Otherwise ON_DBL_QNAN is returned.

◆ MaximumPrincipalCurvature()

double ON_SurfaceCurvature::MaximumPrincipalCurvature ( ) const
Returns
If this is set, the maximum of k1 and k2 is returned. Otherwise ON_DBL_QNAN is returned.

◆ MaximumRadius()

double ON_SurfaceCurvature::MaximumRadius ( ) const

If a principal curvature value is zero or the principal curvatures have opposite signs, then the maximum radius of curvature is infinite and ON_SurfaceCurvature::InfinteRadius is returned. Otherwise the maximum radius of curvature is 1/min(fabs(k1),fabs(k2)).

Returns
IF k1 and k2 are valid, the maximum radius of curvature is returned. Otherwise ON_DBL_QNAN is returned.

◆ MeanCurvature()

double ON_SurfaceCurvature::MeanCurvature ( ) const

The mean curvature is (k1+k2)/2.

Returns
If this is set, the signed mean curvature is returned. Otherwise ON_DBL_QNAN is returned.

◆ MinimumPrincipalCurvature()

double ON_SurfaceCurvature::MinimumPrincipalCurvature ( ) const
Returns
If this is set, the minimum of k1 and k2. Otherwise ON_DBL_QNAN is returned.

◆ MinimumRadius()

double ON_SurfaceCurvature::MinimumRadius ( ) const

The minimum radius of curvature is 1/max(fabs(k1),fabs(k2)). Infinte radius values are returned as ON_SurfaceCurvature::InfinteRadius.

Returns
Minimum radius of curvature up to a maximum of 1e300. If both k1 and k2 are zero, then 1e300 is returned.

Member Data Documentation

◆ InfinteRadius

const double ON_SurfaceCurvature::InfinteRadius
static

Value used to indicate a radius of curvature is infinite (1e300).

◆ k1

double ON_SurfaceCurvature::k1

◆ k2

double ON_SurfaceCurvature::k2

principal curvatures

◆ Nan

const ON_SurfaceCurvature ON_SurfaceCurvature::Nan
static

k1 = k2 = ON_DBL_QNAN

◆ Zero

const ON_SurfaceCurvature ON_SurfaceCurvature::Zero
static

k1 = k2 = 0