CAD Surface Position and Orientation
When FRED imports a CAD model, all of its surfaces are defined by NURBs, or trimmed versions of those NURBs called Trimmed Parametrics. These parametric surfaces are always defined in the global coordinate system. One of the major difficulties with this definition is that the X, Y, Z location of a surface is not easily determined from the parametric definitions, which makes the alignment of these structures with native FRED objects difficult. For more information about CAD coordinate systems, see our related article: Attaching Entities to CAD Surfaces
The script that accompanies this document identifies the position of a surface in global coordinates by using numerical sampling with rays. A source is created on the selected surface and the ray statistics are retrieved to give average position and surface normal direction in the global coordinate system. Knowing the position and direction of the surface normal is usually enough information to properly align the NURB objects in a FRED model.
Running the Script
In the 3D view, double mouse click on the surface of interest. This will open the surface dialog and also highlight the node on the object tree.
Using the drop down list, select surface 23 and then in the text entry area enter a value of 10 million.
Press the OK button and then wait for the calculation to be performed (the status bar at the bottom of your FRED window will be displaying information). When the calculation has finished, the output window will contain the following information.
Applying the Output
Download the FRED Script: calculateSurfacePositionOrientation.frs
Download the FRED file: Surface-Source-Emitter.frd