OpenVSPAPI  3.20.0
Functions
XSecSurf Functions

This group of API functions provides capabilities related to the XSecSurf class in OpenVSP.

Click here to return to the main page. More...

Functions

int GetNumXSecSurfs (const string &in geom_id)
 
string GetXSecSurf (const string &in geom_id, int index)
 
int GetNumXSec (const string &in xsec_surf_id)
 
string GetXSec (const string &in xsec_surf_id, int xsec_index)
 
void ChangeXSecShape (const string &in xsec_surf_id, int xsec_index, int type)
 
void SetXSecSurfGlobalXForm (const string &in xsec_surf_id, const Matrix4d &in mat)
 
Matrix4d GetXSecSurfGlobalXForm (const string &in xsec_surf_id)
 

Detailed Description

Function Documentation

◆ ChangeXSecShape()

void ChangeXSecShape ( const string &in  xsec_surf_id,
int  xsec_index,
int  type 
)

Change the shape of a particular XSec, identified by an XSecSurf ID and XSec index

// Add Stack
string sid = AddGeom( "STACK", "" );
// Get First (and Only) XSec Surf
string xsec_surf = GetXSecSurf( sid, 0 );
// Set XSec 1 & 2 to Edit Curve type
ChangeXSecShape( xsec_surf, 1, XS_EDIT_CURVE );
ChangeXSecShape( xsec_surf, 2, XS_EDIT_CURVE );
See also
XSEC_CRV_TYPE
Parameters
[in]xsec_surf_idXSecSurf ID
[in]xsec_indexXsec index
[in]typeXsec type enum (i.e. XS_ELLIPSE)

◆ GetNumXSec()

int GetNumXSec ( const string &in  xsec_surf_id)

Get number of XSecs in an XSecSurf

// Add Stack
string sid = AddGeom( "STACK", "" );
// Get First (and Only) XSec Surf
string xsec_surf = GetXSecSurf( sid, 0 );
// Flatten ends
int num_xsecs = GetNumXSec( xsec_surf );
for ( int i = 0 ; i < num_xsecs ; i++ )
{
string xsec = GetXSec( xsec_surf, i );
SetXSecTanAngles( xsec, XSEC_BOTH_SIDES, 0 ); // Set Tangent Angles At Cross Section
SetXSecTanStrengths( xsec, XSEC_BOTH_SIDES, 0.0 ); // Set Tangent Strengths At Cross Section
}
Parameters
[in]xsec_surf_idXSecSurf ID
Returns
Number of XSecs

◆ GetNumXSecSurfs()

int GetNumXSecSurfs ( const string &in  geom_id)

Get the number of XSecSurfs for the specified Geom

//==== Add Fuselage Geometry ====//
string fuseid = AddGeom( "FUSELAGE", "" );
int num_xsec_surfs = GetNumXSecSurfs( fuseid );
if ( num_xsec_surfs != 1 ) { Print( "---> Error: API GetNumXSecSurfs " ); }
Parameters
[in]geom_idGeom ID
Returns
Number of XSecSurfs

◆ GetXSec()

string GetXSec ( const string &in  xsec_surf_id,
int  xsec_index 
)

Get Xsec ID for a particular XSecSurf at given index

// Add Stack
string sid = AddGeom( "STACK", "" );
// Get First (and Only) XSec Surf
string xsec_surf = GetXSecSurf( sid, 0 );
// Identify XSec 1
string xsec_1 = GetXSec( xsec_surf, 1 );
Parameters
[in]xsec_surf_idXSecSurf ID
[in]xsec_indexXsec index
Returns
Xsec ID

◆ GetXSecSurf()

string GetXSecSurf ( const string &in  geom_id,
int  index 
)

Get the XSecSurf ID for a particular Geom and XSecSurf index

// Add Stack
string sid = AddGeom( "STACK", "" );
// Get First (and Only) XSec Surf
string xsec_surf = GetXSecSurf( sid, 0 );
Parameters
[in]geom_idGeom ID
[in]indexXSecSurf index
Returns
XSecSurf ID

◆ GetXSecSurfGlobalXForm()

Matrix4d GetXSecSurfGlobalXForm ( const string &in  xsec_surf_id)

Get the global surface transform matrix for given XSecSurf

Parameters
[in]xsec_surf_idXSecSurf ID
Returns
Transformation matrix

◆ SetXSecSurfGlobalXForm()

void SetXSecSurfGlobalXForm ( const string &in  xsec_surf_id,
const Matrix4d &in  mat 
)

Set the global surface transform matrix for given XSecSurf

Parameters
[in]xsec_surf_idXSecSurf ID
[in]matTransformation matrix
SetXSecTanStrengths
void SetXSecTanStrengths(const string &in xsec_id, int side, double top, double right=- 1.0e12, double bottom=- 1.0e12, double left=- 1.0e12)
GetNumXSecSurfs
int GetNumXSecSurfs(const string &in geom_id)
XS_EDIT_CURVE
Definition: openvsp_as.h:2123
XSEC_BOTH_SIDES
Definition: openvsp_as.h:2140
GetXSec
string GetXSec(const string &in xsec_surf_id, int xsec_index)
ChangeXSecShape
void ChangeXSecShape(const string &in xsec_surf_id, int xsec_index, int type)
GetXSecSurf
string GetXSecSurf(const string &in geom_id, int index)
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
SetXSecTanAngles
void SetXSecTanAngles(const string &in xsec_id, int side, double top, double right=- 1.0e12, double bottom=- 1.0e12, double left=- 1.0e12)
Print
void Print(const string &in data, bool new_line=true)
GetNumXSec
int GetNumXSec(const string &in xsec_surf_id)