3.4.0
Functions for boolean calculations

Functions

TiglReturnCode tiglGetCurveIntersection (TiglCPACSConfigurationHandle cpacsHandle, const char *curvesID1, int curve1Idx, const char *curvesID2, int curve2Idx, double tolerance, char **intersectionID)
 tiglGetCurveIntersection computes intersection point of two (intersection) curves. Both curves are the result of a previous intersection (e.g. Fuselage-Wing Intersection). More...
 
TiglReturnCode tiglGetCurveIntersectionCount (TiglCPACSConfigurationHandle cpacsHandle, const char *intersectionID, int *pointCount)
 tiglGetCurveIntersectionCount returns the number of intersection points computed by tiglGetCurveIntersection for the given intersectionID. More...
 
TiglReturnCode tiglGetCurveIntersectionPoint (TiglCPACSConfigurationHandle cpacsHandle, const char *intersectionID, int pointIdx, double *pointX, double *pointY, double *pointZ)
 tiglGetCurveIntersectionPoint returns an intersection point calculated by tiglGetCurveIntersection More...
 
TiglReturnCode tiglGetCurveParameter (TiglCPACSConfigurationHandle cpacsHandle, const char *curveID, int curveIdx, double pointX, double pointY, double pointZ, double *eta)
 tiglGetCurveParameter projects a point onto a curve of an intersection line. The intersection line is specified by a curveID. The curveID can be calculated using tiglIntersectComponents, tiglIntersectWithPlane or tiglIntersectWithPlaneSegment. The function returns the parameter eta of the projected point on the curve. More...
 
TiglReturnCode tiglIntersectComponents (TiglCPACSConfigurationHandle cpacsHandle, const char *componentUidOne, const char *componentUidTwo, char **intersectionID)
 tiglIntersectComponents computes the intersection line(s) between two shapes specified by their CPACS uid. It returns an intersection ID for further computations on the result. To query points on the intersection line, tiglIntersectGetPoint has to be called. More...
 
TiglReturnCode tiglIntersectGetLineCount (TiglCPACSConfigurationHandle cpacsHandle, const char *intersectionID, int *lineCount)
 tiglIntersectGetLineCount returns the number of intersection lines computed by tiglIntersectComponents, tiglIntersectWithPlane or tiglIntersectWithPlaneSegment for the given intersectionID. More...
 
TiglReturnCode tiglIntersectGetPoint (TiglCPACSConfigurationHandle cpacsHandle, const char *intersectionID, int lineIdx, double eta, double *pointX, double *pointY, double *pointZ)
 tiglIntersectGetPoint samples a point on an intersection line calculated by tiglIntersectComponents, tiglIntersectWithPlane or tiglIntersectWithPlaneSegment. More...
 
TiglReturnCode tiglIntersectWithPlane (TiglCPACSConfigurationHandle cpacsHandle, const char *componentUid, double px, double py, double pz, double nx, double ny, double nz, char **intersectionID)
 tiglIntersectWithPlane computes the intersection line(s) between a shape and a plane. It returns an intersection ID for further computations on the result. To query points on the intersection line, tiglIntersectGetPoint has to be called. More...
 
TiglReturnCode tiglIntersectWithPlaneSegment (TiglCPACSConfigurationHandle cpacsHandle, const char *componentUid, double p1x, double p1y, double p1z, double p2x, double p2y, double p2z, double wx, double wy, double wz, char **intersectionID)
 tiglIntersectWithPlaneSegment computes the intersection line(s) between a shape and a plane segment. The plane segment is defined by p(u,v) = P1*(1-u) + P2*u + w*v, with u in [0,1] (see image). More...
 

Detailed Description

Function for boolean calculations on wings/fuselages.

These function currently only implement intersection algorithms between two shapes defined in cpacs ot a shape and a plane. Shapes or geometries are identified with their cpacs uid.

Currently only wings, wing segments, fuselages, and fuselage segments can be used in the intersection routines.

Function Documentation

◆ tiglGetCurveIntersection()

TiglReturnCode tiglGetCurveIntersection ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  curvesID1,
int  curve1Idx,
const char *  curvesID2,
int  curve2Idx,
double  tolerance,
char **  intersectionID 
)

tiglGetCurveIntersection computes intersection point of two (intersection) curves. Both curves are the result of a previous intersection (e.g. Fuselage-Wing Intersection).

The curves must be specified by their intersectionIDs and an index of the wire in the intersection. For each calculated intersection, the distance between the point on the first curve to the point on the second curve is smaller than the tolerance specified by the user.

It returns an intersection ID for further computations on the result. To query the number of intersection points, call tiglGetCurveIntersectionCount. To query intersection points, tiglGetCurveIntersectionPoint or tiglGetCurveParameter has to be called.

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]curvesID1ID of the first intersection
[in]curve1IdxIndex of the curve in the first intersection
[in]curvesID2ID of the second intersection
[in]curve2IdxIndex of the curve in the second intersection
[in]tolerancetolerance to specify the required accuracy of the intersection point
[out]intersectionIDA unique identifier that is associated with the computed intersection.
Returns
  • TIGL_SUCCESS if an intersection could be computed
  • TIGL_NOT_FOUND if the cpacs handle is not valid
  • TIGL_NULL_POINTER if either curveID or the intersectionID is a NULL pointer
  • TIGL_INDEX_ERROR if either curve index is invalid
  • TIGL_MATH_ERROR if the tolerance is not positive
  • TIGL_ERROR if some other error occurred

◆ tiglGetCurveIntersectionCount()

TiglReturnCode tiglGetCurveIntersectionCount ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  intersectionID,
int *  pointCount 
)

tiglGetCurveIntersectionCount returns the number of intersection points computed by tiglGetCurveIntersection for the given intersectionID.

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]intersectionIDThe intersection identifier returned by tiglGetCurveIntersection
[out]pointCountNumber of intersection points computed by tiglGetCurveIntersection If no intersection could be computed, pointCount is 0.
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NOT_FOUND if the cpacs handle is not valid
  • TIGL_NULL_POINTER if either intersectionID or pointCount is a NULL pointer

◆ tiglGetCurveIntersectionPoint()

TiglReturnCode tiglGetCurveIntersectionPoint ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  intersectionID,
int  pointIdx,
double *  pointX,
double *  pointY,
double *  pointZ 
)

tiglGetCurveIntersectionPoint returns an intersection point calculated by tiglGetCurveIntersection

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]intersectionIDThe intersection identifier returned by tiglGetCurveIntersection
[in]pointIdxIndex of the intersection point. To get the number of intersection points, call tiglGetCurveIntersectionCount with 1 <= pointIdx <= pointCount.
[out]pointXX coordinate of the resulting point.
[out]pointYY coordinate of the resulting point.
[out]pointZZ coordinate of the resulting point.
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NOT_FOUND if the cpacs handle is not valid
  • TIGL_NULL_POINTER if pointX, pointY, or pointZ or the intersectionID are NULL pointers
  • TIGL_INDEX_ERROR if pointIdx is not in valid range

◆ tiglGetCurveParameter()

TiglReturnCode tiglGetCurveParameter ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  curveID,
int  curveIdx,
double  pointX,
double  pointY,
double  pointZ,
double *  eta 
)

tiglGetCurveParameter projects a point onto a curve of an intersection line. The intersection line is specified by a curveID. The curveID can be calculated using tiglIntersectComponents, tiglIntersectWithPlane or tiglIntersectWithPlaneSegment. The function returns the parameter eta of the projected point on the curve.

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]curveIDThe id of the intersection line.
[in]curveIdxThe index of curve in the intersection.
[in]pointXX coordinate of the point to be projected.
[in]pointYY coordinate of the point to be projected.
[in]pointZZ coordinate of the point to be projected.
[out]etaThe parameter along the first curve.
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NOT_FOUND if the cpacs handle is not valid
  • TIGL_NULL_POINTER if intersectionID, curveID or eta are NULL pointers
  • TIGL_INDEX_ERROR if curveIdx is not in valid range

◆ tiglIntersectComponents()

TiglReturnCode tiglIntersectComponents ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  componentUidOne,
const char *  componentUidTwo,
char **  intersectionID 
)

tiglIntersectComponents computes the intersection line(s) between two shapes specified by their CPACS uid. It returns an intersection ID for further computations on the result. To query points on the intersection line, tiglIntersectGetPoint has to be called.

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]componentUidOneThe UID of the first component
[in]componentUidTwoThe UID of the second component
[out]intersectionIDA unique identifier that is associated with the computed intersection.
Returns
  • TIGL_SUCCESS if an intersection could be computed
  • TIGL_NOT_FOUND if the cpacs handle is not valid
  • TIGL_NULL_POINTER if either componentUidOne, componentUidTwo, or intersectionID are NULL pointers
  • TIGL_UID_ERROR if componentUidOne or componentUidTwo can not be found in the CPACS file

◆ tiglIntersectGetLineCount()

TiglReturnCode tiglIntersectGetLineCount ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  intersectionID,
int *  lineCount 
)

tiglIntersectGetLineCount returns the number of intersection lines computed by tiglIntersectComponents, tiglIntersectWithPlane or tiglIntersectWithPlaneSegment for the given intersectionID.

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]intersectionIDThe intersection identifier returned by tiglIntersectComponents or tiglIntersectWithPlane
[out]lineCountNumber of intersection lines computed by tiglIntersectComponents or tiglIntersectWithPlane. If no intersection could be computed, line count is 0.
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NOT_FOUND if the cpacs handle or the intersectionID is not valid
  • TIGL_NULL_POINTER if lineCount is a NULL pointer

◆ tiglIntersectGetPoint()

TiglReturnCode tiglIntersectGetPoint ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  intersectionID,
int  lineIdx,
double  eta,
double *  pointX,
double *  pointY,
double *  pointZ 
)

tiglIntersectGetPoint samples a point on an intersection line calculated by tiglIntersectComponents, tiglIntersectWithPlane or tiglIntersectWithPlaneSegment.

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]intersectionIDThe intersection identifier returned by tiglIntersectComponents or tiglIntersectWithPlane
[in]lineIdxLine index to sample from. To get the number of lines, call tiglIntersectGetLineCount. 1 <= lineIdx <= lineCount.
[in]etaParameter on the curve that determines the point position, with 0 <= eta <= 1.
[out]pointXX coordinate of the resulting point.
[out]pointYY coordinate of the resulting point.
[out]pointZZ coordinate of the resulting point.
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NOT_FOUND if the cpacs handle or the intersectionID is not valid
  • TIGL_NULL_POINTER if pointX, pointY, or pointZ are NULL pointers
  • TIGL_INDEX_ERROR if lineIdx is not in valid range
  • TIGL_MATH_ERROR if eta is not in range 0 <= eta <= 1

◆ tiglIntersectWithPlane()

TiglReturnCode tiglIntersectWithPlane ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  componentUid,
double  px,
double  py,
double  pz,
double  nx,
double  ny,
double  nz,
char **  intersectionID 
)

tiglIntersectWithPlane computes the intersection line(s) between a shape and a plane. It returns an intersection ID for further computations on the result. To query points on the intersection line, tiglIntersectGetPoint has to be called.

The shape has to be specified by its CPACS UID. The plane is specified by a central point p on the plane and a normal vector n, which is perpendicular to the plane. The normal vector must not be zero!

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]componentUidThe UID of the CPACS shape
[in]pxX Coordinate of the plane center point
[in]pyY Coordinate of the plane center point
[in]pzZ Coordinate of the plane center point
[in]nxX value of the plane normal vector
[in]nyY value of the plane normal vector
[in]nzZ value of the plane normal vector
[out]intersectionIDA unique identifier that is associated with the computed intersection.
Returns
  • TIGL_SUCCESS if an intersection could be computed
  • TIGL_NOT_FOUND if the cpacs handle is not valid
  • TIGL_NULL_POINTER if either componentUid or intersectionID are NULL pointers
  • TIGL_UID_ERROR if componentUid can not be found in the CPACS file
  • TIGL_MATH_ERROR if the normal vector is zero

◆ tiglIntersectWithPlaneSegment()

TiglReturnCode tiglIntersectWithPlaneSegment ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  componentUid,
double  p1x,
double  p1y,
double  p1z,
double  p2x,
double  p2y,
double  p2z,
double  wx,
double  wy,
double  wz,
char **  intersectionID 
)

tiglIntersectWithPlaneSegment computes the intersection line(s) between a shape and a plane segment. The plane segment is defined by p(u,v) = P1*(1-u) + P2*u + w*v, with u in [0,1] (see image).

intersectPlaneSegment.png
The dashed line connecting the points P1 and P2 is projected along w onto the shape (blue dashed line).

It returns an intersection ID for further computations on the result. To query points on the intersection line, tiglIntersectGetPoint has to be called.

The shape has to be specified by its CPACS UID. The plane segment is specified by two points p1 and p2 and a normal vector w, which (ideally) is perpendicular to (p2 - p1). The normal vector w must not be zero!

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]componentUidThe UID of the CPACS shape
[in]p1xX Coordinate of the first point P1
[in]p1yY Coordinate of the first point P1
[in]p1zZ Coordinate of the first point P1
[in]p2xX Coordinate of the second point P2
[in]p2yY Coordinate of the second point P2
[in]p2zZ Coordinate of the second point P2
[in]wxX value of the normal vector w
[in]wyY value of the normal vector w
[in]wzZ value of the normal vector w
[out]intersectionIDA unique identifier that is associated with the computed intersection.
Returns
  • TIGL_SUCCESS if an intersection could be computed
  • TIGL_NOT_FOUND if the cpacs handle is not valid
  • TIGL_NULL_POINTER if either componentUid or intersectionID are NULL pointers
  • TIGL_UID_ERROR if componentUid can not be found in the CPACS file
  • TIGL_MATH_ERROR if the normal vector is zero, p1 and p2 are equal or if w and (p2-p1) are linearly dependent.