Caveats
Important notes about how curves are generated and displayed in AutoCAD.
- To avoid errors created by settings such as SNAP, ORTHO, and OSNAP, their variables are stored, temporarily cancelled, then restored during the execution of a curve.
- To avoid division by zero, whenever denominators are less than 10-12 (1e-12 in AutoLISP), the denominators for those point calculations are changed to 1e-12. The AutoLISP code for denominator input is:
(defun avoid_zero (input) (if (< (abs input) 1e-13) 1e-12 input)) - To avoid imaginary numbers, the
(expt number power)function is modified toALT_EXPTthat converts various domain situations and imaginary values so that only real values within 1e7 are plotted. A setting,complexsafe, either nil or T, allows one to either flip an imaginary root to an artificial real value or suppress it entirely. Both code and details of this and other utility functions are kept in Curvecore.lsp. See For AutoCAD Users - Therefore, any curve whose formula contains the possibility of division by zero or imaginary numbers may have an altered appearance, as the polyline may include points with these ‘corrections’. Search the code for the functions
(avoid_zero...and(alt_expt...to identify the suspects. - For the above reasons, extraneous lines to and from infinity have been removed in the images that follow.
- The curves, their variable values, and their image magnifications are arbitrarily chosen to reveal interesting portions.
- Where curves are commonly used and known but defy parametric calculation, parametric approximations found in the literature are used so that the user can still plot these, although with varying accuracy. An example is the Bessel function.