OpenVSPAPI  3.23.0
Functions
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 CompPnt01 (const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w)
 
vec3d CompNorm01 (const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w)
 
vec3d CompTanU01 (const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w)
 
vec3d CompTanW01 (const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w)
 
void CompCurvature01 (const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w, double &out k1, double &out k2, double &out ka, double &out kg)
 
double ProjPnt01 (const string &in geom_id, const int &in surf_indx, const vec3d &in pt, double &out u, double &out w)
 
double ProjPnt01I (const string &in geom_id, const vec3d &in pt, int &out surf_indx, double &out u, double &out w)
 
double ProjPnt01Guess (const string &in geom_id, const int &in surf_indx, const vec3d &in pt, const double &in u0, const double &in w0, double &out u, double &out w)
 
double AxisProjPnt01 (const string &in geom_id, const int &in surf_indx, const int &in iaxis, const vec3d &in pt, double &out u_out, double &out w_ou, vec3d &out p_out)
 
double AxisProjPnt01I (const string &in geom_id, const int &in iaxis, const vec3d &in pt, int &out surf_indx_out, double &out u_out, double &out w_out, vec3d &out p_out)
 
double AxisProjPnt01Guess (const string &in geom_id, const int &in surf_indx, const int &in iaxis, const vec3d &in pt, const double &in u0, const double &in w0, double &out u_out, double &out w_out, vec3d &out p_out)
 
void GetUWTess01 (const string &in geom_id, int &in surf_indx, double[]@ us, double[]@ ws)
 
vec3d[] CompVecPnt01 (const string &in geom_id, const int &in surf_indx, double[]@ us, double[]@ ws)
 
vec3d[] CompVecNorm01 (const string &in geom_id, const int &in surf_indx, double[]@ us, double[]@ ws)
 
void CompVecCurvature01 (const string &in geom_id, const int &in surf_indx, double[]@ us, double[]@ ws, double[]@ k1s, double[]@ k2s, double[]@ kas, double[]@ kgs)
 
void ProjVecPnt01 (const string &in geom_id, const int &in surf_indx, vec3d[]@ pts, double[]@ us, double[]@ ws, double[]@ ds)
 
void ProjVecPnt01Guess (const string &in geom_id, const int &in surf_indx, vec3d[]@ pts, double[]@ u0s, double[]@ w0s, double[]@ us, double[]@ ws, double[]@ ds)
 
void AxisProjVecPnt01 (const string &in geom_id, const int &in surf_indx, const int &in iaxis, vec3d[]@ pts, double[]@ us, double[]@ ws, vec3d[]@ ps_out, double[]@ ds)
 
void AxisProjVecPnt01Guess (const string &in geom_id, int &in surf_indx, const int &in iaxis, vec3d[]@ pts, double[]@ u0s, double[]@ w0s, double[]@ us, double[]@ ws, vec3d[]@ ps_out, double[]@ ds)
 

Detailed Description

Function Documentation

◆ AxisProjPnt01()

double AxisProjPnt01 ( const string &in  geom_id,
const int &in  surf_indx,
const int &in  iaxis,
const vec3d &in  pt,
double &out  u_out,
double &out  w_ou,
vec3d &out  p_out 
)

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;
vec3d p_out;
double idist = AxisProjPnt01( geom_id, surf_indx, Y_DIR, pt, u_out, w_out, p_out);
Print( "iDist " + idist + " u_out " + u_out + " w_out " + w_out );
Print( "3D Offset ", false);
Print( surf_pt - p_out );
See also
AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01, AxisProjVecPnt01Guess
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]iaxisAxis 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
[out]p_outOutput 3D coordinate point
Returns
Axis aligned distance between the 3D point and the projected point on the surface

◆ AxisProjPnt01Guess()

double AxisProjPnt01Guess ( const string &in  geom_id,
const int &in  surf_indx,
const int &in  iaxis,
const vec3d &in  pt,
const double &in  u0,
const double &in  w0,
double &out  u_out,
double &out  w_out,
vec3d &out  p_out 
)

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 u_out, w_out;
vec3d p_out;
d = AxisProjPnt01Guess( geom_id, surf_indx, Y_DIR, pt, u0, w0, u_out, w_out, p_out);
Print( "Dist " + d + " u " + uout + " w " + wout );
See also
AxisProjPnt01, AxisProjPnt01I, AxisProjVecPnt01, AxisProjVecPnt01Guess
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]iaxisAxis 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]uOutput closest U (0 - 1) surface coordinate
[out]wOutput closest W (0 - 1) surface coordinate
[out]p_outOutput 3D coordinate point
Returns
Distance between the 3D point and the closest point of the surface

◆ AxisProjPnt01I()

double AxisProjPnt01I ( const string &in  geom_id,
const int &in  iaxis,
const vec3d &in  pt,
int &out  surf_indx_out,
double &out  u_out,
double &out  w_out,
vec3d &out  p_out 
)

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;
vec3d p_out;
int surf_indx_out;
double idist = AxisProjPnt01I( geom_id, Y_DIR, pt, surf_indx_out, u_out, w_out, p_out);
Print( "iDist " + idist + " u_out " + u_out + " w_out " + w_out + " surf_index " + surf_indx_out );
Print( "3D Offset ", false);
Print( surf_pt - p_out );
See also
AxisProjPnt01, AxisProjPnt01Guess, AxisProjVecPnt01, AxisProjVecPnt01Guess
Parameters
[in]geom_idParent Geom ID
[in]iaxisAxis 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
[out]p_outOutput 3D coordinate point
Returns
Axis aligned distance between the 3D point and the projected point on the surface

◆ AxisProjVecPnt01()

void AxisProjVecPnt01 ( const string &in  geom_id,
const int &in  surf_indx,
const int &in  iaxis,
vec3d@[]  pts,
double@[]  us,
double@[]  ws,
vec3d@[]  ps_out,
double@[]  ds 
)

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, poutv, 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] );
}
See also
AxisProjPnt01, AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01Guess
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]iaxisAxis direction to project point along (X_DIR, Y_DIR, or Z_DIR)
[in]ptsInput array of 3D coordinate points
[out]usOutput array of the closest U (0 - 1) surface coordinate for each 3D input point
[out]wsOutput array of the closest W (0 - 1) surface coordinate for each 3D input point
[out]ps_outOutput array of 3D coordinate point
[out]dsOutput array of axis distances for each 3D point and the projected point of the surface

◆ AxisProjVecPnt01Guess()

void AxisProjVecPnt01Guess ( const string &in  geom_id,
int &in  surf_indx,
const int &in  iaxis,
vec3d@[]  pts,
double@[]  u0s,
double@[]  w0s,
double@[]  us,
double@[]  ws,
vec3d@[]  ps_out,
double@[]  ds 
)

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, poutv, 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] );
}
See also
AxisProjPnt01, AxisProjPnt01Guess, AxisProjPnt01I, AxisProjVecPnt01
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]iaxisAxis direction to project point along (X_DIR, Y_DIR, or Z_DIR)
[in]ptsInput array of 3D coordinate points
[in]u0sInput array of U (0 - 1) surface coordinate guesses
[in]w0sInput array of W (0 - 1) surface coordinate guesses
[out]usOutput array of the closest U (0 - 1) surface coordinate for each 3D input point
[out]wsOutput array of the closest W (0 - 1) surface coordinate for each 3D input point
[out]ps_outOutput array of 3D coordinate point
[out]dsOutput array of axis distances for each 3D point and the projected point of the surface

◆ CompCurvature01()

void CompCurvature01 ( const string &in  geom_id,
const int &in  surf_indx,
const double &in  u,
const double &in  w,
double &out  k1,
double &out  k2,
double &out  ka,
double &out  kg 
)

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;
CompCurvature01( geom_id, surf_indx, u, w, k1, k2, ka, kg );
Print( "Curvature : k1 " + k1 + " k2 " + k2 + " ka " + ka + " kg " + kg );
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]uU (0 - 1) surface coordinate
[in]wW (0 - 1) surface coordinate
[out]k1Output value of maximum principal curvature
[out]k2Output value of minimum principal curvature
[out]kaOutput value of mean curvature
[out]kgOutput value of Gaussian curvature

◆ CompNorm01()

vec3d CompNorm01 ( const string &in  geom_id,
const int &in  surf_indx,
const double &in  u,
const double &in  w 
)

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() + ' )' );
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]uU (0 - 1) surface coordinate
[in]wW (0 - 1) surface coordinate
Returns
Normal vector

◆ CompPnt01()

vec3d CompPnt01 ( const string &in  geom_id,
const int &in  surf_indx,
const double &in  u,
const double &in  w 
)

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_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]uU (0 - 1) surface coordinate
[in]wW (0 - 1) surface coordinate
Returns
Normal vector3D coordinate point

◆ CompTanU01()

vec3d CompTanU01 ( const string &in  geom_id,
const int &in  surf_indx,
const double &in  u,
const double &in  w 
)

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() + ' )' );
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain 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 CompTanW01 ( const string &in  geom_id,
const int &in  surf_indx,
const double &in  u,
const double &in  w 
)

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() + ' )' );
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain 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 CompVecCurvature01 ( const string &in  geom_id,
const int &in  surf_indx,
double@[]  us,
double@[]  ws,
double@[]  k1s,
double@[]  k2s,
double@[]  kas,
double@[]  kgs 
)

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 );
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]usInput array of U (0 - 1) surface coordinates
[in]wsInput array of W (0 - 1) surface coordinates
[out]k1sOutput array of maximum principal curvatures
[out]k2sOutput array of minimum principal curvatures
[out]kasOutput array of mean curvatures
[out]kgsOutput array of Gaussian curvatures

◆ CompVecNorm01()

vec3d [] CompVecNorm01 ( const string &in  geom_id,
const int &in  surf_indx,
double@[]  us,
double@[]  ws 
)

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 );
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]usInput array of U (0 - 1) surface coordinates
[in]wsInput array of W (0 - 1) surface coordinates
Returns
Array of 3D normal vectors

◆ CompVecPnt01()

vec3d [] CompVecPnt01 ( const string &in  geom_id,
const int &in  surf_indx,
double@[]  us,
double@[]  ws 
)

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_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]usInput array of U (0 - 1) surface coordinates
[in]wsInput array of W (0 - 1) surface coordinates
Returns
Array of 3D coordinate points

◆ GetUWTess01()

void GetUWTess01 ( const string &in  geom_id,
int &in  surf_indx,
double@[]  us,
double@[]  ws 
)

Get the surface coordinate point of each intersection of the tesselated 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 );
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[out]usOutput array of U (0 - 1) surface coordinates
[out]wsOutput array of W (0 - 1) surface coordinates

◆ ProjPnt01()

double ProjPnt01 ( const string &in  geom_id,
const int &in  surf_indx,
const vec3d &in  pt,
double &out  u,
double &out  w 
)

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 );
See also
ProjPnt01Guess, ProjPnt01I
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]ptInput 3D coordinate point
[out]uOutput closest U (0 - 1) surface coordinate
[out]wOutput closest W (0 - 1) surface coordinate
Returns
Distance between the 3D point and the closest point of the surface

◆ ProjPnt01Guess()

double ProjPnt01Guess ( const string &in  geom_id,
const int &in  surf_indx,
const vec3d &in  pt,
const double &in  u0,
const double &in  w0,
double &out  u,
double &out  w 
)

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;
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 );
See also
ProjPnt01, ProjPnt01I
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]ptInput 3D coordinate point
[in]u0Input U (0 - 1) surface coordinate guess
[in]w0Input W (0 - 1) surface coordinate guess
[out]uOutput closest U (0 - 1) surface coordinate
[out]wOutput closest W (0 - 1) surface coordinate
Returns
Distance between the 3D point and the closest point of the surface

◆ ProjPnt01I()

double ProjPnt01I ( const string &in  geom_id,
const vec3d &in  pt,
int &out  surf_indx,
double &out  u,
double &out  w 
)

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;
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 );
See also
ProjPnt01, ProjPnt01Guess
Parameters
[in]geom_idParent Geom ID
[in]ptInput 3D coordinate point
[out]surf_indxOutput main surface index from the parent Geom
[out]uOutput closest U (0 - 1) surface coordinat
[out]wOutput closest W (0 - 1) surface coordinat
Returns
Distance between the 3D point and the closest point of the surface

◆ ProjVecPnt01()

void ProjVecPnt01 ( const string &in  geom_id,
const int &in  surf_indx,
vec3d@[]  pts,
double@[]  us,
double@[]  ws,
double@[]  ds 
)

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 );
See also
ProjVecPnt01Guess
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]ptsInput array of 3D coordinate points
[out]usOutput array of the closest U (0 - 1) surface coordinate for each 3D input point
[out]wsOutput array of the closest W (0 - 1) surface coordinate for each 3D input point
[out]dsOutput array of distances for each 3D point and the closest point of the surface

◆ ProjVecPnt01Guess()

void ProjVecPnt01Guess ( const string &in  geom_id,
const int &in  surf_indx,
vec3d@[]  pts,
double@[]  u0s,
double@[]  w0s,
double@[]  us,
double@[]  ws,
double@[]  ds 
)

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 );
See also
ProjVecPnt01,
Parameters
[in]geom_idParent Geom ID
[in]surf_indxMain surface index from the parent Geom
[in]ptsInput array of 3D coordinate points
[in]u0sInput array of U (0 - 1) surface coordinate guesses
[in]w0sInput array of W (0 - 1) surface coordinate guesses
[out]usOutput array of the closest U (0 - 1) surface coordinate for each 3D input point
[out]wsOutput array of the closest W (0 - 1) surface coordinate for each 3D input point
[out]dsOutput array of distances for each 3D point and the closest point of the surface
ProjVecPnt01Guess
void ProjVecPnt01Guess(const string &in geom_id, const int &in surf_indx, vec3d[]@ pts, double[]@ u0s, double[]@ w0s, double[]@ us, double[]@ ws, double[]@ ds)
GetUWTess01
void GetUWTess01(const string &in geom_id, int &in surf_indx, double[]@ us, double[]@ ws)
AxisProjVecPnt01
void AxisProjVecPnt01(const string &in geom_id, const int &in surf_indx, const int &in iaxis, vec3d[]@ pts, double[]@ us, double[]@ ws, vec3d[]@ ps_out, double[]@ ds)
AxisProjPnt01I
double AxisProjPnt01I(const string &in geom_id, const int &in iaxis, const vec3d &in pt, int &out surf_indx_out, double &out u_out, double &out w_out, vec3d &out p_out)
vec3d::z
double z() const
CompVecNorm01
vec3d[] CompVecNorm01(const string &in geom_id, const int &in surf_indx, double[]@ us, double[]@ ws)
CompTanW01
vec3d CompTanW01(const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w)
vec3d::x
double x() const
CompVecPnt01
vec3d[] CompVecPnt01(const string &in geom_id, const int &in surf_indx, double[]@ us, double[]@ ws)
CompVecCurvature01
void CompVecCurvature01(const string &in geom_id, const int &in surf_indx, double[]@ us, double[]@ ws, double[]@ k1s, double[]@ k2s, double[]@ kas, double[]@ kgs)
CompCurvature01
void CompCurvature01(const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w, double &out k1, double &out k2, double &out ka, double &out kg)
vec3d::y
double y() const
ProjPnt01Guess
double ProjPnt01Guess(const string &in geom_id, const int &in surf_indx, const vec3d &in pt, const double &in u0, const double &in w0, double &out u, double &out w)
AxisProjVecPnt01Guess
void AxisProjVecPnt01Guess(const string &in geom_id, int &in surf_indx, const int &in iaxis, vec3d[]@ pts, double[]@ u0s, double[]@ w0s, double[]@ us, double[]@ ws, vec3d[]@ ps_out, double[]@ ds)
Y_DIR
@ Y_DIR
Definition: openvsp_as.h:1311
vec3d
A class for representing 3D vectors.
Definition: openvsp_as.h:349
CompPnt01
vec3d CompPnt01(const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w)
array
AngelScript ScriptExtension for representing the C++ std::vector.
Definition: openvsp_as.h:252
ProjPnt01
double ProjPnt01(const string &in geom_id, const int &in surf_indx, const vec3d &in pt, double &out u, double &out w)
vec3d::offset_y
void offset_y(double offset)
CompNorm01
vec3d CompNorm01(const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w)
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
ProjVecPnt01
void ProjVecPnt01(const string &in geom_id, const int &in surf_indx, vec3d[]@ pts, double[]@ us, double[]@ ws, double[]@ ds)
Print
void Print(const string &in data, bool new_line=true)
AxisProjPnt01
double AxisProjPnt01(const string &in geom_id, const int &in surf_indx, const int &in iaxis, const vec3d &in pt, double &out u_out, double &out w_ou, vec3d &out p_out)
ProjPnt01I
double ProjPnt01I(const string &in geom_id, const vec3d &in pt, int &out surf_indx, double &out u, double &out w)
AxisProjPnt01Guess
double AxisProjPnt01Guess(const string &in geom_id, const int &in surf_indx, const int &in iaxis, const vec3d &in pt, const double &in u0, const double &in w0, double &out u_out, double &out w_out, vec3d &out p_out)
CompTanU01
vec3d CompTanU01(const string &in geom_id, const int &in surf_indx, const double &in u, const double &in w)