OpenVSPAPI  3.28.0
Functions
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 ChangeBORXSecShape (const string &in geom_id, int type)
 
int GetBORXSecShape (const string &in geom_id)
 
vec3d[] ReadBORFileXSec (const string &in bor_id, const string &in file_name)
 
void SetBORXSecPnts (const string &in bor_id, vec3d[]@ pnt_arr)
 
vec3d ComputeBORXSecPnt (const string &in bor_id, double fract)
 
vec3d ComputeBORXSecTan (const string &in bor_id, double fract)
 
void ReadBORFileAirfoil (const string &in bor_id, const string &in file_name)
 
void SetBORAirfoilUpperPnts (const string &in bor_id, vec3d[]@ up_pnt_vec)
 
void SetBORAirfoilLowerPnts (const string &in bor_id, vec3d[]@ low_pnt_vec)
 
void SetBORAirfoilPnts (const string &in bor_id, vec3d[]@ up_pnt_vec, vec3d[]@ low_pnt_vec)
 
vec3d[] GetBORAirfoilUpperPnts (const string &in bor_id)
 
vec3d[] GetBORAirfoilLowerPnts (const string &in bor_id)
 
double[] GetBORUpperCSTCoefs (const string &in bor_id)
 
double[] GetBORLowerCSTCoefs (const string &in bor_id)
 
int GetBORUpperCSTDegree (const string &in bor_id)
 
int GetBORLowerCSTDegree (const string &in bor_id)
 
void SetBORUpperCST (const string &in bor_id, int deg, double[]@ coeff_arr)
 
void SetBORLowerCST (const string &in bor_id, int deg, double[]@ coeff_arr)
 
void PromoteBORCSTUpper (const string &in bor_id)
 
void PromoteBORCSTLower (const string &in bor_id)
 
void DemoteBORCSTUpper (const string &in bor_id)
 
void DemoteBORCSTLower (const string &in bor_id)
 
void FitBORAfCST (const string &in bor_id, int deg)
 

Detailed Description

Function Documentation

◆ ChangeBORXSecShape()

void ChangeBORXSecShape ( const string &in  geom_id,
int  type 
)

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" ); }
See also
XSEC_CRV_TYPE
Parameters
[in]geom_idGeom ID
[in]typeXSec type enum (i.e. XS_ROUNDED_RECTANGLE)

◆ ComputeBORXSecPnt()

vec3d ComputeBORXSecPnt ( const string &in  bor_id,
double  fract 
)

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 );
Parameters
[in]bor_idGeom ID of BOR
[in]fractCurve parameter value (range: 0 - 1)
Returns
3D coordinate point

◆ ComputeBORXSecTan()

vec3d ComputeBORXSecTan ( const string &in  bor_id,
double  fract 
)

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 );
Parameters
[in]bor_idGeom ID of BOR
[in]fractCurve parameter value (range: 0 - 1)
Returns
Tangent vector

◆ DemoteBORCSTLower()

void DemoteBORCSTLower ( const string &in  bor_id)

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_idGeom ID of BOR

◆ DemoteBORCSTUpper()

void DemoteBORCSTUpper ( const string &in  bor_id)

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_idGeom ID of BOR

◆ FitBORAfCST()

void FitBORAfCST ( const string &in  bor_id,
int  deg 
)

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_idGeom ID of BOR
[in]degCST degree

◆ GetBORAirfoilLowerPnts()

vec3d [] GetBORAirfoilLowerPnts ( const string &in  bor_id)

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 );
See also
SetAirfoilPnts
Parameters
[in]bor_idGeom ID of BOR
Returns
Array of coordinate points for the lower airfoil surface

◆ GetBORAirfoilUpperPnts()

vec3d [] GetBORAirfoilUpperPnts ( const string &in  bor_id)

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 );
See also
SetAirfoilPnts
Parameters
[in]bor_idGeom ID of BOR
Returns
Array of coordinate points for the upper airfoil surface

◆ GetBORLowerCSTCoefs()

double [] GetBORLowerCSTCoefs ( const string &in  bor_id)

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_idGeom ID of BOR
Returns
Array of CST coefficients for the lower airfoil surface

◆ GetBORLowerCSTDegree()

int GetBORLowerCSTDegree ( const string &in  bor_id)

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_idGeom ID of BOR
Returns
CST Degree for lower airfoil surface

◆ GetBORUpperCSTCoefs()

double [] GetBORUpperCSTCoefs ( const string &in  bor_id)

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_idGeom ID of BOR
Returns
Array of CST coefficients for the upper airfoil surface

◆ GetBORUpperCSTDegree()

int GetBORUpperCSTDegree ( const string &in  bor_id)

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_idGeom ID of BOR
Returns
CST Degree for upper airfoil surface

◆ GetBORXSecShape()

int GetBORXSecShape ( const string &in  geom_id)

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" ); }
Parameters
[in]geom_idGeom ID
Returns
XSec type enum (i.e. XS_ROUNDED_RECTANGLE)

◆ PromoteBORCSTLower()

void PromoteBORCSTLower ( const string &in  bor_id)

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_idGeom ID of BOR

◆ PromoteBORCSTUpper()

void PromoteBORCSTUpper ( const string &in  bor_id)

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_idGeom ID of BOR

◆ ReadBORFileAirfoil()

void ReadBORFileAirfoil ( const string &in  bor_id,
const string &in  file_name 
)

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" );
Parameters
[in]bor_idGeom ID of BOR
[in]file_nameAirfoil XSec file name

◆ ReadBORFileXSec()

vec3d [] ReadBORFileXSec ( const string &in  bor_id,
const string &in  file_name 
)

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" );
Parameters
[in]bor_idGeom ID of BOR
[in]file_nameFuselage XSec file name
Returns
Array of coordinate points read from the file and set to the XSec

◆ SetBORAirfoilLowerPnts()

void SetBORAirfoilLowerPnts ( const string &in  bor_id,
vec3d@[]  low_pnt_vec 
)

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 );
Parameters
[in]bor_idGeom ID of BOR
[in]low_pnt_vecArray of points defining the lower surface of the airfoil

◆ SetBORAirfoilPnts()

void SetBORAirfoilPnts ( const string &in  bor_id,
vec3d@[]  up_pnt_vec,
vec3d@[]  low_pnt_vec 
)

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 );
Parameters
[in]bor_idGeom ID of BOR
[in]up_pnt_vecArray of points defining the upper surface of the airfoil
[in]low_pnt_vecArray of points defining the lower surface of the airfoil

◆ SetBORAirfoilUpperPnts()

void SetBORAirfoilUpperPnts ( const string &in  bor_id,
vec3d@[]  up_pnt_vec 
)

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 );
Parameters
[in]bor_idGeom ID of BOR
[in]up_pnt_vecArray of points defining the upper surface of the airfoil

◆ SetBORLowerCST()

void SetBORLowerCST ( const string &in  bor_id,
int  deg,
double@[]  coeff_arr 
)

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_idGeom ID of BOR
[in]degCST degree of lower airfoil surface
[in]coeff_arrArray of CST coefficients for the lower airfoil surface

◆ SetBORUpperCST()

void SetBORUpperCST ( const string &in  bor_id,
int  deg,
double@[]  coeff_arr 
)

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_idGeom ID of BOR
[in]degCST degree of upper airfoil surface
[in]coeff_arrArray of CST coefficients for the upper airfoil surface

◆ SetBORXSecPnts()

void SetBORXSecPnts ( const string &in  bor_id,
vec3d@[]  pnt_arr 
)

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" );
if ( vec_array.size() > 0 )
{
vec_array[1] = vec_array[1] * 2.0;
vec_array[3] = vec_array[3] * 2.0;
SetBORXSecPnts( bor_id, vec_array );
}
Parameters
[in]bor_idGeom ID of BOR
[in]pnt_arrArray of XSec coordinate points
XS_FILE_AIRFOIL
@ XS_FILE_AIRFOIL
Definition: openvsp_as.h:2264
XS_ROUNDED_RECTANGLE
@ XS_ROUNDED_RECTANGLE
Definition: openvsp_as.h:2256
GetBORXSecShape
int GetBORXSecShape(const string &in geom_id)
GetBORAirfoilLowerPnts
vec3d[] GetBORAirfoilLowerPnts(const string &in bor_id)
ReadBORFileAirfoil
void ReadBORFileAirfoil(const string &in bor_id, const string &in file_name)
ComputeBORXSecTan
vec3d ComputeBORXSecTan(const string &in bor_id, double fract)
SetBORXSecPnts
void SetBORXSecPnts(const string &in bor_id, vec3d[]@ pnt_arr)
vec3d
A class for representing 3D vectors.
Definition: openvsp_as.h:345
ReadBORFileXSec
vec3d[] ReadBORFileXSec(const string &in bor_id, const string &in file_name)
SetBORAirfoilPnts
void SetBORAirfoilPnts(const string &in bor_id, vec3d[]@ up_pnt_vec, vec3d[]@ low_pnt_vec)
SetBORAirfoilLowerPnts
void SetBORAirfoilLowerPnts(const string &in bor_id, vec3d[]@ low_pnt_vec)
array
AngelScript ScriptExtension for representing the C++ std::vector.
Definition: openvsp_as.h:249
ComputeBORXSecPnt
vec3d ComputeBORXSecPnt(const string &in bor_id, double fract)
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
Print
void Print(const string &in data, bool new_line=true)
ChangeBORXSecShape
void ChangeBORXSecShape(const string &in geom_id, int type)
XS_FILE_FUSE
@ XS_FILE_FUSE
Definition: openvsp_as.h:2258
GetBORAirfoilUpperPnts
vec3d[] GetBORAirfoilUpperPnts(const string &in bor_id)
SetBORAirfoilUpperPnts
void SetBORAirfoilUpperPnts(const string &in bor_id, vec3d[]@ up_pnt_vec)