The following group of API functions may be used to control parametric propeller blade curves (PCurves). Click here to return to the main page.
More...
|
| void | vsp::SetPCurve (const std::string &geom_id, const int &pcurveid, const std::vector< double > &tvec, const std::vector< double > &valvec, const int &newtype) |
| void | vsp::PCurveConvertTo (const std::string &geom_id, const int &pcurveid, const int &newtype) |
| int | vsp::PCurveGetType (const std::string &geom_id, const int &pcurveid) |
| std::vector< double > | vsp::PCurveGetTVec (const std::string &geom_id, const int &pcurveid) |
| std::vector< double > | vsp::PCurveGetValVec (const std::string &geom_id, const int &pcurveid) |
| void | vsp::PCurveDeletePt (const std::string &geom_id, const int &pcurveid, const int &indx) |
| int | vsp::PCurveSplit (const std::string &geom_id, const int &pcurveid, const double &tsplit) |
| void | vsp::ApproximateAllPropellerPCurves (const std::string &geom_id) |
| void | vsp::ResetPropellerThicknessCurve (const std::string &geom_id) |
◆ ApproximateAllPropellerPCurves()
| void vsp::ApproximateAllPropellerPCurves |
( |
const std::string & | geom_id | ) |
|
|
extern |
Approximate all propeller blade curves with cubic Bezier curves.
string prop =
AddGeom(
"PROP",
"" );
{
Print(
"ERROR: the blade curves would not convert to PCHIP" );
__failure++;
}
{
Print(
"ERROR: ApproximateAllPropellerPCurves did not convert the curves" );
__failure++;
}
if ( tvec.size() < 4 || ( tvec.size() - 1 ) % 3 != 0 )
{
Print(
"ERROR: the converted curve is not a cubic Bezier" );
__failure++;
}
void Print(const std::string &data, bool new_line=true)
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::vector< double > PCurveGetTVec(const std::string &geom_id, const int &pcurveid)
void ApproximateAllPropellerPCurves(const std::string &geom_id)
int PCurveGetType(const std::string &geom_id, const int &pcurveid)
void PCurveConvertTo(const std::string &geom_id, const int &pcurveid, const int &newtype)
void Update(bool update_managers=true)
- Parameters
-
| [in] | geom_id | string Geom ID |
◆ PCurveConvertTo()
| void vsp::PCurveConvertTo |
( |
const std::string & | geom_id, |
|
|
const int & | pcurveid, |
|
|
const int & | newtype ) |
|
extern |
Change the type of a propeller blade curve (P Curve)
string prop_id =
AddGeom(
"PROP" );
- See also
- PCURV_TYPE
- Parameters
-
| [in] | geom_id | string Parent Geom ID |
| [in] | pcurveid | int P Curve index |
| [in] | newtype | int Curve type enum (i.e. CEDIT) |
◆ PCurveDeletePt()
| void vsp::PCurveDeletePt |
( |
const std::string & | geom_id, |
|
|
const int & | pcurveid, |
|
|
const int & | indx ) |
|
extern |
Delete a propeller blade curve (P Curve) point
string prop_id =
AddGeom(
"PROP" );
void PCurveDeletePt(const std::string &geom_id, const int &pcurveid, const int &indx)
- Parameters
-
| [in] | geom_id | string Parent Geom ID |
| [in] | pcurveid | int P Curve index |
| [in] | indx | int Point index |
◆ PCurveGetTVec()
| std::vector< double > vsp::PCurveGetTVec |
( |
const std::string & | geom_id, |
|
|
const int & | pcurveid ) |
|
extern |
Get the parameters of a propeller blade curve (P Curve). Each parameter is a fraction of propeller radius.
string prop_id =
AddGeom(
"PROP" );
if ( tvec.size() == 0 ) {
Print(
"ERROR: PCurveGetTVec" ); __failure++; }
- Parameters
-
| [in] | geom_id | string Parent Geom ID |
| [in] | pcurveid | int P Curve index |
- Returns
- vector <double> Array of parameters
◆ PCurveGetType()
| int vsp::PCurveGetType |
( |
const std::string & | geom_id, |
|
|
const int & | pcurveid ) |
|
extern |
Get the type of a propeller blade curve (P Curve)
string prop_id =
AddGeom(
"PROP" );
if ( t < 0 ) {
Print(
"ERROR: PCurveGetType" ); __failure++; }
- See also
- PCURV_TYPE
- Parameters
-
| [in] | geom_id | string Parent Geom ID |
| [in] | pcurveid | int P Curve index |
- Returns
- int Curve type enum (i.e. CEDIT)
◆ PCurveGetValVec()
| std::vector< double > vsp::PCurveGetValVec |
( |
const std::string & | geom_id, |
|
|
const int & | pcurveid ) |
|
extern |
Get the values of a propeller blade curve (P Curve). What the values represent id dependent on the curve type (i.e. twist, chord, etc.).
string prop_id =
AddGeom(
"PROP" );
if ( valvec.size() == 0 ) {
Print(
"ERROR: PCurveGetValVec" ); __failure++; }
std::vector< double > PCurveGetValVec(const std::string &geom_id, const int &pcurveid)
- Parameters
-
| [in] | geom_id | string Parent Geom ID |
| [in] | pcurveid | int P Curve index |
- Returns
- vector <double> Array of values
◆ PCurveSplit()
| int vsp::PCurveSplit |
( |
const std::string & | geom_id, |
|
|
const int & | pcurveid, |
|
|
const double & | tsplit ) |
|
extern |
Split a propeller blade curve (P Curve) at the specified 1D parameter
string prop_id =
AddGeom(
"PROP" );
int PCurveSplit(const std::string &geom_id, const int &pcurveid, const double &tsplit)
- Parameters
-
| [in] | geom_id | string Parent Geom ID |
| [in] | pcurveid | int P Curve index |
| [in] | tsplit | double 1D parameter split location |
- Returns
- int Index of new control point
◆ ResetPropellerThicknessCurve()
| void vsp::ResetPropellerThicknessCurve |
( |
const std::string & | geom_id | ) |
|
|
extern |
Reset propeller T/C curve to match basic thickness of file-type airfoils. Typically only used for a propeller that has been constructed with file-type airfoils across the blade. The new thickness curve will be a PCHIP curve with t/c matching the propeller's XSecs – unless it is a file XSec, then the Base thickness is used.
string prop =
AddGeom(
"PROP",
"" );
{
Print(
"ERROR: ResetPropellerThicknessCurve did not make a PCHIP curve" );
__failure++;
}
if ( int( vvec.size() ) != num_xsec || tvec.size() != vvec.size() )
{
Print(
"ERROR: ResetPropellerThicknessCurve did not follow the XSecs" );
__failure++;
}
else
{
for ( int i = 0; i < num_xsec; i++ )
{
if ( tc.length() > 0 )
{
if ( !closeTo( vvec[i],
GetParmVal( tc ), 1e-6 ) )
{
Print(
"ERROR: station " + i +
" does not match its XSec" );
__failure++;
}
}
}
for ( int i = 1; i < int( tvec.size() ); i++ )
{
if ( tvec[i] <= tvec[i - 1] )
{
Print(
"ERROR: the thickness stations are not increasing" );
__failure++;
}
}
}
while ( GetNumTotalErrors() > 0 )
{
}
void ResetPropellerThicknessCurve(const std::string &geom_id)
double GetParmVal(const std::string &parm_id)
std::string GetXSecParm(const std::string &xsec_id, const std::string &name)
std::string GetXSecSurf(const std::string &geom_id, int index)
std::string GetXSec(const std::string &xsec_surf_id, int xsec_index)
int GetNumXSec(const std::string &xsec_surf_id)
- Parameters
-
| [in] | geom_id | string Geom ID |
◆ SetPCurve()
| void vsp::SetPCurve |
( |
const std::string & | geom_id, |
|
|
const int & | pcurveid, |
|
|
const std::vector< double > & | tvec, |
|
|
const std::vector< double > & | valvec, |
|
|
const int & | newtype ) |
|
extern |
Set the parameters, values, and curve type of a propeller blade curve (P Curve)
string prop_id =
AddGeom(
"PROP" );
void SetPCurve(const std::string &geom_id, const int &pcurveid, const std::vector< double > &tvec, const std::vector< double > &valvec, const int &newtype)
- See also
- PCURV_TYPE
- Parameters
-
| [in] | geom_id | string Parent Geom ID |
| [in] | pcurveid | int P Curve index |
| [in] | tvec | vector <double> Array of parameter values |
| [in] | valvec | vector <double> Array of values |
| [in] | newtype | int Curve type enum (i.e. CEDIT) |