Dec 062017
Fast and flexible conturing system for use with AutoCAD.
File QS2.ZIP from The Programmer’s Corner in
Category Printer + Display Graphics
Fast and flexible conturing system for use with AutoCAD.
File Name File Size Zip Size Zip Type
QS.DOC 47048 15229 deflated
QS.EXE 72710 38475 deflated
QS.LSP 24347 6309 deflated
QS.MNU 34547 9100 deflated

Download File QS2.ZIP Here

Contents of the QS.DOC file

//////// // /////// //////
// // // // // //
// // // // //
// // // // // ////// // //// /////// // // // /// //
// // // // // // //// // // // //// //////
// // // // // // // // // // // // // //
//////// /////// // ////// // // /////// /////// // // TM
// //

Version 2

Generic Contouring Utility for AutoCAD(R)

September 1988

U S E R ' S M A N U A L

(c) Copyright 1987,1988 Schreiber Instruments, Inc.
All rights reserved.

7250 Eastmoor Drive, Suite 226
Denver, CO 80237
(303) 759-1024

QuickSurf is a trademark of Schreiber Instruments, Inc.
AutoCAD is registered in the U. S. Patent and Trademark office by
Autodesk, Inc.

T a b l e o f C o n t e n t s

1.Introduction . . . . . . . . . . . 1-1
2.The "Convertible Demo" . . . . . . . . 2-1
3.QuickSurf without AutoCAD . . . . . . . 3-1
4.Quick Installation . . . . . . . . . 4-1
5.Operation from AutoCAD . . . . . . . . 5-1
a. GEN - Generate random points . . . . 5-1
b. QSX - Extract control points . . . . 5-1
c. QSXPL - Extract polylines . . . . . 5-2
d. QSOPT - Set options . . . . . . . 5-3
e. QS - Run QuickSurf . . . . . . . . 5-5
f. LABEL - Label contours with elevations . 5-5
g. SMOOTH - Smooth polylines . . . . . 5-6
h. TICK - Draw tickmarks ("hatchuring") . . 5-6
i. POST - Post elevations of control points 5-7
j. VOLUME - Calculate volume under a surface 5-7
k. PROFILE - Generate a profile . . . . 5-8
l. FLATTEN - Put a profile in the x-y plane 5-8
m. TILT - Tilt objects for plan view . . . 5-9
6.Customizing Your Installation . . . . . 6-1
a. Placement of QS.EXE . . . . . . . 6-1
b. Loading the QuickSurf menu . . . . . 6-1
c. Loading the QuickSurf AutoLISP routines . 6-2
d. AutoLISP related environmental variables 6-2
e. Memory for QS.EXE . . . . . . . . 6-3
f. Temporary files . . . . . . . . . 6-3
g. QuickSurf input and output files . . . 6-4
7.Input File Specifications . . . . . . . 7-1
8.Output . . . . . . . . . . . . . 8-1
9.QuickSurf Reference . . . . . . . . . 9-1
-i Demo conversion instructions . . . . 9-2
-l Contour levels . . . . . . . . . 9-2
-z Contour interval . . . . . . . . 9-2
-n Number of grid cells . . . . . . . 9-2
-d Dimensions of grid cells . . . . . . 9-2
-p Draw control points . . . . . . . 9-3
-t Draw triangles . . . . . . . . . 9-3
-g Draw grid . . . . . . . . . . . 9-3
-c Color contours . . . . . . . . . 9-3
-m Monochrome contours . . . . . . . 9-3
-y Layered contours . . . . . . . . 9-3
-x Indexing . . . . . . . . . . . 9-3
-r Window definition . . . . . . . . 9-4
-f Scaling z coordinates . . . . . . . 9-4
-v Verbose report . . . . . . . . . 9-4
- Suppress contours . . . . . . . . 9-4
-w Weighting . . . . . . . . . . . 9-4
-s Derivatives . . . . . . . . . . 9-4
-b Blending . . . . . . . . . . . 9-4
-k Local extrema . . . . . . . . . 9-4

Q u i c k S u r f

1. Introduction

QuickSurf is a fast and flexible contouring system for use in
conjunction with AutoCAD(R) Version 2.6 or later, as well as
other graphics systems capable of interpreting AutoCAD's .DXF
format files.

With unsurpassed performance, versatility, and ease of use,
QuckSurf is the right tool for any discipline in which spatial
or other three-dimensional data can be meaningfully represented
by surfaces. QuickSurf supports all the usual features of
contour mapping systems: smoothing, labeling, hatchuring,
indexing, grid mesh views from arbitrary viewpoints and with
hidden line removal, volume calculation, and profiling. With
the extensive editing features of AutoCAD, QuickSurf provides
an environment where interactive contour mapping is a reality,
and allows preparation of high quality hard copy maps on virtually
every graphic output device in existence.

Version 2 is upward compatible with earlier versions, and offers
a 30% imrovement in performance, increased control point and grid
capacity, lower memory requirements, better interpretation of very
irregular surfaces, and a number of new features suggested by more
than 200 users of earlier versions.

Please note: this manual presumes that the reader is knowledgeable
and experienced in the use of AutoCAD. If you are new to AutoCAD,
we suggest that you obtain training through an Authorized AutoCAD
Training Center, or get assistance from an experienced user before
attempting to install or use QuickSurf.

2. The "Convertible Demo"

Schreiber Instruments, Inc. uses a unique method to distribute
demonstration and operational copies of QuickSurf.

Every distributed copy is the complete, documented, not copy
protected system, except for two things:

o Contours are generated at randomly selected elevations
rather than at regular intervals.

o The grid and the triangle network are only partially

This demonstration version is sufficient for prospective users
to completely evaluate QuickSurf, and determine whether it would
serve their needs.

We usually charge only a nominal shipping and handling fee for
the demonstration version, and make it available free of charge
through bulletin boards and other electronic distribution media.
We encourage copying and redistribution of this version, in its
complete, unaltered form.

The demonstration version can be converted to a full working
system by obtaining a password from Schreiber Instruments, Inc.
When arrangements for payment are made, the conversion can be
performed immediately by telephone, without a modem.

Starting with this version, it is no longer necessary to perform
the conversion by telephone. You can send your key number to
us by mail with your payment, and we can call you back with
the password, or send it to you by mail.

The "convertible demo" concept is a simple, foolproof system
that incorporates demonstration, delivery, and copy protection,
requires no special disks nor hardware, allows unlimited
installations, imposes minimal inconvenience and only the
cost of a phone call on users, eliminates downtime due to
copy protection problems, and protects our investment in
development from piracy.

3. QuickSurf without AutoCAD

QuickSurf can be used with many CAD and graphics systems other
then AutoCAD, since input to QuickSurf is a generic text file,
and output is a .DXF file, which is a de facto standard for
exchange of graphic information, and is recognized by most
other systems.

If your system does not include a translator for .DXF, only a
modest level of programming skill is needed to write your own
translator that will allow you to import contours, grids, and
triangles into your system.

Many features of QuickSurf are implemented through AutoLISP,
a user-programmable language extension of AutoCAD. These
features, unfortunately, can only be used with AutoCAD.

If you plan to use QuickSurf without AutoCAD, Sections 4. and
5. of this manual are not applicable, and only parts of Section
6. will be of interest to you.

4. Quick Installation

You have considerable flexibility in installing QuickSurf in
your system, and integrating it with other third-party software,
or your own applications. To achieve optimum performance and
ease of use, you should read and thoroughly understand Section
6., Customizing Your Installation.

However, if you're in a hurry, AND if you have a standard
installation of AutoCAD, you can get started quickly by using
the following simple procedure:

c:; Change to drive C:
md \qs; Create QuickSurf subdirectory
cd \qs; Change to it
copy a:qs.exe; Copy
copy a:qs.lsp acad.lsp; files
copy a:qs.mnu acad.mnu; from floppy
set lispheap=25000; Reserve memory
set lispstack=6000; for AutoLISP
\acad\acad test=; Start AutoCAD, no prototype

Bring up the AutoCAD drawing editor for a new file (option 1 on
the main menu), and proceed to the next section.

5. Operation from AutoCAD

When properly installed, QuickSurf becomes simply an extension
of AutoCAD. All features of AutoCAD work normally, and the
commands described in this section are added to AutoCAD's
standard command repertoire. All the added commands can be
invoked through the keyboard, through the QUICKSRF submenu,
or the QuickSurf pull-down menu.

The commands are listed in a tutorial sequence, i. e., in
order in which you can run through them as you are learning
to use QuickSurf.

a. GEN - Generate random points

Command: GEN
Number of points: xxx

Intended for demonstration, experimentation, or
learning, this command will provide you with a data
set of random 3D points, if you don't have real-world
data available.

GEN will generate random points within the rectangle from
(0,0) to (13,9), and their elevations will range from
0 to 3. 50 points is a comfortable number for early
experimentation, and if you have the time, the disk
space, and the patience, you can go to 10920.

b. QSX - Extract control points

Command: QSX
File name : filename
First corner of area : point1
[ Second corner of area: point2 ]
Select objects: objects

Prior to running QuickSurf, you must create an input
file of control points. This file is described in detail
in Section 7.

The QSX command allows you to easily create this file
from existing data in your drawing.

No extension should be specified for the file name, and
QSX will append the extension ".QS". You may wish to
use different file names for working with multiple surfaces
within the same drawing.

You may limit grid and contour generation to the interior
of a rectangle by specifying the two corner points. If
no rectangle is specified, grid and contours will cover
the interior of the convex polygon that encloses all the
control points.

Use the normal AutoCAD object selection mechanism to select
objects that are to be used as control points. The objects
selected may be of any type, but only POINTs, SHAPEs, and
insertion points of INSERTed blocks will be used.

Naturally, all selected objects that are to be used as
control points should have an elevation, unless their
elevation is explicitly intended to be 0.

When all objects have been selected, QSX will write the
file to disk, and show a running count of the number of
control points actually written.

You can examine the file using "TYPE filename.QS", or
modify it using your text editor. The parentheses that
appear in the file are generated by AutoLISP, and they
are not required.

Note:Grid and contours will be generated only in
the area that is both inside the rectangle
defined by the two corner points, and inside
the perimeter of the control points. A minimum
of three points are required. The maximum
depends on memory available (see Section 6.).

c. QSXPL - Extract polylines

Command: QSXPL
File name : filename
First corner of area : point1
[ Second corner of area: point2 ]
Select objects: objects

This command is identical to the QSX command, but it only
extracts vertices of existing polylines. It is useful
for reprocessing contours that were manually digitized,
edited, or imported from another system.

Naturally, the polylines must have correct elevations,
and they should not be smoothed nor fitted.

d. QSOPT - Set options

Command: QSOPT
Maximum density grid ? Y or N
[ Grid cells in x direction : nx ]
[ Grid cells in y direction : ny ]
Interval : interval
[ Contour levels : levels ]
Points ? Y or N
[ Layer : pointlayer ]
Triangles ? Y or N
[ Layer : trilayer ]
Grid ? Y or N
[ Layer : gridlayer ]
Contour (Color/Mono/LaYered/None) : cmode
[ Layer : contlayer ]
[ Index line width : width ]
Verbose ? Y or N

This command prompts the user for the major options of the
gridding and contouring process, and saves the responses
for subsequent running of QuickSurf. It is not necessary
to run QSOPT prior to running QS, and null responses are
acceptable to all prompts.

If you respond with Y to the Maximum density grid prompt,
the grid will be generated with as many grid cells as
will fit into memory. In a standard installation of
AutoCAD, this will be about 5000 grid cells (a 70x70 grid,
e. g.). This number can be increased by modifying the
ACAD.PGP file, as described in Section 6.

If you don't request a maximum density grid, you'll be
prompted for the number of cells in the x direction.
The width of the area to be gridded is divided by nx
(grid cells in x direction) to obtain horizontal grid
spacing, and nx+1 columns of grid will be generated,
when possible.

If no response is given for ny (grid cells in y direction),
a number will be chosen so that the cells are approximately

If no contour interval, or an interval of zero is specified,
QSOPT will prompt for a number of levels. The entire range
of z values will be divided by that number and rounded up
to obtain the contour interval.

If you respond with Y to the Points prompt, QuickSurf
will bring the control points into the drawing, as POINT
entities, on the specified layer. If the points were
originally extracted from the drawing, this option will
duplicate the original points.

If you respond with Y to the Triangles prompt, a network
of triangles that connects all the control points will
be generated. The triangles are drawn as 3DFACEs, with
all vertices at control points.

If you respond with Y to the Grid prompt, the array of
grid cells used for contouring will be drawn as 3DFACEs.

Note that the surfaces represented by the triangles and
by the grid are not the same: triangles are flat faces
with straight edges, while the grid is an approximation
to a smoothed surface.

Both the triangles and the grid are suitable for 3D
display with VPOINT, hidden line removal, and shading
with AutoShade.

Contours may be generated three different ways, or
not at all. By default, they are drawn in a different
color for each elevation, all on one layer (Color). They
may also be drawn with no color on one layer (Mono), or
on a different layer for each elevation (LaYered).

If the "LaYered" method is chosen, the layer name entered
(which may be null) will be used as a prefix, to which
the elevation of the layer will be appended to form the
layer name. Either L or Y can be used request the
layered mode.

If contouring is requested, QSOPT will also prompt for
index line width. Every 4th or 5th elevation will be
drawn with the width specified, and the frequency is
chosen automatically by QuickSurf. A width of .01
is suitable for most hard copy devices at scale 1=1.
For other scales, multiply .01 by the scale. By
default, no indexing is performed (width is 0).

When QuickSurf runs, it normally reports only the times,
in seconds, of the major phases of the process. When
the Verbose option is enabled, QuickSurf will also
display running counts of steps in some of the phases,
so that the progress of a long-running job can be
monitored. This typically adds about 10% to the run
time of QuickSurf, which is usually negligible.

e. QS - Run QuickSurf

Command: QS
File name : filename

QS invokes the SHELL command to run QS.EXE, using the
options as set by QSOPT, or a logical set of defaults,
if QSOPT has not been executed.

The file name may be that of a file that was created
by extraction (QSX or QSXPL), or by some external means
(spreadsheet, data base, user's application program, etc.).
No extension should be specified, and the file name must
have the extension ".QS".

This command will also execute a DXFIN command, to bring
in the file generated by QuickSurf. You can ignore the
AutoCAD warning message, indicating that only the ENTITIES
section will be input.

f. LABEL - Label contours with elevations

Command: LABEL
Label location: point
Label location: point
Label location:
Text height: distance

Use a pointing device to specify one or more points
on contour lines at which a label is to be drawn.
A small circle will be drawn at each location as
you point to it. Enter a space or carriage return
after the last desired location.

You can respond to the prompt for the text height
with a "rubber band" line from the last label location
entered, or with a number.

For each location indicated, LABEL will erase the circle,
make a gap in the contour for the text, tilt the text so
that it follows the general direction of the contour line,
and post its elevation using the current text style. The
label will have the same layer, color, and elevation as
the contour line.

It's best to label contours on straight sections, where
neighboring contours are relatively sparse, and careless
labeling may produce strange results. If some overwriting
or bad placement occurs, you can use the MOVE and ROTATE
commands to make minor adjustments, or U to undo up to
the bad spot. It may take two or three U's to undo a
badly placed label.

Generally, you don't have to be very precise when placing
labels, since the damage can always be easily repaired,
but you'll save time by planning the layout of labels
ahead of time, and being reasonably careful.

Note:UNDO All must be active when the LABEL command
is invoked, and the current text style must have
variable height (0.0).

g. SMOOTH - Smooth polylines

Command: SMOOTH
Select objects: polylines

You may select anything (including the entire drawing).
Selected entities that are POLYLINEs will be smoothed,
and other entities will be ignored.

By default, SMOOTH uses Fit on Version 2.6, and
Spline with system variable SPLINESEGS set to -1 on
Release 9.0. Some crossing of contours may occur with
Fit, and PEDIT can be used to edit offending contours

h. TICK - Draw tickmarks ("hatchuring")

Command: TICK
Select objects: polylines
Distance between ticks : distance
Length of ticks : length

This command will draw evenly spaced tickmarks
perpendicular to selected polylines. The ticks
will point in the downward (decreasing z) direction.
They are usually applied only to the inner closed
contour of a local minimum.

One or more contours may be selected for hatchuring.
After a null response, the distance between ticks and
length of ticks may be entered as relative lengths.
The defaults are .25 and .0625, respectively.

A negative value for tick length will cause the ticks
to point upward, rather than downward, as is customary.

Note:The recommended sequence of operations on a
contour is LABEL, SMOOTH, TICK. The first two
may be reversed, but TICK must always be last.

i. POST - Post elevations of control points

Command: POST
Select objects: control-points
Text position: offset-point
Text height: distance
Layer : layer-name

Anything may be selected, but only POINTS, SHAPES, and
INSERTS will be processed.

The text position relative to each control point is
specified relative to one of the selected control
points, and will be the same for all others. The
lower left corner of the text string is the reference

The text height may be specified as the length of the
"rubber band" line from the selected text position.

The default layer for labeling points is ELEV, or
another layer may be specified.

Overwriting of text or other important features may
occur in dense areas. The MOVE command can be used to
clean up such situations manually.

The POST command requires that the height of the current
text style is variable (0.0).

j. VOLUME - Calculate volume under a surface

Command: VOLUME
Select objects: objects

Either the grid, or the triangles may be used to
estimate the volume "under" them, but not both.
For triangles, the exact volume under the planar
surfaces is calculated. For grid, an approximation
is calculated, whose accuracy depends on the grid

The command will display the volume under each
individual entity selected, and the grand total.

To calculate the volume enclosed between two surfaces,
(as in cut-and-fill operations), measure the volume
under the top surface, record the total, then measure
the volume under the second surface, and subtract the
results. For this method to be accurate, the same
area must be covered by both surfaces.

k. PROFILE - Generate a profile

Command: PROFILE
First point: point
Next point: point
Next point: point

This command must be used only in plan view, AFTER
a surface has been displayed, using triangles, grid,
or contours. All visible entities are used for the
interpolation, so only one surface should be visible,
and triangles should not be used simultaneously with
grid and contours. The user specified points are
connected with a sequence of 3DLINEs, which follow
the "lay of the land" along the user specified path.

After the profile is generated, it is available for
selection with a "Previous" select option, so that you
can conveniently proceed to the following command.

l. FLATTEN - Put a profile in the x-y plane

Command: FLATTEN
Select objects: profile
Origin of flattened profile <0,0>: point
Erase old profile ? : Y or N

This command should be used immediately after the PROFILE
command, using option "Previous" when selecting objects.

All selected 3DLINES will be joined into a single POLYLINE,
in which the distance along the profile becomes x, and
z becomes y. The "origin" is actually the left end of the
profile, at elevation 0.

Since the FLATTENed profile is a single POLYLINE entity,
it can easily be moved to a different location after
it is generated. In other words, the specified origin
is not critical, and it can be selected for convenience.

After a flattened version of the profile is drawn, you
have the option to erase the original, or leave it alone.

m. TILT - Tilt objects for plan view

Command: TILT
Select objects: objects

The purpose of this command is primarily to allow you
to present both a plan view of contours and an oblique
view of the grid in the same drawing.

After generating a grid, freeze all layers except the
one containing the grid, or other objects to be tilted.
Use VPOINT to obtain the desired view. Now run TILT,
selecting only the desired objects. Return to plan
view (VPOINT 0,0), thaw all layers, and run MOVE, using
select option "Previous", to move the tilted objects
to the desired position in the plan view drawing.

The above proceedure may be repeated for multiple
views of the same or different items in one drawing.

6. Customizing Your Installation

The simple installation procedure in Section 4. is sufficient
for small contouring projects. The material in this section
will enable you to get optimum performance from QuickSurf on
large projects, and to make the use of QuickSurf easy and

As you read this, you may want to refer to appropriate sections
in the AutoCAD Reference Manual, the AutoLISP Programmer's
Reference, and the AutoCAD Installation and Performance Guide.

a. Placement of QS.EXE

For QuickSurf to operate properly, QS.EXE must be
available from AutoCAD. You have three alternatives:

1. You can always run QuickSurf only from the
C:\QS directory, where it was copied during
initial installation. Often this is impractical,
especially if you use other third-party software
that imposes conflicting requirements.

2. You can include C:\QS in the PATH environmental
variable, so that it is available from any
directory. This works, but it slows down the
response of DOS to all commands.

3. You can move QS.EXE to a directory that is
already listed in the PATH, for example ACAD
or DOS.

Consider these alternatives based on your normal mode
of operation, and personal preference.

b. Loading the QuickSurf menu

If you start AutoCAD from the C:\QS subdirectory,
the QuickSurf menu will be loaded automatically.
It is, in fact, the complete menu as provided with
AutoCAD Release 9, with a pull-down menu and a few
submenus added to support QuickSurf.

If you start AutoCAD from another directory, you can
bring the QuickSurf menu in by using the MENU command.

c. Loading the QuickSurf AutoLISP routines

If you start AutoCAD from C:\QS, the AutoLISP routines
will load automatically, if you followed the quick
installation procedure in Section 4.

You can also force automatic loading by moving the
ACAD.LSP file to your AutoCAD subdirectory, or by
appending it to the existing ACAD.LSP file in the
AutoCAD subdirectory. This will cause it to be loaded
every time you start AutoCAD, even if you don't plan
to use QuickSurf during the session.

Since the QuickSurf file of AutoLISP routines is quite
large, you will want it to load only when you intend
to use QuickSurf, rather than all the time.

A good compromise solution is to add the following line
to the ACAD.LSP file in your AutoCAD directory:

(defun c:loadqs () (command "menu" "c:\\qs\\qs") (load "c:\\qs\\qs"))

That will add a new command, LOADQS, to your system.
You can then use this command to load both the QuickSurf
AutoLISP routines, and the QuickSurf menu, only when you
plan to use them, and with minimum conflict with other

d. AutoLISP related environmental variables

QuickSurf requires the LISPHEAP and LISPSTACK variables
to be set to at least 6000 and 25000 respectively. These
variables are usually set by AUTOEXEC.BAT, or by another
batch file that is used to start AutoCAD.

If you already have settings that are the same or greater,
you can probably leave them alone. You may want to make
LISPHEAP larger if you will be loading other AutoLISP
files simultaneously with QuickSurf's ACAD.LSP. If you
exceed the maxima imposed by AutoCAD, a warning will be
issued when you start AutoCAD, and AutoLISP will be

e. Memory for QS.EXE

In AutoCAD, QS.EXE is invoked by the SHELL command, which
requests the amount of memory specified in the ACAD.PGP
file, normally located in subdirectory C:\ACAD. Normally,
this is 127000 bytes, which will let you process about
5000 points, and generate grids of up to 5000 cells.

By changing 127000 in the ACAD.PGP file to a larger
number, you can increase these maxima. For every four
bytes added, you can process an additional control
point, and for each three bytes you can generate an
additional grid cell. The absolute maximum is 10,920
control points, and the number of grid cells is always
limited only by memory.

Changing 127000 to 256000 will allow you to run up
to 10,920 control points, and it will improve the
performance of QuickSurf even when running smaller
numbers, because it will reduce disk usage by doing
more work in memory.

The amount of memory requested by SHELL should not
be arbitrarily large. If it is greater than the amount
of memory available, it will be completely rejected.
Also, increasing the amount of memory requested by SHELL
will slow down the execution of any program that is
invoked by SHELL, because larger amounts of memory have
to be saved on disk, and reread, whenever SHELL is used.

The best number to use on your system, for your type
of work, can only be determined experimentally. Start
with 127000, and increase the number if it is too small
to process all control points, or to generate the amount
of grid requested, or if the run times are much longer
from within AutoCAD than from DOS.

f. Temporary files

When necessary, QuickSurf creates files for temporary
storage, and deletes them upon completion. To select
placement for these files, QuickSurf looks for the
environmental variables QSTMP, TMP, and TEMP, in that
order. If one of these variables is defined, it is
used as the path for the subdirectory in which the
temporary files are created. If none of them are
defined, the temporary files will be created in the
current directory.

For optimum performance, the temporary files should
be created in a RAM disk (virtual disk in memory).
If you have a RAM disk, and if about 500000 bytes
are always available on that disk, we suggest that
you set QSTMP to a path to that disk by


assuming that E: is your RAM disk. This setting should
be added to your AUTOEXEC.BAT file to make it automatic.

QuickSurf will work if the temporary files are created
on a hard disk, or even a floppy disk, but there may
be substantial degradation when large numbers of points
are processed with limited memory.

Many other software products use either TMP ot TEMP for
placement of temporary files. If one of these variables
is already defined on your system, and if the choice of
assignment is acceptable, you don't need to define QSTMP.

g. QuickSurf input and output files

The input file to QuickSurf is processed very quickly,
and requires no special handling. The output file
(a .DXF file) is also written relatively quickly, but
it can get huge, especially if you generate triangles
for a large number of control points, or if you draw
a large grid. In those cases, it may take much longer
to load the .DXF file into AutoCAD than it took for
QuickSurf to generate it. It's not unusual to see
.DXF files of 5 megabytes or more.

The output .DXF file is always created in the same
directory from which the input (.QS) file is read.

The disk drive must have enough room to accomodate
both files simultaneously, and if it's the same drive
as the one assigned for temporary files, it must also
accomodate them.

Ideally, all the files should be on a RAM disk for
for optimum performance. This is only possible with
for smaller jobs. You should determine experimentally
what the limits of your system are, and run small jobs
through RAM disk, and bigger ones on a hard disk with
plenty of room to spare.

If you are really tight on disk space, try this:
Rename your input file so that its extension is .DXF,
and run QuickSurf from DOS, using the file name with
the .DXF extension. The input file will be destroyed,
and the disk space that it occupied will become available
for the output file of QuickSurf, which will have the
same name.

If you are skilled in AutoCAD customization, we encourage you
to modify QS.MNU and QS.LSP, as well as other aspects of the
AutoCAD environment, to suit your requirements.

7. Input File Specifications

QuickSurf requires that data be provided in an ASCII text
file in a very free-form format.

Basically, control points must be provided as x-y-z
triplets in a text file, one point per line. Standard
decimal or scientific (exponential) notation may be used
for the coordinate values, and any group of characters
that cannot be mistaken for a number may be used to
separate the three values on a line. Hence, spaces,
tabs, commas, semicolons, parentheses, etc., may act
as separators of values on a line.

The QSX and QSXPL commands allow you to create a correctly
formatted input file from data in an existing AutoCAD drawing.
Input can also be easily created by spreadsheets, data base
report generators, manual entry, or application programs
easily written in any language.

By default, QuickSurf will process the smallest rectangle that
encloses all the control points provided. QuickSurf will
NOT extrapolate outside the perimeter of the control points,
and, like any other contouring method, it won't do very
well around the edges.

Therefore, a smaller rectangle may be specified for contouring
than the extrema of the control points. Ideally, this area
should be well within the perimeter of the control points,
with some control points in all directions around it.

The rectangle to be contoured may be specified by providing
FOUR rather than THREE values on the first line of the input
file. These four values are two x-y pairs, which are opposite
corners of the desired rectangle.

The rectangle may also be specified on the command line (see
Section 9., option -r), rather than in the input file.

Values beyond the fourth on the first line, and beyond the
third on subsequent lines are ignored, as are all lines with
fewer than three recognizable numeric values.

The maximum number of points that QuickSurf can process
depends on the memory available. If the input file contains
more points than can be processed, QuickSurf will issue a
warning message, and continue by ignoring the points beyond
the limit.

Likewise, if the requested grid density is too high, a warning
message is issued, and QuickSurf continues by generating the
maximum number of gridcells that can be accomodated with the
memory available.

The extension ".QS" is required if the input file will be
normally processed from within AutoCAD. Any extension is
acceptable for processing in DOS, or by SHELL command from

8. Output

QuickSurf generates an AutoCAD .DXF file, with the same
name as the input file. The file may contain one or more
of the following:

a. Control points

The control points in the input file are generated as
POINT entities, with appropriate elevations, on the
designated layer (POINT by default).

b. Triangles

The triangles are generated by connecting the control
points in an optimal pattern, for subsequent processing,
and visual examination. The triangles are created as
3DFACE entities. This makes them useful for use with
the AutoCAD HIDE command, as well as AutoShade. A
deisignated layer (TRI by default) may be specified
for the triangles.

c. Grid

An array of usually square cells is generated, also as
3DFACE entities, that covers the area to be contoured.
This is not very interesting in plan view, but in a view
with an elevated VPOINT, it produces the common fishnet
display of the surface. The default layer name is GRID.
Either cell dimensions, or the number of cells in the
x and y dimensions of the contoured area may be specified
by the user. Cells that are not totally within the control
point perimeter are not generated.

Like the triangles, the grid may be used with HIDE and
AutoShade to produce strikingly beautiful and visually
effective displays of surfaces.

d. Contours

Contour lines are generated within the area covered by
the grid cells as POLYLINEs, with appropriate elevations.
By default, all contours are placed on layer CONT, with
a different color assigned to each elevation, starting
with color 1 (red) for the lowest elevation.

Alternatively, contours may be generated without color
specifications (BYLAYER), or placed on a different layer
for each elevation, with automatically generated unique
names for the layers.

Either the contour interval, or the number of intervals
may be specified by the user. By default, 15 or fewer
optimally selected elevations are chosen.

Since the contours are POLYLINEs, they may be further
smoothed using the Spline or Fit options of PEDIT.

Contours can be indexed automatically, so that every
4th or every 5th elevation is generated with a wide

9. QuickSurf Reference

This section describes all the options that can be used with
QuickSurf, when QS.EXE is executed as a DOS command.

Most of the options can be used from within AutoCAD, through
appropriate responses to the QSOPT command. Some options
have additional variations, ond others are not supported at
all by the QSOPT command, since they are very rarely used.

By typing just "QS" in DOS or "SHELL QS" in AutoCAD, you will
get the following help screen that summarizes the commonly used

Usage: QS [options] filename[.ext]
Default extension: .QS
Options: (xxx,yyy = numeric values; sss = label)
-iDemo conversion instructions (demo only)
-lxxxMaximum number of contour levels <15>
-zxxxContour interval (overrides -l)
-nxxx[,yyy]Grid cells in x [y] direction <32>
-dxxx[,yyy]Grid cell width [height] (overrides -n)
-p[sss]Draw control points on layer sss
-t[sss]Draw triangles on layer sss
-g[sss]Draw grid on layer sss
-c[sss]Color contours on layer sss (default)
-m[sss]Monochrome contours on layer sss
-y[sss]Layered contours with prefix sss <>
-x[xxx]Index contours using width of xxx <.01>
-rxx0,yy0,xx1,yy1Window definition
-fxxxScale z values by xxx
-v[xxx]Verbose report with frequency xxx <100>
-Suppress contours
See manual for -w, -s, -b, -k

Either lower case or capital letters may be used to specify the
options. A slash (/) may be used instead of the dash (-), and
exclamation marks (!) may be used instead of commas (,) with
options that have multiple fields.

Options must be separated by one or more spaces or tabs, and
no spaces nor tabs may be imbedded in the options.

The options may be listed in any order, and the file name must
be last. If no options at all are specified, QuickSurf will
generate only color contours on layer CONT.

A detailed description of all options follows, in the sequence
in which they appear in the help screen.

-iIf you are running a demonstration version of QuickSurf,
you will get instructions for converting it to a full
working system.

-lxxxApproximate number of elevations at which contours are
to be generated. The entire range of elevations (as
determined by QuickSurf) will be divided by xxx+1 and
rounded up to obtain the contour interval, and xxx or
fewer elevations will be contoured. The rounding is
to a power of 10 multiple of 1, 2, 2.5, or 5.

-zxxxThis option specifies the contour interval, and hence
is mutually exclusive with option -l.

-z,xx0,xx1,xx2 ... ,xxn
Specific contour elevations can be enumerated with this
option (note the comma immediately following the -z).
In this case, contours are not generated at regular
intervals, but only at elevations explicitly listed
with the option.

In the demonstration version, the options -n and -z
do NOT work exactly as described here, and contour
elevations are random and unpredictable.

-nxxxThe number of cells in the x direction is set to xxx,
and the size and shape of the cells are set to obtain
best coverage of the area being processed. The cells
are approximately square.

The number of cells is set to xxx in the x direction,
and to yyy in the y direction.

-n+The maximum number of cells that can fit into memory
available is generated, with approximately square cells.
Three bytes are required for each grid point, so that
about 160,000 cells (400x400, e. g.) can be generated
when running QuickSurf from DOS. When running from
AutoCAD, the number depends on the memory provided by
the SHELL command, as well as on the number of control
points, and other system constraints.

-dxxxSquare cells of size xxx are generated, and the number
of cells in each direction (x and y) will be determined
by QuickSurf. If -d is specified, -n is ignored.

Grid cells are generated with width xxx, and height yyy.

When the grid size specified using the -n or -d options
exceeds available memory, a warning message is issued,
and QuickSurf continues as with the -n+ option (maximum
grid density possible).

-p[sss]sss specifies the layer on which the control points
are to be placed as POINT entities. If sss is omitted,
the layer name POINT is used. If the option is entirely
omitted, the control points are not drawn.

-t[sss] sss specifies the layer on which triangles are drawn
as 3DFACE entities. The triangles constitute a network
that connects all the control points so that every vertex
is at a control point. The default layer is TRI.

-g[sss]Grid cells are drawn on layer sss as 3DFACES. The default
layer name is GRID.

In the demonstration version, only about a third of the
triangles and grid cells are generated, by random selection.

-c[sss]By default, contours are generated in multiple colors
on layer CONT. Use this option to designate a different
layer. The first (lowest) elevation is drawn with color
1 (red), and the color number is incremented as the
elevation is changed.

-m[sss]Contours are generated on layer sss (CONT by default)
without color specifications (BYLAYER).

-y[sss]Contours are generated on a different layer for each
elevation, without color specifications. The layer
names are constructed by appending the elevation to
the specified prefix sss. If an elevation contains
a decimal point, it is replaced by an underscore
character (_), since layer names cannot contain point
characters. If sss is omitted, there is no prefix.

-To completely suppress contour generation, (if grid
only is desired, e. g.), use this option.

-x[xxx]Every 4th or every 5th contour elevation is generated
with a polyline of width xxx. The default width is
.01, which is suitable for most hard copy devices
when plotting at scale 1 to 1. For generating scaled
plots, the desired line width should be scaled by the
plotting scale factor. QuickSurf automatically
chooses the frequency (4 or 5), depending on the
contour interval.

Grid generation and contouring is limited to the
interior of the rectangle defined by the pairs (xx0,yy0)
and (xx1,yy1), which are interpreted as opposite corners
of the rectangle. If this option is specified, it
overrides the rectangle definition on the first line
of the input file, if any.

-fxxxScale z values of control points by xxx. This option is
useful when the units of the z values are different from
those of x and y, or if vertical exaggeration is desired
on very flat surfaces.

-v[xxx]QuickSurf will count events during major phases of
operation, and report the count on the screen. This
slows down the operation slightly, but it allows you
to monitor progress, especially when running large
jobs. The default frequency is 100.

-wxxxPower for weighting. Influence among points is normally
proportional to the inverse square of the distance between
them, i. e., the default power is 2. By specifying a
different integer value between 0 and 16, you can increase
or decrease the influence of more distant points. Larger
values reduce the influence of distant points, and zero
gives equal influence to all points.

-sxxxLevel of derivatives. Normally, 1st and 2nd derivatives
are calculated. -s1 causes only 1st derivatives to be
calculated, and -s0 bypasses both weighting and calculation
of any derivatives. -s2 is the default. Substantial time
can be saved by NOT calculating the 2nd derivatives when
processing large numbers of control points, but the
quality of contours will decline, especially in areas of
sparse control.

-bxxxLevel of blending. Adjacent triangles are blended with
a polynomial function that provides continuous derivatives
of order xxx. By default, xxx for blending is the same as
for calculation of derivatives (-s option).

-kHonor local extrema. The z extrema of the generated surface
normally can exceed the extrema of the control points, due
to the effects of smoothing. The -k option forces the
1st derivatives to zero at local minima and maxima, and
thus it can reduce, or totally eliminate "overshoot".
The use of this option is recommended only as a last
resort for very badly behaved surfaces.

If the input file (described in Section 7.) is specified without
an extension, ".QS" is assumed; if the file name has no extension,
it should be terminated with a period; otherwise, the complete
file name should be used.

In all cases, QuickSurf will generate a file with the same name
as the input file, and extension ".DXF".

 December 6, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>