Navigation: File Commands > Export > Export CAD

 

Export CAD

 

Contact Us: fredsupport@photonengr.com

 

 

 

Description


This feature exports FRED geometry or rays to IGES and STEP formats.  CAD export capability is under constant development and users are encouraged to send Photon Engineering any test-cases which fail to export from FRED properly.  The complex nature with which geometry can be created in FRED does not generically lend itself to direct translation into NURBs.

 

 

Navigation


This command can be accessed by selecting File >  Export > CAD (IGES or STEP) Format from the menu.

 

 

Controls          


Control

Inputs / Description

Defaults

File Name

Name of file to export.

FRED file name

File Format

Choose STEP or IGES.

STEP

Export Type

Export as Solids or Surfaces.

 

The Solids option attempts to group together surfaces that compose objects.  This can be though of as placing different object components under a single subassembly in FRED.

 

The Surfaces option makes no attempt at object grouping.

Solids

Optional Author Identifiers

User input: Name and Organization

 

Options

Export

 

Select an export option:

 Traceable

 Untraceable

 Never Traceable

 All Curves

 Current Ray Trajectories (rays must be rendered in the 3D view)

 Disable Trimming

 Export Selected Entities (this option is currently disabled in FRED)

Traceable (toggled)

Tolerance

Coincidence Tolerance

Tolerance for which points/curves/surfaces are considered coincident.  This option can be scaled up or down in increments of 10 if the user notices some objects fail to export properly from the document.

0.0001

Azimuthal Sampling

Azimuthal Samples

Number of samples used to compute the inner and outer trimming curves for a surface.  Azimuthal (around the edge) sampling for ruled surfaces and tubes w/one unity shape factor.

32

Radial Sampling

Radial Samples

Radial sampling for standard and general asphere surfaces, and sampling along local z axis of tubes w/one unity shape factor.

32

Show fit statistics

Print fit statistics to output window.

Checked

Fitted Surface Sampling

Number of Patches

Number of U V patches.

16, 16

Show fit statistics

Print fit statistics to output window.

Checked

Ruled Surface Sampling

Number of Samples

Samples along Edges

32

 

OK

Accept settings and close dialog box.

 

Cancel

Discard settings and close dialog box.

 

Help

Access this Help page.

 

 

 

Current ray trajectories

When exporting current ray trajectories to CAD, users may notice that the ray data (represented as independent curves in the exported CAD file) appears incorrect.  The ray trajectory data is extracted directly from the OpenGL (3D viewer) data, which results in certain restrictions and behaviors noted below.  Fundamentally, the ray trajectory data is created in CAD as connected line segments, where each segment represents the ray trajectory between ray intersections.

 

Ray intersection positions appear incorrectly located

Graphics display memory, where the ray data is pulled from for export to CAD, is single precision.  Consequently, the exported ray intercept data will also be single precision.

 

Ray trajectories appear incomplete

There are two possibilities for this behavior:

1.

For the rays trajectories to be exported, they need to be (a) drawn in the 3D view, and (b) visible in the 3D view.  One possible reason that ray trajectories may not have exported completely is that an open window was obscuring part of the 3D view during export.

2.

There is line segment buffer size in OpenGL that limits the number of segments (ray paths between intersection points) that can be exported to CAD and the buffer size is different for 32-bit and 64-bit machines.  When FRED detects a scenario in which more rays were requested for export than the line segment buffer can support, an error message should popup indicating that "Not all rays will be printed".  The only solution for this failure scenario is to re-trace the system with fewer rays rendered and attempt to export the system again.  Note that the buffer stores line segments (ray trajectories between intersections) , not full ray paths, so there is no explicit limit on the ray count.  The failure criteria will depend heavily on the number of intersections each ray takes along its path.

 

 

Application Notes


Supported surfaces and curves

The scripted surface and spline surface are not currently handled in the CAD export routine.  Recognizable polynomial surface forms described in the application notes below are exported but other unrecognized forms are ignored.

 

How surfaces are exported

The following table summarizes how surfaces are exported from FRED into CAD format.

 

Surface Type

How surface is exported

Accuracy

Plane

Exact NURB translation

Exact

Conic

Exact NURB translation.  Has separate algorithms for a "traditional" conic surface and the special case of a partial or full spheroid/ellipsoid.

Exact

Standard Asphere

User-specified radial profile sampling is converted into NURB curve using local cubic fit and then revolved about the axis.

Depends upon accuracy of NURB representation of radial profile curve

General Asphere

User-specified radial profile sampling is converted into NURB curve using local cubic fit and then revolved about the axis.

Depends upon accuracy of NURB representation of radial profile curve

Cylinder

Exact NURB translation for cross sections with arbitrary shape factors.

Exact

Conic Foci

User-specified radial profile sampling is converted into NURB curve using local cubic fit and then revolved about axis.  Recognizes the following special cases:

 -Sphere

 -Ellipsoid

If the focii points defining the major axes are separated by a large value, numeric stability in the export may be incurred.

 -Hyperbolid

The hyperboloid sheet on which the point defining the surface lies will be exported.  The remaining sheet is ignored.

Depends upon accuracy of NURB representation of radial profile curve

Tabulated Cylinder

Base curve is extruded along user-specified direction vector to create the NURB surface

Depends upon accuracy of NURB representation of base curve

Ruled

User-specified sampling along both curves defines sample point pairs which are then connected with a straight line.  The resultant NURB surface is not C1 continuous in either direction.

Depends upon the number of samples along both curves

Surface of Revolution

Profile curve exported depending upon curve type.  Curve is then rotated about axis to create the NURB surface.

Depends upon accuracy of NURB representation of profile curve

NURB

No translation required

Exact

Trimmed Parametric

No translation required for base NURB surface  Trimming curves are exported depending upon curve type

Base surface is exact, but trimming accuracy depends upon NURB representations of trimming curves

Toroidal Asphere

2D planar mesh with user-specific sampling is projected onto the surface along surface local z axis where the patches are quadratically stitched together to improve continuity across patch boundaries.  Sagged mesh turned into a NURB surface

Depends upon number of (U,V) patches and order (complexity) of the surface

XY Toroidal Asphere

2D planar mesh with user-specific sampling is projected onto the surface along surface local z axis where the patches are quadratically stitched together to improve continuity across patch boundaries.  Sagged mesh turned into a NURB surface

Depends upon number of (U,V) patches and order (complexity) of the surface

Polynomial Asphere

2D planar mesh with user-specific sampling is projected onto the surface along surface local z axis where the patches are quadratically stitched together to improve continuity across patch boundaries.  Sagged mesh turned into a NURB surface

Depends upon number of (U,V) patches and order (complexity) of the surface

Zernike

2D planar mesh with user-specific sampling is projected onto the surface along surface local z axis where the patches are quadratically stitched together to improve continuity across patch boundaries.  Sagged mesh turned into a NURB surface.

Depends upon number of (U,V) patches and order (complexity) of the surface

Bicubic Mesh

2D planar mesh with user-specific sampling is projected onto the surface along surface local z axis where the patches are quadratically stitched together to improve continuity across patch boundaries.  Sagged mesh turned into a NURB surface

Depends upon number of (U,V) patches and order (complexity) of the surface

Polynomial Surface

Only the following special cases are recognized and exported.  Other generic unrecognized forms are ignored.

# of terms up to 4:

Constant x,y or z, will export correctly.

# of terms equal to 5:

XZ parabolic trough

# of terms 6 - 7:

Elliptical or circular cylinder, Elliptical or circular paraboloid

# of terms equal to 8:

YZ parabolic trough

# of terms equal to 10:

Ellipsoid, sphere, elliptical or circular cone

# of terms equal to 35:

Torus or CPC

Depends on recognized form.

Forbes Aspheres

2D planar mesh with user-specific sampling is projected onto the surface along surface local z axis where the patches are quadratically stitched together to improve continuity across patch boundaries.  Sagged mesh turned into a NURB surface

Depends upon number of (U,V) patches and order (complexity) of the surface

Super-Gaussian

Superposition Surface

2D planar mesh with user-specific sampling is projected onto the surface along surface local z axis where the patches are quadratically stitched together to improve continuity across patch boundaries.  Sagged mesh turned into a NURB surface

Depends upon number of (U,V) patches and order (complexity) of the surface

 

 

How curves are exported

The following table summarizes how curves are exported from FRED into CAD format.

 

Curve Type

How Curve is Exported

Accuracy

Circular Arc

Exact NURB translation

Exact

Composite

Individual curves are converted into NURB curves according to the type and then connected together into a single NURB curve

Depends on member curves

Conic Arc

Elliptical and parabolic curves have exact NURB representations but hyperbolic curves are not yet supported

Exact if curve is elliptical or parabolic

Line Segment

Linear NURB curve

Exact

NURB

Exact NURB translation

Exact

Racetrack

Exact NURB translation

Exact

Spline

Curve is fit to cubic NURB curve

Depends upon accuracy of fit

Segmented

Each straight line segment is converted into a linear NURB curve and then connected together into a single NURB curve

Exact

 

 

Surface sampling

In the export dialog FRED users should note the sampling specifications entered for aspheric (Radial Sampling), fitted and ruled (Azimuthal Sampling) surfaces. 

 

Each sampling specification has an important impact on the accuracy of the exported surface as represented by NURBs.  Take the case of the cylinder shown in the following figure which was created in FRED as a ruled surface.

 

 

In this case we have chosen two circular curves, though in general they need not be of the same shape.  Each of the curves is parameterized along its length from 0 to 1 and FRED internally connects points of equal parameterization (A, B, C and D in the figure) with straight lines.  One can immediately conclude that the more sampling points specified in the CAD export dialog (Azimuthal Sampling), the more faithfully the original surface will be represented by NURBs.  The following image shows exactly this relationship. Shown in the top left is the original surface and shown in the clockwise direction are exported surfaces with sample points of 16, 32 and 128 along the parameterized curve.

 

 

In the case of general and toroidal aspheric surfaces there are no exact NURB representations due to the fundamental mathematical relationships and these surface types must be approximated.

 

General aspheres

For general aspheres, the surface is sampled radially, the samples are connected into a NURB curve, and the curve is spun about the axis to create the three dimensional surface.  Like the ruled surface, the number of radial sample points can be specified in the export dialog under the aspheric surface sampling section.  As a general rule the approximation becomes more accurate with an increasing number of surface sample points, though there are instances where the local surface shape is such that the slope prohibits such an assumption.

 

Toroidal aspheres

Toroidal aspheres are approximated by projecting a mesh of patches along the z-axis of the surface and smoothing the individual patches at their boundaries.  For surfaces which are nearly planar this method works well.  However, as the surface becomes increasingly parallel to the direction of the mesh projection (surfaces with significant sag), the mesh cannot sample the surface well and therefore cannot reproduce the surface with high fidelity. 

 

Deformed Surfaces

Deformed surfaces are exported if the base surface is a toroidal asphere, XY toroidal asphere, polynomial asphere, Zernike surface, or a bicubic mesh surface. For all other surface types only the base surface is exported to CAD. Depending upon user feedback, deformations added to other surface types may be exported in future versions of FRED. In all supported cases the base surface and the deformation are sampled with a 2D planar mesh and converted to a NURB surface. The accuracy of the resulting NURB is dependent upon the number of U,V patches and the complexity of the deformed surface.

 

Diffractive Surfaces

Like most other optical software, FRED does not actually intersect the structures of a diffractive surface. Instead, FRED calculates the local grating frequency at the ray intersection point and uses the grating equation to modify the ray direction accordingly. Since the diffractive structures are not actually described in FRED, they are not exported.

 

Tabulated Cylinders

Tabulated cylinder surfaces are formed from curves which are extruded along a straight line. Tabulated cylinders extruded from both continuous and discontinuous curves can be trimmed and exported to CAD.

 

Cylinder Surface with a Rectangular Cross Section

Cylinder surfaces with rectangular cross sections are interesting mathematically because they have branches. Although the outer trimming volume is usually set to trim these branches away, they are nonetheless present.  The image below shows two copies of the same square cylinder.  The surface on the left has an outer trimming volume which is sized such that the branches are trimmed.  The surface on the right has an oversized outer trimming volume and shows the presence of the branches.

 

 

In contrast, the CAD export code does not generate branches on cylinders with rectangular cross sections because the NURBs are constructed from points, not mathematical functions. If a cylinder with a rectangular cross section is used as a trimming surface in the FRED model, almost certainly the exported CAD model will be incorrect because of the differences between how FRED and CAD accomplish trimming. In this case, it is recommended that the cylinder be replaced with four planar surfaces in order to be exported correctly.

 

Trimming in CAD

Where possible, a surface should be trimmed using its inner and outer trimming volume specifications.  If the trimming volume options are insufficient for achieving the desired geometry, the rules below should be considered when applying more complex trimming operations.

 

Trimming in CAD is accomplished when the trimming surface cleanly cuts through the surface to be trimmed. This is very different from FRED, which trims on the basis of the sign of the surface normal.  The only exception to this rule are planes, which are internally scaled by 3x during export (but properly trimmed for the final export).  If a plane being used as a surface trimmer cleanly cuts through the trimmed object after a 3X scaling, no modification needs to be made to the plane in order to achieve the proper export.  Shown below is a cylinder in FRED which is trimmed by a small plane which does not cleanly cut through the cylinder dimensions.

 

 

If the cylinder in the previous figure were exported from FRED into CAD the trimming specifications would not export. However, if we increase the extent of the trimming plane so that it completely cuts through the cylinder, then the exported model will include the trimming specifications (see figure below).

 

 

Trimming surfaces are created in CAD with their assigned outer trimming volume dimensions, which can lead to incorrect CAD exports because the trimming surface may only partially cut through the base surface. The exception to this are planes, whose dimensions are increased somewhat when used as a trimming surface. Consider the figure below in which a trimming surface that only partially cuts through a base surface will appropriately trim in FRED because the trimming operation is based on the sign of the surface normal. However, the trimmed surface will not export correctly to CAD.

 

 

The resulting CAD exports for the case of a plane partially cut through by a trimming surface and for the case of a plane fully cut by a trimming surface are shown below. It is critical to note that the plane only partially cut by the trimming surface does not export correctly to CAD.

 

 

 

Logical Trimming Operation Rules

The following rules apply to the export of logical trimming operations:

Any number of AND'd surface trimming specifications

Any number of AND'd trimming volume specifications

Any number of OR'd surface trimming specifications

Any number of AND'd aperture trimming curves

Any number of AND'd trimming surfaces and aperture curves

No mixed AND/OR specifications

No trimming specifications with parenthesis

 

 

Trimming with Curves

The following rules apply to the export of curve trimming operations:

 

An aperture collection curve may be composed of any number of curves.  A surface may be trimmed with any number of AND'd aperture curves or surfaces.

 

Clear aperture and edge curves are both interpreted to specify an outer boundary curve for the base surface. Due to the fact that only the outer boundary is significant to the CAD program, apertures curves containing both clear aperture and edge trimming curves should be edited to remove the clear aperture curve(s) in most cases. Hole curves are applied to the base surface while obscuration curves are ignored.

 

When an aperture curve is applied as a trimmer to a surface, a best-fit plane is put through all points in the aperture curve.  The curve points are then projected along the surface normal of the best fit plane when the trimming operation is performed.  This algorithm applies regardless of the "Curve Extrusion" setting on the aperture curve itself.

 

 

Export Accuracy and Verification

As described in the previous tables, FRED uses fitting routines for several surfaces types because the FRED surfaces do not have exact NURB representations. In the cases of the standard aspheric, general aspheric, and the conic foci surfaces, FRED fits the radial profile to a user-specified number of sample points. By default, the fitting statistics are reported in the output window. The sample points are generated to the maximum radial dimension of the outer trimming volume. If the surface is subsequently trimmed, the printed statistics may not be accurate.  FRED output fitting statistics for a standard aspheric surface is shown in the following image.

 

 

In the cases of the toroidal, XY toroidal and polynomial aspheric surfaces, the Zernike surface, and the bicubic mesh surface, FRED projects a 2D planar mesh onto the surface and creates a NURB from the sagged mesh. By default, the fitting statistics are reported in the output window. The samples points are generated to the maximum dimensions of the outer trimming volume. If the surface is subsequently trimmed, the printed statistics may not be accurate.  FRED output fitting statistics for a toroidal aspheric surface are shown below.

 

 

 

Limitations of the CAD export feature

Many optomechanical engineers would like to work in an environment where CAD files containing optical and mechanical structures are seamlessly transferred back and forth between optical and CAD application software. While this is certainly done, we have to be concerned with the underlying accuracy of the NURB representations of the optical surfaces. It turns out that only a few surfaces commonly used in optics have exact NURB representations, including planes, conics, and cylinders. All other surfaces, including aspherics, must be approximated in order to construct a NURB representation.

 

FRED gives the user the opportunity to set the sampling for the approximated surfaces in the CAD export dialog. Generally speaking, the greater the number of sampling points the closer fit to the surface. However, due to errors in the local surface derivative this may not always be true and there are frequently tradeoffs between the accuracies of the surface points and the accuracies of the surface normals.

 

The projection method that FRED uses works very well for surfaces that are near planar. On a surface that has significant sag, the mesh can have difficulty conforming to the surface around the sides. Essentially, the mesh is being projected onto a surface that is near-parallel to the projection direction and therefore the surface may not be well sampled.

 

In many cases, the NURB equivalents created by FRED and other optical engineering software are accurate enough for mount design, solid modeling, etc. However it is our experience that these representations are rarely accurate enough for raytracing if the NURB is brought back into FRED.

 

In the past, we have recommended to our customers that all optical surfaces expressed as NURBs should be checked before attempting to raytrace in FRED. We typically trace a fan of rays onto the surface and then compare the ray coordinates with the known surface sag values. The differences will be the errors introduced by representing the surfaces as 32 NURBs. Ultimately the user will have to decide if the errors are acceptable for the given application.

 

Export Failure

In some cases, the error message

 

"Failure during export!! Attempting to export untrimmed model!"

 

may occur.  This message is displayed when the first attempt at CAD export has failed to apply proper surface and curve trimming specifications.  Upon initial failure, a second attempt at model export will be made using only the trimming volumes, ignoring any surface or curve trimming.  If this attempt fails as well, the following message will be displayed:

 

"General failure during export!!"

 

In some circumstances, the export failure messages may be displayed when trying to export to a remote network location.  Exporting the model to a local disk location may resolve the issue.  If this does not apply, proceed with the debugging suggestions below.

 

In the event of catastrophic export failure (on the second attempt), the user should debug the export in the following way.   Begin by selecting a high level node on the object tree, perhaps a subassembly containing many other components which is one level below the Geometry folder in the hierarchy.  Now open the CAD export dialog and use the option "Export selected entities".  If the export proceeded without error, the geometry causing the export failure is not a child of the selected node.  Proceed through the object tree working down through the hierarchy until the problem part is identified.  If any abnormality with the construction of this part cannot be identified, the user is encouraged to send the sample file to Photon Engineering for further diagnosis.

 

Consider the the following construction of a plane with a semi-circular aperture, which was created by connecting a circular arc with a line segment as a ruled surface.  This surface will fail on export from FRED.

 

 

As part of a larger model, this surface was identified as the reason for export failure using the procedure outlined above.  Notice that inspection of this surface in the 3D view shows some odd drawing characteristics (the dark regions).  It turns out that the two curves being connected were in reverse order, causing the ruled surface to be folded back onto itself.  In the following image the original surface is shown on the left and the modified surface connecting the two curves in the proper order is shown on the right, with both surfaces being drawn in iso-contour mode.  Notice that the iso-contour lines on the corrected surface (right) are much better behaved than those in the reversed configuration (left).  The corrected surface exports properly in FRED.

 

 

While FRED is capable of rendering (and tracing) this surface, the NURB representation is probably invalid due to improper surface normals and therefore fails on export.

 

Element Primitives and Booleans

When exporting Element Primitive or Element Boolean nodes, all child nodes will be exported regardless of their traceability flag.  The child nodes are necessary for the trimming logic to succeed, though not all of the child nodes are necessarily required for raytracing.

 

 

Related Topics


File Menu Command Summary

 

 

 

 

 

Copyright © Photon Engineering, LLC