| User-defined Surfaces,
BSDF and Materials |
|||||||||
|
FRED
has a very large assortment of predefined surface types. They range from ordinary optical surfaces such as planes, conics, and rotationally symmetric aspherics to surfaces typically found in CAD software such as NURBS, splines, and surfaces created from extruded curves. For most users, this palette of surfaces covers most of the common applications. When we were planning FRED, we knew that users would occasionally require a surface type that we had not yet programmed. To address this need, we implemented user-defined surfaces, BSDF and materials through FRED's built-in BASIC compiler. The advantages are many:
|
![]() Rippled surface as a BASIC script
|
||||||||
|
In many other optical software, a user faced with this problem would be required to program the new surface in a DLL. This requires an appropriate compiler and some experience with code development; these are significant drawbacks for most users. Perhaps the most inconvenient aspect of the DLL, though, is portability: in order to run the file containing the user-defined surface, the user must also have the DLL present as well. This makes file sharing difficult. Other software deal with the problem of a user-defined surface by implemented a scripted surface that is interpreted during execution. While this avoids the need for a compiler to create a DLL, interpreted code is always slow, a drawback for many applications. |
|||||||||
© Photon Engineering LLC. All Rights Reserved.