Copyright (C) 1986-2009 by Daniel H. Hudgins, All Rights Reserved.
No part of "This Web Site" (HTML document), including associated files, may be: distributed, sublicensed, transmitted, copied, archived, mirrored, modified, bundled, embedded, sold, given away, rented, loaned, or shared in any form without express written permission in a formal Vendor agreement contract dated and signed in ink obtained directly from Daniel H. Hudgins by registered postal mail. All agreements for permission to distribute expire after a period no greater than one year from the date of the signing of the agreement by Daniel H. Hudgins. See the current "EULA" for information regarding limited copying and storage for the purpose of "Beta Testing" "This Web Site."
To view or use the current version of this Web page you may need to reload or refresh the display of this page by your browser. Just clicking on the browser's [Reload] or [Refresh] icon may not be enough to insure that all of the page's most current contents have been cached and displayed. Some browsers may have additional commands to help display the page's most current contents such as: holding down the [Shift] key and clicking on the [Reload] icon, holding down the [Control] key and clicking on the [Refresh] icon, holding down the [Control] and [Shift] keys and clicking on the [Refresh] icon, pressing the [Control] and [F5] keys, pressing [Control] and the [R] key, or some other combination of keys or clicks. Check to see which commands your HTML browser uses to load the most current page contents into its cache and then to display them onto the screen.
This Web site is dedicated to the thousands of "users" of my programs, those who have helped test my programs over the last 23 or so years, and especially those who shared their experiences with me.
You must read this notice: This is a licensed Web site (HTML document and associated files). You must read and agree to be legally bound in contract by the Terms of Use and conditions given in the End User License Agreement ("EULA"), Legal Notices, Instructions, Warnings, Disclaimers, and all other text in "SECTION: 0" of "This Web Site" (HTML document and associated files) before reading or using any of the information, software programs, and or files, contained in, linked to, and or associated with, "This Web Site" (HTML document and associated files). Any use or "Beta Testing" of "This Web Site" constitutes your acknowledgment of your full agreement with the current End User License Agreement ("EULA") and your decision to have this current license supersede all prior and contemporaneous agreements and understandings. Information and files in "This Web Site" (HTML document and associated files) have been placed here so that long time users of "The Author's" programs DANCAD3D.COM (tm) , DANCAD87.EXE (tm), DANCINEL.EXE (tm), DANCINES.EXE (tm) , DANCAM.EXE (tm) , or DANPLOT.EXE (tm) could help proofread the text of the documentation files or screens displayed, and also help test data files, example files, and or any software programs that might be made available from time to time, to aid "The Author" in finding mistakes, bugs, and other errors, omissions, defects, mistakes, and faults. Everything in "This Web Site" (HTML document and associated files) is "Beta Test", "Beta Code", Experimental, Preliminary, requires proofreading, or is being evaluated for possible revision, and is NOT warranted to be free of defect. To help "The Author" report any bugs, foul-ups, defects, or mistakes that you find, see "SECTION: 8" for instructions. "This Web Site" (HTML document and associated files) and all other files and programs by Daniel H. Hudgins are made available "AS IS" without warranty of any kind express, expressed, or implied. All offers and specifications are subject to change or discontinuation without notice of any kind. Please look over "SECTION: 8" of "This Web Site" before contacting "The Author."
This section has text mostly about revisions to the "Beta Test" version v2.7F of my CAD and v2.74 CAM programs, and might be looked to for updated information relating to changes from v2.7E, regarding some of the revised or added program features. There may be changes made in versions subsequent to the revisions of the version of v2.7F that alter what is described in this section as it applies to that subsequent version. See also any other documentation files, and pages in this Web site (HTML document) for additional and or any more recent information.
The HTML documentation in this SECTION: 3.3.7.6 was derived from the text in the file INFOV27F.TXT that is, or was at one time, included in my *.ZIP file archive DANCAD3D.ZIP (tm). You may find the current revision of DANCAD3D.ZIP (tm) to download by going to SECTION: 9.70.51.0. My file DANCAD3D.ZIP (tm) may also archive some other types of files like the ones described in this section, so check the current *.ZIP file in its current revision to see what exactly might be in it.
You may not distribute, sell, rent, share, or give away these HTML documentation files or printed copies of them. You may not extract text from these HTML documentation files for distribution, sale, rent, sharing, or giving away. You can use the [Print] option in your browser to make one copy for yourself to mark up in order to help me proofread the text for mistakes.
Documents may be available to download from time to time, you can check SECTION: 9 to see what the current situation with regard to downloadable files is. The names of these documentation files may change, and they may be edited, combined, or eliminated in the future, without notice.
You may need to adjust your browser for best viewing of the pre- formatted text by changing the "font" size using the commands in your browser (see the help in your browser, or use the pull-down menus in your HTML browser.) If some letters in words on the screen appear to be missing or scrambled try changing the font size in your browser as this sometimes happens even though the words are spelled correctly in the HTML code.
Use the "Edit, Find in page Ctrl+F" or "Edit, Find (in this page)... Ctrl+F" command in your browser to search for keywords within the documentation text in this HTML page. You will need to search over again in the other pages in this HTML document for the same keyword since your browser may not search for a keyword beyond the current page that is loaded.
My current file DANCAD3D.ZIP (tm) is a *.ZIP file that holds the current "Beta Test" versions of my programs and associated files for "Beta Testing." This section refers to the preliminary revision of the v2.7F version of the programs, look for other sections or documentation relating to any subsequent revisions.
The use and copying of these programs and files are governed by my current Terms of Use and End User License Agreement ("EULA") which are located in SECTION: 0 of this "Beta Test" Web site. You must read and fully agree to be legally bound by the current End User License Agreement ("EULA") before you use or "Beta Test" any of the files in my file DANCAD3D.ZIP (tm). If you are unable to read and agree to the current End User License Agreement ("EULA") do not use or "Beta Test" any of the files in my program distribution, the DANCAD3D.ZIP (tm) archive file.
Be sure that you scan the programs and files in my DANCAD3D.ZIP (tm) for virus or other contamination since you are responsible for checking them before you use them. These programs and this information are made available "AS-IS" and are without warranty of any kind express, expressed, or implied. Since these programs are "Beta Test" you must agree to become a "Beta Tester" before you make any use of them, see the End User License Agreement ("EULA") in this "Beta Test" Web site for more information. Be sure to read the current instructions in this "Beta Test" Web site regarding procedures for reporting program bugs and other such problems.
On some systems the *.ASC data files, or *.MAC macro files, may be able to be renamed *.TXT to avoid certain kinds of file type misinterpretation by text editor type programs and such. Thank you for helping test these "Beta Test" CAD and CAM programs.
A *.TXT file version, similar to some of the text in this S0303076.HTM Section, may be included in the v2.7F revision of my DANCAD3D.ZIP (tm) file (see the "downloads" SECTION: 9 of this "Beta Test" Web site). See the text in any files like README.*, FILES.TXT, and INFOV27F.TXT stored in my current DANCAD3D.ZIP (tm). You should check for the current types of document files because they may be more up-to-date than this *.HTM file, or it is possible that this HTML file could be more up to date, depending on which one got worked on last.
Below is text from file INFOV27F.TXT that was written to be included in a preliminary revision of version v2.7F of my DANCAD3D.ZIP (tm) distribution for preliminary information about changes in version v2.7F of the CAD and v2.74 of the CAM programs. You should read this information before you try to use or "Beta Test" the revised programs. This information is in addition to the previous documentation, i.e. a supplement to, and does not go into detail about many of the previously documented features, so you should therefore review the other sections and documentation as well. See also INFO16.TXT in file DANCAD16.ZIP (tm) for revisions relating to v3.7 of the programs.
The text of INFOV27F.TXT was derived from some notes I made to myself as I worked on the code for v2.7F, so you should check this document, and the other documentation, against the programs before you do any "serious" testing of the programs since there may be some differences between the descriptions here and the current state of development of commands and features in the programs. Please report any discrepancies between the documentation and the programs or files that you find. Some of the text from this section may have been incorporated into the other sections of this Web site, in doing that some of the text may have been further revised, and so may contain additional information, therefore after reading through all of this section you should also read through all of the other portions of this Web site, even those portions that might seem to be duplicates.
I have kept this preliminary information in one long file so that you can use the "find in page" feature of your HTML browser to search for a keyword relating to some new command or feature you are looking for more information about, otherwise you might have to search through more files.
See also the This Section and About DANCAD3D.ZIP (tm) sub-sections above, as well as SECTION: 9.70.0.0 and SECTION: 9.70.51.0 for more information about v2.7.
DOCUMENT: INFOV27F.TXT
Copyright (C) 2003 by Daniel H. Hudgins, All Rights Reserved.
Terms of use: This "Beta Test" document may only be used in accord and within
the limitations imposed by the current End User License Agreement "EULA" posted
at the author's Web site www.DANCAD3D.com (sm) in file S0000000.HTM, any other
use or copying is prohibited. This document is provided "AS IS" without
warranty of any kind express, expressed, or implied. Mistakes, errors, and
omissions should be reported according to the instructions in SECTION: 8 of the
current "On-Line" version of my Web site www.DANCAD3D.com (sm).
This preliminary document has some brief descriptions of changes made to my CAD
and CAM programs DANCAD3D.COM (tm), DANCAD87.COM (tm), DANCAM.EXE (tm), and
DANPLOT.EXE (tm) between the release of v2.7E and the "Beta Test" release of
v2.7F. This file is meant to be included in the initial "Beta Test" v2.7F
distribution to help long time users acquaint themselves with some of the many
changes that have been made to the programs. If you are not a long time user
you will most probably need to read all of the text located at my "Beta Test"
Web site www.DANCAD3D.com (sm) before you read this document in order to make
practical use of it. This document is not a complete list of changes made to
the programs, and may not reflect the operation of the version of the program
accompanying it in all respects. The programs may be still undergoing change,
so the results obtained from any of the commands may be different than
expected, and the operation of older commands may have changed as well. Since
so many changes have been made to the programs you should not expect any of the
commands to operate as you have used them in the past, and you should
frequently back-up and save what you are working on so that you do not lose
everything when the program crashes. All specifications, descriptions, and
instructions are subject to change without notice.
Be sure to see also the file INFO16.TXT that is in archive DANCAD16.ZIP (tm).
I would like to thank the thousands of users of my programs who have helped
"Beta Test" the many revisions of my programs since about 1986, I hope you will
enjoy checking out some of the newer program features that I have spent so many
years working on. Best wishes for success in your projects.
---
MISCELLANEOUS NOTES ABOUT CHANGES IN CAD V2.7F MAY 25, 2003
The hidden line removal in the CAD programs has undergone considerable change
since the last revision of v2.7E. A Z-Buffer is now used in combination with
triangle sorting in order to reduce problems associated with triangle sorting
and thereby hopefully make drawing elements for display in the hidden line
display modes easier. Also 3D elements loaded through the DXF file type should
display better using the Z-Buffer since the Z-Buffer is relatively indifferent
about the size of the triangles and how the triangles are organized in the
element. In converting the hidden line removal to use a Z-Buffer it became
apparent that with a few more changes I could have the program export drawings
as 24 bit "true-color" BMP files at resolutions in excess of what the video
board might support, and that with a few more changes I could add anti-
aliasing, photo backgrounds, edge outline shading, and such. The anti-aliasing
can be used in the 24 bit BMP "true-color" files on simple line drawings to
reduce the "jagged" lines and allow large drawings to be output in color for
printing on raster type color printers, or for printing on a four color
printing press in "postable" size, and such. The Z-Buffer is limited to a
maximum size of 2.1GB, or the amount of free disk space on the Z-Buffer drive,
so the maximum drawing size is reduced with the use of oversampling or
undersampling for anti-aliasing, i.e. the maximum size image in a BMP file that
you can save would be saved without any anti-aliasing being performed. The Z-
Buffer that DANCAD87.COM (tm) makes is somewhat larger than the Z-Buffer that
DANCAD3D.COM (tm) makes, so DANCAD3D.COM (tm) has a slightly larger maximum
image size when saving a 24 bit BMP file. Z-Buffers cannot be exchanged between
DANCAD87.COM (tm) and DANCAD3D.COM (tm) since they are compiled to use
different numeric formats that are incompatible. Some other commands such as
MUTATE and CRT BACKGROUND were changed to work with the new options associated
with the Preview command's use of the Z-Buffer. In the drawing editor the Z-
Buffer changes add some more display modes. These changes are discussed in
more detail below.
---
PARTIAL LIST OF CHANGES IN V2.7F
* Z-Buffer now used to help simplify drawing 3D elements, each pixel is
processed by depth rather than just whole triangles allowing shapes to
intersect and display with the outside parts showing.
* The View Hidden Configure command in the Drawing Editor has been changed and
now lets you enter a path for the Z-Buffer storage. This is included since the
Z-Buffer can be up to 2.1GB in size and may need to be in its own harddisk
partition, or on a drive other than the one the CAD program files are installed
onto.
* "Unlimited" polygons, i.e. triangles, in a 3D hidden line display or hard-
copy. The Z-Buffer can be saved and filled repeatedly, thereby allowing more
triangle elements to be included in the image than can fit into the drawing
workspace at one time. This may allow you to create images with many elements
and elements that have smooth curves made of many small triangles.
* Anti-aliasing oversampling to smooth "jagged" lines in 24 bit output BMP
files. Anti-aliasing sets some pixels at a mixture of the surrounding color
and the line color when the line path falls partly over the pixels rather than
directly over their center, this tends to make angled lines look smoother when
the image is viewed from a sufficient distance.
* Sub-Pixel undersampling allow display of details smaller than one pixel to be
displayed as a change in color in 24 bit output BMP files.
* Higher quality 24 bit "true-color" like output to a BMP file can be made with
a computer using any type video board, even Hercules (tm) monochrome, since the
video board is not used for forming the image, the image is formed in a Z-
Buffer stored on the harddisk.
* Adjustable color dithering to improve 24 bit color output on video displays
that might have 6 bit channels, and such.
* 24 bit BMP file can be used as a photo background for 2D or 3D drawings
plotted for output as a 24 bit BMP file.
* The CRT BACKGROUND can now output the background image as a 24 bit BMP file
as well as a Pixel file.
* The default video aspect ratio, i.e. a value of 1.0, has been adjusted to
output square pixels when BMP files are saved from the video screen in video
modes that use square pixels such as 640 by 480, 800 by 600, 1024 by 768, 1600
by 1200. The video aspect ratio should be set to 1.0 before saving a BMP file
of the video screen when the video mode has square pixels in order to avoid
distortion of the saved image.
* A new graphics "mode" BMP, a.k.a. F0B24, has been added to flag that a 24
bit BMP file of variable size and shape is to be saved. New variable names
have been assigned to the display values associated with this graphics "mode."
The video aspect ratio value, set through the main menu Change command, should
be set to 1.0 before using the BMP graphics mode to save a 24 bit BMP file in
order to produce square pixels and avoid distortion of the saved image.
* Mutate command has new modes for use with the hidden line display modes. The
Mutated element can be flagged for special treatment in some display modes.
Mode 1 is now like mode 102. Mode 100 is like the old mode 1, that is the
mutated triangles are not flagged as mutated. Mode 102 flags the triangles as
mutated by setting the second bit of the triangle's second line's shape
attribute. Mode 103 flags the triangle as both mutated and to be displayed
with shaded edge outlines in display modes that shade the edge outlines, by
setting both the first and second bits of the triangle's second line's shape
attribute.
* Correct command has two new modes, CORRECT F L, i.e. Correct Filter Lines, to
filter triangles and dots out of a line element, and CORRECT F T, i.e. Correct
Filter Triangles, to filter "bad" triangles and free lines out of a triangle
element. CORRECT F L cam be used before some commands that convert lines into
triangles so that dots, i.e. very short line segments, that might have gotten
into the source element by accident while drawing it can be automatically
removed. CORRECT F T can be used to filter out very small or thin triangles
that cause error messages when some other commands are used, these triangles
are generally to small or thin to show up well in the display and so their
removal would not be noticed. These two new filters have been incorporated
into some of the other commands to screen and filter elements in order to avoid
some problems later with the program reporting error messages relating to
elements being manipulated or displayed.
* The SORT command now has two modes, mode 1 sorts far to near (back to front),
and mode 2 sorts near to far (front to back).
* The way the LINETYPE command processes triangle elements was revised so that
the first bit of the second line of the triangles' shape byte could be set in
order to flag that you want the edge outlines shaded in some display modes, and
also to bypass the second bit of the second shape byte so that the mutated
element flag bit would not be changed when you alter the other attributes.
* The default video raster aspect ratio has been changed so that now when a
video aspect ratio adjustment of 1.0 is entered in the main menu's Change
command the raster on the video display should be adjusted to have a 4:3 shape.
This should conform better to the display of VGA 640 by 480 display mode on a
LCD or flat panel display that has square pixels. This also helps reduce small
corrections that would be needed when converting BMP or Pixel files into ASCII
tool path files for use with the CAM programs, since square pixels in the image
would conform to even scaling factors for the X and Y axis on the machine tool.
Some video modes or monitors do not use the 4:3 aspect ratio, so compensation
with the video aspect ratio option of the main menu Change command, or the use
of the Magnify command may still be required under some circumstances.
* The 20 series of hidden line display modes has been modified so that mode 21
now does the outlining of the edges in the same color as the triangle fill, and
mode 24 does the triangle fill without the outlining of the edges. The change
to mode 21 and mode 24 are to allow for the production of traveling mats that
will fit the outline of the shapes when the shapes are displayed with outlines,
that is the outlining changes the size of the silhouette mate somewhat, so
there needed to be a option to make the mate with or without the outlining.
* A new display mode 6 was added that displays the triangles in a surface as
random colors other than the background fill color. This new mode can be used
with the Preview or DISPLAY command, and in the Drawing Editor.
* In the Drawing Editor when you select the View Hidden Hidden command you now
can have the option to select from some video mode codes like the ones used in
the main menu Preview command. Since the drawing editor is limited to 16
colors in this revision, only display modes 1, 2, 3, 4, 5, 6, 20, 21, 22, 23,
and 24 are implemented. Of these only 1, 2, 3, 6, and 23 would be of much
frequent interest probably. Mode 23 fills the triangles in the triangle color,
and outlines the flagged triangle edges in the opposite color. Display mode 3
shows the normals and fills in the triangles for hidden line removal, see also
the Hidden Correct Set command from the drawing editor root menu to set the
length of the normals so that you can see them in display mode 3.
* File BMPTEST2.MAC was revised to take into account the change in the default
aspect ratio.
* Some changes were made to DEMO1.MAC, with regard to the aspect ratio changes,
and to the file made for printing.
* Two of the triangle attribute bits have been assigned new meanings. The one
bit of the triangle's second line shape attribute flags that you want the
triangle edges to be displayed with depth shading when a display mode is
selected, such as mode 63, that can display shaded triangle edge outlines.
There is no special command for setting this bit from the menus, but you can
select "Tall" shape with the Lines edit Line style command in the drawing
editor in order to set the one bit of the shape attributes for the element to
high and so activate this feature. When the one bit of the shape attribute is
low the edge outlines are displayed without shading even in modes that can
display shaded outlines. The second bit of the triangle's second line shape
attribute is used to flag that a triangle has been mutated from a free line.
There is no command to change the mutation flag bit, other than when the MUTATE
command is used originally to make the mutated element. You could change the
MUTATE bit by editing an ASCII file of the element, but I cannot think of much
of a reason for doing so. When the second bit of the triangle's second line
shape attribute is high the triangle was mutated, and low the triangle is
ordinary.
* If you are upgrading from some older version please note that in the drawing
editor and main menu Preview command, as well as some possible other commands,
when you want to interrupt the re-drawing of the screen you should now press
the [Ctrl] key or the [Ctrl] and [X] keys, rather than the [SpaceBar] as was
done in some previous versions of the CAD programs.
---
VIDEO ASPECT ISSUES WHEN SAVING COLOR BMP FILES
The video aspect adjustment value that is set in the main menu Change command
effects the aspect ratio of the pixels saved in color BMP files. When you save
a BMP file of the screen, and the video mode has square pixels, you should set
the video aspect adjustment to 1.0 to avoid distorting the saved image. In
those video modes that do not have square pixels when the raster is displayed
as 4:3, you may need to use the video aspect adjustment value to correct for
the difference between the raster shape and the BMP image later being displayed
as if it had square pixels.
When a color BMP file is saved from the video screen, e.g. as when in the main
menu Preview command after the image displays on the screen, if the video
aspect adjustment has been set to a value other than 1.0 to make up for your
screen shape, the resulting BMP file may look correct on your monitor, but may
be distorted on some other person's monitor that is 4:3 or some other aspect
ratio. It is better to leave the video aspect adjustment at 1.0 and adjust the
height or width of your monitor if you can, so that images that you save as BMP
files will display undistorted on other peoples monitors if they have also
adjusted their monitor to have square pixels.
The 24 bit BMP graphics mode is also effected by the value of the video aspect
adjustment in the main menu Change command. It was setup this way so that the
saved image would correspond to what is also displayed on the main menu Preview
screen, and so that you can make distorted images when needed for special
applications by setting the video aspect adjustment to a value other than 1.0.
For most applications you should set the video aspect adjustment value to 1.0
before saving a 24 bit BMP file of your elements in order to avoid having the
saved image be distorted. You should adjust your monitor to an exact 4:3
raster shape if you can, so that the video aspect adjustment can be set at 1.0
most of the time.
---
HARDDISK ISSUES WHEN USING THE Z-BUFFER
Since the Z-Buffer is stored on the computer's harddisk you should try to use
the fastest harddisk possible for the Z-Buffer drive. You can select the Z-
Buffer drive with the View Hidden Configure command in the CAD program's
drawing editor.
The maximum size for the Z-Buffer file is currently about 2.1GB, so a full size
DOS FAT16 size partition will work if it is empty except for being used to hold
the Z-Buffer. Having the Z-Buffer drive formatted FAT16 may make it work
somewhat faster than having it formatted FAT32, but I have not tested the same
disk formatted both ways yet, you can check this on your system if the best
speed possible is an issue. Running the CAD programs under Windows 95 (tm), as
the only active program, may give faster results than under DOS 6.22 since the
ATA66 or ATA100 drivers for the harddisk may not be operational under DOS. A
7200RPM or faster harddisk with a 2MB or larger built in buffer should be
employed when possible. If the Z-Buffer is just being used for the 1, 2, 4,
and 8 bit screen display modes you may be able to put the Z-Buffer in a RAM
disk if your system has enough free RAM memory, e.g. 512MB or more RAM. A RAM
disk may not be faster for the Z-Buffer than a harddisk on some systems, so you
may need to test to see what works best on your system.
When running under DOS you should check the speed differences for various
settings of the disk cashing program, e.g. read buffer active and write buffer
active, or just read buffer active. If the harddisk has a hardware buffer
built in, using a software buffer may slow down the file access. Likewise the
settings of the BUFFERS in the CONFIG.SYS file may make things faster or slower
depending on the type of harddisk used, some older harddisks may have had no
buffer of their own, and so without a software buffer might run very slow when
many random reads and writes need to be made one after the other.
You can try the example macro file ZBUFFER1.MAC (see below) to benchmark the Z-
Buffer speed with different settings of your harddisk cache. If you do not
have enough free disk space to run the macro as it comes, you can edit it to
reduce the X and Y pixel values, or the oversample value, so that a smaller Z-
Buffer file is required.
---
HOW TO OUTPUT A VARIABLE SIZE 24 BIT "TRUE-COLOR" BMP FILE
The main menu Preview command and the macro DISPLAY command can now be used to
output higher quality versions of your drawings, both 2D line drawings and 3D
hidden line rendered elements. The output of the drawing is made in the form
of a 24 bit BMP file using the "true-color" 24 bit color system. The size and
shape of the drawing file saved can be adjusted by entering different values
for the X and Y pixel dimensions, although the default width to height ratio is
4:3, i.e. Y = X * 0.75.
You can then use some other program to print the 24 bit BMP file created by my
programs, or you can use some other program to convert the BMP file into JPG.
If you convert the BMP file into JPG you should probably choose the "low loss"
or "minimum compression" modes do limit the degradation of the image from
compression. Conversion of the 24 bit BMP images into 8 bit GIF images is not
recommended since banding of the tones may appear in the image, although such
conversion might be acceptable for line drawings or if larger dithering values
are used to compensate for a limited palette in 8 bit GIF images.
When you want to make a 24 bit BMP file by using the main menu Preview command
you enter BMP at the video mode prompt, then another special screen comes up
that lets you enter some values that control the quality and size of the image
that will be produced. The video "mode" BMP is a simple form of the actual
mode code which is F0B24, which you may see in the automatic output macro
associated with the macro GRAPH_MODE command. In this revision BMP gets
converted into F0B24, but this may change in other versions.
The first special 24 bit BMP prompt asks you for the anti-aliasing Oversample
value. To make normal line drawings with "jagged" non-anti-aliased type line
edges on the sloped lines enter a value of 1. A value of 1 allows larger size
drawings than when other values are entered since no oversampling or
undersampling is being used. A value of 4 is the default since the anti-
aliasing begins to work well at a value of 4, i.e. 4*4:1 or 16:1 oversampling.
A oversampling value of 2, i.e. 4:1 oversampling, does not work very well for
reducing "jagged" lines since the intermediate tones for the pixel are limited.
A value of 3, i.e. 9:1 oversampling, is better than 2 but not as good as 4.
Values greater than 4 generally look better but may request a Z-Buffer that is
too large since the Z-Buffer size increases by the square of the oversampling
or undersampling value. Values up to 8 may be useful but from 8 to 16 the
improvement probably becomes less noticeable. Since the oversampling would
make lines "gray out" the program automatically thickens the line segments,
mutated lines, and triangle edge outlines in order to keep them at least a full
pixel wide, and generally two to three pixels wide so that the "jagged" lines
are reduced when the oversampling value is 2 or more. If you do not want the
lines thickened, set the oversampling to 1 and use the sub-pixel undersampling
to achieve anti-aliasing. Setting the oversampling to 4 and the under sampling
to 2 can be a useful compromise for display modes that produce outlined
triangle edges, such as display mode 63 and such, although some lines or edges
may look a little more "jagged" depending on the adjacent colors since in some
ways the undersampling may undo the oversampling to some extent.
The second special 24 bit BMP prompt sets the sub-pixel undersampling. The
undersampling can be used like the oversampling for anti-aliasing to reduce
"jagged" lines, but does not thicken the line segments, and so the larger the
value used the more "grayed out" thin lines will become. Sub-pixel resolution
might increase the apparent detail in some instances since when viewed at the
right distance the viewer may see a straighter line when some pixels are bright
or dim rather than being just set or not set. The oversampling and
undersampling can be used at the same time to control the width of the triangle
outlines, for instance the oversampling could be set at 4 to 8 and the
undersampling set at 2 or 3. When both the oversampling and undersampling are
used at the same time the Z-Buffer gets very large and so you may need to limit
the values entered in order to keep the Z-Buffer within the limits of 2.1GB or
the free disk space available on the driver path you selected for the Z-Buffer
with the drawing editor's View Hidden Configure command.
The third special 24 bit BMP prompt selects the X pixels of the finished image.
This lets you select the size of the BMP file image, and is set up for 300 dpi,
so a 10 inch wide image would be made by entering a value of 3000. 300 dpi is a
good value for color images that will be printed out and viewed from normal
distances, you might try to use your photo editing software if you want to
change the image information, but the file as saved should meet general needs.
The X pixels value, that you enter, should be able to be evenly divided by 4
without a remainder, e.g. enter 320 or 404, and not 401, 402, or 403, and such.
The fourth special 24 bit BMP prompt selects the Y pixels. The program
normally defaults to a value of 0.75 times the X pixels for the Y pixels since
that value gives you a 4:3 raster shape for the drawing which corresponds to
the shape of the Preview screen when the on screen display modes are used. You
can make the drawing taller or shorter by entering a different Y pixels value,
for instance Y = X * 0.5625 gives you a landscape 16:9 wide screen ratio, or Y
= X * 1.25 gives you a "portrait" 8:10 shape image. You may need to adjust the
display scale if you make the image taller or shorter so that the image fits
the frame as you like. The video aspect adjustment value in the main menu
Change command should generally be set to 1.0 unless you want to make an
anamorphic compressed image for use in a wide screen movie.
The fifth special 24 bit BMP prompt lets you adjust the dithering of the tone
values to reduce the digital tone banding that can show up in digital images.
Internally the program calculates brightness values with greater precision than
the 24 bit BMP file can hold in its three 8 bit values for the Red, Green, and
Blue components. To try to preserve some of the apparent brightness precision
over large areas the program can set pixels to a color higher or lower than the
rounded off brightness value some of the time, for instance if the brightness
was 128.25 the pixel might be set to 128 three quarters of the time and 129 one
quarter of the time giving about an average brightness of 128.25 to the eye.
This may help make the tones look somewhat smoother on average, and may reduce
the tendency for bands to appear in the image when the faces of objects are
turned a angles such that the shading changes only a little from one end of the
face to the other end of the face, for example if a cube is turned so that the
front edge is at brightness 130 and the back edge is at brightness 125 then
only five tones would be presented if the values were rounded to the whole
values stored in the BMP file, but if dithering was used the shading would
change gradually from 130 all of the time to 130 half of the time and 129 half
of the time to 129 all of the time to 129 half of the time and 128 half of the
time to 128 all of the time and so on down to 125 all of the time. When viewed
from a distance the number of apparent shades may increase the larger the
shaded area is since the tone is taken as the average brightness of many points
to some extent. Although the 24 bit BMP file allows 256 levels of brightness
for each of the three spectral colors, some display systems may only allow 32
or 64 levels of brightness for each of the three spectral colors. Since the
display system may limit the shading of the image tones, you may need to
increase the dithering value to 4, 8, or more in order to reduce the tone
"stepping" and thereby reduce the tone banding in the images that you present.
Even if your video board uses 8 bit D2A converters, if you want the tones in
the image to be smooth looking on images you post on the internet you may want
to use larger dithering values than what you need for your personal viewing.
If someone viewing your images has his computer set to the 8 bit, 15 bit, or 16
bit "high-color" video modes rather than the 24 bit "true-color" video mode
they may see noticeable tone banding in your images if you have too small of a
dithering value entered. It would be nice if all display systems actually
displayed 24 bits of tone values so that the dithering could be set to a low
value all the time, but since the number of colors displayed may actually not
extend to the 24 bit limit for each pixel on all display systems you have the
dithering value to use to try to compensate in some way for some aspects of
those limitations. When outputting line drawings you may not want to use the
dithering since having the lines in a solid color may look better, so in those
cases you might set the dithering to 0. Valid values for the dithering
increase by powers of two, so if the BMP file is displayed on a device that can
show 256 shades each for red, green, and blue the dithering is set to 1, if
only 128 shades can be displayed dithering is set to 2, if only 64 shades then
dithering is set to 4, if only 32 then dithering is set to 8, if only 16 then
dithering is set to 16, if only 8 then dithering is set to 32, if only 4 then
dithering is set to 64, if only 2 then dithering is set to 128, and if only 1
then dithering is set to 256.
After you enter the values that effect the setup of the Z-Buffer file the
program asks you for two filenames. The first filename asked for is the name
of the background image, the second filename asked for is the name of the 24
bit "true-color" BMP file you want the image saved into. If you do not want a
background image loaded into the Z-Buffer, or the Z-Buffer already had a
background image loaded into it, do not enter the name of a background BMP
file, just press [Esc] then [Return] at the background filename prompt. If you
do not load a background BMP file into the Z-Buffer the background color will
be set to a fill color based on the color selected for line color 0 in the
palette table in the drawing editor's Setup Palette command. If you want to
make a shaded background BMP file to use as a background image you can use the
CRT BACKGROUND command in the main menu's Files Utilities Video Background
command. The second prompt as mentioned is for the name of the 24 bit BMP file
to make, if you want to abort the command and not make a file press [Esc] then
[Return], i.e. enter a blank filename, and the program should return to the
main menu without making a file. Be sure that you end the filename with the
extension .BMP since many programs may REQUIRE BMP files to have the BMP file
extension.
You should be able to view the 24 bit BMP file saved in some types of photo
editing or other graphics programs that read 24 bit BMP files, such as the
version of MSPAINT.EXE (tm) that comes with Windows 95 (tm) and such. It is
best not to re-size or alter the image tones of the 24 bit BMP image since
doing so may degrade the anti-aliasing and tone dithering benefits. Rather use
the settings in my CAD programs beforehand to try to have the image come out
the right size, brightness, and such so that no alterations are required after
the file is saved. A small amount of sharpening may make the image more
"snappy" but can counteract the anti-aliasing somewhat and so should be done on
a copy of the original file in case you do not like the effect on that
particular 24 bit BMP image file.
---
HOW TO REUSE THE Z-BUFFER FOR "UNLIMITED" POLYGONS IN A SINGLE RENDERING
Normally the Z-BUFFER file is erased after being used to render the image so as
to free disk space. In order to keep the Z-BUFFER you need to add a number to
the display mode passed to the Preview, DISPLAY, JET ADD, JET WORKSPACE, DOT
ADD, or DOT WORKSPACE commands. Several options can be achieved in this way,
with the values as shown here:
display mode + 0 = open new Z-BUFFER and erase Z-BUFFER after display.
display mode + 1000 = open new Z-BUFFER and keep Z-BUFFER after display.
display mode + 2000 = reopen old Z-BUFFER and keep Z-BUFFER after display.
display mode + 3000 = reopen old Z-BUFFER and erase Z-BUFFER after display.
The option to reuse the Z-Buffer applies to all display modes that use the Z-
Buffer and not just the BMP or F0B24 display mode. In those modes that write
directly to the screen, bypassing the Z-Buffer, you can include the extra
elements in the Pixel background image so they are "behind" the elements from
the Z-Buffer, or draw them over the image from the Z-Buffer once it has been
displayed on the screen. The end result for writing just to the Z-Buffer or a
mix of writing directly to the screen as well as writing to the Z-Buffer is
about the same, it is just that somewhat different steps are used to get the
result.
To fill a Z-BUFFER more than one time you first add 1000 to the display mode
and use the DISPLAY command, then initialize the workspace load the additional
elements and add 2000 to the display mode and use DISPLAY to reopen the Z-
BUFFER file for more filling, you can repeat using 2000 plus the display mode
over and over adding more and more elements to the Z-BUFFER file, when you are
down to the last filling you can add 3000 to the display mode and use DISPLAY
which will fill in the final elements display the completed seen and then erase
the no longer needed Z-BUFFER file.
You do not need to erase the Z-BUFFER after the final filling, but you do not
want to reopen it if you are going to start rendering a different image since
parts of the images would get mixed up. When you are going to add a background
you would want to add the background only to the first filling of the Z-BUFFER
since the mixing of the colors at the edges during anti-aliasing will not be
correct if you change the background after the first filling. If you are not
using oversampling or undersampling it might be possible to change the
background in the Z-BUFFER after the first filling. You cannot change the Z-
BUFFER size and other settings between fillings, and the perspective and
lighting values should also remain the same for all fillings, in most cases, so
as to avoid things looking wrong, e.g. having the light come from different
angles on different elements in the same rendering. You can change the display
mode between fillings, you might display some fillings using display mode 74
and some using display mode 73 in order to only have some elements have their
flagged edges outlined. You might also want to change the perspective values
between fillings of the Z-BUFFER if you want to display a line drawing over a
3D element to insert labels or other text and such (when the video mode
displays line drawings to the screen, rather than the Z-Buffer, you would
display what is in the Z-Buffer onto the screen, then display the line drawing
on top of that image that is on the screen, i.e. by not resetting the video
graphics mode between displaying the Z-Buffer and the line drawing element.)
One peculiarity of the initial revision of v2.7F is that when you are saving a
24 bit "true-color" BMP file all display modes write to the Z-BUFFER, including
the display of free lines used for line drawings, but when you are displaying
1, 2, 4, and 8 bit images onto the screen, and not to a 24 bit BMP file, free
lines are drawn DIRECTLY TO THE SCREEN and not into the Z-BUFFER since drawing
free lines directly to the screen is generally much faster than drawing them to
the Z-BUFFER file. When displaying on the screen, display modes in the 10
series display both lines and triangles directly to the screen bypassing the Z-
BUFFER in order to display more quickly. All triangle elements used with the
hidden line display modes are displayed using the Z-BUFFER. Normally this dual
path to the screen is not a problem since everything ends up on the screen
anyway in the 1, 2, 4, and 8 bit video modes, but if you want to express free
lines into a Z-BUFFER that you want to keep and then display the Z-BUFFER on
the screen later you need to first use the MUTATE command to convert the free
lines into triangles so that they will get expressed by Preview or DISPLAY into
the Z-BUFFER rather than onto the screen directly. Another approach is to not
plot the mutated free lines to the Z-BUFFER, but to display the Z-BUFFER then
save the image as a pixel file and use that pixel file as a background to
display the free lines over later with the Preview or DISPLAY commands.
Another peculiarity of the Z-BUFFER in the initial revision of v2.7F is that
the printer strips associated with the DOT and JET commands normally use the
same Z-BUFFER over and over again for each of the many strips that make up the
page, so only one Z-BUFFER file is used even though many strips are used.
However when you add 1000 to the display mode to create a Z-BUFFER that will be
saved, EACH STRIP CREATES ITS OWN Z-BUFFER file, and you end up with a set of
numbered files, ZBUFFER.1, ZBUFFER.2 and so on. This can require a very large
amount of disk space, so be sure that the Z-BUFFER path is set to a disk with
lots of free disk space. When there is only one Z-BUFFER file being used it is
usually named ZBUFFER.0, or something like that, so the extension might be used
to tell if you have a set of files or just one by checking for the existence of
file ZBUFFER.0 along the Z-BUFFER path.
Another reason for keeping the Z-BUFFER might be when most of the scene remains
the same and motionless during an animation. You would first create a Z-BUFFER
and fill it with the static background image and stationary 3D elements of the
scene that you wish to have the animated elements appear in. You would then
make a copy of the Z-BUFFER with the static elements so that you would have a
copy under another filename that would not get overwritten the next time you
use the DISPLAY command. You would then reopen the Z-BUFFER with the static
elements in it by using the DISPLAY command with the use of the perspective
mode being added to 2000 or 3000, and then the new elements that change from
frame to frame would be filled into the Z-Buffer so that they are with the
other elements already in the Z-Buffer file. When you are ready to make the
next frame you copy the Z-BUFFER with the background and static elements back
to its original name, keeping the original duplicate for making more copies
later, and then use DISPLAY to add the second set of moving elements in their
next positions, and so on. By only displaying the moving part of the scene
into the copy of the Z-BUFFER that contains the background and static elements
you can probably save some of the sorting and filling time by not having to do
those steps to the unchanging parts of the scene over and over again.
---
CHANGES TO MACRO COMMANDS
The macro GRAPH_MODE and DISPLAY commands have been altered to support the new
BMP and F0B24 graphics modes. Since several additional parameters are required
for the making of the 24 bit BMP file the LET and LET$ macro commands are used
before the DISPLAY command in order to pass the needed values via the harddisk.
VERSION v2.7F
; Example macro to save 24 bit BMP file.
WYSIWYG 1
LET B24OVER_.VAR = 4 ; anti-aliasing oversample value
LET B24UNDER.VAR = 2 ; sub-pixel undersample value
LET B24XPIX_.VAR = 800 ; x pixels value
LET B24YPIX_.VAR = 600 ; y pixels value
LET B24DITHE.VAR = 4 ; tone dithering value
LET$ B24BACK_.VAR = "MYPHOTO.BMP" ; background 24 bit BMP image
LET$ B24NAME_.VAR = "MYCGI.BMP" ; name for 24 bit BMP file to output to
GRAPH_MODE BMP
LET LS0ZFAR_.VAR = -7.75 ; far lambert lighting point
LET LS0ZNEAR.VAR = +5.50 ; near lambert lighting point
LET LS1XDEG_.VAR = 0 ; light source x rotation
LET LS1YDEG_.VAR = -75 ; light source y rotation
LET LS1ZDEG_.VAR = -45 ; light source z rotation
LET LS0LAMB_.VAR = 0.85 ; lambert brightness
LET LS0REFL_.VAR = 0.8 ; lambert reflection brightness
LET LS1BRIG_.VAR = 1 ; light source brightness
LET LS1REFL_.VAR = 1 ; light source reflection brightness
# 1 DISPLAY -20 -20 0 -10 240 74 0 0 ; make the 24 bit BMP file
TEXT
; End example macro to save 24 bit BMP file.
If you want to make an image that uses more elements or triangles than can fit
into the drawing workspace at one time you can use the DISPLAY command more
than one time to fill the Z-BUFFER more than once. In Graphics mode BMP or
F0B24, a BMP file will be created each time DISPLAY is used so that you can see
what has been displayed to the Z-BUFFER, but you can just ignore the BMP file
made after each filling of the Z-BUFFER and only keep the final one made after
the last filling of the Z-BUFFER file.
Normally the Z-BUFFER file is deleted after the BMP file is output to free disk
space. In order to keep the Z-BUFFER you need to add a number to the display
mode passed to the DISPLAY command. Several options can be achieved in this
way, with the values as shown here:
display mode + 0 = open new Z-BUFFER and erase Z-BUFFER after display.
display mode + 1000 = open new Z-BUFFER and keep Z-BUFFER after display.
display mode + 2000 = reopen old Z-BUFFER and keep Z-BUFFER after display.
display mode + 3000 = reopen old Z-BUFFER and erase Z-BUFFER after display.
To fill a Z-BUFFER more than one time you first add 1000 to the display mode
and use the DISPLAY command, then initialize the workspace load the additional
elements and add 2000 to the display mode and use DISPLAY to reopen the Z-
BUFFER file for more filling, you can repeat using 2000 plus the display mode
over and over adding more and more elements to the Z-BUFFER file, when you are
down to the last filling you can add 3000 to the display mode and use DISPLAY
which will fill in the final elements display the completed scene and then
erase the unneeded Z-BUFFER file.
Adding the values 1000, 2000, or 3000 should only be done when the Z-Buffer is
going to be used by the display mode selected, when the display goes directly
to the video screen adding these values to the display mode probably has no
useful or defined effect.
You do not need to erase the Z-BUFFER after the final filling, but you do not
want to reopen it if you are going to start rendering a different image since
parts of the images would get mixed up. When you are going to add a background
you would want to add the background only to the first filling of the Z-BUFFER
since the mixing of the colors at the edges during anti-aliasing will not be
correct if you change the background after the first filling. If you are not
using oversampling or undersampling it might be possible to change the
background in the Z-BUFFER after the first filling. You cannot change the Z-
BUFFER settings between fillings, and the perspective and lighting values
should also remain the same for all fillings to avoid things looking wrong.
You can change the display mode between fillings, say have some fillings done
by using display mode 74 (e.g. 2074) and some done by using display mode 73
(e.g. 2073) in order to only have some elements have outlined edges. You might
want to change the perspective values between fillings of the Z-BUFFER if you
want to display a line drawing over a 3D element to insert labels or other text
and such.
The variables used for the display modes may get erased after each use, this
helps produce error messages and make sure that you have stated the values that
you want used, and that the values read are not just old variables left on your
harddisk from some time in the past.
Normally in the 1, 2, 4, and 8 bit per pixel video modes the background image
is loaded onto the screen by using the LOAD PIXEL command before the DISPLAY
command, and the DISPLAY command writes in parts of the screen over what is
there. Since the 24 bit per pixel BMP output file comes from the Z-BUFFER and
not the video screen, the background image is loaded into the Z-BUFFER rather
than the screen. When the 1, 2, 4, and 8 bit per pixel video modes are used
you do not need to state the variables that pertain to the 24 bit per pixel use
of the Z-BUFFER, you just use the DISPLAY command and the Z-BUFFER will be made
up according to the screen dimensions without anti-aliasing since anti-aliasing
is not implemented for the video modes with very limited colors since subtle
color changes are needed to have the anti-aliasing work well. If no background
image is loaded then the background color comes from the setting of color 0 in
the line color number to line color color number palette table, see Setup
Palette in the Drawing Editor, or the PALETTE macro command.
Below is the macro code for example macro file ZBUFFER1.MAC (tm). This macro
may be included in the v2.7F distribution DANCAD3D.ZIP (tm) file. ZBUFFER1.MAC
(tm) shows commands used to create, fill, and reopen a Z-BUFFER file, so as to
make a 24 bit "true-color" BMP file as the output.
VERSION v2.7F
TEXT
LOCATE 1 1
OUTPUT$ "ZBUFFER1.MAC (tm) Copyright (C) 2003 by Daniel H. Hudgins, All Rights Reserved."
LOCATE 1 3
OUTPUT$ "Example macro to fill the Z-Buffer more than once and save to a 24 bit BMP file."
LOCATE 1 5
OUTPUT$ "The 24 bit "%true-color"% image from the Z-Buffer is output to file ZBUFFER1.BMP"
LOCATE 1 6
OUTPUT$ "that you can try to look at with another graphics program e.g. MSPAINT.EXE (tm)."
LOCATE 1 7
OUTPUT$ "If the macro crashes it is probably because you do not have enough free disk"
LOCATE 1 8
OUTPUT$ "on your harddrives. You can try editing this macro to reduce the X & Y pixels"
LOCATE 1 9
OUTPUT$ "and or the oversample and undersample values to reduce the disk space demands."
LOCATE 1 11
OUTPUT$ "Since the Z-Buffer used does not use the video board, a SVGA is not required"
LOCATE 1 12
OUTPUT$ "for this macro to run. The image is not displayed on the screen, it is just"
LOCATE 1 13
OUTPUT$ "output to a BMP file that you can try to view or print from some other program."
LOCATE 1 15
OUTPUT$ "You can edit the GRAPH_MODE if you rather have the output come out on the screen"
LOCATE 1 16
OUTPUT$ "since all the elements displayed are triangle elements. You may wish to change"
LOCATE 1 17
OUTPUT$ "the display modes if you are going to display using monochrome or 16 color mode"
LOCATE 1 18
OUTPUT$ "e.g. try mode 1 for monochrome, and 23 for 16 color, plus 1000, 2000, or 3000."
LOCATE 1 20
OUTPUT$ "The screen will go black for a long time while the program is working, this"
LOCATE 1 21
OUTPUT$ "macro takes about 10 minutes on a 733MHz PIII, the main menu shows when done."
LOCATE 1 23
OUTPUT$ "See also the information in file INFOV27F.TXT and at www.DANCAD3D.com (sm)."
LOCATE 1 25
OUTPUT$ "Press [Return] to continue."
WAIT
TEXT
LOCATE 1 1
OUTPUT$ "Working: Making elements..."
INITIALIZE
POLYGON 72 72 0.5 14 1 0 0 { This is element 1 }
# 1 OFFSET CURRENT 3.0 0 0
# 1 LATHE D 360 350
# 1 ROTATE Z 90 0 0
# 1 ROTATE Z 0 0 -85
BEGIN_NEW_ELEMENT { Number: 2 }
APPEND 0 1 0 1.2 1 0 1 1 0 0
APPEND 1.2 1 0 1.2 11 0 1 1 0 0
APPEND 1.2 11 0 0 11 0 1 1 0 0
# 2 LINETYPE 9 1 0 0
# 2 LATHE D 6 6 ; 1:13:22 a.m., Friday, May 16, 2003.
BEGIN_CUBE { Element 3 }
APPEND_LINE -4 6.6 4 -4 5.4 4 1 1 160 0
APPEND_LINE 4 5.4 4 4 5.4 7.7806525 1 1 208 0
APPEND_LINE 4 5.4 4 4 6.6 4 1 1 160 0
APPEND_LINE -4 6.6 4 -4 6.6 7.7806525 1 1 208 0
APPEND_LINE -4 5.4 -4 -4 6.6 -4 1 1 160 0
APPEND_LINE 4 6.6 -4 4 6.6 -7.7806525 1 1 208 0
APPEND_LINE 4 6.6 -4 4 5.4 -4 1 1 160 0
APPEND_LINE -4 5.4 -4 -4 5.4 -7.7806525 1 1 208 0
APPEND_LINE 4 5.4 4 4 5.4 -4 1 1 160 0
APPEND_LINE 4 6.6 -4 7.7806525 6.6 -4 1 1 208 0
APPEND_LINE 4 6.6 -4 4 6.6 4 1 1 160 0
APPEND_LINE 4 5.4 4 7.7806525 5.4 4 1 1 208 0
APPEND_LINE -4 6.6 -4 -4 5.4 -4 1 1 160 0
APPEND_LINE -4 5.4 4 -7.7806525 5.4 4 1 1 208 0
APPEND_LINE -4 5.4 4 -4 6.6 4 1 1 160 0
APPEND_LINE -4 6.6 -4 -7.7806525 6.6 -4 1 1 208 0
APPEND_LINE -4 5.4 4 -4 5.4 -4 1 1 160 0
APPEND_LINE 4 5.4 -4 4 1.8193475 -4 1 1 208 0
APPEND_LINE 4 5.4 -4 4 5.4 4 1 1 160 0
APPEND_LINE -4 5.4 4 -4 1.8193475 4 1 1 208 0
APPEND_LINE 4 6.6 -4 -4 6.6 -4 1 1 160 0
APPEND_LINE -4 6.6 4 -4 10.1806525 4 1 1 208 0
APPEND_LINE -4 6.6 4 4 6.6 4 1 1 160 0
APPEND_LINE 4 6.6 -4 4 10.1806525 -4 1 1 208 0
{ End CUBE type DIAGONAL } ; 1:16:14 a.m., Friday, May 16, 2003.
# 3 CENTER_FOR_CUBE -4 5.4 -4 ; 1:16:16 a.m., Friday, May 16, 2003.
# 3 LINETYPE 12 1 1 0 ; set tall equal shape so edges can be shaded.
LETTERING
DANCAD3D
0 6 4.05 0 0 0 0.6 0.8
10 1 0 0 0 0.4 0.5 6.666
C J DANCAD3D.FON ; Element 4, 1:38:12 a.m., Friday, May 16, 2003.
# 4 MUTATE 103
# 4 ERASE
# 0 OFFSET C 0 -3.5 0
{ STOP } ; you can stop here and use Preview to display in mode S640C256
# 1 SAVE ASCII JOINELE1.ASC
# 2 SAVE ASCII JOINELE2.ASC
# 3 SAVE ASCII JOINELE3.ASC
# 4 SAVE ASCII JOINELE4.ASC
INITIALIZE
LOAD ASCII JOINELE1.ASC ; load first set of elements
LET B24OVER_.VAR = 2 ; anti-aliasing oversample value
LET B24UNDER.VAR = 1 ; sub-pixel undersample value
LET B24XPIX_.VAR = 640 ; x pixels value
LET B24YPIX_.VAR = 480 ; y pixels value
LET B24DITHE.VAR = 4 ; tone dithering value
LET$ B24BACK_.VAR = "" ; no background when making background
LET$ B24NAME_.VAR = "BACKGRO1.BMP" ; name for 24 bit BMP file to output to
GRAPH_MODE BMP ; set video mode for CRT BACKGROUND
CRT BACKGROUND 21 0.999 2 4
TEXT
LET B24OVER_.VAR = 4 ; anti-aliasing oversample value
LET B24UNDER.VAR = 1 ; sub-pixel undersample value
LET B24XPIX_.VAR = 640 ; x pixels value
LET B24YPIX_.VAR = 480 ; y pixels value
LET B24DITHE.VAR = 4 ; tone dithering value
LET$ B24BACK_.VAR = "BACKGRO1.BMP" ; background 24 bit BMP image
LET$ B24NAME_.VAR = "ZBUFFER1.BMP" ; name for 24 bit BMP file to output to
GRAPH_MODE BMP ; the video mode must be reset each time
LET LS0ZFAR_.VAR = -4.85 ; far lambert lighting point
LET LS0ZNEAR.VAR = +5.85 ; near lambert lighting point
LET LS1XDEG_.VAR = 0 ; light source x rotation
LET LS1YDEG_.VAR = 80 ; light source y rotation
LET LS1ZDEG_.VAR = -70 ; light source z rotation
LET LS0LAMB_.VAR = 0.875 ; lambert brightness
LET LS0REFL_.VAR = 0.875 ; lambert reflection brightness
LET LS1BRIG_.VAR = 0.900 ; light source brightness
LET LS1REFL_.VAR = 0.900 ; light source reflection brightness
# 1 DISPLAY -22 -20 0 -22 92 1074 0 0 ; open a new Z-BUFFER file.
TEXT
INITIALIZE
LOAD ASCII JOINELE2.ASC ; load second set of elements
LET B24OVER_.VAR = 4 ; anti-aliasing oversample value
LET B24UNDER.VAR = 1 ; sub-pixel undersample value
LET B24XPIX_.VAR = 640 ; x pixels value
LET B24YPIX_.VAR = 480 ; y pixels value
LET B24DITHE.VAR = 4 ; tone dithering value
LET$ B24BACK_.VAR = "" ; no background on second fill of Z-BUFFER
LET$ B24NAME_.VAR = "ZBUFFER1.BMP" ; name for 24 bit BMP file to output to
GRAPH_MODE BMP ; reset video mode
LET LS0ZFAR_.VAR = -4.85 ; far lambert lighting point
LET LS0ZNEAR.VAR = +5.85 ; near lambert lighting point
LET LS1XDEG_.VAR = 0 ; light source x rotation
LET LS1YDEG_.VAR = 80 ; light source y rotation
LET LS1ZDEG_.VAR = -70 ; light source z rotation
LET LS0LAMB_.VAR = 0.875 ; lambert brightness
LET LS0REFL_.VAR = 0.875 ; lambert reflection brightness
LET LS1BRIG_.VAR = 0.900 ; light source brightness
LET LS1REFL_.VAR = 0.900 ; light source reflection brightness
# 1 DISPLAY -22 -20 0 -22 92 2074 0 0 ; reopen Z-BUFFER file in mode 2074.
TEXT
WYSIWYG 1
{ PALETTE 1 0 8 }
INITIALIZE
LOAD ASCII JOINELE3.ASC ; load third set of elements
LET B24OVER_.VAR = 4 ; anti-aliasing oversample value
LET B24UNDER.VAR = 1 ; sub-pixel undersample value
LET B24XPIX_.VAR = 640 ; x pixels value
LET B24YPIX_.VAR = 480 ; y pixels value
LET B24DITHE.VAR = 4 ; tone dithering value
LET$ B24BACK_.VAR = "" ; no background on second fill of Z-BUFFER
LET$ B24NAME_.VAR = "ZBUFFER1.BMP" ; name for 24 bit BMP file to output to
GRAPH_MODE BMP
LET LS0ZFAR_.VAR = -4.85 ; far lambert lighting point
LET LS0ZNEAR.VAR = +5.85 ; near lambert lighting point
LET LS1XDEG_.VAR = 0 ; light source x rotation
LET LS1YDEG_.VAR = 80 ; light source y rotation
LET LS1ZDEG_.VAR = -70 ; light source z rotation
LET LS0LAMB_.VAR = 0.875 ; lambert brightness
LET LS0REFL_.VAR = 0.875 ; lambert reflection brightness
LET LS1BRIG_.VAR = 0.900 ; light source brightness
LET LS1REFL_.VAR = 0.900 ; light source reflection brightness
# 1 DISPLAY -22 -20 0 -22 92 2073 0 0 ; reopen Z-BUFFER file in mode 2073.
TEXT
INITIALIZE
LOAD ASCII JOINELE4.ASC ; load forth & final set of elements
LET B24OVER_.VAR = 4 ; anti-aliasing oversample value
LET B24UNDER.VAR = 1 ; sub-pixel undersample value
LET B24XPIX_.VAR = 640 ; x pixels value
LET B24YPIX_.VAR = 480 ; y pixels value
LET B24DITHE.VAR = 4 ; tone dithering value
LET$ B24BACK_.VAR = "" ; no background on second fill of Z-BUFFER
LET$ B24NAME_.VAR = "ZBUFFER1.BMP" ; name for 24 bit BMP file to output to
GRAPH_MODE BMP ; reset video mode
LET LS0ZFAR_.VAR = -4.85 ; far lambert lighting point
LET LS0ZNEAR.VAR = +5.85 ; near lambert lighting point
LET LS1XDEG_.VAR = 0 ; light source x rotation
LET LS1YDEG_.VAR = 80 ; light source y rotation
LET LS1ZDEG_.VAR = -70 ; light source z rotation
LET LS0LAMB_.VAR = 0.875 ; lambert brightness
LET LS0REFL_.VAR = 0.875 ; lambert reflection brightness
LET LS1BRIG_.VAR = 0.900 ; light source brightness
LET LS1REFL_.VAR = 0.900 ; light source reflection brightness
# 1 DISPLAY -22 -20 0 -22 92 3074 0 0 ; reopen Z-BUFFER file then erase it.
TEXT
; End macro to fill Z-BUFFER more than once and save 24 bit BMP file.
The same general idea of keeping the Z-BUFFER and the need for the macro
command to be preceded by the necessary Z-BUFFER and lighting variables applies
to the JET ADD, JET WORKSPACE, DOT ADD, and DOT WORKSPACE commands. As may
have been mentioned above, when the Z-BUFFER is saved from the DOT or JET
commands a set of files is saved, one Z-BUFFER file for each of the many strips
that make up the DOT or JET page. Because of the high resolution of the DOT
and JET pages the size of the set of Z-BUFFERS will take up a considerable
amount of disk space, so it is important that you have sufficient free disk
space if you are going to try to preserve the Z-BUFFER while using the DOT or
JET commands. The perspective display modes that effect the retention of the
Z-BUFFER can also be accessed through the main menu Preview command as well as
the Hardcopy Jet Add, Hardcopy Jet Workspace, Hardcopy Dot Add, and Hardcopy
Dot Workspace commands.
The SORT command now has two modes:
# 1 SORT 1 ; sorts triangles back to front
# 1 SORT 2 ; sorts triangles front to back
The MUTATE command has some new modes that effect the display of triangles:
# 1 MUTATE 1 ; Convert free lines to triangles, like mode 102 now
# 2 MUTATE 2 ; like in v2.7E
# 2 MUTATE 3 ; like in v2.7E
# 1 MUTATE 100 ; line mode 1 in v2.7E
# 1 MUTATE 102 ; lines to triangles, flag as mutated
# 1 MUTATE 103 ; like 102 but also flag for shade by depth
Mutate mode 100 is not generally recommended since the shine of the surface
reflection from the light sources can show up in the rendering depending on the
angle of the element and the display mode.
Mutate mode 102 sets the second bit of the second line in each triangle's shape
byte so that the program knows that the triangles have been mutated from free
lines and can give them special treatment.
Mutate mode 103 sets the first and second bits of the second line in each
triangle's shape byte so that the program will shade the mutated element by
depth in display modes, such as perspective display mode 64, that support that
option. Although you might want use this feature to have the mutated lines
shade along with the other elements in a 3D rendering, because the lines going
toward the back of the display space when rotated can get very dark, you might
prefer to use mutate mode 102 to keep the line color constant at all depths.
These new mutate modes are also available through the Mutate command in the
drawing editor.
Two new options were added to the CORRECT command that filter elements.
# 1 CORRECT F L ; filters out dots and triangles, keeps free lines
# 2 CORRECT F T ; filters out lines and "bad" triangles, keeps good triangles
The "F" stands for Filter mode, the "L" stands for Line mode, and the "T"
stands for triangle mode. The "L" filter is used internally by the program to
"prep" line elements before some of the commands that convert line elements
into triangles, so as to remove line segments that are very short or have no
length, since it is not allowed that the resulting triangles made from a line
source element would have no length on one side. The "T" filter is used to
remove triangles that have no length on one side, and might also be able to
remove free lines from a triangle element. If a free line is stuck between the
first and second lines in a triangle the free line and the first and second
lines of the corrupted triangle will probably get deleted since the program has
no way of associating parts of a triangle that are not made of consecutive line
segments in the workspace. Since both filters delete line segments these
commands tend to work faster when the element being filtered is the element
with the highest element number, rather than an element somewhere in the middle
because when an line segment gets deleted all of the line segments with a
higher line number need to be shuffled down by one line number, so the fewer
lines above the one getting deleted the better. These new filters are also
accessible through the drawing editor's Hidden Correct command.
The CRT BACKGROUND command was altered to make a BMP file rather than a Pixel
file when the graphics mode BMP or F0B24 is set. The same variables that need
to proceed the DISPLAY command when graphics mode BMP or F0B24 are used need to
precede the CRT BACKGROUND macro command so that the program will know what
kind and size of Z-Buffer to setup and what the name of the 24 bit BMP file to
make should be.
LET B24OVER_.VAR = 1 ; anti-aliasing oversample value
LET B24UNDER.VAR = 1 ; sub-pixel undersample value
LET B24XPIX_.VAR = 800 ; x pixels value
LET B24YPIX_.VAR = 600 ; y pixels value
LET B24DITHE.VAR = 4 ; tone dithering value
LET$ B24BACK_.VAR = "" ; no background when making background
LET$ B24NAME_.VAR = "BACKGROU.BMP" ; name for 24 bit BMP file to output to
GRAPH_MODE BMP ; set video mode for CRT BACKGROUND
CRT BACKGROUND 21 1 2 4
In the above example the value passed to B24OVER_.VAR will probably have some
effect on the appearance of the background image since two colors are being
mixed in a random "texture" like pattern. When CRT BACKGROUND is writing to
the screen using the 1, 2, 4, or 8 bit per pixel video modes the variables used
with the 24 bit BMP file mode are not required in v2.7F.
The GRAPH_MODE command should now accept the new "graphics" modes BMP and F0B24
which for the time being should do the same thing. You should reset the video
mode with the macro TEXT command so that you are back in video text mode after
using the BMP or F0B24 graphics mode.
GRAPH_MODE BMP
; command that uses BMP mode here
TEXT
GRAPH_MODE F0B24
; command that uses F0B24 mode here
TEXT
Be sure to set the correct graphics mode before using any of the commands that
require that the program be in graphics mode. The display variables that are
used by the hidden line display modes and the BMP or F0B24 graphics mode should
be assigned before being required each time the command is called that uses the
variable values, since the variables may be erased after being read. Erasing
the variables after they are read might help insure that the values being read
are "fresh" assignments and not old values left on the harddisk from some time
before.
The LINETYPE command was altered to treat elements that have triangles
differently than elements that are made of free lines. In a element made of
triangles the first bit of the shape byte in the second line of each triangle
tells the program to shade the edge lines that are set to show in display modes
that show them. Since there is no special command to set this bit you can use
the macro LINETYPE command to set this bit. This bit being set in the shape
byte of the first line in a triangle has no defined effect at this point in the
development of the program.
# 1 LINETYPE 14 3 1 0 ; have edges shaded when right display mode is selected
# 1 LINETYPE 14 3 0 0 ; do not shade flagged edges in any display mode
Since there is no special command for setting this bit, you can use the drawing
editor's Line edit Line style command to set the line type to "square tall"
when you want the edges shaded, and "square equal" when you do not want the
edge outlines shaded at any time. By controlling the shading of the edges by
an attribute bit in the drawing element rather than by selecting a special
display mode you can have some element's edges shaded and some not shaded in
the same rendering.
The LINETYPE command was also modified so as to bypass the second bit of the
triangle's second shape attribute byte, so that the element mutated from a free
line flag bit, the second bit in the second shape byte, would not get changed
when you use the LINETYPE command to alter the color or edge line width of a
triangle element. You should not edit triangle elements made in, or to be used
in v2.7F, in versions or revisions of the CAD programs prior to v2.7F since the
presence of these control flag bits in triangle elements was not defined in
those versions, and the bits may get improperly altered or have undesirable
effects. In general, drawings or elements made in a newer version or revision
should not be used in older versions or revisions since the code that supports
newer features is not the same or even present in older versions.
Since LINETYPE is set to bypass the mutated flag bit, you cannot use it to
alter the mutated flag bit. This is probably not a problem since that bit is
only used to flag mutated triangle elements. If you need to alter that bit you
can save the element as an ASCII file and use the search and replace in the
Write command or some other text editor to change the second shape byte's
values, you can edit the automatic output macro you saved while drawing and
change the mutate mode so that when you regenerate the drawing the mutate bit
is not set, or you can try to mutate the triangles back into free lines and
then mutate them back into triangles but use a different mode the second time.
Some new or altered perspective display modes are accessible:
6 = fill triangles with random colors not background color with no edges
21 = fill triangles with triangle color, outline edges in same color
24 = like 21 but without the edge outline
These new or changed modes are also available from the main menu Preview
command and the drawing editor's View Hidden Hidden command.
---
CHANGES TO V2.74 AND V3.74 CAM PROGRAMS IN MAY 9, 2003 REVISIONS.
Since the default video aspect ratio was changed in the CAD programs I have
also revised the CAM programs so that the difference between the programs might
not be another reason for adjusting the monitor's controls. One of the reasons
that the video aspect ratio was changed was that BMP graphics files normally
have a one-to-one square pixel shape. When BMP graphics files are converted
into ASCII tool path files, through use of the file utility or JET commands in
the CAD programs, fewer adjustments might need to be made if the video aspect
ratio matches the BMP file aspect ratio, and therefore parts manufactured from
tool path files made through such conversion might not need to be compensated
for aspect conversion ratios if all the aspect ratios used are for 1:1 pixel
shapes, i.e. a 4:3 raster shape when the BMP file is 640 by 480 pixels and
such. Some video board's or video modes pixel shapes do not have 1:1 square
pixels, so you may still need to use the Magnify command or the video aspect
adjustment in the CAD program's main menu's Change command to make adjustments
for those circumstances in order to get the X and Y axis in the tool path file
generated to come out with even height to width motor steps for corresponding
to even proportions in the BMP file converted.
The default video aspect ratio was changed to 4:3 in the CAM programs so that
flat panel video monitors that do not have height or width controls but do have
square pixels will be more likely to display shapes proportioned appropriately.
If you have a CRT video monitor you should set the video aspect adjustment in
the programs to 1.0 and adjust the monitors controls to have the video aspect
test pattern come out square. If your CRT monitor does not have height or
width adjustments and does not display a 4:3 raster, or your LCD or other flat
panel display does not have square pixels, then you might try using the video
aspect adjustment in the programs to compensate for differences in the aspect
ratios. The aspect ratio adjustment in the programs effects the display of
shapes in the "Teach" mode's graphic display, and the video aspect ratio test
pattern. If you are using the Hercules (tm) video mode on a monochrome
graphics monitor the monitor's aspect ratio is probably wider than 4:3, so if
things had looked correct on it in previous revisions you will probably have to
make an aspect ratio adjustment now in the software. If you are using a color
monitor it is probably displaying an aspect ratio near 4:3, although some
monitors have bezels that are a wider shape, so the width of the image on the
screen may not fill the screen's width when the raster is adjusted to show
square pixels, i.e. you will have more black space at the sides of the raster
than at the top and bottom.
---
ADDITIONAL INFORMATION
Please visit my Web site On-Line at: http://www.DANCAD3D.com/ for additional
information. Please report bugs, mistakes, or other problems with this
document or the programs, see SECTION: 8 at the current On-Line version of my
Web site for current instructions.