AlSurface
 
 
 

Interface to Alias NURBS surface geometry.

Synopsis

#include <AlSurface.h>
class AlSurface : public AlObject
AlSurface();
virtual	~AlSurface();
virtual statusCode	deleteObject();
virtual AlObject*	copyWrapper() const;
statusCode	create( int, int, curveFormType, curveFormType, int, int, const double[], const double[], int, int, const double[], const int[], const int[] );
statusCode	create( int, int, curveFormType, curveFormType, const double[], const double[], int, int, const double[] );
statusCode	createRevolvedSurface(const double[3], const double[3], double, double, const AlCurve* );
statusCode	createRevolvedSurface( double [3], double [3], AlCurve* );
statusCode	createLinearExtrusionSurface( double [3], double, AlCurve* );
statusCode	createTorus(const double[3], const double[3], double, double, const double[3], double, double, double, double);
statusCode	createSphere( double [3], double );
statusCode	createCylinder( double [3], double [3], double);
statusCode	createCone( double[3], double, double[3], double);
virtual AlObjectType	type() const;
AlSurfaceNode*	surfaceNode() const;
curveFormType	uForm() const;
curveFormType	vForm() const;
int	uDegree() const;
int	vDegree() const;
int	uNumberOfSpans() const;
int	vNumberOfSpans() const;
int	uNumberOfCVs() const;
int	vNumberOfCVs() const;
AlSurfaceCV*	firstCV() const;
AlSurfaceCV*	getCV( int, int ) const;
AlAttributes*	firstAttribute() const;
boolean	isAffectedByViewFrame() const;		// Obselete
boolean	isConstructionHistoryResultingSurface() const;
// Specific to AlSurface
statusCode	setCVsUnaffectedPosition( const double[]);
statusCode	setuKnotVector( const double[] );
statusCode	setvKnotVector( const double[] );
statusCode	setCVsUnaffectedPositionInclMultiples( const double[] );
statusCode	setRealuKnotVector( const double[] );
statusCode	setRealvKnotVector( const double[] );
statusCode	unpileEndKnots( int, const double[] );
boolean	isPointActive( double u, double v ) const;
// Common to AlSurface, AlTrimRegion
statusCode	CVsWorldPosition( double[], int[], int[])const;
statusCode	CVsAffectedPosition( const AlTM&, double[], int[], int[]) const;
statusCode	CVsUnaffectedPosition( double[], int[], int[])const;
int	uNumberOfKnots() const;
int	vNumberOfKnots() const;
statusCode	uKnotVector( double[] ) const;
statusCode	vKnotVector( double[] ) const;
int	uNumberOfCVsInclMultiples() const;
int	vNumberOfCVsInclMultiples() const;
statusCode	CVsWorldPositionInclMultiples( double[] ) const;
statusCode	CVsAffectedPositionInclMultiples( const AlTM&, double[] ) const;
statusCode	CVsUnaffectedPositionInclMultiples( double[] )const;
int	realuNumberOfKnots() const;
int	realvNumberOfKnots() const;
statusCode	realuKnotVector( double[] ) const;
statusCode	realvKnotVector( double[] ) const;
statusCode	area( double& area, boolean worldCoords = TRUE, double tolerance=0.001 );
statusCode	circumference( double& circ, boolean worldCoords = TRUE, double tolerance=0.001 );
statusCode	eval(double,double,boolean,double P[3], double Pu[3]=NULL, double Pv[3]=NULL, double n[3]=NULL,boolean=FALSE,boolean=FALSE ) const;
// Specific to AlSurface
AlShader*	firstShader() const;
AlShader*	nextShader( const AlShader* ) const;
statusCode	nextShaderD( AlShader* ) const;
statusCode	assignShader( AlShader* );
statusCode	layerShader( AlShader* );
statusCode	renderInfo( AlRenderInfo& ) const;
statusCode	setRenderInfo( const AlRenderInfo& ) const;
boolean	trimmed() const;
boolean	isTargetSurface() const;
statusCode	project( AlCurveNode*, double[3], boolean );
statusCode projectNormal( AlCurveNode* curveNode, boolean keep_history );
statusCode trim( int, const double[], const double[], boolean );
statusCode	trim( int, const double[], const double[] );
statusCode	trim( int, const AlCurveOnSurface*[] );
statusCode	uniformRebuild( AlSurfaceNode* &newSurfaceNode, int nu, int nv, boolean inU, boolean inV, boolean=TRUE );
statusCode periodicToNonPeriodic( int, int );
statusCode periodicToNonPeriodic() const;
AlSurface* 	untrimmedToTrimmedSurface() const;
AlTrimRegion*	trimSurfaceToRegion() const;
AlTrimRegion*	firstTrimRegion() const;
AlCurve*	localBoundary( int ) const;
AlCurve*	getModelSpaceSurfaceBoundary() const;
AlCurve*	parameterBoundary( int ) const;
AlCurve*	getParamSpaceSurfaceBoundary() const;
AlCurveOnSurface*	firstCurveOnSurface() const;
statusCode	addCurveOnSurface( AlCurveOnSurface* );
statusCode	removeCurveOnSurface( AlCurveOnSurface* );
boolean	isDisplayModeSet( AlDisplayModeType ) const;
statusCode	setDisplayMode( AlDisplayModeType, boolean );
statusCode	doUpdates( boolean newState = TRUE );
statusCode	insert( double, Direction );
statusCode reverseDirection( boolean inU, boolean inV );

Description

AlSurface is the interface to the geometric data of Alias’ NURBS surface objects. To create a surface, first instantiate and create an AlSurface and then instantiate and create an AlSurfaceNode. There is only a limited amount that you can do with an AlSurface that does not have an AlSurfaceNode.

For more information on how to create the surface geometry, see the description for the create() method.

Note: method isAffectedByViewFrame() is now obsolete. The new method to call is isConstructionHistoryResultingSurface() to find out if a surface may be modified based on changes to its constructor objects.

A NURBS surface is described as having two dimensions, u and v. Many of the surface properties (form, multiplicity, and so on) are the same as a NURBS curve but are expressed in both the u and v direction.

The form of a surface in the u or v direction can be one of three types: periodic, closed or open. If a surface is "kPeriodic" in u, then it is tangent continuous in u at all points in that direction. If a surface is "kClosed" in u, it is not periodic but its edges in the u direction are coincident. If the surface is neither closed nor periodic in u, it is considered to be "kOpen". The same applies in the v direction.

There are two ways to delete an AlSurface. If the AlSurface deleteObject() is called, the attached AlSurfaceNode is deleted. If the AlSurfaceNode deleteObject() is called, the attached AlSurface is deleted.

You should always create a surface node for a surface. If you create a surface with no surface node, then the surface is not added to the universe. If you should lose the pointer to the surface, it will become lost memory.

There is one limitation to this class: you cannot add or remove individual CVs (except by changing multiplicity).

If an AlSurface has curves-on-surface, then you can get a pointer to the first curve-on-surface and then traverse the curves using methods in the class AlCurveOnSurface.

If an AlSurface is trimmed, the trim regions on the surface can be accessed using the firstTrimRegion() method and then traversed using methods in the class AlTrimRegion.

All AlSurface objects will have at least one shader attached to them. These can be accessed through the firstShader() and nextShader() methods.

All AlSurface objects have render information attached to them. The AlRenderInfo structure can be used to query the surface’s render parameters.

Surfaces are made of surface control points (or CVs) which you traverse as a list by using the firstCV() in conjunction with the AlSurfaceCV methods. You can also pack the surface information into an array using methods in this class.

What is multiplicity?

An AlSurfaceCV object can actually represent multiple CVs, depending on the AlSurfaceCV’s multiplicity and periodicity. Notice that in this class there are two sets of methods - some "InclMultiples" and some not (namely "numberOfCVs", "CVsWorldPosition", "CVsUnaffectedPosition", etc). The set of methods without multiplicity lets you get all surface CV’s where a surface CV can have multiplicity of 1, 2 or 3. The set of methods "InclMultiples" lets you get ALL surface CVs including multiples due to a multiplicity > 1 and due to periodicity.

Example 1

Create a surface in the interactive Alias package with 16 CVs, and pick the CV which is second in the u direction and second in the v direction. Set the multiplicity of this CV to 3 in the u direction and 2 in the v direction (using the "multiplicity" tool). Then:

  1. uNumberOfCVs() will return 4. uNumberOfCVs() will return 4.
  2. CVsWorldPosition must be passed a 4x4x4 CVs matrix, and the u and v multiplicity vectors must each be of length 4.
  3. CVsUnaffectedPosition() must be passed the same as item 2.
  4. setCVsUnaffectedPosition() must be passed the same as item 2.
  5. uNumberOfCVsInclMultiples() will return 6. vNumberOfCvsInclMultiples() will return 5.
  6. CVsWorldPositionInclMultiples() must be passed a 6x5x4 CVs matrix. You will notice that in this matrix there are duplicate CVs to indicate multiples due to multiplicity > 1 and periodicity.
  7. CVsUnaffectedPositionInclMultiples() must be passed the same as item 6. You will notice that in this matrix there are duplicate CVs to indicate multiples due to multiplicity > 1 and periodicity.
  8. setCVsUnaffectedPositionInclMultiples() must be passed the same as item 6. Similar to items 6 and 7, you should put duplicate CVs to account for multiples although this is not mandatory. You may want to refer to the examples in the AlCurve class description. The way CVs are ignored also applies to this method.

Example 2

If you create a surface in the interactive Alias package with 16 CVs and "close" the surface in the u direction (using the "close" tool in the Object Tools palette), you create a periodic surface. Then:

  1. uNumberOfCVs() will return 4. uNumberOfCVs() will return 4.
  2. CVsWorldPosition must be passed a 4x4x4 CVs matrix, and the u and v multiplicity vectors must each be of length 4.
  3. CVsUnaffectedPosition() must be passed the same as item 2.
  4. setCVsUnaffectedPosition() must be passed the same as item 2.
  5. uNumberOfCVsInclMultiples() will return 7. uNumberOfCVsInclMultiples() will return 4.
  6. CVsWorldPositionInclMultiples() must be passed a 7x4x4 CVs matrix.
  7. CVsUnaffectedPositionInclMultiples() must be passed the same as item 6.
  8. setCVsUnaffectedPositionInclMultiples() must be passed the same as item 6. Similar to items 6 and 7, you should put duplicate CVs to account for multiples although this is not mandatory. You may want to refer to the examples in the AlCurve class description. The way CVs are ignored also applies to this method.

How do I process a matrix of CVs?

Methods in this class store CVs in the V direction first, then in the U direction. Here’s an example of how to get the world positions of the CVs of a surface and print them out in V direction then U direction. (Notice that the outer "for" loop uses the number of CVs in the U direction).

     int  numUCvs = surface->uNumberOfCVs();
     int  numVCvs = surface->vNumberOfCVs();
     double *cvs = new double [numUCvs * numVCvs * 4];
     int  *uMult = new int [numUCvs];
     int  *vMult = new int [numVCvs];
     int  u, v, index;
     surface->CVsWorldPosition( cvs, uMult, vMult );
     for( index = 0, u = 0; u < numUCvs; u++ ) {
         for( v = 0; v < numVCvs; v++, index+=4 ) {
	printf(" %g, %g, %g, %g\n",
             cvs[index], cvs[index+1], cvs[index+2], cvs[index+3] );
         }
     }

AlSurface::AlSurface()

Description

Constructs an AlSurface wrapper object.

AlSurface::~AlSurface()

Description

Deletes an AlSurface wrapper object.

AlObject *AlSurface::copyWrapper() const

Description

Returns an exact duplicate of this AlSurface wrapper.

statusCode AlSurface::deleteObject()

Description

Deletes the AlSurface, its AlSurfaceCVs, and any AlCurveOnSurface attached to the surface. If this surface has an attached AlSurfaceNode, this node is also deleted.

Return Codes

sSuccess - the surface was deleted

sFailure - the surface couldn’t be deleted

sInvalidObject - the surface is invalid

AlObjectType AlSurface::type() const

Description

Returns the class identifier kSurfaceType.

AlSurfaceNode* AlSurface::surfaceNode() const

Description

Returns a pointer to the AlSurfaceNode for this surface. Returns NULL if there is not attached surface node.

statusCode AlSurface::create(int uDeg,int vDeg,curveFormType uForm,curveFormType vForm,int uNumKnots,int vNumKnots,const double uKnotVector[],const double vKnotVector[],int uNumControlPts,int vNumControlPts,const double controlPoints[],const int uMultiplicity[],const int vMultiplicity[] )

Description

Used to create the data used to represent a surface. See the AlCurve::create() method in AlCurve for a general description of how NURBS curves are represented with this interface. Surfaces are a natural extension of curves.

Surfaces contain two one-dimensional arrays of knot values called knot vectors for each of the ’u’ and ’v’ parametric directions of the surface. The form and degree of the surface can be different in both the ’u’ and ’v’ direction. The control points are stored in a two-dimensional array of points so there are a total of uNumControlPts * vNumControlPts control points. The ’controlPoints’ parameter must have the dimensions [uNumControlPts][vNumControlPts][4].

This method may be used in the same way as the AlCurve::create() method, and the conditions that must be met by the input data are the same except that the conditions apply to both the ’u’ and ’v’ directions independently.

For more information on multiplicity, see the Class Description.

Arguments

< uDeg - the degree of the curve in ’u’

< vDeg - the degree of the curve in ’v’

< uForm - open, closed or periodic in ’u’

< vForm - open, closed or periodic in ’v’

< uNumKnots - the number of knots in the uKnotVector

< vNumKnots - the number of knots in the vKnotVector

< uKnotVector - the sequence of knot values in ’u’

< vKnotVector - the sequence of knot values in ’v’

< uNumControlPts - the number of points in controlPoint in ’u’

< vNumControlPts - the number of points in controlPoint in ’v’

< controlPoints - the array of control points with dimensions controlPoints[uNumControlPts][vNumControlPts][4]

< uMultiplicity - The multiplicity vector in ’u’. This must be of length uNumControlPts

< vMultiplicity - The multiplicity vector in ’v’. This must be of length vNumControlPts

Return code

sSuccess - surface was created

sInsufficientMemory - ran out of memory

sAlreadyCreated - the AlSurface has already been created

sInvalidArgument - this return code can be generated in many ways

  • number of spans <= 0 either in U or V { if periodic, number of spans = number of control points, if open or closed, number of spans = number of control points - degree. Substitute parameters for either the U or V direction. }
  • number of knots != number of spans + 1 in either U or V
  • the U or V knot vectors are not a non-decreasing sequence of values
  • knots that delimit the first and last spans are non -zero, ie. ( knotVector[1] - knotVector[0] ) and ( knotVector[numKnots-1] - knotVector[numKnots-2] ) are not both zero for either U or V
  • if U is closed, the first and last CVs in U are not identical for all V’s
  • if V is closed, the first and last CVs in V are not identical for all U’s
  • if U is periodic, the number of spans in U is less than 3 or the U degree is greater than the number of spans in U
  • if V is periodic, the number of spans in V is less than 3 or the V degree is greater than the number of spans in V

statusCode AlSurface::create(int uDeg,int vDeg,curveFormType uForm,curveFormType vForm,const double uKnotVector[],const double vKnotVector[],int uNumControlPts,int vNumControlPts,const double controlPoints[] )

Description

Used to create the data used to represent a surface. See the AlCurve::create() method for a general description of how NURBS curves are represented with this interface. Surfaces are a natural extension of curves.

Surfaces contain two one-dimensional arrays of knot values called knot vectors for each of the ’u’ and ’v’ parametric directions of the surface. The form and degree of the surface can be different in both the ’u’ and ’v’ direction. The control points are stored in a two-dimensional array of points so there are a total of uNumControlPts * vNumControlPts control points. The ’controlPoints’ parameter must have the dimensions [uNumControlPts][vNumControlPts][4].

This method may be used in the same way as the AlCurve::create() method, and the conditions that must be met by the input data are the same except that the conditions apply to both the ’u’ and ’v’ directions independently.

Note: this method requires that redundant knots be specified.

Arguments

< uDeg - the degree of the curve in ’u’

< vDeg - the degree of the curve in ’v’

< uForm - open, closed or periodic in ’u’

< vForm - open, closed or periodic in ’v’

< uKnotVector - the sequence of knot values in ’u’. Size of this array is uNumControlPts + uDeg + 1

< vKnotVector - the sequence of knot values in ’v’. Size of this array is vNumControlPts + vDeg + 1

< uNumControlPts - the number of points in controlPoint in ’u’

< vNumControlPts - the number of points in controlPoint in ’v’

< controlPoints - the array of control points with dimensions controlPoints[uNumControlPts][vNumControlPts][4]

Return code

sSuccess - surface was created

sInsufficientMemory - ran out of memory

sAlreadyCreated - the AlSurface has already been created

sInvalidArgument - this return code can be generated in many ways

  • the number of spans is <= 0 in either U or V { number of spans = number of control points - degree in either U or V. Substitute parameters for either the U or V direction. }
  • the U or V knot vectors are not a non-decreasing sequence of values
  • the difference between the first ’degree’ { U or V } and difference between the last degree { U or V } number of knots is not 0
	for (i = 0; i < deg; i++)
		( knotVector[i+1] - knotVector[i] != 0) ||
		( knotVector[numKnots-i-1] - knotVector[numKnots-i-2] != 0 )
  • for a periodic surface in U or V, the knot deltas for a periodic dimension are not correct. If the knot deltas are correct, the following is true:
	For i = 0 to 2*deg-1 (n = numberSpans)
		T[i+1] - T[i] = T[i+n+1] - T[i+n] 
  • if U is closed, the first and last CVs in U are not identical for all points in V
  • if V is closed, the first and last CVs in V are not identical for all points in U
  • if U is periodic, the number of spans in U is less than 3 or the U degree is greater than the number of spans in U
  • if V is periodic, the number of spans in V is less than 3 or the V degree is greater than the number of spans in V
  • for a periodic surface in U, the first uDegree number of CVs must match the last uDegree number of CVs for all V dimensions.
  • for a periodic surface in V, the first vDegree number of CVs must match the last vDegree number of CVs for all U dimensions

statusCode AlSurface::createRevolvedSurface( const double startPoint[3], const double endPoint[3], double startAngle, double endAngle, const AlCurve* generatrix )

Description

Used to create a surface of revolution instead of the more complex AlSurface::create() method.

Angles are measured in degrees with the generatrix being at zero degrees. As well the angles of rotation are measured counter clockwise while looking in the direction of startPoint from endPoint.

Arguments

< startPoint - one end of axis of revolution

< endPoint - other end of axis of revolution

< startAngle - the starting angle in degrees

< endAngle - the ending angle in degrees

< generatrix - the curve to be spun about the axis

Return code

sSuccess - the surface was created

sInvalidArgument - a NULL argument was supplied

sInsufficientMemory - ran out of memory

sAlreadyCreated - the AlSurface has already been created

sFailure - generatrix was invalid

statusCode AlSurface::createRevolvedSurface( double pointOnAxis[3], double direction[3], AlCurve *curve )

Description

Create a surface of revolution from a point, a direction vector and a curve

Arguments

< pointOnAxis - point on axis of the revolved surface

< direction - direction of the revolved surface axis

< curve - boundary curve that defines the revolved surface

Return code

sSuccess - the surface was created

sInvalidArgument - a NULL argument was supplied or curve is invalid

sInsufficientMemory - ran out of memory

sAlreadyCreated - the AlSurface has already been created

sFailure - the method failed

statusCode AlSurface::createLinearExtrusionSurface( double direction[3], double len, AlCurve *curve )

Description

Create a surface of linear extrusion from a direction vector, a length of extrusion and a curve.

Arguments

< direction - direction to extrude along

< len - length to extrude by

< curve - edge boundary to extrude from

Return code

sSuccess - the surface was created

sInvalidArgument - a NULL argument was supplied

sInsufficientMemory - Ran out of memory.

sAlreadyCreated - the AlSurface has already been created

sFailure - curve was invalid

statusCode AlSurface::createTorus(const double origin[3], const double direction[3], double majorRadius, double minorRadius, const double zero[3], double rot_start, double rot_end, double arc_start, double arc_end)

Description

Create a partial torus surface.

Arguments

> origin - center of torus

> direction - axis direction

> majorRadius - major radius

> minorRadius - minor radius

> zero - vector toward zero angle

> rot_start - start angle for rotation

> rot_end - end angle for rotation

> arc_start - start angle for arc

> arc_end - end angle for arc

Returns

sSuccess - the surface was successfully created

sInvalidArgument - an invalid argument was supplied

sFailure - an error occurred

statusCode AlSurface::createSphere( double origin[3], double radius )

Description

Create a spherical surface from an origin point and a radius.

Arguments

< origin - center of sphere

< radius - radius of the sphere

Returns

sSuccess - the surface was successfully created

sInvalidArgument - an invalid argument was supplied or radius <= 0

sFailure - an error occurred

statusCode AlSurface::createCylinder( double bottomAxisPoint[3], double topAxisPoint[3], double radius )

Description

Create a Cylindrical surface from a bottom and top point and a radius.

Arguments

< bottomAxisPoint - center point of the cylinder’s bottom

< topAxisPoint - center point of the cylinder’s top

< radius - radius of the cylinder

Returns

sSuccess - the surface was successfully created

sInvalidArgument - an invalid argument was supplied or radius <= 0 or the top and bottom points are the same

sFailure - an error occurred

statusCode AlSurface::createCone( double bottomAxisPoint[3], double bottomRadius, double topAxisPoint[3], double topRadius )

Description

Create a conical surface from a bottom axis point and its radius and a top axis point and its radius.

Arguments

< bottomAxisPoint - bottom center point of the cone

< topAxisPoint - top center point of the cone

< bottomRadius - radius at the bottom of the cone

< topRadius - radius at the top of the cone

Returns

sSuccess - the surface was successfully created

sInvalidArgument - an invalid argument was supplied or bottomRadius <= 0 o topRadius <= 0 or the top and bottom points are the same

sFailure - an error occurred

curveFormType AlSurface::uForm() const

Description

Returns the form of the surface in the ’u’ direction, that is, kOpen, kClosed or kPeriodic. For more information on form, see the AlSurfaceclass description. kInvalidCurve is returned if the surface is invalid.

curveFormType AlSurface::vForm() const

Description

Returns the form of the surface in the ’v’ direction, that is, kOpen, kClosed or kPeriodic. For more information on form, see the AlSurface class description. kInvalidCurve is returned if the surface is invalid.

int AlSurface::uDegree() const

Description

Returns the degree of the surface in the ’u’ direction. -1 is returned if the surface is not valid.

int AlSurface::vDegree() const

Description

Returns the degree of the surface in the ’v’ direction. -1 is returned if the surface is not valid.

int AlSurface::uNumberOfSpans() const

Description

Returns the number of spans in the ’u’ direction of the surface. If the surface is not valid -1 will be returned.

int AlSurface::vNumberOfSpans() const

Description

Returns the number of spans in the ’v’ direction of the surface. If the surface is not valid -1 will be returned.

int AlSurface::uNumberOfCVs() const

Description

Returns the number of CVs in the ’u’ direction of the surface. If the surface is not valid -1 will be returned.

int AlSurface::vNumberOfCVs() const

Description

Returns the number of CVs in the ’v’ direction of the surface. If the surface is not valid -1 will be returned.

AlSurfaceCV* AlSurface::firstCV() const

Description

Returns a pointer to the first CV in this surface. To traverse the CVs of this surface, use the methods in the AlSurfaceCV class. With the 6.1 release of OpenModel it is no longer necessary to specify whether a permanent pointer is necessary as was done in earlier releases.

AlSurfaceCV* AlSurface::getCV( int indexU, int indexV ) const

Description

Returns a pointer to the CV identified by the given indices. Returns NULL if the CV could not be found or one of the indices was negative. The indices of the first CV are (0,0).

AlAttributes* AlSurface::firstAttribute() const

Description

Returns the first attribute on this surface if any, otherwise NULL is returned. Note that if CV positions are modified through any of the AlSurface, AlSurfaceCV, AlCluster, AlSet, and so on, methods then the attributes are removed from the surface.

statusCode AlSurface::CVsWorldPosition(double CVList[], int uMultiplicity[], int vMultiplicity[] ) const

Description

Returns the world position of this surface’s CVs in the given array and the multiplicity of each CV in the multiplicity vector. The CV array must have the size [uNumberOfCVs * vNumberOfCVs * 4]. The multiplicity vector uMultiplicity must be of length uNumberOfCVs and the vector vMultiplicity must be of length vNumberOfCVs.

Note that the positions returned are [ x y z w ] and not [ w*x w*y w*z w ].

The multiplicity vectors returned by this function are the same as the ones returned by CVsUnaffectedPosition().

Arguments

> CVList - contains all the CVs’ world positions upon return

> uMultiplicity - contains each CV’s multiplicity in u

> vMultiplicity - contains each CV’s multiplicity in v

Return Codes

sSuccess - the CVs’ world positions were retrieved

sInvalidArgument - one of the parameters was NULL

sFailure - the world positions were not retrieved

sInvalidObject - the surface is invalid

statusCode AlSurface::CVsAffectedPosition( const AlTM& tm, double CVList[],int uMultiplicity[],int vMultiplicity[] ) const

Description

Returns the affected position of this surface’s CVs in the given array and the multiplicity of each CV in the multiplicity vector. The CV array must have the size [uNumberOfCVs * vNumberOfCVs * 4]. The multiplicity vector uMultiplicity must be of length uNumberOfCVs and the vector vMultiplicity must be of length vNumberOfCVs. The multiplicity vectors returned by this function are the same as the ones returned by CVsUnaffectedPosition().

Arguments

< tm - the transformation matrix generated while walking the DAG

> CVList - contains all the CVs’ world positions upon return

> uMultiplicity - contains each CV’s multiplicity in u

> vMultiplicity - contains each CV’s multiplicity in v

Return Codes

sSuccess - the CVs’ affected positions were retrieved

sInvalidArgument - one of the parameters was NULL

sFailure - the affected positions were not retrieved

sInvalidObject - the surface is invalid

statusCode AlSurface::CVsUnaffectedPosition( double CVList[],int uMultiplicity[],int vMultiplicity[] ) const

Description

Returns the unaffected positions of this surface’s CVs in the given array and the multiplicity of each CV in the multiplicity vector. The CV array must have the size [uNumberOfCVs * vNumberOfCVs * 4]. The multiplicity vector uMultiplicity must be of length uNumberOfCVs and the vector vMultiplicity must be of length vNumberOfCVs. The multiplicity vectors returned by this function are the same as the ones returned by CVsWorldPosition().

Arguments

> CVList - contains all the CVs’ unaffected positions upon return

> uMultiplicity - contains each CV’s multiplicity in u

> vMultiplicity - contains each CV’s multiplicity in v

Return Codes

sSuccess - the CVs’ unaffected positions were retrieved

sInvalidArgument - one of the parameters was NULL

sFailure - the unaffected positions were not retrieved

sInvalidObject - the surface is invalid

statusCode AlSurface::doUpdates( boolean newState )

Description

See AlDagNode.

statusCode AlSurface::insert( double param, Direction dir )

Description

Inserts an isoparm into the surface.

Arguments

< param - parametric value of the new isoparm on the surface

< dir - direction of the new isoparm (either kU or kV)

Return Codes

sSuccess - normal completion

sInvalidArgument - one of the parameters is out of range

sFailure - an error occurred

sInvalidObject - the surface is invalid

statusCode AlSurface::setCVsUnaffectedPosition( const double CVList[] )

Description

Sets the unaffected positions of this surface’s CVs to the given array. The passed-in CV array must have the size [uNumberOfCVs * vNumberOfCVs * 4].

Arguments

< CVList - contains all the CVs’ unaffected positions upon return

Return Codes

sSuccess - the unaffected positions were set

sInvalidArgument - one of the parameters was NULL

sFailure - the unaffected positions were not set

sInvalidObject - the surface is invalid

boolean AlSurface::isAffectedByViewFrame() const

Description

This function is now OBSELETE. Call method is ConstructionHistoryResultingSurface() instead.

boolean AlSurface::isConstructionHistoryResultingSurface() const

Description

Returns TRUE if this surface is the resulting surface of a construction history operation.

Return Codes

TRUE - the surface is created by construction history

FALSE - the surface is not created by construction history or the surface has no AlSurfaceNode

boolean AlSurface::isPointActive( double u, double v ) const

Description

Determines the U,V coordinates of a point on a surface in a trim region.

Arguments

< u - the parametric u coordinate of the point on the surface

< v - the parametric v coordinate of the point on the surface

Return Codes

TRUE - the point is in a trimmed region

FALSE - the point is outside of a trimmed region

statusCode AlSurface::area( double& area, boolean worldCoordinates, double tolerance )

Description

Determines the area of the surface.

sSuccess will be returned if the evaluation succeeded. sFailure will be returned if the evaluation failed.

Arguments

< worldCoordinates - the evaluation is to be in world coordinates

> area - the returned value

> tolerance - the error tolerance

Return Codes

sSuccess - the coordinate was successfully determined

sFailure - the evaluation failed

sInvalidObject - the surface is invalid

sInvalidArgument - tolerance was not a positive number

statusCode AlSurface::circumference( double& circumference, boolean worldCoordinates, double tolerance )

Description

Determines the circumference of the surface.

This is a meaningless value for a closed surface but it will be attempted anyway. For example, a sphere has four edges that join at the poles, although it does not have a true circumference.

sSuccess will be returned if the evaluation succeeded. sFailure will be returned if the evaluation failed.

Arguments

< worldCoordinates - the evaluation is to be in world coordinates

> circumference - the returned value

> tolerance - the error tolerance

Return Codes

sSuccess - the coordinate was successfully determined

sFailure - the evaluation failed

sInvalidObject - the surface is invalid

sInvalidArgument - tolerance was not a positive number

statusCode AlSurface::eval(double u, double v, boolean worldCoordinates, double P[3], double Pu[3], double Pv[3], double n[3], boolean uLimitFromBelow, boolean vLimitFromBelow ) const

Description

Determines the 3D coordinate and partial derivatives of the parameter values on the surface. sSuccess will be returned if the evaluation succeeded. sFailure will be returned if the evaluation failed.

Use isPointActive to determine if the point is in a trim region

uLimitsFromBelow and vLimitsFromBelow are used when determining the normal. These tell which direction limits are used to determine the normal if the gradient is not numerically stable.

Arguments

< u - the parametric u coordinate of the point on the surface

< v - the parametric v coordinate of the point on the surface

< worldCoordinates - the evaluation is to be in world coordinates

> P - the point on the surface (if not NULL)

> Pu - the partial wrt u of the point on the surface (if not NULL)

> Pv - the partial wrt v of the point on the surface (if not NULL)

> n - the normal to the surface (if not NULL)

< uLimitFromBelow - use u limit from below

< vLimitFromBelow - use v limit from below

Return Codes

sSuccess - the coordinate was successfully determined

sFailure - the evaluation failed

sInvalidObject - the surface is invalid

int AlSurface::uNumberOfKnots() const

Description

Returns the number of knots in the ’u’ direction of the surface. This method will not function properly on surfaces with unpiled end knots. Use realuNumberOfKnots() instead. This method will return -1 if the surface is invalid.

int AlSurface::vNumberOfKnots() const

Description

Returns the number of knots in the ’v’ direction of the surface. This method will not function properly on surfaces with unpiled end knots. Use realvNumberOfKnots() instead. This method will return -1 if the surface is invalid.

statusCode AlSurface::uKnotVector( double knotVector[] ) const

Description

Returns this curve’s knot vector in the given ’knotVector’. The parameter ’knotVector’ must be of length ’uNumberOfKnots()’. This method will only function properly with surfaces with knots piled up on the ends. For surfaces with unpiled end knots use realuKnotVector() instead.

Arguments

> knotVector - vector of length ’uNumberOfKnots()’ that contains this curve’s knot vector upon return

Return Codes

sSuccess - the curve’s knot vector was returned

sInvalidArgument - knotVector was NULL

sInvalidObject - the surface was invalid

statusCode AlSurface::vKnotVector( double knotVector[] ) const

Description

Returns this curve’s knot vector in the given ’knotVector’. The parameter ’knotVector’ must be of length ’vNumberOfKnots()’. This method will only function properly with surfaces with knots piled up on the ends. For surfaces with unpiled end knots use realvKnotVector() instead.

Arguments

> knotVector - vector of length ’vNumberOfKnots()’ that contains this curve’s knot vector upon return

Return Codes

sSuccess - the v knot vector was returned

sInvalidArgument - knotVector was NULL

sFailure - the v knot vector was not returned

sInvalidObject - the surface is invalid

statusCode AlSurface::setuKnotVector( const double uKnotVector[] )

Description

Sets this curve’s knot vector to the given ’uKnotVector’. The parameter ’knotVector’ must be of length ’uNumberOfKnots()’. If the surface is trimmed this method does nothing. This method will only function properly with surfaces with knots piled up on the ends. For surfaces with unpiled end knots use setRealuKnotVector() instead.

Arguments

< uKnotVector - vector of length ’uNumberOfKnots()’ to set this curve with

Return Codes

sSuccess - the u knot vector was set

sInvalidArgument - knotVector was NULL

sFailure - the u knot vector was not set or the surface is trimmed

sInvalidObject - the surface is invalid

statusCode AlSurface::setvKnotVector( const double vKnotVector[] )

Description

Sets this curve’s knot vector to the given ’vKnotVector’. The parameter ’knotVector’ must be of length ’vNumberOfKnots()’. If the surface is trimmed this method does nothing. This method will only function properly with surfaces with knots piled up on the ends. For surfaces with unpiled end knots use setRealvKnotVector() instead.

Arguments

< vKnotVector - vector of length ’vNumberOfKnots()’ to set this curve with

Return Codes

sSuccess - the v knot vector was set

sInvalidArgument - knotVector was NULL

sFailure - the v knot vector was not set or the surface is trimmed

sInvalidObject - the surface is invalid

int AlSurface::uNumberOfCVsInclMultiples() const

Description

Returns the number of control points in the ’u’ direction (uDegree + uNumberOfSpans). For more information on multiplicity, see the AlSurface class description. This method returns -1 if the surface is invalid.

int AlSurface::vNumberOfCVsInclMultiples() const

Description

Returns the number of control points in the ’v’ direction (vDegree + vNumberOfSpans). For more information on multiplicity, see the AlSurface class description. This method returns -1 if the surface is invalid.

statusCode AlSurface::CVsWorldPositionInclMultiples( double CVList[] ) const

Description

Same as CVsWorldPosition() except that this method includes multiples. The parameter CVList must have dimensions [uNumberOfCVsInclMultiples * vNumberOfCVsInclMultiples * 4]. The surfaceNode must be set or sFailure will be returned For more information on multiplicity, see the AlSurfaceclass description.

NOTE: The data is arranged in the array as cv[u][v][4].

Note that the positions returned are [ x y z w ] and not [ w*x w*y w*z w ].

Arguments

> CVList - contains the world positions of all CVs upon return

Return Codes

sSuccess - the world positions of all CVs was returned

sInvalidArgument - CVList was NULL

sFailure - the world positions of all CVs could not be returned

sInvalidObject - the surface is invalid

statusCode AlSurface::CVsAffectedPositionInclMultiples( const AlTM& tm, double CVList[] ) const

Description

Same as CVsAffectedPosition() except that this method includes multiples. The parameter CVList must have dimensions [uNumberOfCVsInclMultiples * vNumberOfCVsInclMultiples * 4]. For more information on multiplicity, see the AlSurface class description.

NOTE: The data is arranged in the array as cv[u][v][4].

Note that the positions returned are [ x y z w ] and not [ w*x w*y w*z w ].

Arguments

< tm - the transformation matrix generated while walking the DAG

> CVList - contains the world positions of all CVs upon return

Return Codes

sSuccess - the affected positions of all CVs were returned

sInvalidArgument - CVList was NULL

sFailure - the affected positions of all CVs could not be returned

sInvalidObject - the surface is invalid

statusCode AlSurface::CVsUnaffectedPositionInclMultiples( double CVList[] ) const

Description

Same as CVsUnaffectedPosition() except that this method includes multiples. The parameter CVList must have dimensions [uNumberOfCVsInclMultiples * vNumberOfCVsInclMultiples * 4]. For more information on multiplicity, see the AlSurface class description. For more information on unaffected position, see the description in the AlSurfaceCV class, method unaffectedPosition().

NOTE: The data is arranged in the array as cv[u][v][4].

Arguments

> CVList - contains the unaffected positions of all CV’s upon return

Return Codes

sSuccess - the unaffected positions of all CVs were returned

sInvalidArgument - CVList was NULL

sFailure - the unaffected positions of all CVs could not be returned

sInvalidObject - the surface is invalid

statusCode AlSurface::setCVsUnaffectedPositionInclMultiples( const double CVList[] )

Description

Same as setCVsUnaffectedPosition() except that this method includes multiples. The parameter CVList must have dimensions [uNumberOfCVsInclMultiples * vNumberOfCVsInclMultiples * 4]. For more information on multiplicity, see the AlSurface class description. For more information on unaffected position, see the description in the AlSurfaceCV class, method unaffectedPosition(). You cannot give multiples different values. This is best explained in the examples in the AlCurve class description. Some of the values in the given CVList may be ignored, because they specify a redundant point due to multiplicity > 1 or due to periodicity.

NOTE: The data is arranged in the array as cv[u][v][4].

Arguments

< CVList - the new positions to set this surface’s CVs to

Return Codes

sSuccess - the unaffected positions of all CVs were set

sInvalidArgument - CVList was NULL

sFailure - the unaffected positions of all CVs could not be set

sInvalidObject - the surface is invalid

boolean AlSurface::isTargetSurface() const

Description

Returns TRUE if the surface is a target surface. If this node does not have a parent Dag node, then it is considered not to be a target surface.

boolean AlSurface::trimmed() const

Description

Returns TRUE if the surface has been trimmed. A target surface (a surface with a curve-on-surface that has never been trimmed) is not considered to be a trimmed surface.

statusCode AlSurface::project( AlCurveNode* curveNode, double vector[3], boolean keep_history )

Description

This method projects a 3D curve along the given vector onto the surface, creating 2D curves on the surface. Several curves can be projected onto the surface which can then be trimmed.

Arguments

< curveNode - the curve to be projected onto the surface

< vector - the vector to project the curve along

< keep_history - Should the construction history be kept.

Return Codes

sSuccess - successfully projected the curve

sInvalidObject - this surface is not valid

sInvalidArgument - the curve node is not valid, the vector is of zero length, or the surface has no parent surface node

sInsufficientMemory - inadequate memory to run the command

sFailure - failed to project the curve

statusCode AlSurface::unpileEndKnots( int whichEnds, const double interval[] )

Description

NOTE: This operation generates prototype geometry that may not be compatible with all OpenModel or Alias operations. Operations on unpiled surfaces may result in unexpected results including fatal errors. Use unpiled surfaces at your own risk.

Surfaces in Alias have knots that are piled up at the ends so that the surface interpolates the ends. This operation will unpile these knots so that the curve no longer interpolates the ends.

The interval used to space the knots of the unpiled knots will either be taken from the given argument, or if this is NULL the last non-zero knot interval on the given end will be used. All knot intervals must be greater than zero or sInvalidArgument will be returned.

The AlSurface requires an AlSurfaceNode above it for this operation to succeed.

Arguments

< whichEnds - one or more of AL_UNPILE_START_U, ..., AL_UNPILE_END_V or’ed together

< interval - an array (possibly NULL) of degree - 1 knot intervals

Return Codes

sSuccess - the specified ends were unpiled

sFailure - the surface is invalid in some way (ex. no CVs)

sInvalidObject - the surface is invalid

sInvalidArgument - an attempt was made to unpile a periodic surface in the direction of its periodicity

int AlSurface::realuNumberOfKnots() const

Description

Returns the actual number of u knots on the surface. That is uNumberOfSpans() + 2*uDegree() - 1. (Note that two additional knots are required to define a NURBS curve, but they have no effect on the curve so are not included in this count.) This method returns -1 if the surface is not valid.

int AlSurface::realvNumberOfKnots() const

Description

Returns the actual number of v knots on the surface. That is vNumberOfSpans() + 2*vDegree() - 1. (Note that two additional knots are required to define a NURBS curve, but they have no effect on the curve so are not included in this count.) This method returns -1 if the surface is not valid.

statusCode AlSurface::realuKnotVector( double knotVector[] ) const

Description

Returns realuNumberOfKnots() in ’knotVector’ for the u direction of the surface.

Arguments

> knotVector - array to place the knot vector into

Return Codes

sSuccess - successfully copied the surface’s knot vector into knotVector

sInvalidArgument - knotVector was NULL

sInvalidObject - the surface was invalid

statusCode AlSurface::realvKnotVector( double knotVector[] ) const

Description

Returns realvNumberOfKnots() in ’knotVector’ for the v direction of the surface.

Arguments

> knotVector - array to place the knot vector into

Return Codes

sSuccess - successfully copied the surface’s knot vector into knotVector

sInvalidArgument - knotVector was NULL

sInvalidObject - the surface was invalid

statusCode AlSurface::setRealuKnotVector( const double knotVector[] )

Description

Sets the knots in the u direction for this surface. The parameter ’knotVector’ must be of ’realuNumberofKnots()’.

Arguments

< knotVector - array of knots

Return Codes

sSuccess - the u knots were successfully set

sInvalidArgument - knotVector was NULL

sFailure - the surface was trimmed

sInvalidObject - the surface is invalid

statusCode AlSurface::setRealvKnotVector( const double knotVector[] )

Description

Sets the knots in the v direction for this surface. The parameter ’knotVector’ must be of ’realvNumberofKnots()’.

Arguments

< knotVector - array of knots

Return Codes

sSuccess - the v knots were successfully set

sInvalidArgument - knotVector was NULL

sFailure - the surface was trimmed

sInvalidObject - the surface is invalid

AlShader* AlSurface::firstShader() const

Description

Returns the first shader that this surface object references. Returns NULL if there are no shaders.

AlShader* AlSurface::nextShader( const AlShader* last_shader ) const

Description

Returns the shader after the given shader in the object’s shader list. Returns NULL if there isn’t a next shader. Specifying NULL as parameter will return the first shader.

Arguments

< last_shader - shader from which to walk forward

statusCode AlSurface::nextShaderD( AlShader* last_shader ) const

Description

Destructively points ’last_shader’ to the shader after the given shader in the object’s shader list.

Arguments

< last_shader - shader from which to walk forward

Return Codes

sSuccess - last_shader now points to the next shader

sFailure - there isn’t a next shader

sInvalidArgument - last_shader is invalid

sInvalidObject - the surface is invalid

statusCode AlSurface::assignShader( AlShader* shader )

Description

Assigns the given shader to the surface. If the surface already has shaders they will be removed from the surface. The surface must have a surface node for this method to succeed.

Arguments

< shader - the shader which will be assigned to the surface

Return Codes

sSuccess - the shader was successfully assigned to the surface

sInvalidArgument - ’shader’ was invalid

sFailure - the shader was not created

sInvalidObject - the surface is invalid

statusCode AlSurface::layerShader( AlShader* shader )

Description

Layers the given shader on the surface. The surface must have a surface node for this method to succeed.

Arguments

< shader - the shader which will be layered on the surface

Return Codes

sSuccess - the shader was successfully layered on the surface

sInvalidArgument - ’shader’ was invalid

sFailure - the shader was not created

sInvalidObject - the surface is invalid

statusCode AlSurface::renderInfo( AlRenderInfo &renderInfo ) const

Description

Fills in the renderInfo structure with the render info for this surface.

Arguments

> renderInfo - the structure to fill in

Return Codes

sSuccess - getting the render information was successful

sInvalidArgument - ’renderInfo’ is NULL

sFailure - there wasn’t any render information (renderInfo is unchanged)

sInvalidObject - the surface is invalid

statusCode AlSurface::setRenderInfo( const AlRenderInfo &renderInfo ) const

Description

Sets the render info for this surface to the contents of the renderInfo structure.

Arguments

< renderInfo - the structure to take the render information from

Return Codes

sSuccess - setting the render information was successful

sInvalidArgument - ’renderInfo’ was NULL or a parameter in ’renderInfo’ was out of range

sFailure - setting the render information failed

sInvalidObject - the surface is invalid

AlCurveOnSurface* AlSurface::firstCurveOnSurface() const

Description

Returns the first curve on surface from the list of curves on this surface. Access the remainder of the curves on surfaces in the list with AlCurveOnSurface methods. This method returns NULL if there aren’t any curves on this surface.

statusCode AlSurface::addCurveOnSurface( AlCurveOnSurface* AlCos )

Description

Add a curve on surface to the list of curves on this surface. It is illegal to add a curve on surface that is already attached to another surface. The surface must be attached to a surfaceNode or this routine will fail.

Arguments

< AlCos - the curve-on-surface to add to the surface

Return Codes

sSuccess - the curve was added

sInvalidArgument - AlCos was invalid

sFailure - the surface is trimmed

sInvalidObject - the surface is invalid

statusCode AlSurface::removeCurveOnSurface( AlCurveOnSurface* AlCos )

Description

Remove a curve on surface from the list of curves on this surface. It is illegal to attempt to remove a curve on surface from this surface if it is not attached to this surface. It is legal to remove a curve on surface from a surface that is trimmed as long as the curve on surface has not been used for the trimming of the surface.

Arguments

< AlCos - the curve on surface to remove

Return Codes

sSuccess - the CoS was removed

sInvalidArgument - AlCos was invalid

sFailure - the Curve on surface could not be removed

sInvalidObject - the surface is invalid

boolean AlSurface::isDisplayModeSet( AlDisplayModeType mode ) const

Description

Returns TRUE if the specified display mode is toggled on for the surface. Returns FALSE otherwise.

The only valid AlDisplayModeTypes for an AlSurface are:

kDisplayGeomHull

kDisplayGeomEditPoints

kDisplayGeomKeyPoints

kDisplayGeomCVs

Arguments

< mode - display mode of interest

statusCode AlSurface::setDisplayMode( AlDisplayModeType mode, boolean on_or_off )

Description

For the given display mode, if the flag is TRUE then the display mode for the surface is set, otherwise it is unset.

The only valid AlDisplayModeTypes for an AlSurface are:

kDisplayGeomHull

kDisplayGeomEditPoints

kDisplayGeomKeyPoints

kDisplayGeomCVs

Arguments

< mode - display mode of interest

< on_or_off - TRUE means that this surface will have the display mode set. FALSE means it will be unset.

Return values

sSuccess - operation was successful

sFailure - unable to complete this operation

sInvalidArgument - invalid display type.

sInvalidObject - the surface is invalid

AlTrimRegion* AlSurface::firstTrimRegion() const

Description

Returns the first trim region of a list if the surface has been trimmed. Returns NULL if there is no such trim region. Use the methods in the AlNewTrimRegion class to get trim region information.

AlSurface* AlSurface::untrimmedToTrimmedSurface() const

Description

Converts an untrimmed surface to a trimmed surface. NULL is returned if the function fails. The surface is attached to face and therefore may not be separately deleted. A deletion of the face will also force the deletion of the surface. Use the methods in the AlNewTrimRegion class to get trim region information.

AlTrimRegion* AlSurface::trimSurfaceToRegion() const

Description

Converts a trim surface to a trim region. NULL is returned on failure. The surface is attached to face and therefore may not be separately deleted. A deletion of the face will also force a deletion of the surface. Use the methods in the AlNewTrimRegion class to get trim region information.

statusCode AlSurface::periodicToNonPeriodic( int u, int v )

Description

If a surface is periodic, converts it to a non-periodic surface (closed surface) by making it have multiple end knots in the selected direction (u/v).

Note: This method modifies the surface.

Arguments

> u - change in u direction if u has the following value:

  • 1 make left (u0) end multiple
  • 0 make both (u) ends multiple
  • 1 make right(un) end multiple

> v - change in v direction if v has the following value:

  • -1 make left (v0) end multiple
  • 0 make both (v) ends multiple
  • 1 make right(vn) end multiple

Return Codes

sInvalidObject - the surface was invalid

sFailure - the method didn't succeed

sSuccess - the surface was converted to non-periodic one in the u/v direction

statusCode AlSurface::periodicToNonPeriodic( ) const

Description

If a surface is periodic, converts it to a non-periodic surface (closed surface) by making it have multiple end knots at both endpoints in u/v.

Note: This method modifies the surface.

Return Codes

sInvalidObject - the surface was invalid

sFailure - the method didn't succeed

sSuccess - the surface was converted to non-periodic one in both u and v directions

AlCurve* AlSurface::getModelSpaceSurfaceBoundary() const

Description:

This method builds and returns the true 3D boundary curve.

This methods builds an edge bspline for each edge of the surface, and appends each of them to the resulting curve. For example, a cylinder would return a singular curve of 4 bsplines: a line, a circle, a line and a circle.

Restrictions:

Edges are numbered counter-clockwise from ne = 0 to 3 where:

  • ne=0 at v=v0, ne=1 at u=un,
  • ne=2 at v=vn, ne=3 at u=u0

Edges are numbered as follows:

  • 0 = edge bspline is u0,v0 to u1,v0
  • 1 = edge bspline is u1,v0 to u1,v1
  • 2 = edge bspline is u1,v1 to u0,v1
  • 3 = edge bspline is u0,v to u0,v0

The surface has multiple end knots in u and v. This method misses a bspline segment when an edge has no length (that is, at a pole).

AlCurve* AlSurface::getParamSpaceSurfaceBoundary() const

Description

This methods builds a parameter space (2D) bspline for each edge of the surface, and appends each of them to the resulting 2D curve.

Edges are numbered counter-clockwise from ne = 0 to 3 where

ne=0 at v=v0,
ne=1 at u=un,
ne=2 at v=vn,
ne=3 at u=u0.

The surface has multiple end knots in u and v. This method builds and returns a singular 2D boundary curve.

AlCurve* AlSurface::localBoundary( int ne ) const

Description

Returns the bspline resulting from an edge of a surface. The function extracts the surface 3D boundary bspline corresponding to the edge number ne (0-3).

NULL is returned if the edge boundary cannot be found.

Edges are numbered counter-clockwise 0 to 3 where:

0 = bottom edge (v = *srf->node0->v)
1 = right edge  (u = *srf->noden->u)
2 = top edge    (v = *srf->noden->v)
3 = left edge   (u = *srf->node0->u)
edge 0 is at v0,
edge 1 is at un,
edge 2 is at un and
edge 3 is at u0.
ne=0 at v=v0,
ne=1 at u=un,
ne=2 at v=vn,
ne=3 at u=u0. 

The surface has multiple end knots in u and v. This method handles a bspline segment when an edge has no length (that is, at a pole).

AlCurve* AlSurface::parameterBoundary( int ne ) const

Description

Returns the parameter space bspline of an edge of a surface. NULL is returned if the edge boundary cannot be found. The function extracts the surface 2D boundary bspline corresponding to the edge number ne (0-3).

Edges are numbered counter-clockwise 0 to 3 where:

Edge 0 is at v0, edge 1 is at un, edge 2 is at vn and edge 3 is at u0.

ne=0 at v=v0, ne=1 at u=un, ne=2 at v=vn, ne=3 at u=u0.

The surface has multiple end knots in u and v.

statusCode AlSurface::trim( int count, const double u[], const double v[], boolean keepArea )

Description

This method applies the current curves on the surface to this surface. The surface can be trimmed already.

See the descriptions for AlTrimRegion, AlTrimBoundary, and AlTrimCurve for a description of trim geometry.

The surface must have a surface node for this method to succeed.

A trim selector is a point in the region which is to be kept in the trim. The 'count' value must be greater than 1.

Arguments

< count - number of (u,v) trim selectors

< u,v - an array of u,v coordinates marking regions inside the trim to keep u an v are within the space of the surface

< keepArea - if true, marked region is kept. Otherwise marked region isremoved.

statusCode AlSurface::trim( int count, const AlCurveOnSurface* uvTrimCurves[] )

Description

Applies the passed curves on the surface to this (untrimmed) surface. Each curve on surface must be a closed curve. The first curve in the array must by the outer boundary of a trim region. All other curves in the array are disjoint closed inner boundaries that do not intersect the outer boundary. See the descriptions for AlTrimRegion, AlTrimBoundary, and AlTrimCurve for a description of trim geometry. The surface must have a surface node for this method to succeed.

Arguments

< count - number of AlCurveOnSurface curves (must be > 0)

< uvTrimCurves - an array of closed AlCurveOnSurfaces that defines one trimmed region

Return code

sSuccess - a trim region was successfully created

sInvalidArgument - one of the parameters is NULL or out of range

sFailure - the trim operation failed

sInvalidObject - the surface is invalid

AlSurface::reverseDirection( boolean inU, boolean inV )

Description

Reverse the direction of the surface

Arguments

< inU - set to TRUE to reverse in the U direction

< inV - set to TRUE to reverse in the V direction

Returns

sSuccess - the surface was reversed

sInvalidObject - the surface is invalid

sFailure - an error occurred

statusCode AlSurface::projectNormal( AlCurveNode* curveNode, boolean keep_history )

Description

This method projects a curve onto a surface.

Arguments

< curveNode - The curve to be projected onto the surface.

< keep_history - Should the construction history be kept.

Return Codes

sSuccess - Successfully projected the curve.

sInvalidObject - This surface is not valid.

sInvalidArgument - The curve node is not valid, the vector is of zero length, or the surface has no parent surface node.

sInsufficientMemory - Inadequate memory to run the command.

sFailure - Failed to project the curve.

{

statusCode AlSurface::uniformRebuild( AlSurfaceNode* &newSurfaceNode, int requested_nu, int requested_nv, boolean inU, boolean inV, boolean matchParameterization )

Description

Approximate this rational surface with a uniform non-rational with a given number of spans. This is a "sample and fit" version of the reduction routine. Trim curves and curves on surface are copied and adjusted to the new surface. The parameters requested_nu/v specify the number of spans that are requested.

If the matchParameterization flag is TRUE, then the reduced surface will be reparameterized to match the same parameter space as the original curve. Otherwise, the curve will be parameterized from 0 to the number of requested spans (in integer increments).

Arguments

> newSurfaceNode - the rebuilt copy of the surface

< requested_nu - number of requested spans in the u direction

< requested_nv - number of requested spans in the v direction

< inU - rebuild in the U direction

< inV - rebuild in the V direction

< matchParameterization - preserve the parameterization space

Return code

sSuccess - the surface was successfully rebuilt

sFailure - the rebuild operation failed

sInvalidObject - the surface is invalid

sInvalidArgument - both inU and inV were FALSE;