Interface to Alias NURBS surface geometry.
#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 );
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.
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.
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:
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:
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] ); } }
Constructs an AlSurface wrapper object.
Deletes an AlSurface wrapper object.
Returns an exact duplicate of this AlSurface wrapper.
Deletes the AlSurface, its AlSurfaceCVs, and any AlCurveOnSurface attached to the surface. If this surface has an attached AlSurfaceNode, this node is also deleted.
sSuccess - the surface was deleted
sFailure - the surface couldn’t be deleted
sInvalidObject - the surface is invalid
Returns the class identifier kSurfaceType.
Returns a pointer to the AlSurfaceNode for this surface. Returns NULL if there is not attached surface node.
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.
< 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
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
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.
< 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]
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
for (i = 0; i < deg; i++) ( knotVector[i+1] - knotVector[i] != 0) || ( knotVector[numKnots-i-1] - knotVector[numKnots-i-2] != 0 )
For i = 0 to 2*deg-1 (n = numberSpans) T[i+1] - T[i] = T[i+n+1] - T[i+n]
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.
< 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
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
Create a surface of revolution from a point, a direction vector and a curve
< pointOnAxis - point on axis of the revolved surface
< direction - direction of the revolved surface axis
< curve - boundary curve that defines the revolved surface
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
Create a surface of linear extrusion from a direction vector, a length of extrusion and a curve.
< direction - direction to extrude along
< len - length to extrude by
< curve - edge boundary to extrude from
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
Create a partial torus surface.
> 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
sSuccess - the surface was successfully created
sInvalidArgument - an invalid argument was supplied
sFailure - an error occurred
Create a spherical surface from an origin point and a radius.
< origin - center of sphere
< radius - radius of the sphere
sSuccess - the surface was successfully created
sInvalidArgument - an invalid argument was supplied or radius <= 0
sFailure - an error occurred
Create a Cylindrical surface from a bottom and top point and a radius.
< bottomAxisPoint - center point of the cylinder’s bottom
< topAxisPoint - center point of the cylinder’s top
< radius - radius of the cylinder
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
Create a conical surface from a bottom axis point and its radius and a top axis point and its radius.
< 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
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
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.
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.
Returns the degree of the surface in the ’u’ direction. -1 is returned if the surface is not valid.
Returns the degree of the surface in the ’v’ direction. -1 is returned if the surface is not valid.
Returns the number of spans in the ’u’ direction of the surface. If the surface is not valid -1 will be returned.
Returns the number of spans in the ’v’ direction of the surface. If the surface is not valid -1 will be returned.
Returns the number of CVs in the ’u’ direction of the surface. If the surface is not valid -1 will be returned.
Returns the number of CVs in the ’v’ direction of the surface. If the surface is not valid -1 will be returned.
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.
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).
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.
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().
> 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
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
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().
< 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
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
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().
> 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
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
See AlDagNode.
Inserts an isoparm into the surface.
< param - parametric value of the new isoparm on the surface
< dir - direction of the new isoparm (either kU or kV)
sSuccess - normal completion
sInvalidArgument - one of the parameters is out of range
sFailure - an error occurred
sInvalidObject - the surface is invalid
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].
< CVList - contains all the CVs’ unaffected positions upon return
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
This function is now OBSELETE. Call method is ConstructionHistoryResultingSurface() instead.
Returns TRUE if this surface is the resulting surface of a construction history operation.
TRUE - the surface is created by construction history
FALSE - the surface is not created by construction history or the surface has no AlSurfaceNode
Determines the U,V coordinates of a point on a surface in a trim region.
< u - the parametric u coordinate of the point on the surface
< v - the parametric v coordinate of the point on the surface
TRUE - the point is in a trimmed region
FALSE - the point is outside of a trimmed region
Determines the area of the surface.
sSuccess will be returned if the evaluation succeeded. sFailure will be returned if the evaluation failed.
< worldCoordinates - the evaluation is to be in world coordinates
> area - the returned value
> tolerance - the error tolerance
sSuccess - the coordinate was successfully determined
sFailure - the evaluation failed
sInvalidObject - the surface is invalid
sInvalidArgument - tolerance was not a positive number
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.
< worldCoordinates - the evaluation is to be in world coordinates
> circumference - the returned value
> tolerance - the error tolerance
sSuccess - the coordinate was successfully determined
sFailure - the evaluation failed
sInvalidObject - the surface is invalid
sInvalidArgument - tolerance was not a positive number
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.
< 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
sSuccess - the coordinate was successfully determined
sFailure - the evaluation failed
sInvalidObject - the surface is invalid
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.
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.
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.
> knotVector - vector of length ’uNumberOfKnots()’ that contains this curve’s knot vector upon return
sSuccess - the curve’s knot vector was returned
sInvalidArgument - knotVector was NULL
sInvalidObject - the surface was invalid
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.
> knotVector - vector of length ’vNumberOfKnots()’ that contains this curve’s knot vector upon return
sSuccess - the v knot vector was returned
sInvalidArgument - knotVector was NULL
sFailure - the v knot vector was not returned
sInvalidObject - the surface is invalid
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.
< uKnotVector - vector of length ’uNumberOfKnots()’ to set this curve with
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
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.
< vKnotVector - vector of length ’vNumberOfKnots()’ to set this curve with
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
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.
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.
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 ].
> CVList - contains the world positions of all CVs upon return
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
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 ].
< tm - the transformation matrix generated while walking the DAG
> CVList - contains the world positions of all CVs upon return
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
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].
> CVList - contains the unaffected positions of all CV’s upon return
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
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].
< CVList - the new positions to set this surface’s CVs to
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
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.
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.
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.
< 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.
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
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.
< 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
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
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.
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.
Returns realuNumberOfKnots() in ’knotVector’ for the u direction of the surface.
> knotVector - array to place the knot vector into
sSuccess - successfully copied the surface’s knot vector into knotVector
sInvalidArgument - knotVector was NULL
sInvalidObject - the surface was invalid
Returns realvNumberOfKnots() in ’knotVector’ for the v direction of the surface.
> knotVector - array to place the knot vector into
sSuccess - successfully copied the surface’s knot vector into knotVector
sInvalidArgument - knotVector was NULL
sInvalidObject - the surface was invalid
Sets the knots in the u direction for this surface. The parameter ’knotVector’ must be of ’realuNumberofKnots()’.
< knotVector - array of knots
sSuccess - the u knots were successfully set
sInvalidArgument - knotVector was NULL
sFailure - the surface was trimmed
sInvalidObject - the surface is invalid
Sets the knots in the v direction for this surface. The parameter ’knotVector’ must be of ’realvNumberofKnots()’.
< knotVector - array of knots
sSuccess - the v knots were successfully set
sInvalidArgument - knotVector was NULL
sFailure - the surface was trimmed
sInvalidObject - the surface is invalid
Returns the first shader that this surface object references. Returns NULL if there are no shaders.
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.
< last_shader - shader from which to walk forward
Destructively points ’last_shader’ to the shader after the given shader in the object’s shader list.
< last_shader - shader from which to walk forward
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
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.
< shader - the shader which will be assigned to the surface
sSuccess - the shader was successfully assigned to the surface
sInvalidArgument - ’shader’ was invalid
sFailure - the shader was not created
sInvalidObject - the surface is invalid
Layers the given shader on the surface. The surface must have a surface node for this method to succeed.
< shader - the shader which will be layered on the surface
sSuccess - the shader was successfully layered on the surface
sInvalidArgument - ’shader’ was invalid
sFailure - the shader was not created
sInvalidObject - the surface is invalid
Fills in the renderInfo structure with the render info for this surface.
> renderInfo - the structure to fill in
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
Sets the render info for this surface to the contents of the renderInfo structure.
< renderInfo - the structure to take the render information from
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
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.
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.
< AlCos - the curve-on-surface to add to the surface
sSuccess - the curve was added
sInvalidArgument - AlCos was invalid
sFailure - the surface is trimmed
sInvalidObject - the surface is invalid
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.
< AlCos - the curve on surface to remove
sSuccess - the CoS was removed
sInvalidArgument - AlCos was invalid
sFailure - the Curve on surface could not be removed
sInvalidObject - the surface is invalid
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
< mode - display mode of interest
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
< 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.
sSuccess - operation was successful
sFailure - unable to complete this operation
sInvalidArgument - invalid display type.
sInvalidObject - the surface is invalid
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.
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.
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.
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.
> u - change in u direction if u has the following value:
> v - change in v direction if v has the following value:
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
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.
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
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:
Edges are numbered as follows:
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).
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.
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).
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.
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.
< 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.
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.
< count - number of AlCurveOnSurface curves (must be > 0)
< uvTrimCurves - an array of closed AlCurveOnSurfaces that defines one trimmed region
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
Reverse the direction of the surface
< inU - set to TRUE to reverse in the U direction
< inV - set to TRUE to reverse in the V direction
sSuccess - the surface was reversed
sInvalidObject - the surface is invalid
sFailure - an error occurred
This method projects a curve onto a surface.
< curveNode - The curve to be projected onto the surface.
< keep_history - Should the construction history be kept.
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.
{
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).
> 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
sSuccess - the surface was successfully rebuilt
sFailure - the rebuild operation failed
sInvalidObject - the surface is invalid
sInvalidArgument - both inU and inV were FALSE;