AlIntersect
Support for intersection of objects.
Synopsis
#include <AlIntersect.h>
class AlIntersect
static statusCode intersect( AlCurve*, AlCurve*, AlList* & );
static statusCode intersect( AlCurve*, AlSurface*, AlList* & );
static statusCode intersect( AlSurface*, AlSurface*, AlIntersectSurfSurfInfo& );
static statusCode intersect( AlSurface *surface, double point[3], double planeNormal[3], AlIntersectSurfSurfInfo &ss );
static statusCode intersect( AlSurface *surface, double point[3],double planeNormal[3], double boundingBoxTol, boolean & noIntersect, boolean &intersectWithinTol, double &x, double &y, double &z );
class AlIntersectCurveCurveInfo : public AlLinkItem
AlIntersectCurveCurveInfo* nextItem() const;
AlIntersectCurveCurveInfo* prevItem() const;
double tCurve1, tCurve2;
double point[3];
class AlIntersectCurveSurfInfo : public AlLinkItem
AlIntersectCurveSurfInfo* nextItem() const;
AlIntersectCurveSurfInfo* prevItem() const;
double t;
double pointOnCurve[3];
double u,v;
double pointOnSurface[3];
class AlIntersectSurfSurfInfo
~AlIntersectSurfSurfInfo();
int numberIsolatedPoints;
double3* isolatedPoints;
int numberIntersectionCurves;
AlCurve** intersectionCurves;
int numberBoundaryCurves;
AlCurve** boundaryCurves;
Description
This collection of classes provides the programmer with the ability to determine points of intersection between two curves, a curve and a surface, or two surfaces.
Each type of intersection responds with its own class of results: AlIntersectCurveCurveInfo, AlIntersectCurveSurfInfo, and AlIntersectSurfSurfInfo. The first two of these are simple AlList classes. The last one is a structure storing pointers to AlCurves and (x/y/z) points.
AlIntersectCurveCurveInfo* AlIntersectCurveCurveInfo::nextItem() const
Description
Returns the next item in the AlIntersectCurveCurveInfo list.
AlIntersectCurveCurveInfo* AlIntersectCurveCurveInfo::prevItem() const
Description
Returns the previous item in the AlIntersectCurveCurveInfo list.
AlIntersectCurveSurfInfo* AlIntersectCurveSurfInfo::nextItem() const
Description
Returns the next item in the AlIntersectCurveSurfInfo list.
AlIntersectCurveSurfInfo* AlIntersectCurveSurfInfo::prevItem() const
Description
Returns the previous item in the AlIntersectCurveSurfInfo list.
AlIntersectSurfSurfInfo::~AlIntersectSurfSurfInfo()
Description
Destructor for AlIntersectSurfSurfInfo. Only deletes the isolatedPoints[] array, so that the user may choose which AlCurves to keep.
statusCode AlIntersect::intersect( AlCurve* curve, AlSurface* surface,AlList* &list )
Description
Intersects a curve with a surface. Points of intersection are returned in a AlIntersectCurveSurfInfo list, giving (x,y,z) coordinates, (u,v) parameters, and (t) parameters.
Arguments
< curve - a valid AlCurve to intersect
< surface - a valid surface to intersect
> list - the points of intersection (see AlIntersectCurveSurfInfo)
Return Codes
sSuccess - successful intersection (not necessarily any points of intersection)
sInvalidArgument - the curve/surface was invalid
sFailure - the intersection failed
statusCode AlIntersect::intersect( AlCurve* curve1, AlCurve* curve2,AlList* &list )
Description
Intersects a curve with another curve. Points of intersection are returned in a AlIntersectCurveCurveInfo list, giving (x,y,z) coordinates and (t) parameters.
Arguments
< curve1 - a valid AlCurve to intersect
< curve2 - a valid AlCurve to intersect
> list - the points of intersection (see AlIntersectCurveCurveInfo)
Return Codes
sSuccess - successful intersection (not necessarily any points of intersection)
sInvalidArgument - a curve was invalid
sFailure - the intersection failed
statusCode AlIntersect::intersect( AlSurface *surface, double point[3], double planeNormal[3], AlIntersectSurfSurfInfo &ss );
Description
This method intersects a surface and an infinite plane. As in t
he other surface/surface intersection method, an AlIntersectSurfSurfInfo is returned.
Arguments
< surface - the surface to intersect
< point - point on the plane of intersection
< planeNormal - normal of the plane of intersection
> ss - the points of intersection (see AlIntersectSurfSurfInfo)
Return Codes
sSuccess - the intersection worked( does not imply intersection)
sInvalidArgument - the surface pointer is null
sInvalidObject - the surface is an invalid wrapper
sFailure - intersection failed
:statusCode AlIntersect::intersect( AlSurface *surface, double point[3], double planeNormal[3], double boundingBoxTol, boolean &noIntersect, boolean &intersectWithinTol, double &x, double &y, double &z );
Description
This method intersects a surface and a plane. The result of surface and plane intersection are curves. This method will find the curves of intersection, sum the bounding boxes of the curves and find the mid point of the joined bounding box. This method can be used to evaluate intersection points where the surface is discontinuous. Through iteration, you can find a point where the bounding box tolerance(distance from min to max points) is less than the parameter passed in.
Arguments
< surface - the surface to intersect
< point - point on the plane of intersection
/< planeNormal - normal of the plane of intersection
< boundingBoxTolerance - smallest distance between the min and max points of a bounding box required
> noIntersect - set to TRUE or FALSE depending on if the intersection was found
intersectWithTol - set to TRUE if the intersection was in a bounding box matching the specified tolerance. Set to FALSE otherwise.
> x,y,z - the mid point of the bounding box built from the curves of intersection
Return Codes
sSuccess - the intersection worked
sInvalidArgument - the surface pointer is null
sInvalidObject - the surface is an invalid wrapper
sFailure - intersection failed
statusCode AlIntersect::intersect( AlSurface* surface1, AlSurface* surface2,AlIntersectSurfSurfInfo &ss )
Description
Intersects a surface with another surface. Points of intersection are returned in a AlIntersectSurfSurf list, giving AlCurves and (x,y,z) points.
Arguments
< surface1 - a valid AlCurve to intersect
< surface2 - a valid AlCurve to intersect
> ss - the points of intersection (see AlIntersectSurfSurfInfo)
Return Codes
sSuccess - successful intersection (not necessarily any points of intersection)
sInsufficientMemory - not enough memory to perform intersection
sInvalidArgument - a surface was invalid
sFailure - the intersection failed