OpenVSP API Documentation 3.51.3
Loading...
Searching...
No Matches
BOR Functions

This group of API functions provides capabilities related to the body of revolution (BOR) geometry type in OpenVSP. Click here to return to the main page. More...

Functions

void vsp::ChangeBORXSecShape (const std::string &bor_id, int type)
int vsp::GetBORXSecShape (const std::string &bor_id)
std::vector< vec3dvsp::ReadBORFileXSec (const std::string &bor_id, const std::string &file_name)
std::vector< vec3dvsp::GetBORXSecPnts (const std::string &bor_id)
vec3d vsp::ComputeBORXSecPnt (const std::string &bor_id, double fract)
vec3d vsp::ComputeBORXSecTan (const std::string &bor_id, double fract)
void vsp::ReadBORFileAirfoil (const std::string &bor_id, const std::string &file_name)
void vsp::SetBORAirfoilUpperPnts (const std::string &bor_id, const std::vector< vec3d > &up_pnt_vec)
void vsp::SetBORAirfoilLowerPnts (const std::string &bor_id, const std::vector< vec3d > &low_pnt_vec)
void vsp::SetBORAirfoilPnts (const std::string &bor_id, const std::vector< vec3d > &up_pnt_vec, const std::vector< vec3d > &low_pnt_vec)
std::vector< vec3dvsp::GetBORAirfoilUpperPnts (const std::string &bor_id)
std::vector< vec3dvsp::GetBORAirfoilLowerPnts (const std::string &bor_id)
std::vector< double > vsp::GetBORUpperCSTCoefs (const std::string &bor_id)
std::vector< double > vsp::GetBORLowerCSTCoefs (const std::string &bor_id)
int vsp::GetBORUpperCSTDegree (const std::string &bor_id)
int vsp::GetBORLowerCSTDegree (const std::string &bor_id)
void vsp::SetBORUpperCST (const std::string &bor_id, int deg, const std::vector< double > &coefs)
void vsp::SetBORLowerCST (const std::string &bor_id, int deg, const std::vector< double > &coefs)
void vsp::PromoteBORCSTUpper (const std::string &bor_id)
void vsp::PromoteBORCSTLower (const std::string &bor_id)
void vsp::DemoteBORCSTUpper (const std::string &bor_id)
void vsp::DemoteBORCSTLower (const std::string &bor_id)
void vsp::FitBORAfCST (const std::string &bor_id, int deg)

Detailed Description

Function Documentation

◆ ChangeBORXSecShape()

void vsp::ChangeBORXSecShape ( const std::string & bor_id,
int type )
extern

Set the XSec type for a BOR component

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
if ( GetBORXSecShape( bor_id ) != XS_ROUNDED_RECTANGLE ) { Print( "ERROR: ChangeBORXSecShape" ); __failure++; }
void ChangeBORXSecShape(const std::string &bor_id, int type)
int GetBORXSecShape(const std::string &bor_id)
@ XS_ROUNDED_RECTANGLE
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
See also
XSEC_CRV_TYPE
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]typeint XSec type enum (i.e. XS_ROUNDED_RECTANGLE)

◆ ComputeBORXSecPnt()

vec3d vsp::ComputeBORXSecPnt ( const std::string & bor_id,
double fract )
extern

Compute 3D coordinate for a point on a BOR XSecCurve given the parameter value (U) along the curve

//==== Add Geom ====//
// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
double u_fract = 0.25;
vec3d pnt = ComputeBORXSecPnt( bor_id, u_fract );
// The section is a closed curve, so the ends meet.
if ( dist( ComputeBORXSecPnt( bor_id, 0.0 ), ComputeBORXSecPnt( bor_id, 1.0 ) ) > 1e-6 )
{
Print( "ERROR: the BOR section does not close" );
__failure++;
}
// The section lies in a plane of constant Z.
if ( !closeTo( pnt.z(), ComputeBORXSecPnt( bor_id, 0.0 ).z(), 1e-9 ) )
{
Print( "ERROR: the BOR section is not planar" );
__failure++;
}
// Walking the curve has to move, not sit still.
if ( dist( pnt, ComputeBORXSecPnt( bor_id, u_fract + 0.25 ) ) < 1e-9 )
{
Print( "ERROR: ComputeBORXSecPnt does not advance along the curve" );
__failure++;
}
Definition Vec3d.h:243
double z() const
Definition Vec3d.h:514
vec3d ComputeBORXSecPnt(const std::string &bor_id, double fract)
double dist(const vec3d &a, const vec3d &b)
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]fractdouble Curve parameter value (range: 0 - 1)
Returns
vec3d Coordinate point on curve

◆ ComputeBORXSecTan()

vec3d vsp::ComputeBORXSecTan ( const std::string & bor_id,
double fract )
extern

Compute the tangent vector of a point on a BOR XSecCurve given the parameter value (U) along the curve

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
double u_fract = 0.25;
vec3d tan = ComputeBORXSecTan( bor_id, u_fract );
// A tangent is a direction, so it has to have some length.
if ( tan.mag() < 1e-9 )
{
Print( "ERROR: ComputeBORXSecTan returned a degenerate tangent" );
__failure++;
}
// The tangent has to follow the curve, so stepping along the curve from the
// point has to line up with it.
double du = 1.0e-5;
vec3d fd = ComputeBORXSecPnt( bor_id, u_fract + du ) - ComputeBORXSecPnt( bor_id, u_fract );
if ( fd.mag() < 1e-12 )
{
Print( "ERROR: the BOR section does not advance" );
__failure++;
}
else if ( dot( fd, tan ) / ( fd.mag() * tan.mag() ) < 0.999 )
{
Print( "ERROR: ComputeBORXSecTan does not follow the curve" );
__failure++;
}
double mag() const
vec3d ComputeBORXSecTan(const std::string &bor_id, double fract)
double dot(const vec3d &a, const vec3d &b)
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]fractdouble Curve parameter value (range: 0 - 1)
Returns
vec3d Tangent vector on curve

◆ DemoteBORCSTLower()

void vsp::DemoteBORCSTLower ( const std::string & bor_id)
extern

Demote the CST for the lower airfoil surface of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL

See also
GetLowerCSTDegree
Parameters
[in]bor_idstring Body of revolution Geom ID

◆ DemoteBORCSTUpper()

void vsp::DemoteBORCSTUpper ( const std::string & bor_id)
extern

Demote the CST for the upper airfoil surface of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL

See also
GetUpperCSTDegree
Parameters
[in]bor_idstring Body of revolution Geom ID

◆ FitBORAfCST()

void vsp::FitBORAfCST ( const std::string & bor_id,
int deg )
extern

Fit a CST airfoil for an existing airfoil of a BOR of type XS_FOUR_SERIES, XS_SIX_SERIES, XS_FOUR_DIGIT_MOD, XS_FIVE_DIGIT, XS_FIVE_DIGIT_MOD, XS_ONE_SIX_SERIES, or XS_FILE_AIRFOIL.

Parameters
[in]bor_idstring Body of revolution Geom ID
[in]degint CST degree

◆ GetBORAirfoilLowerPnts()

std::vector< vec3d > vsp::GetBORAirfoilLowerPnts ( const std::string & bor_id)
extern

Get the coordinate points for the lower surface of an airfoil of a BOR. The XSecCurve must be of type XS_FILE_AIRFOIL

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" );
array< vec3d > @low_array = GetBORAirfoilLowerPnts( bor_id );
if ( low_array.length() == 0 )
{
Print( "ERROR: GetBORAirfoilLowerPnts returned nothing" );
__failure++;
}
void ReadBORFileAirfoil(const std::string &bor_id, const std::string &file_name)
std::vector< vec3d > GetBORAirfoilLowerPnts(const std::string &bor_id)
@ XS_FILE_AIRFOIL
See also
SetAirfoilPnts
Parameters
[in]bor_idstring Body of revolution Geom ID
Returns
vector<vec3d> Vector of coordinate points for the lower airfoil surface

◆ GetBORAirfoilUpperPnts()

std::vector< vec3d > vsp::GetBORAirfoilUpperPnts ( const std::string & bor_id)
extern

Get the coordinate points for the upper surface of an airfoil on a BOR. The BOR XSecCurve must be of type XS_FILE_AIRFOIL

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" );
array< vec3d > @up_array = GetBORAirfoilUpperPnts( bor_id );
if ( up_array.length() == 0 )
{
Print( "ERROR: GetBORAirfoilUpperPnts returned nothing" );
__failure++;
}
std::vector< vec3d > GetBORAirfoilUpperPnts(const std::string &bor_id)
See also
SetAirfoilPnts
Parameters
[in]bor_idstring Body of revolution Geom ID
Returns
vector<vec3d> Vector of coordinate points for the upper airfoil surface

◆ GetBORLowerCSTCoefs()

std::vector< double > vsp::GetBORLowerCSTCoefs ( const std::string & bor_id)
extern

Get the CST coefficients for the lower surface of an airfoil of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL

See also
SetLowerCST
Parameters
[in]bor_idstring Body of revolution Geom ID
Returns
vector<double> Vector of CST coefficients for the lower airfoil surface

◆ GetBORLowerCSTDegree()

int vsp::GetBORLowerCSTDegree ( const std::string & bor_id)
extern

Get the CST degree for the lower surface of an airfoil of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL

See also
SetLowerCST
Parameters
[in]bor_idstring Body of revolution Geom ID
Returns
int CST Degree for lower airfoil surface

◆ GetBORUpperCSTCoefs()

std::vector< double > vsp::GetBORUpperCSTCoefs ( const std::string & bor_id)
extern

Get the CST coefficients for the upper surface of an airfoil of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL

See also
SetUpperCST
Parameters
[in]bor_idstring Body of revolution Geom ID
Returns
vector<double> Vector of CST coefficients for the upper airfoil surface

◆ GetBORUpperCSTDegree()

int vsp::GetBORUpperCSTDegree ( const std::string & bor_id)
extern

Get the CST degree for the upper surface of an airfoil of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL

See also
SetUpperCST
Parameters
[in]bor_idstring Body of revolution Geom ID
Returns
int CST Degree for upper airfoil surface

◆ GetBORXSecPnts()

std::vector< vec3d > vsp::GetBORXSecPnts ( const std::string & bor_id)
extern

Set the coordinate points for a specific BOR. The BOR XSecCurve must be of type XS_FILE_FUSE.

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
array< vec3d > @vec_array = ReadBORFileXSec( bor_id, "TestXSec.fxs" );
vec3d before = ComputeBORXSecPnt( bor_id, 0.0 );
if ( vec_array.size() == 0 )
{
Print( "ERROR: ReadBORFileXSec returned no points" );
__failure++;
}
else
{
vec_array[1] = vec_array[1] * 2.0;
vec_array[3] = vec_array[3] * 2.0;
SetBORXSecPnts( bor_id, vec_array );
Update();
vec3d after = ComputeBORXSecPnt( bor_id, 0.0 );
// Points 1 and 3 are the top and bottom of the diamond read from file,
// so doubling them doubles the height of the section while leaving its
// width alone. The section is normalized to the body diameter by its
// height, so the section grows half as wide as it was.
if ( !closeTo( after.x(), 0.5 * before.x(), 1e-6 ) )
{
Print( "ERROR: SetBORXSecPnts did not reshape the section" );
__failure++;
}
}
double x() const
Definition Vec3d.h:440
std::vector< vec3d > ReadBORFileXSec(const std::string &bor_id, const std::string &file_name)
@ XS_FILE_FUSE
void Update(bool update_managers=true)
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]pnt_vecvector<vec3d> Vector of XSec coordinate points

Get the coordinate points for a specific BOR. The BOR XSecCurve must be of type XS_FILE_FUSE. The points are returned normalized to the section's width and height.

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
array< vec3d > @vec_array = ReadBORFileXSec( bor_id, "TestXSec.fxs" );
// The points that were read are the points the section is carrying.
array< vec3d > @check_array = GetBORXSecPnts( bor_id );
if ( check_array.size() == 0 )
{
Print( "ERROR: GetBORXSecPnts returned nothing" );
__failure++;
}
else
{
// The stored points are normalized, so they fit in the unit box, and the
// curve closes on itself.
for ( int i = 0; i < int( check_array.size() ); i++ )
{
if ( abs( check_array[i].x() ) > 0.5 + 1e-9 || abs( check_array[i].y() ) > 0.5 + 1e-9 )
{
Print( "ERROR: GetBORXSecPnts returned a point outside the unit box" );
__failure++;
}
}
if ( dist( check_array[0], check_array[check_array.size() - 1] ) > 1e-8 )
{
Print( "ERROR: GetBORXSecPnts returned an open curve" );
__failure++;
}
}
std::vector< vec3d > GetBORXSecPnts(const std::string &bor_id)
See also
SetBORXSecPnts, ReadBORFileXSec
Parameters
[in]bor_idstring Body of revolution Geom ID
Returns
vector<vec3d> Vector of XSec coordinate points

◆ GetBORXSecShape()

int vsp::GetBORXSecShape ( const std::string & bor_id)
extern

Get the XSec type for a BOR component

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
if ( GetBORXSecShape( bor_id ) != XS_ROUNDED_RECTANGLE ) { Print( "ERROR: GetBORXSecShape" ); __failure++; }
Parameters
[in]bor_idstring Body of revolution Geom ID
Returns
int XSec type enum (i.e. XS_ROUNDED_RECTANGLE)

◆ PromoteBORCSTLower()

void vsp::PromoteBORCSTLower ( const std::string & bor_id)
extern

Promote the CST for the lower airfoil surface of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL

See also
GetLowerCSTDegree
Parameters
[in]bor_idstring Body of revolution Geom ID

◆ PromoteBORCSTUpper()

void vsp::PromoteBORCSTUpper ( const std::string & bor_id)
extern

Promote the CST for the upper airfoil surface of a BOR. The XSecCurve must be of type XS_CST_AIRFOIL

See also
GetUpperCSTDegree
Parameters
[in]bor_idstring Body of revolution Geom ID

◆ ReadBORFileAirfoil()

void vsp::ReadBORFileAirfoil ( const std::string & bor_id,
const std::string & file_name )
extern

Read in shape from airfoil file and set to the specified BOR XSecCurve. The XSecCurve must be of type XS_FILE_AIRFOIL. Airfoil files may be in Lednicer or Selig format with \*.af or \*.dat extensions.

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" );
array< vec3d > @up_array = GetBORAirfoilUpperPnts( bor_id );
array< vec3d > @low_array = GetBORAirfoilLowerPnts( bor_id );
if ( up_array.size() == 0 || up_array.size() != low_array.size() )
{
Print( "ERROR: ReadBORFileAirfoil did not read matching surfaces" );
__failure++;
}
else
{
// The points run from the leading edge to the trailing edge on a unit
// chord, and a NACA 0012 is symmetric top to bottom.
if ( !closeTo( up_array[0].x(), 0.0, 1e-6 ) ||
!closeTo( up_array[up_array.size() - 1].x(), 1.0, 1e-6 ) )
{
Print( "ERROR: ReadBORFileAirfoil did not normalize the chord" );
__failure++;
}
double max_up = 0.0;
for ( int i = 0; i < int( up_array.size() ); i++ )
{
if ( !closeTo( low_array[i].y(), -up_array[i].y(), 1e-6 ) )
{
Print( "ERROR: ReadBORFileAirfoil did not read a symmetric section" );
__failure++;
}
if ( up_array[i].y() > max_up )
{
max_up = up_array[i].y();
}
}
if ( !closeTo( 2.0 * max_up, 0.12, 1e-3 ) )
{
Print( "ERROR: ReadBORFileAirfoil did not read a twelve percent section" );
__failure++;
}
}
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]file_namestring Airfoil XSec file name

◆ ReadBORFileXSec()

std::vector< vec3d > vsp::ReadBORFileXSec ( const std::string & bor_id,
const std::string & file_name )
extern

Set the coordinate points for a specific BOR. The BOR XSecCurve must be of type XS_FILE_FUSE.

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
array< vec3d > @vec_array = ReadBORFileXSec( bor_id, "TestXSec.fxs" );
// The file holds a closed curve, and the section it produced is the one the
// body is now built on.
if ( vec_array.size() < 3 )
{
Print( "ERROR: ReadBORFileXSec returned too few points" );
__failure++;
}
else if ( dist( vec_array[0], vec_array[vec_array.size() - 1] ) > 1e-8 )
{
Print( "ERROR: ReadBORFileXSec returned an open curve" );
__failure++;
}
if ( GetBORXSecShape( bor_id ) != XS_FILE_FUSE )
{
Print( "ERROR: ReadBORFileXSec changed the section type" );
__failure++;
}
// The section curve closes on itself.
if ( dist( ComputeBORXSecPnt( bor_id, 0.0 ), ComputeBORXSecPnt( bor_id, 1.0 ) ) > 1e-6 )
{
Print( "ERROR: the BOR section does not close" );
__failure++;
}
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]file_namestring Fuselage XSec file name
Returns
vector<vec3d> Array of coordinate points read from the file and set to the XSec

◆ SetBORAirfoilLowerPnts()

void vsp::SetBORAirfoilLowerPnts ( const std::string & bor_id,
const std::vector< vec3d > & low_pnt_vec )
extern

Set the lower points for an airfoil on a BOR. The BOR XSecCurve must be of type XS_FILE_AIRFOIL.

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" );
array< vec3d > @low_array = GetBORAirfoilLowerPnts( bor_id );
for ( int i = 0 ; i < int( low_array.size() ) ; i++ )
{
low_array[i].scale_y( 0.5 );
}
SetBORAirfoilLowerPnts( bor_id, low_array );
// The halved lower surface has to come back halved, and the upper surface
// has to be left alone.
array< vec3d > @check_array = GetBORAirfoilLowerPnts( bor_id );
array< vec3d > @up_array = GetBORAirfoilUpperPnts( bor_id );
if ( check_array.size() != low_array.size() )
{
Print( "ERROR: SetBORAirfoilLowerPnts point count" );
__failure++;
}
else
{
double max_up = 0.0;
double min_low = 0.0;
for ( int i = 0; i < int( low_array.size() ); i++ )
{
if ( dist( check_array[i], low_array[i] ) > 1e-6 )
{
Print( "ERROR: SetBORAirfoilLowerPnts did not store point " + i );
__failure++;
}
if ( up_array[i].y() > max_up ) { max_up = up_array[i].y(); }
if ( check_array[i].y() < min_low ) { min_low = check_array[i].y(); }
}
if ( !closeTo( 0.5 * max_up, -min_low, 1e-6 ) )
{
Print( "ERROR: SetBORAirfoilLowerPnts did not leave the upper surface alone" );
__failure++;
}
}
void SetBORAirfoilLowerPnts(const std::string &bor_id, const std::vector< vec3d > &low_pnt_vec)
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]low_pnt_vecvector<vec3d> Vector of points defining the lower surface of the airfoil

◆ SetBORAirfoilPnts()

void vsp::SetBORAirfoilPnts ( const std::string & bor_id,
const std::vector< vec3d > & up_pnt_vec,
const std::vector< vec3d > & low_pnt_vec )
extern

Set the upper and lower points for an airfoil on a BOR. The BOR XSecCurve must be of type XS_FILE_AIRFOIL.

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" );
array< vec3d > @up_array = GetBORAirfoilUpperPnts( bor_id );
array< vec3d > @low_array = GetBORAirfoilLowerPnts( bor_id );
for ( int i = 0 ; i < int( up_array.size() ) ; i++ )
{
up_array[i].scale_y( 2.0 );
low_array[i].scale_y( 0.5 );
}
SetBORAirfoilPnts( bor_id, up_array, low_array );
array< vec3d > @check_up = GetBORAirfoilUpperPnts( bor_id );
array< vec3d > @check_low = GetBORAirfoilLowerPnts( bor_id );
if ( check_up.size() != up_array.size() || check_low.size() != low_array.size() )
{
Print( "ERROR: SetBORAirfoilPnts point count" );
__failure++;
}
else
{
double max_up = 0.0;
double min_low = 0.0;
for ( int i = 0; i < int( up_array.size() ); i++ )
{
if ( dist( check_up[i], up_array[i] ) > 1e-6 || dist( check_low[i], low_array[i] ) > 1e-6 )
{
Print( "ERROR: SetBORAirfoilPnts did not store point " + i );
__failure++;
}
if ( check_up[i].y() > max_up ) { max_up = check_up[i].y(); }
if ( check_low[i].y() < min_low ) { min_low = check_low[i].y(); }
}
// The section started symmetric; doubling the top and halving the
// bottom leaves the top four times as deep as the bottom.
if ( !closeTo( max_up, -4.0 * min_low, 1e-6 ) )
{
Print( "ERROR: SetBORAirfoilPnts did not scale the two surfaces apart" );
__failure++;
}
}
void SetBORAirfoilPnts(const std::string &bor_id, const std::vector< vec3d > &up_pnt_vec, const std::vector< vec3d > &low_pnt_vec)
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]up_pnt_vecvector<vec3d> Vector of points defining the upper surface of the airfoil
[in]low_pnt_vecvector<_>vec3d> Vector of points defining the lower surface of the airfoil

◆ SetBORAirfoilUpperPnts()

void vsp::SetBORAirfoilUpperPnts ( const std::string & bor_id,
const std::vector< vec3d > & up_pnt_vec )
extern

Set the upper points for an airfoil on a BOR. The BOR XSecCurve must be of type XS_FILE_AIRFOIL.

// Add Body of Recolution
string bor_id = AddGeom( "BODYOFREVOLUTION", "" );
ReadBORFileAirfoil( bor_id, "airfoil/N0012_VSP.af" );
array< vec3d > @up_array = GetBORAirfoilUpperPnts( bor_id );
for ( int i = 0 ; i < int( up_array.size() ) ; i++ )
{
up_array[i].scale_y( 2.0 );
}
SetBORAirfoilUpperPnts( bor_id, up_array );
// The doubled upper surface has to come back doubled, and the lower surface
// has to be left alone.
array< vec3d > @check_array = GetBORAirfoilUpperPnts( bor_id );
array< vec3d > @low_array = GetBORAirfoilLowerPnts( bor_id );
if ( check_array.size() != up_array.size() )
{
Print( "ERROR: SetBORAirfoilUpperPnts point count" );
__failure++;
}
else
{
double max_up = 0.0;
double min_low = 0.0;
for ( int i = 0; i < int( up_array.size() ); i++ )
{
if ( dist( check_array[i], up_array[i] ) > 1e-6 )
{
Print( "ERROR: SetBORAirfoilUpperPnts did not store point " + i );
__failure++;
}
if ( check_array[i].y() > max_up ) { max_up = check_array[i].y(); }
if ( low_array[i].y() < min_low ) { min_low = low_array[i].y(); }
}
if ( !closeTo( max_up, -2.0 * min_low, 1e-6 ) )
{
Print( "ERROR: SetBORAirfoilUpperPnts did not leave the lower surface alone" );
__failure++;
}
}
void SetBORAirfoilUpperPnts(const std::string &bor_id, const std::vector< vec3d > &up_pnt_vec)
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]up_pnt_vecvector<vec3d> Vector of points defining the upper surface of the airfoil

◆ SetBORLowerCST()

void vsp::SetBORLowerCST ( const std::string & bor_id,
int deg,
const std::vector< double > & coefs )
extern

Set the CST degree and coefficients for the lower surface of an airfoil of a BOR. The number of coefficients should be one more than the CST degree. The XSecCurve must be of type XS_CST_AIRFOIL

See also
GetLowerCSTDegree, GetLowerCSTCoefs
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]degint CST degree of lower airfoil surface
[in]coefsvector<double> Vector of CST coefficients for the lower airfoil surface

◆ SetBORUpperCST()

void vsp::SetBORUpperCST ( const std::string & bor_id,
int deg,
const std::vector< double > & coefs )
extern

Set the CST degree and coefficients for the upper surface of an airfoil of a BOR. The number of coefficients should be one more than the CST degree. The XSecCurve must be of type XS_CST_AIRFOIL

See also
GetUpperCSTDegree, GetUpperCSTCoefs
Parameters
[in]bor_idstring Body of revolution Geom ID
[in]degint CST degree of upper airfoil surface
[in]coefsvector<double> Array of CST coefficients for the upper airfoil surface