Description Computes the sag of a specified Surface entity at given local X,Y coordinates. Surface sag can be computed on all surface types except for tubes or cylinders. If the surface is defined by a functional form (ex. sphere, asphere, etc.), then the sag function can be called at arbitrary X,Y positions. Calling the sag function at a position where the surface does not exist (ex. outside the radius of a sphere) will result in an error. If the surface is not defined by a functional form (ex. bicubic mesh), then the sag function can be called anywhere within the surface's trimming volume. Calling the sag function outside of the surface's trimming volume will result in an error. Surface and curve trimming operations are ignored by the Sag function.
Errors in calling the Sag function can be trapped by taking the following approach. In the top of the script, define: On Error GoTo errCatch
At the end of the script, define a control structure similar to: errCatch: If loopFlag Then Err.Clear data(jj,kk)=1e+308 Resume Next End If
The If statement in the code above is implemented to ensure that the error logic only executes when desired (in this case when loopFlag = True. Inside of the If statement, the sample script will clear the error triggered by the Sag function, set the current value in a data array to a "hole" value and then continue in the script from where the error was triggered.
Syntax sg = Sag ( n, X, Y )
Parameters sg (Double) Local z sag value of specified entity at given X,Y coordinates.
n As Long Node number of entity.
X As Double X coordinate for sag computation.
Y As Double Y coordinate for sag computation.
See Also
|