Dec 272017
 
SURMODL Ver 1.31 solid modeling. Program 1 of 3. Includes TP source.
File SURF1311.ZIP from The Programmer’s Corner in
Category Science and Education
SURMODL Ver 1.31 solid modeling. Program 1 of 3. Includes TP source.
File Name File Size Zip Size Zip Type
3DSURF.PAS 2003 783 deflated
ARCCOS.PAS 290 200 deflated
BORDER.PRE 1078 411 deflated
CHECKEY.PAS 336 201 deflated
CHEKSURF.PRE 2469 810 deflated
COLORMOD.PAS 4599 1339 deflated
CONTINUE.PAS 1365 620 deflated
DRAWAXES.PAS 3700 781 deflated
DRAWPLOT.PRE 26625 4125 deflated
EXGRAPHI.PRE 2679 574 deflated
EXTRUDE.PAS 11387 2061 deflated
FEM2SURF.BAS 3456 1436 deflated
FILES.IDX 4912 1775 deflated
FILLSURF.PRE 3596 1100 deflated
FUNC2SUR.BAS 896 433 deflated
FUNC2SUR.PAS 3425 1275 deflated
FUNC3D.PAS 538 288 deflated
GETKEY.PAS 809 401 deflated
GETONE.PAS 2187 674 deflated
GOURAUD.PRE 5042 1548 deflated
GRAFSTAT.PAS 904 483 deflated
HIDNLINE.PRE 2340 871 deflated
INITIAL.PAS 1080 513 deflated
INLIMITS.PRE 889 385 deflated
INREAL.PAS 3866 1341 deflated
INTRFILL.PRE 2721 800 deflated
LITEMENU.PAS 4639 1360 deflated
MENU.PAS 836 353 deflated
MENUMSG.PAS 243 178 deflated
MINMAX.PRE 776 331 deflated
MPREP.PAS 13158 3035 deflated
NORMALIZ.PRE 2181 890 deflated
ONSCREEN.PRE 1967 542 deflated
OPENWIN.PAS 942 374 deflated
PARAMENU.PAS 5323 1613 deflated
PATCH.PAS 2124 803 deflated
PERSPECT.PAS 2289 844 deflated
PLANE.PAS 6695 1596 deflated
PREINIT.PAS 364 229 deflated
PREPROC.PAS 7470 2101 deflated
PREREAD.PAS 10180 2178 deflated
READFILE.PRE 10202 2073 deflated
READINI.PAS 9180 1923 deflated
README 11993 5139 deflated
REFLECT.PAS 4225 1362 deflated
REVOLUTE.PRE 25644 5785 deflated
REVOLVE.PAS 9331 1886 deflated
SCSHROT.PAS 3003 814 deflated
SETGMODE.PRE 5331 1342 deflated
SETSYS.PAS 3199 761 deflated
SGRAPH.P 2410 901 deflated
SHADING.PRE 6302 1650 deflated
SHADOWS.PRE 3422 1252 deflated
SHELLPTS.PAS 3069 760 deflated
SHELSURF.PRE 2330 916 deflated
STORLINE.PAS 1573 671 deflated
STORSHAD.PAS 2235 821 deflated
SURFACE.PRE 3651 1181 deflated
SURFFILE.PAS 1849 581 deflated
SURFMODL.PRE 25948 7162 deflated
SWAPS.PAS 355 174 deflated
TBEMULAT.PRE 823 378 deflated
TITLESCR.PAS 928 450 deflated
WIREFRAM.PRE 1710 691 deflated
WRITEFIL.PAS 1600 624 deflated
WRITEINI.PAS 2043 755 deflated

Download File SURF1311.ZIP Here

Contents of the README file


README FILE FOR SURFMODL VERSION 1.31

This diskette contains the public domain SURFMODL program to do surface
modeling (also known as solids modeling) on the IBM PC and most compatibles.
For a listing of the files on this diskette and their meaning, read the
file named FILES.IDX. For complete documentation on the use of SURFMODL,
read the file named SURFMOD1.DOC. This file may be viewed with the TYPE
command:
TYPE SURFMOD1.DOC
or printed out:
COPY SURFMOD1.DOC LPT1:

Users who run one of the standard COM files on the distribution diskette
(SURFMODL.COM or SURFMHZC.COM) will find themselves presented with a menu
of System types each time a data file is loaded in. To make this message
go away, so you don't have to answer it every time, you have to re-save the
INI file (from the Parameters Menu - Save Current Settings). Then the
next time you reload that data file you won't get the menu; your last
system type will be used. Note, therefore, that it is important that if
you are going to give away SURFMODL data files to your friends or upload
them to a BBS, you should either: (1) Send them only the original INI files
from the distribution disks; (2) Do not send them any INI files at all; or
(3) Manually edit the INI file to delete the system identification. This
is any line that begins with the number '1' (usually the second line of the
file). I have done step 3 in all of my distribution files. If
SURFMODL reads an INI file that has no system type defined, it presents
the menu. The results of not doing this can be bad: Whoever receives your
file will run SURFMODL with your System type defined. If it doesn't match
his system type, then his machine will hang and he'll have to reboot (and
he'll report a bug to me).

One other note: Not all the data files on these disks can be viewed
with the versions of SURFMODL that come on the distribution disks. The
COM files I have supplied are, in all cases, compiled for the small memory
option, which has a maximum of 1024 nodes. If you try to view a data file
and are told that the maximum number of nodes or surfaces is exceeded, then
the only way that file can be viewed is to recompile SURFMODL with the
BIGMEM option defined.

SPECIAL (LATE) NOTE ON VERSION 1.31: VERSION 1.31 IS IDENTICAL TO VERSION
1.3 FOR ALL VERSIONS EXCEPT THE HERCULES. IN THAT CASE, THERE WERE SOME
PROBLEMS WITH THE IN-LINE MACHINE CODE THAT WAS ADDED AND I HAD TO REVERT
TO THE TURBO GRAPHIX TOOLBOX CODE. THEREFORE, THE COM FILE YOU RUN ON THESE
DISTRIBUTION DISKETTES WILL SAY VERSION 1.3 IF IT IS A NON-HERCULES VERSION,
OR 1.31 IF IT IS A HERCULES VERSION. BE ASSURED THAT THERE ARE ABSOLUTELY
NO MISSING FEATURES IN VERSION 1.3 AND IF YOU GOT VERSION 1.3 PRIOR TO THE
1.31 RELEASE, THERE IS NO NEED TO UPGRADE TO 1.31 UNLESS YOU ARE USING THE
HERCULES. ALSO NOTE THAT THE DOCUMENTATION FILE (SURFMOD1.DOC) IS NOW IN
ERROR WHEN IT SAYS THE HERCULES VERSION CAN BE COMPILED WITHOUT THE TOOLBOX.
THE TOOLBOX "DEFINE" MUST BE USED TO COMPILE SURFMODL FOR THE HERCULES.
(end of note on version 1.31)


THE FOLLOWING INFORMATION IS ONLY FOR USERS OF SURFMODL VERSION 1.2:

For users of the last release of SURFMODL (1.2), I had planned to present
a list of all files that had changed since the last release. However,
this release turned out to be a major overhaul of SURFMODL and virtually
every file was changed. The major reason why files were changed were
to accomodate the BIGMEM preprocessor directive, which stipulates that
SURFMODL should use array sizes about quadruple the sizes of the last
release. Therefore, numerous .PAS files were changed to .PRE files (in
other words, they have to be run through MPREP before they can be
compiled. A few other files were changed from .PRE files to .PAS files
(OPENWIN, READINI, INITIAL, and PARAMENU) as I reorganized SURFMODL to
avoid unnecessary preprocessing. If you decide to copy the source files
from this release onto the same diskette or directory where you kept the
source files for the old release, be especially careful to delete all
of these .PRE files or else the new .PAS versions will be overwritten
when you preprocess.

The new version of SURFMODL contains several enhancements, most of them
in the user interface, and most of them at the suggestion of SURFMODL
users. I thank everyone for this constructive criticism, and I invite
it to continue. All known bugs have also been fixed in the new release,
including:

-- The axes can now be drawn reliably, without ever causing the program
to terminate. (Use Option 6, view type, to set the axes to be drawn.)
-- Occasionally, SURFMODL would fail to re-transform the coordinate after
reading a new file and the result would be an incomprehensible mess.
-- The dithering option for drawing filled surfaces would sometimes lead
to all surfaces being drawn in black. This was the reason the Hercules
version never worked 100 percent.
-- The Gouraud shading algorithm had a bug that occasionally allowed some
surfaces to be colored black.
-- The hidden line removal routine had a problem that caused lines to
appear of varying thickness (thanks to Brad Keister for this fix).

The new features include:

-- A new graphical preprocessor, REVOLUTION, for the automatic generation
of surfaces of revolution. See REVOLUTE.DOC for details.
-- If BIGMEM is defined in the recompilation process, then heap memory
is used for all the major arrays in SURFMODL and the array dimensions
are quadrupled. Current dimensions are about right for a 512K system
with very little memory taken up by memory-resident utilities or
RAMdisks. If you don't have enough memory to run this, you will receive
a Run-time error FF (heap/stack collision). (I was able to run the
largest version of SURFMODL with these dimensions, when CHKDSK reported
I had 436K free on my 512K machine.)
-- If you define MEMRPT, SURFMODL will give you a verbose memory report
at the beginning of the run, telling you how much higher the arrays
could have been dimensioned and still fit in your memory. I had some
trouble with these predicted dimensions, as I detailed in comments in
SURFMODL.PRE. The heap allocations for the arrays take up somewhere
around 1.37 times the amount I calculated them to consume.
-- I made some attempt at re-optimizing the filled surface plotting.
In the last release, in an attempt to increase machine independence,
I used a single version of the GDRAW routine for all line drawing.
As Brad Keister pointed out to me, this slowed down surface filling
(for the non-Gouraud plots) by a factor of 2-3. So I've introduced a
new routine (in DRAWPLOT.PRE) called GHDRAW to quickly draw horizontal
lines. It speeds things up considerably for non-Gouraud shading as
well as for hidden line removal.
-- There is now a "random shading" term for Gouraud-interpolated modeling.
If you enter a Randshade value greater than 0 (in the Gouraud option of
the Lighting Menu), then a random number in the range (0 - Randshade)
will be added to the shading value of each pixel as it is drawn. The
idea is to reduce the clarity of the lines between different shades
on a Gouraud-interpolated plot. In order to use this, you must know
how many shades of grey your system is using; the dithering option
(selectable under System type in the Parameters Menu) always uses 16
shades. The EGA uses 11 in non-dithering mode, and the CGA uses 7.
The value you select for Randshade should never be greater than
1/Nshade (the number of shades), or the image will begin to look
truly random. I have found that values in the range 0.5 - 0.8 times
1/Nshade yield pretty good results. Play around with it and see what
looks good.
-- Several people said they wanted some kind of indicator that SURFMODL
was still alive during plotting, for those times when there is a long
delay before anything gets plotted. My best attempt is a "status line"
at the bottom of the graphics screen. You have to look carefully to see it,
since it's only one pixel wide. SURFMODL just plots another dot on
the line, from left to right across the screen, for every surface it
processes. When it reaches the right-hand edge, it erases the line
and starts over again. When the plot is all finished, it erases the
line altogether (which also takes care of those people who wanted an
indicator when plotting was finished). If this line is coming out too
high above the bottom of the graphics window, and interfering with your
plot, you may want to make some simple changes to the GRAFSTAT.PAS file.
(Just change all occurences of Gymax-5 to Gymax-1, for instance.)
-- Any plot can now be aborted by pressing the 'A' key. During plotting,
SURFMODL checks the keyboard after plotting every surface; before
entering graphics mode it just does it between major sections, so
response may not be immediate.
-- A couple of people complained that they sometimes needed to keep an
image up on the screen for a while, either to photograph it or just
for display. The old version cleared the screen as soon as any key
was pressed, and if someone accidentally touched the keyboard you lost
your image. The new one works almost the same. If you hit the 'P'
key, then it enters a pause mode whereby all keystrokes are ignored
except the letter 'P', which then exits the pause mode. Then any other
keystroke clears the screen. Incidentally, this was done in a new
procedure called CONTINUE. Also in this procedure is a place for you
to add a call to your favorite screen dump procedure when someone hits
the 'S' key. That's for users of non-resident screen dump routines.
This is also the place to output a screen image to a file. This is
a feature I would like to see in the next version of SURFMODL.
-- For all numeric input in the menus, you can now keep the last value
by hitting Enter. This doesn't work for the Y/N entries, though.
-- Several of the entries in the menus are now explained before you are
prompted for new values. I found myself forgetting the equation that
uses the lighting constants, and I figure if I do then infrequent users
have a much worse time.
-- The title (from the data file) is now printed at the top of the graphics
screen at the beginning of plotting, if Ngraphchar > 0 (see SETSYS.PAS).
Note that this is done with a standard Pascal write statement, so if
your system can't handle a write in graphics mode then Ngraphchar should
be 0. I have done this with the Hercules, since I know that card will
give you gibberish on the screen as soon as you do a write. If there
are any others that can't handle this feature, let me know. Incidentally,
if you just don't like the look of the title at the top, you can get
rid of it by making the first line of the data file blank. Then if you
want to include a title in the data file, you can do it in a comment
(start the line with an asterisk). Remember that the first line of the
file can't be a comment, though.
-- There is a new preprocessing directive, NOSHADOW, which removes the
shadowing routines from SURFMODL. You'll need this if you want to
compile with the NO_OVLY directive (to stop SURFMODL from overlaying).
Even then, you'll be lucky if you can compile the new version without
overlaying.
-- Turbo Graphix Toolbox users take note: The 1.3 release is larger than
the last one, and you will NOT be able to compile SURFMODL unless you
comment out significant portions of the KERNEL.SYS file (you will run
out of memory). I detailed the appropriate lines to comment out in
the main documentation file.


 December 27, 2017  Add comments

Leave a Reply