ABSTRACT

In this chapter, several programs that you may find useful will be presented. These include a collection of Pascal procedures for generating 2D line plots; three programs for manipulating ASCII, R12 DXF, and HP-GL PLT files; and two AutoLISP applications for automatically generating 3D entities from within AutoCAD with description read from file. LibPlots.PAS is a unit with procedures that allows you to write programs that

generate graphs very similar to those done with D_2D. ¬eUtil~TXT.PAS program can be used to add between every two data points read

from a Œle, additional points interpolated linearly, and spline or B-spline. It can also evaluate numerically the Œrst and second derivatives and can transfer to an output Œle every certain row of the original data. ¬e program can also make continuous a series of angle values restricted, for example, to [−π…π] and can apply a logarithm transform to the input data safe from crashing when encountering a number that is negative or zero. By directly editing its code, additional transformations are possible, like scaling, oŠsetting of data, and custom functional transforms. Util~DXF.PAS is a DXF viewer that can display 2D and 3D lines and polylines, cir-

cles, and arcs of circle read from an R12 DXF Œle. In addition, the program can be used to extract to ASCII the x, y or x, y, z coordinates of selected polyline(s), a feature useful for transferring level-curves plots from D_3D to D_2D or for digitizing curves available only as raster images. Figure 1.14 has been produced this way, that is, a picture was imported into AutoCAD and polylines were drawn over. When completed, the drawing was exported to R12 DXF, and the x, y coordinates of the vertices of these polylines were then extracted to Œle using Util~DXF. ¬is Œle then served as input to the D_2D program when producing Figure 1.14.