OpenVSP API Documentation 3.41.0
 
Loading...
Searching...
No Matches
Geom Surface Query Functions

This group of API functions pertains to general surface queries for Geom surfaces, such as computing 3D location from surface coordinates, identifying curvature, and performing point projections. Click here to return to the main page. More...

Functions

vec3d vsp::CompPnt01 (const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
 
vec3d vsp::CompNorm01 (const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
 
vec3d vsp::CompTanU01 (const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
 
vec3d vsp::CompTanW01 (const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
 
void vsp::CompCurvature01 (const std::string &geom_id, const int &surf_indx, const double &u, const double &w, double &k1_out, double &k2_out, double &ka_out, double &kg_out)
 
double vsp::ProjPnt01 (const std::string &geom_id, const int &surf_indx, const vec3d &pt, double &u_out, double &w_out)
 
double vsp::ProjPnt01I (const std::string &geom_id, const vec3d &pt, int &surf_indx_out, double &u_out, double &w_out)
 
double vsp::ProjPnt01Guess (const std::string &geom_id, const int &surf_indx, const vec3d &pt, const double &u0, const double &w0, double &u_out, double &w_out)
 
double vsp::AxisProjPnt01 (const std::string &geom_id, const int &surf_indx, const int &iaxis, const vec3d &pt, double &u_out, double &w_out)
 
double vsp::AxisProjPnt01I (const std::string &geom_id, const int &iaxis, const vec3d &pt, int &surf_indx_out, double &u_out, double &w_out)
 
double vsp::AxisProjPnt01Guess (const std::string &geom_id, const int &surf_indx, const int &iaxis, const vec3d &pt, const double &u0, const double &w0, double &u_out, double &w_out)
 
bool vsp::InsideSurf (const std::string &geom_id, const int &surf_indx, const vec3d &pt)
 
vec3d vsp::CompPntRST (const std::string &geom_id, const int &surf_indx, const double &r, const double &s, const double &t)
 
double vsp::FindRST (const std::string &geom_id, const int &surf_indx, const vec3d &pt, double &r_out, double &s_out, double &t_out)
 
double vsp::FindRSTGuess (const std::string &geom_id, const int &surf_indx, const vec3d &pt, const double &r0, const double &s0, const double &t0, double &r_out, double &s_out, double &t_out)
 
void vsp::ConvertRSTtoLMN (const std::string &geom_id, const int &surf_indx, const double &r, const double &s, const double &t, double &l_out, double &m_out, double &n_out)
 
void vsp::ConvertRtoL (const std::string &geom_id, const int &surf_indx, const double &r, double &l_out)
 
void vsp::ConvertLMNtoRST (const std::string &geom_id, const int &surf_indx, const double &l, const double &m, const double &n, double &r_out, double &s_out, double &t_out)
 
void vsp::ConvertLtoR (const std::string &geom_id, const int &surf_indx, const double &l, double &r_out)
 
void vsp::ConvertUtoEta (const std::string &geom_id, const double &u, double &eta_out)
 
void vsp::ConvertEtatoU (const std::string &geom_id, const double &eta, double &u_out)
 
std::vector< vec3dvsp::CompVecPnt01 (const std::string &geom_id, const int &surf_indx, const std::vector< double > &u_in_vec, const std::vector< double > &w_in_vec)
 
std::vector< vec3dvsp::CompVecNorm01 (const std::string &geom_id, const int &surf_indx, const std::vector< double > &us, const std::vector< double > &ws)
 
void vsp::CompVecCurvature01 (const std::string &geom_id, const int &surf_indx, const std::vector< double > &us, const std::vector< double > &ws, std::vector< double > &k1_out_vec, std::vector< double > &k2_out_vec, std::vector< double > &ka_out_vec, std::vector< double > &kg_out_vec)
 
void vsp::ProjVecPnt01 (const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec, std::vector< double > &d_out_vec)
 
void vsp::ProjVecPnt01Guess (const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts, const std::vector< double > &u0s, const std::vector< double > &w0s, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec, std::vector< double > &d_out_vec)
 
void vsp::AxisProjVecPnt01 (const std::string &geom_id, const int &surf_indx, const int &iaxis, const std::vector< vec3d > &pts, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec, std::vector< double > &d_out_vec)
 
void vsp::AxisProjVecPnt01Guess (const std::string &geom_id, const int &surf_indx, const int &iaxis, const std::vector< vec3d > &pts, const std::vector< double > &u0s, const std::vector< double > &w0s, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec, std::vector< double > &d_out_vec)
 
std::vector< bool > vsp::VecInsideSurf (const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts)
 
std::vector< vec3dvsp::CompVecPntRST (const std::string &geom_id, const int &surf_indx, const std::vector< double > &r_in_vec, const std::vector< double > &s_in_vec, const std::vector< double > &t_in_vec)
 
void vsp::FindRSTVec (const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts, std::vector< double > &r_out_vec, std::vector< double > &s_out_vec, std::vector< double > &t_out_vec, std::vector< double > &d_out_vec)
 
void vsp::FindRSTVecGuess (const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts, const std::vector< double > &r0s, const std::vector< double > &s0s, const std::vector< double > &t0s, std::vector< double > &r_out_vec, std::vector< double > &s_out_vec, std::vector< double > &t_out_vec, std::vector< double > &d_out_vec)
 
void vsp::ConvertRSTtoLMNVec (const std::string &geom_id, const int &surf_indx, const std::vector< double > &r_vec, const std::vector< double > &s_vec, const std::vector< double > &t_vec, std::vector< double > &l_out_vec, std::vector< double > &m_out_vec, std::vector< double > &n_out_vec)
 
void vsp::ConvertLMNtoRSTVec (const std::string &geom_id, const int &surf_indx, const std::vector< double > &l_vec, const std::vector< double > &m_vec, const std::vector< double > &n_vec, std::vector< double > &r_out_vec, std::vector< double > &s_out_vec, std::vector< double > &t_out_vec)
 
void vsp::GetUWTess01 (const std::string &geom_id, const int &surf_indx, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec)
 

Detailed Description

Function Documentation

◆ AxisProjPnt01()

double vsp::AxisProjPnt01 ( const std::string & geom_id,
const int & surf_indx,
const int & iaxis,
const vec3d & pt,
double & u_out,
double & w_out )
extern

Project an input 3D coordinate point onto a surface along a specified axis. If the axis-aligned ray from the point intersects the surface multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the surface, the original point is returned and -1 is returned in the other output parameters.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
vec3d surf_pt = CompPnt01( geom_id, surf_indx, u, w );
vec3d pt = surf_pt;
pt.offset_y( -5.0 );
double u_out, w_out;
double idist = AxisProjPnt01( geom_id, surf_indx, Y_DIR, pt, u_out, w_out);
Print( "iDist " + idist + " u_out " + u_out + " w_out " + w_out );
Print( "3D Offset ", false);
Definition Vec3d.h:235
void offset_y(double offset)
Definition Vec3d.h:801
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
vec3d CompPnt01(const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
double AxisProjPnt01(const std::string &geom_id, const int &surf_indx, const int &iaxis, const vec3d &pt, double &u_out, double &w_out)
See also
AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01, AxisProjVecPnt01Guess
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]iaxisint Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR)
[in]ptInput 3D coordinate point
[out]u_outOutput closest U (0 - 1) surface coordinate
[out]w_outOutput closest W (0 - 1) surface coordinate
Returns
Axis aligned distance between the 3D point and the projected point on the surface

◆ AxisProjPnt01Guess()

double vsp::AxisProjPnt01Guess ( const std::string & geom_id,
const int & surf_indx,
const int & iaxis,
const vec3d & pt,
const double & u0,
const double & w0,
double & u_out,
double & w_out )
extern

Project an input 3D coordinate point onto a surface along a specified axis given an initial guess of surface parameter. If the axis-aligned ray from the point intersects the surface multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the surface, the original point is returned and -1 is returned in the other output parameters. The surface parameter guess should allow this call to be faster than calling AxisProjPnt01 without a guess.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
vec3d surf_pt = CompPnt01( geom_id, surf_indx, u, w );
vec3d pt = surf_pt;
pt.offset_y( -5.0 );
// Construct initial guesses near actual parameters
double u0 = u + 0.01234;
double w0 = w - 0.05678;
double uout, wout;
double d = AxisProjPnt01Guess( geom_id, surf_indx, Y_DIR, pt, u0, w0, uout, wout);
Print( "Dist " + d + " u " + uout + " w " + wout );
double AxisProjPnt01Guess(const std::string &geom_id, const int &surf_indx, const int &iaxis, const vec3d &pt, const double &u0, const double &w0, double &u_out, double &w_out)
See also
AxisProjPnt01, AxisProjPnt01I, AxisProjVecPnt01, AxisProjVecPnt01Guess
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]iaxisint Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR)
[in]ptInput 3D coordinate point
[in]u0Input U (0 - 1) surface coordinate guess
[in]w0Input W (0 - 1) surface coordinate guess
[out]u_outOutput closest U (0 - 1) surface coordinate
[out]w_outOutput closest W (0 - 1) surface coordinate
Returns
Distance between the 3D point and the closest point of the surface

◆ AxisProjPnt01I()

double vsp::AxisProjPnt01I ( const std::string & geom_id,
const int & iaxis,
const vec3d & pt,
int & surf_indx_out,
double & u_out,
double & w_out )
extern

Project an input 3D coordinate point onto a Geom along a specified axis. The intersecting surface index is also returned. If the axis-aligned ray from the point intersects the Geom multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the Geom, the original point is returned and -1 is returned in the other output parameters.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
vec3d surf_pt = CompPnt01( geom_id, surf_indx, u, w );
vec3d pt = surf_pt;
pt.offset_y( -5.0 );
double u_out, w_out;
int surf_indx_out;
double idist = AxisProjPnt01I( geom_id, Y_DIR, pt, surf_indx_out, u_out, w_out);
Print( "iDist " + idist + " u_out " + u_out + " w_out " + w_out + " surf_index " + surf_indx_out );
Print( "3D Offset ", false);
double AxisProjPnt01I(const std::string &geom_id, const int &iaxis, const vec3d &pt, int &surf_indx_out, double &u_out, double &w_out)
See also
AxisProjPnt01, AxisProjPnt01Guess, AxisProjVecPnt01, AxisProjVecPnt01Guess
Parameters
[in]geom_idstring Parent Geom ID
[in]iaxisint Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR)
[in]ptInput 3D coordinate point
[out]surf_indx_outOutput main surface index from the parent Geom
[out]u_outOutput closest U (0 - 1) surface coordinate
[out]w_outOutput closest W (0 - 1) surface coordinate
Returns
Axis aligned distance between the 3D point and the projected point on the surface

◆ AxisProjVecPnt01()

void vsp::AxisProjVecPnt01 ( const std::string & geom_id,
const int & surf_indx,
const int & iaxis,
const std::vector< vec3d > & pts,
std::vector< double > & u_out_vec,
std::vector< double > & w_out_vec,
std::vector< double > & d_out_vec )
extern

Project an input array of 3D coordinate points onto a surface along a specified axis. If the axis-aligned ray from the point intersects the surface multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the surface, the original point is returned and -1 is returned in the other output parameters.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
int n = 5;
array<double> uvec, wvec;
uvec.resize( n );
wvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
uvec[i] = (i+1)*1.0/(n+1);
wvec[i] = (n-i)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPnt01( geom_id, surf_indx, uvec, wvec );
for( int i = 0 ; i < n ; i++ )
{
ptvec[i].offset_y( -5.0 );
}
array<double> uoutv, woutv, doutv;
AxisProjVecPnt01( geom_id, surf_indx, Y_DIR, ptvec, uoutv, woutv, doutv );
// Some of these outputs are expected to be non-zero because the projected point is on the opposite side of
// the pod from the originally computed point. I.e. there were multiple solutions and the original point
// is not the closest intersection point. We could offset those points in the +Y direction instead of -Y.
for( int i = 0 ; i < n ; i++ )
{
Print( i, false );
Print( "U delta ", false );
Print( uvec[i] - uoutv[i], false );
Print( "W delta ", false );
Print( wvec[i] - woutv[i] );
}
void AxisProjVecPnt01(const std::string &geom_id, const int &surf_indx, const int &iaxis, const std::vector< vec3d > &pts, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec, std::vector< double > &d_out_vec)
std::vector< vec3d > CompVecPnt01(const std::string &geom_id, const int &surf_indx, const std::vector< double > &u_in_vec, const std::vector< double > &w_in_vec)
See also
AxisProjPnt01, AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01Guess
Parameters
[in]geom_idstring Geom ID
[in]surf_indxint Main surface index from the Geom
[in]iaxisint Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR)
[in]ptsvector<vec3d> Input vector of 3D coordinate points
[out]u_out_vecvector<double> Output vector of the closest U (0 - 1) surface coordinate for each 3D input point
[out]w_out_vecvector<double> Output vector of the closest W (0 - 1) surface coordinate for each 3D input point
[out]d_out_vecvector<double> Output vector of axis distances for each 3D point and the projected point of the surface

◆ AxisProjVecPnt01Guess()

void vsp::AxisProjVecPnt01Guess ( const std::string & geom_id,
const int & surf_indx,
const int & iaxis,
const std::vector< vec3d > & pts,
const std::vector< double > & u0s,
const std::vector< double > & w0s,
std::vector< double > & u_out_vec,
std::vector< double > & w_out_vec,
std::vector< double > & d_out_vec )
extern

Project an input array of 3D coordinate points onto a surface along a specified axis given initial guess arrays of surface parameter. If the axis-aligned ray from the point intersects the surface multiple times, the nearest intersection is returned. If the axis-aligned ray from the point does not intersect the surface, the original point is returned and -1 is returned in the other output parameters. The surface parameter guess should allow this call to be faster than calling AxisProjVecPnt01 without a guess.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
int n = 5;
array<double> uvec, wvec;
uvec.resize( n );
wvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
uvec[i] = (i+1)*1.0/(n+1);
wvec[i] = (n-i)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPnt01( geom_id, surf_indx, uvec, wvec );
for( int i = 0 ; i < n ; i++ )
{
ptvec[i].offset_y( -5.0 );
}
array<double> uoutv, woutv, doutv, u0v, w0v;
u0v.resize( n );
w0v.resize( n );
for( int i = 0 ; i < n ; i++ )
{
u0v[i] = uvec[i] + 0.01234;
w0v[i] = wvec[i] - 0.05678;
}
AxisProjVecPnt01Guess( geom_id, surf_indx, Y_DIR, ptvec, u0v, w0v, uoutv, woutv, doutv );
for( int i = 0 ; i < n ; i++ )
{
Print( i, false );
Print( "U delta ", false );
Print( uvec[i] - uoutv[i], false );
Print( "W delta ", false );
Print( wvec[i] - woutv[i] );
}
void AxisProjVecPnt01Guess(const std::string &geom_id, const int &surf_indx, const int &iaxis, const std::vector< vec3d > &pts, const std::vector< double > &u0s, const std::vector< double > &w0s, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec, std::vector< double > &d_out_vec)
See also
AxisProjPnt01, AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]iaxisint Axis direction to project point along (X_DIR, Y_DIR, or Z_DIR)
[in]ptsvector<vec3d> Input vector of 3D coordinate points
[in]u0svector<double> Input vector of U (0 - 1) surface coordinate guesses
[in]w0svector<double> Input vector of W (0 - 1) surface coordinate guesses
[out]u_out_vecvector<double> Output vector of the closest U (0 - 1) surface coordinate for each 3D input point
[out]w_out_vecvector<double> Output vector of the closest W (0 - 1) surface coordinate for each 3D input point
[out]d_out_vecvector<double> Output vector of axis distances for each 3D point and the projected point of the surface

◆ CompCurvature01()

void vsp::CompCurvature01 ( const std::string & geom_id,
const int & surf_indx,
const double & u,
const double & w,
double & k1_out,
double & k2_out,
double & ka_out,
double & kg_out )
extern

Determine the curvature of a specified surface at the input surface coordinate point

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double k1, k2, ka, kg;
double u, w;
u = 0.25;
w = 0.75;
CompCurvature01( geom_id, surf_indx, u, w, k1, k2, ka, kg );
Print( "Curvature : k1 " + k1 + " k2 " + k2 + " ka " + ka + " kg " + kg );
void CompCurvature01(const std::string &geom_id, const int &surf_indx, const double &u, const double &w, double &k1_out, double &k2_out, double &ka_out, double &kg_out)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]udouble U (0 - 1) surface coordinate
[in]wdouble W (0 - 1) surface coordinate
[out]k1_outdouble Output value of maximum principal curvature
[out]k2_outdouble Output value of minimum principal curvature
[out]ka_outdouble Output value of mean curvature
[out]kg_outdouble Output value of Gaussian curvature

◆ CompNorm01()

vec3d vsp::CompNorm01 ( const std::string & geom_id,
const int & surf_indx,
const double & u,
const double & w )
extern

Calculate the normal vector on the specified surface at input surface coordinate

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
vec3d norm = CompNorm01( geom_id, surf_indx, u, w );
Print( "Point: ( " + norm.x() + ', ' + norm.y() + ', ' + norm.z() + ' )' );
double y() const
Definition Vec3d.h:472
double x() const
Definition Vec3d.h:435
double z() const
Definition Vec3d.h:509
vec3d CompNorm01(const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]uU (0 - 1) surface coordinate
[in]wW (0 - 1) surface coordinate
Returns
Normal vector

◆ CompPnt01()

vec3d vsp::CompPnt01 ( const std::string & geom_id,
const int & surf_indx,
const double & u,
const double & w )
extern

Calculate the 3D coordinate equivalent for the input surface coordinate point

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
vec3d pnt = CompPnt01( geom_id, surf_indx, u, w );
Print( "Point: ( " + pnt.x() + ', ' + pnt.y() + ', ' + pnt.z() + ' )' );
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]uU (0 - 1) surface coordinate
[in]wW (0 - 1) surface coordinate
Returns
Normal vector3D coordinate point

◆ CompPntRST()

vec3d vsp::CompPntRST ( const std::string & geom_id,
const int & surf_indx,
const double & r,
const double & s,
const double & t )
extern

Calculate the (X, Y, Z) coordinate for the input volume (R, S, T) coordinate point

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double r = 0.12;
double s = 0.68;
double t = 0.56;
vec3d pnt = CompPntRST( geom_id, surf_indx, r, s, t );
Print( "Point: ( " + pnt.x() + ', ' + pnt.y() + ', ' + pnt.z() + ' )' );
vec3d CompPntRST(const std::string &geom_id, const int &surf_indx, const double &r, const double &s, const double &t)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]rR (0 - 1) volume coordinate
[in]sS (0 - 1) volume coordinate
[in]tT (0 - 1) volume coordinate
Returns
vec3d coordinate point

◆ CompTanU01()

vec3d vsp::CompTanU01 ( const std::string & geom_id,
const int & surf_indx,
const double & u,
const double & w )
extern

Calculate the vector tangent to the specified surface at input surface coordinate in the U direction

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
vec3d tanu = CompTanU01( geom_id, surf_indx, u, w );
Print( "Point: ( " + tanu.x() + ', ' + tanu.y() + ', ' + tanu.z() + ' )' );
vec3d CompTanU01(const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]uU (0 - 1) surface coordinate
[in]wW (0 - 1) surface coordinate
Returns
Tangent vector in U direction

◆ CompTanW01()

vec3d vsp::CompTanW01 ( const std::string & geom_id,
const int & surf_indx,
const double & u,
const double & w )
extern

Calculate the vector tangent to the specified surface at input surface coordinate in the W direction

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
vec3d tanw = CompTanW01( geom_id, surf_indx, u, w );
Print( "Point: ( " + tanw.x() + ', ' + tanw.y() + ', ' + tanw.z() + ' )' );
vec3d CompTanW01(const std::string &geom_id, const int &surf_indx, const double &u, const double &w)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]uU (0 - 1) surface coordinate
[in]wW (0 - 1) surface coordinate
Returns
Tangent vector in W direction

◆ CompVecCurvature01()

void vsp::CompVecCurvature01 ( const std::string & geom_id,
const int & surf_indx,
const std::vector< double > & us,
const std::vector< double > & ws,
std::vector< double > & k1_out_vec,
std::vector< double > & k2_out_vec,
std::vector< double > & ka_out_vec,
std::vector< double > & kg_out_vec )
extern

Determine the curvature of a specified surface at each surface coordinate point in the input arrays

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> uvec, wvec;
uvec.resize( n );
wvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
uvec[i] = (i+1)*1.0/(n+1);
wvec[i] = (n-i)*1.0/(n+1);
}
array<double> k1vec, k2vec, kavec, kgvec;
CompVecCurvature01( geom_id, 0, uvec, wvec, k1vec, k2vec, kavec, kgvec );
void CompVecCurvature01(const std::string &geom_id, const int &surf_indx, const std::vector< double > &us, const std::vector< double > &ws, std::vector< double > &k1_out_vec, std::vector< double > &k2_out_vec, std::vector< double > &ka_out_vec, std::vector< double > &kg_out_vec)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]usvector<double> Input vector of U (0 - 1) surface coordinates
[in]wsvector<double> Input vector of W (0 - 1) surface coordinates
[out]k1_out_vecvector<double> Output vector of maximum principal curvatures
[out]k2_out_vecvector<double> Output vector of minimum principal curvatures
[out]ka_out_vecvector<double> Output vector of mean curvatures
[out]kg_out_vecvector<double> Output vector of Gaussian curvatures

◆ CompVecNorm01()

std::vector< vec3d > vsp::CompVecNorm01 ( const std::string & geom_id,
const int & surf_indx,
const std::vector< double > & us,
const std::vector< double > & ws )
extern

Determine the normal vector on a surface for each surface coordinate point in the input arrays

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> uvec, wvec;
uvec.resize( n );
wvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
uvec[i] = (i+1)*1.0/(n+1);
wvec[i] = (n-i)*1.0/(n+1);
}
array< vec3d > normvec = CompVecNorm01( geom_id, 0, uvec, wvec );
std::vector< vec3d > CompVecNorm01(const std::string &geom_id, const int &surf_indx, const std::vector< double > &us, const std::vector< double > &ws)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]usvector<double> Input vector of U (0 - 1) surface coordinates
[in]wsvector<double> Input vector of W (0 - 1) surface coordinates
Returns
vector<vec3d> Vector of 3D normal vectors

◆ CompVecPnt01()

std::vector< vec3d > vsp::CompVecPnt01 ( const std::string & geom_id,
const int & surf_indx,
const std::vector< double > & u_in_vec,
const std::vector< double > & w_in_vec )
extern

Determine 3D coordinate for each surface coordinate point in the input arrays

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> uvec, wvec;
uvec.resize( n );
wvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
uvec[i] = (i+1)*1.0/(n+1);
wvec[i] = (n-i)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPnt01( geom_id, 0, uvec, wvec );
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]u_in_vecvector<double> Input vector of U (0 - 1) surface coordinates
[in]w_in_vecvector<double> Input vector of W (0 - 1) surface coordinates
Returns
vector<vec3d> Vector of 3D coordinate points

◆ CompVecPntRST()

std::vector< vec3d > vsp::CompVecPntRST ( const std::string & geom_id,
const int & surf_indx,
const std::vector< double > & r_in_vec,
const std::vector< double > & s_in_vec,
const std::vector< double > & t_in_vec )
extern

Determine 3D coordinate for each volume coordinate point in the input arrays

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> rvec, svec, tvec;
rvec.resize( n );
svec.resize( n );
tvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
rvec[i] = (i+1)*1.0/(n+1);
svec[i] = (n-i)*1.0/(n+1);
tvec[i] = (i+1)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPntRST( geom_id, 0, rvec, svec, tvec );
std::vector< vec3d > CompVecPntRST(const std::string &geom_id, const int &surf_indx, const std::vector< double > &r_in_vec, const std::vector< double > &s_in_vec, const std::vector< double > &t_in_vec)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]r_in_vecvector<double> Input vector of R (0 - 1.0) volume coordinates
[in]s_in_vecvector<double> Input vector of S (0 - 1.0) volume coordinates
[in]t_in_vecvector<double> Input vector of T (0 - 1.0) volume coordinates
Returns
vector<vec3d> Vector of 3D coordinate points

◆ ConvertEtatoU()

void vsp::ConvertEtatoU ( const std::string & geom_id,
const double & eta,
double & u_out )
extern

Convert eta wing coordinate to u coordinate.

// Add Wing Geom
string geom_id = AddGeom( "WING", "" );
int surf_indx = 0;
double eta= 0.25;
double u_out;
ConvertEtatoU( geom_id, eta, u_out );
void ConvertEtatoU(const std::string &geom_id, const double &eta, double &u_out)
Parameters
[in]geom_idstring Parent Geom ID
[in]etaEta (0 - 1) wing spanwise coordinate
[out]u_outU (0 - 1) surface coordinate

◆ ConvertLMNtoRST()

void vsp::ConvertLMNtoRST ( const std::string & geom_id,
const int & surf_indx,
const double & l,
const double & m,
const double & n,
double & r_out,
double & s_out,
double & t_out )
extern

Convert LMN volumetric coordinates to RST coordinates.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double l = 0.12;
double m = 0.34;
double n = 0.56;
double r_out, s_out, t_out;
ConvertLMNtoRST( geom_id, surf_indx, l, m, n, r_out, s_out, t_out );
void ConvertLMNtoRST(const std::string &geom_id, const int &surf_indx, const double &l, const double &m, const double &n, double &r_out, double &s_out, double &t_out)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]lL (0 - 1) linear volume coordinate
[in]mM (0 - 1) linear volume coordinate
[in]nN (0 - 1) linear volume coordinate
[out]r_outR (0 - 1) volume coordinate
[out]s_outS (0 - 1) volume coordinate
[out]t_outT (0 - 1) volume coordinate

◆ ConvertLMNtoRSTVec()

void vsp::ConvertLMNtoRSTVec ( const std::string & geom_id,
const int & surf_indx,
const std::vector< double > & l_vec,
const std::vector< double > & m_vec,
const std::vector< double > & n_vec,
std::vector< double > & r_out_vec,
std::vector< double > & s_out_vec,
std::vector< double > & t_out_vec )
extern

Convert vector of LMN volumetric coordinates to RST coordinates.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> lvec, mvec, nvec;
lvec.resize( n );
mvec.resize( n );
nvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
lvec[i] = (i+1)*1.0/(n+1);
mvec[i] = (n-i)*1.0/(n+1);
nvec[i] = (i+1)*1.0/(n+1);
}
array<double> rvec, svec, tvec;
ConvertLMNtoRSTVec( geom_id, 0, lvec, mvec, nvec, rvec, svec, tvec );
void ConvertLMNtoRSTVec(const std::string &geom_id, const int &surf_indx, const std::vector< double > &l_vec, const std::vector< double > &m_vec, const std::vector< double > &n_vec, std::vector< double > &r_out_vec, std::vector< double > &s_out_vec, std::vector< double > &t_out_vec)
See also
ConvertRSTtoLMNVec, ConvertRSTtoLMN, ConvertLMNtoRST
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]l_vecvector<double> Input vector of L (0 - 1) linear volumetric coordinate
[in]m_vecvector<double> Input vector of M (0 - 1) linear volumetric coordinate
[in]n_vecvector<double> Input vector of N (0 - 1) linear volumetric coordinate
[out]r_out_vecvector<double> Output vector of R (0 - 1) volumetric coordinate
[out]s_out_vecvector<double> Output vector of S (0 - 1) volumetric coordinate
[out]t_out_vecvector<double> Output vector of T (0 - 1) volumetric coordinate

◆ ConvertLtoR()

void vsp::ConvertLtoR ( const std::string & geom_id,
const int & surf_indx,
const double & l,
double & r_out )
extern

Convert L volumetric coordinate to R coordinate.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double l = 0.12;
double r_out;
ConvertLtoR( geom_id, surf_indx, l, r_out );
void ConvertLtoR(const std::string &geom_id, const int &surf_indx, const double &l, double &r_out)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]lL (0 - 1) volume coordinate
[out]r_outR (0 - 1) linear volume coordinate

◆ ConvertRSTtoLMN()

void vsp::ConvertRSTtoLMN ( const std::string & geom_id,
const int & surf_indx,
const double & r,
const double & s,
const double & t,
double & l_out,
double & m_out,
double & n_out )
extern

Convert RST volumetric coordinates to LMN coordinates.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double r = 0.12;
double s = 0.68;
double t = 0.56;
double l_out, m_out, n_out;
ConvertRSTtoLMN( geom_id, surf_indx, r, s, t, l_out, m_out, n_out );
void ConvertRSTtoLMN(const std::string &geom_id, const int &surf_indx, const double &r, const double &s, const double &t, double &l_out, double &m_out, double &n_out)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]rR (0 - 1) volume coordinate
[in]sS (0 - 1) volume coordinate
[in]tT (0 - 1) volume coordinate
[out]l_outL (0 - 1) linear volume coordinate
[out]m_outM (0 - 1) linear volume coordinate
[out]n_outN (0 - 1) linear volume coordinate

◆ ConvertRSTtoLMNVec()

void vsp::ConvertRSTtoLMNVec ( const std::string & geom_id,
const int & surf_indx,
const std::vector< double > & r_vec,
const std::vector< double > & s_vec,
const std::vector< double > & t_vec,
std::vector< double > & l_out_vec,
std::vector< double > & m_out_vec,
std::vector< double > & n_out_vec )
extern

Convert vector of RST volumetric coordinates to LMN coordinates.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> rvec, svec, tvec;
rvec.resize( n );
svec.resize( n );
tvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
rvec[i] = (i+1)*1.0/(n+1);
svec[i] = (n-i)*1.0/(n+1);
tvec[i] = (i+1)*1.0/(n+1);
}
array<double> lvec, mvec, nvec;
ConvertRSTtoLMNVec( geom_id, 0, rvec, svec, tvec, lvec, mvec, nvec );
void ConvertRSTtoLMNVec(const std::string &geom_id, const int &surf_indx, const std::vector< double > &r_vec, const std::vector< double > &s_vec, const std::vector< double > &t_vec, std::vector< double > &l_out_vec, std::vector< double > &m_out_vec, std::vector< double > &n_out_vec)
See also
ConvertLMNtoRSTVec, ConvertRSTtoLMN, ConvertLMNtoRST
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]r_vecvector<double> Input vector of R (0 - 1) volumetric coordinate
[in]s_vecvector<double> Input vector of S (0 - 1) volumetric coordinate
[in]t_vecvector<double> Input vector of T (0 - 1) volumetric coordinate
[out]l_out_vecvector<double> Output vector of L (0 - 1) linear volumetric coordinate
[out]m_out_vecvector<double> Output vector of M (0 - 1) linear volumetric coordinate
[out]n_out_vecvector<double> Output vector of N (0 - 1) linear volumetric coordinate

◆ ConvertRtoL()

void vsp::ConvertRtoL ( const std::string & geom_id,
const int & surf_indx,
const double & r,
double & l_out )
extern

Convert R volumetric coordinate to L coordinate.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double r = 0.12;
double l_out;
ConvertRtoL( geom_id, surf_indx, r, l_out );
void ConvertRtoL(const std::string &geom_id, const int &surf_indx, const double &r, double &l_out)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]rR (0 - 1) volume coordinate
[out]l_outL (0 - 1) linear volume coordinate

◆ ConvertUtoEta()

void vsp::ConvertUtoEta ( const std::string & geom_id,
const double & u,
double & eta_out )
extern

Convert U coordinate to eta wing coordinate.

// Add Wing Geom
string geom_id = AddGeom( "WING", "" );
int surf_indx = 0;
double u = 0.25;
double eta_out;
ConvertUtoEta( geom_id, u, eta_out );
void ConvertUtoEta(const std::string &geom_id, const double &u, double &eta_out)
Parameters
[in]geom_idstring Parent Geom ID
[in]uU (0 - 1) surface coordinate
[out]eta_outEta (0 - 1) wing spanwise coordinate

◆ FindRST()

double vsp::FindRST ( const std::string & geom_id,
const int & surf_indx,
const vec3d & pt,
double & r_out,
double & s_out,
double & t_out )
extern

Determine the nearest (R, S, T) volume coordinate for an input (X, Y, Z) 3D coordinate point and calculate the distance between the 3D point and the found volume point.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double r = 0.12;
double s = 0.68;
double t = 0.56;
vec3d pnt = CompPntRST( geom_id, surf_indx, r, s, t );
double rout, sout, tout;
double d = FindRST( geom_id, surf_indx, pnt );
Print( "Dist " + d + " r " + rout + " s " + sout + " t " + tout );
double FindRST(const std::string &geom_id, const int &surf_indx, const vec3d &pt, double &r_out, double &s_out, double &t_out)
See also
FindRSTGuess
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptvec3d Input 3D coordinate point
[out]r_outdouble Output closest R (0 - 1.0) volume coordinate
[out]s_outdouble Output closest S (0 - 1.0) volume coordinate
[out]t_outdouble Output closest T (0 - 1.0) volume coordinate
Returns
double Distance between the 3D point and the closest point of the volume

◆ FindRSTGuess()

double vsp::FindRSTGuess ( const std::string & geom_id,
const int & surf_indx,
const vec3d & pt,
const double & r0,
const double & s0,
const double & t0,
double & r_out,
double & s_out,
double & t_out )
extern

Determine the nearest (R, S, T) volume coordinate for an input (X, Y, Z) 3D coordinate point given an initial guess of volume coordinates. Also calculate the distance between the 3D point and the found volume point.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double r = 0.12;
double s = 0.68;
double t = 0.56;
vec3d pnt = CompPntRST( geom_id, surf_indx, r, s, t );
double rout, sout, tout;
double r0 = 0.1;
double s0 = 0.6;
double t0 = 0.5;
double d = FindRSTGuess( geom_id, surf_indx, pnt, r0, s0, t0, rout, sout, tout );
Print( "Dist " + d + " r " + rout + " s " + sout + " t " + tout );
double FindRSTGuess(const std::string &geom_id, const int &surf_indx, const vec3d &pt, const double &r0, const double &s0, const double &t0, double &r_out, double &s_out, double &t_out)
See also
FindRST
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptvec3d Input 3D coordinate point
[in]r0double Input R (0 - 1.0) volume coordinate guess
[in]s0double Input S (0 - 1.0) volume coordinate guess
[in]t0double Input T (0 - 1.0) volume coordinate guess
[out]r_outdouble Output closest R (0 - 1.0) volume coordinate
[out]s_outdouble Output closest S (0 - 1.0) volume coordinate
[out]t_outdouble Output closest T (0 - 1.0) volume coordinate
Returns
double Distance between the 3D point and the closest point of the volume

◆ FindRSTVec()

void vsp::FindRSTVec ( const std::string & geom_id,
const int & surf_indx,
const std::vector< vec3d > & pts,
std::vector< double > & r_out_vec,
std::vector< double > & s_out_vec,
std::vector< double > & t_out_vec,
std::vector< double > & d_out_vec )
extern

Determine the nearest volume coordinates for an input array of 3D coordinate points and calculate the distance between each 3D point and the found point in the volume.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> rvec, svec, tvec;
rvec.resize( n );
svec.resize( n );
tvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
rvec[i] = (i+1)*1.0/(n+1);
svec[i] = (n-i)*1.0/(n+1);
tvec[i] = (i+1)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPntRST( geom_id, 0, rvec, svec, tvec );
array<double> routv, soutv, toutv, doutv;
FindRSTVec( geom_id, 0, ptvec, routv, soutv, toutv, doutv );
void FindRSTVec(const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts, std::vector< double > &r_out_vec, std::vector< double > &s_out_vec, std::vector< double > &t_out_vec, std::vector< double > &d_out_vec)
See also
FindRSTVecGuess
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptsvector<vec3d> Input vector of 3D coordinate points
[out]r_out_vecvector<double> Output vector of the closest R (0 - 1.0) volume coordinate for each 3D input point
[out]s_out_vecvector<double> Output vector of the closest S (0 - 1.0) volume coordinate for each 3D input point
[out]t_out_vecvector<double> Output vector of the closest T (0 - 1.0) volume coordinate for each 3D input point
[out]d_out_vecvector<double> Output vector of distances for each 3D point and the closest point of the volume

◆ FindRSTVecGuess()

void vsp::FindRSTVecGuess ( const std::string & geom_id,
const int & surf_indx,
const std::vector< vec3d > & pts,
const std::vector< double > & r0s,
const std::vector< double > & s0s,
const std::vector< double > & t0s,
std::vector< double > & r_out_vec,
std::vector< double > & s_out_vec,
std::vector< double > & t_out_vec,
std::vector< double > & d_out_vec )
extern

Determine the nearest volume coordinates for an input array of 3D coordinate points and calculate the distance between each 3D point and the closest point of the volume. This function takes an input array of volume coordinate guesses for each 3D coordinate, offering a potential decrease in computation time compared to FindRSTVec.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> rvec, svec, tvec;
rvec.resize( n );
svec.resize( n );
tvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
rvec[i] = (i+1)*1.0/(n+1);
svec[i] = (n-i)*1.0/(n+1);
tvec[i] = (i+1)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPntRST( geom_id, 0, rvec, svec, tvec );
array<double> routv, soutv, toutv, doutv;
for( int i = 0 ; i < n ; i++ )
{
ptvec[i] = ptvec[i] * 0.9;
}
FindRSTVecGuess( geom_id, 0, ptvec, rvec, svec, tvec, routv, soutv, toutv, doutv );
void FindRSTVecGuess(const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts, const std::vector< double > &r0s, const std::vector< double > &s0s, const std::vector< double > &t0s, std::vector< double > &r_out_vec, std::vector< double > &s_out_vec, std::vector< double > &t_out_vec, std::vector< double > &d_out_vec)
See also
FindRSTVec,
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptsvector<vec3d> Input vector of 3D coordinate points
[in]r0svector<double> Input vector of U (0 - 1.0) volume coordinate guesses
[in]s0svector<double> Input vector of S (0 - 1.0) volume coordinate guesses
[in]t0svector<double> Input vector of T (0 - 1.0) volume coordinate guesses
[out]r_out_vecvector<double> Output vector of the closest R (0 - 1.0) volume coordinate for each 3D input point
[out]s_out_vecvector<double> Output vector of the closest S (0 - 1.0) volume coordinate for each 3D input point
[out]t_out_vecvector<double> Output vector of the closest T (0 - 1.0) volume coordinate for each 3D input point
[out]d_out_vecvector<double> Output vector of distances for each 3D point and the closest point of the volume

◆ GetUWTess01()

void vsp::GetUWTess01 ( const std::string & geom_id,
const int & surf_indx,
std::vector< double > & u_out_vec,
std::vector< double > & w_out_vec )
extern

Get the surface coordinate point of each intersection of the tessellated wireframe for a particular surface

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
array<double> utess, wtess;
GetUWTess01( geom_id, surf_indx, utess, wtess );
void GetUWTess01(const std::string &geom_id, const int &surf_indx, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec)
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[out]u_out_vecvector<double> Output vector of U (0 - 1) surface coordinates
[out]w_out_vecvector<double> Output vector of W (0 - 1) surface coordinates

◆ InsideSurf()

bool vsp::InsideSurf ( const std::string & geom_id,
const int & surf_indx,
const vec3d & pt )
extern

Test whether a given point is inside a specified surface.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double r = 0.12;
double s = 0.68;
double t = 0.56;
vec3d pnt = CompPntRST( geom_id, surf_indx, r, s, t );
bool res = InsideSurf( geom_id, surf_indx, pt );
if ( res )
{
print( "Inside" );
}
else
{
print( "Outside" );
}
bool InsideSurf(const std::string &geom_id, const int &surf_indx, const vec3d &pt)
See also
VecInsideSurf
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptInput 3D coordinate point
Returns
Boolean true if the point is inside the surface, false otherwise.

◆ ProjPnt01()

double vsp::ProjPnt01 ( const std::string & geom_id,
const int & surf_indx,
const vec3d & pt,
double & u_out,
double & w_out )
extern

Determine the nearest surface coordinate for an input 3D coordinate point and calculate the distance between the 3D point and the closest point of the surface.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
vec3d pnt = CompPnt01( geom_id, surf_indx, u, w );
vec3d norm = CompNorm01( geom_id, surf_indx, u, w );
double uout, wout;
// Offset point from surface
pnt = pnt + norm;
double d = ProjPnt01( geom_id, surf_indx, pnt, uout, wout );
Print( "Dist " + d + " u " + uout + " w " + wout );
double ProjPnt01(const std::string &geom_id, const int &surf_indx, const vec3d &pt, double &u_out, double &w_out)
See also
ProjPnt01Guess, ProjPnt01I
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptvec3d Input 3D coordinate point
[out]u_outdouble Output closest U (0 - 1) surface coordinate
[out]w_outdouble Output closest W (0 - 1) surface coordinate
Returns
double Distance between the 3D point and the closest point of the surface

◆ ProjPnt01Guess()

double vsp::ProjPnt01Guess ( const std::string & geom_id,
const int & surf_indx,
const vec3d & pt,
const double & u0,
const double & w0,
double & u_out,
double & w_out )
extern

Determine the nearest surface coordinate for an input 3D coordinate point and calculate the distance between the 3D point and the closest point of the surface. This function takes an input surface coordinate guess for, offering a potential decrease in computation time compared to ProjPnt01.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
double d = 0;
vec3d pnt = CompPnt01( geom_id, surf_indx, u, w );
vec3d norm = CompNorm01( geom_id, surf_indx, u, w );
double uout, wout;
// Offset point from surface
pnt = pnt + norm;
d = ProjPnt01Guess( geom_id, surf_indx, pnt, u + 0.1, w + 0.1, uout, wout );
Print( "Dist " + d + " u " + uout + " w " + wout );
double ProjPnt01Guess(const std::string &geom_id, const int &surf_indx, const vec3d &pt, const double &u0, const double &w0, double &u_out, double &w_out)
See also
ProjPnt01, ProjPnt01I
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptvec3d Input 3D coordinate point
[in]u0double Input U (0 - 1) surface coordinate guess
[in]w0double Input W (0 - 1) surface coordinate guess
[out]u_outdouble Output closest U (0 - 1) surface coordinate
[out]w_outdouble Output closest W (0 - 1) surface coordinate
Returns
double Distance between the 3D point and the closest point of the surface

◆ ProjPnt01I()

double vsp::ProjPnt01I ( const std::string & geom_id,
const vec3d & pt,
int & surf_indx_out,
double & u_out,
double & w_out )
extern

Determine the nearest surface coordinate and corresponding parent Geom main surface index for an input 3D coordinate point. Return the distance between the closest point and the input.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
double u = 0.12345;
double w = 0.67890;
double d = 0;
vec3d pnt = CompPnt01( geom_id, surf_indx, u, w );
vec3d norm = CompNorm01( geom_id, surf_indx, u, w );
double uout, wout;
int surf_indx_out;
// Offset point from surface
pnt = pnt + norm;
d = ProjPnt01I( geom_id, pnt, surf_indx_out, uout, wout );
Print( "Dist " + d + " u " + uout + " w " + wout + " surf_index " + surf_indx_out );
double ProjPnt01I(const std::string &geom_id, const vec3d &pt, int &surf_indx_out, double &u_out, double &w_out)
See also
ProjPnt01, ProjPnt01Guess
Parameters
[in]geom_idstring Parent Geom ID
[in]ptvec3d Input 3D coordinate point
[out]surf_indx_outint Output main surface index from the parent Geom
[out]u_outdouble Output closest U (0 - 1) surface coordinat
[out]w_outdouble Output closest W (0 - 1) surface coordinat
Returns
double Distance between the 3D point and the closest point of the surface

◆ ProjVecPnt01()

void vsp::ProjVecPnt01 ( const std::string & geom_id,
const int & surf_indx,
const std::vector< vec3d > & pts,
std::vector< double > & u_out_vec,
std::vector< double > & w_out_vec,
std::vector< double > & d_out_vec )
extern

Determine the nearest surface coordinates for an input array of 3D coordinate points and calculate the distance between each 3D point and the closest point of the surface.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> uvec, wvec;
uvec.resize( n );
wvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
uvec[i] = (i+1)*1.0/(n+1);
wvec[i] = (n-i)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPnt01( geom_id, 0, uvec, wvec );
array< vec3d > normvec = CompVecNorm01( geom_id, 0, uvec, wvec );
for( int i = 0 ; i < n ; i++ )
{
ptvec[i] = ptvec[i] + normvec[i];
}
array<double> uoutv, woutv, doutv;
ProjVecPnt01( geom_id, 0, ptvec, uoutv, woutv, doutv );
void ProjVecPnt01(const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec, std::vector< double > &d_out_vec)
See also
ProjVecPnt01Guess
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptsvector<vec3d> Input vector of 3D coordinate points
[out]u_out_vecvector<double> Output vector of the closest U (0 - 1) surface coordinate for each 3D input point
[out]w_out_vecvector<double> Output vector of the closest W (0 - 1) surface coordinate for each 3D input point
[out]d_out_vecvector<double> Output vector of distances for each 3D point and the closest point of the surface

◆ ProjVecPnt01Guess()

void vsp::ProjVecPnt01Guess ( const std::string & geom_id,
const int & surf_indx,
const std::vector< vec3d > & pts,
const std::vector< double > & u0s,
const std::vector< double > & w0s,
std::vector< double > & u_out_vec,
std::vector< double > & w_out_vec,
std::vector< double > & d_out_vec )
extern

Determine the nearest surface coordinates for an input array of 3D coordinate points and calculate the distance between each 3D point and the closest point of the surface. This function takes an input array of surface coordinate guesses for each 3D coordinate, offering a potential decrease in computation time compared to ProjVecPnt01.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int n = 5;
array<double> uvec, wvec;
uvec.resize( n );
wvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
uvec[i] = (i+1)*1.0/(n+1);
wvec[i] = (n-i)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPnt01( geom_id, 0, uvec, wvec );
array< vec3d > normvec = CompVecNorm01( geom_id, 0, uvec, wvec );
for( int i = 0 ; i < n ; i++ )
{
ptvec[i] = ptvec[i] + normvec[i];
}
array<double> uoutv, woutv, doutv, u0v, w0v;
u0v.resize( n );
w0v.resize( n );
for( int i = 0 ; i < n ; i++ )
{
u0v[i] = uvec[i] + 0.01234;
w0v[i] = wvec[i] - 0.05678;
}
ProjVecPnt01Guess( geom_id, 0, ptvec, u0v, w0v, uoutv, woutv, doutv );
void ProjVecPnt01Guess(const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts, const std::vector< double > &u0s, const std::vector< double > &w0s, std::vector< double > &u_out_vec, std::vector< double > &w_out_vec, std::vector< double > &d_out_vec)
See also
ProjVecPnt01,
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptsvector<vec3d> Input vector of 3D coordinate points
[in]u0svector<double> Input vector of U (0 - 1) surface coordinate guesses
[in]w0svector<double> Input vector of W (0 - 1) surface coordinate guesses
[out]u_out_vecvector<double> Output vector of the closest U (0 - 1) surface coordinate for each 3D input point
[out]w_out_vecvector<double> Output vector of the closest W (0 - 1) surface coordinate for each 3D input point
[out]d_out_vecvector<double> Output array of distances for each 3D point and the closest point of the surface

◆ VecInsideSurf()

std::vector< bool > vsp::VecInsideSurf ( const std::string & geom_id,
const int & surf_indx,
const std::vector< vec3d > & pts )
extern

Test whether a vector of points are inside a specified surface.

// Add Pod Geom
string geom_id = AddGeom( "POD", "" );
int surf_indx = 0;
int n = 5;
array<double> rvec, svec, tvec;
rvec.resize( n );
svec.resize( n );
tvec.resize( n );
for( int i = 0 ; i < n ; i++ )
{
rvec[i] = (i+1)*1.0/(n+1);
svec[i] = (n-i)*1.0/(n+1);
tvec[i] = (i+1)*1.0/(n+1);
}
array< vec3d > ptvec = CompVecPntRST( geom_id, 0, rvec, svec, tvec );
array<bool> res;
res = VecInsideSurf( geom_id, surf_indx, ptvec );
std::vector< bool > VecInsideSurf(const std::string &geom_id, const int &surf_indx, const std::vector< vec3d > &pts)
See also
VecInsideSurf
Parameters
[in]geom_idstring Parent Geom ID
[in]surf_indxint Main surface index from the parent Geom
[in]ptsvector<vec3d> Input vector of 3D coordinate points
Returns
Boolean vector for each point. True if it is inside the surface, false otherwise.