Copyright (C) 1986-2008 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 22 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) , 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 read "SECTION: 8" of "This Web Site" (HTML document and associated files) before trying to contact "The Author."
The text in this section has been revised to include some of the developments for a revision of version v2.7B, program versions, updates, or revisions prior or subsequent may work differently and so what is stated here may not apply to the particular version, update, or revision you might have, i.e. those other versions. The documentation is only generally descriptive of the programs, you should check the operation of each particular program that you will be "Beta Testing" since operation of the programs is subject to change without notice.
This HTML documentation section has documentation mostly about my CAD programs DANCAD3D.COM (tm) and DANCAD87.COM (tm). Most the discussion about DANCAD3D.COM (tm) also applies to "Beta Testing" DANCAD87.COM (tm), the math co- processor version, as well, except for some differences in some of the files saved and the need for a math co-processor. See also the other documentation in this Web site for additional information, particularly the CAM program documentation and the supplemental documentation, tutorials, and appendices. The disclaimer, and most of the other legal text is currently located in SECTION: 0, therefore you must read the disclaimer, End User License Agreement (EULA), legal text and other text in SECTION: 0 before you read any of the other documentation or use any part of this HTML document, this section, or associated files and programs.
I may expand or revise the documentation someday, so check back from time to time to see if any new or revised files have been up-loaded to the Web site.
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.
DANCAD3D.COM (tm) and DANCAD87.COM (tm) support two types of drawing elements, those made of "free" line segments, and those made of "triangles." The "free" line segment elements are used for general line drawing, wire-frame animation, and making tool path files for CAM manufacturing. In order to display shapes with the surfaces filled in and shaded by artificial "light" more information is needed than just the two end points of a line, four points are required, three to make a triangle and a forth for the direction and angle of a normal ray from the surface of the triangle. The normal ray helps define the inside and outside of surfaces. The surface of objects for hidden line removal is then made up of abutting triangles, with their normals pointing to the outside or exterior of the object. Hidden line removal refers to a shape looking solid so that you do not see through it to the backside like you would in a wire frame display of an 3D object. While there may be different ways of removing the hidden lines, the desired result is generally always that you do not see the parts that would be obscured in viewing an opaque object.
Believe it or not the pre-v1.0 c. 1985 version of DANCAD3D.COM (tm) had some "hidden line" removal, but running it on my brothers IBM PCjr (tm) it took hours or days just to redraw the screen or print out, so I removed that portion of the code and developed the CAD programs for wire frame animation. Since computers now are perhaps as much as 2000 times faster than that old IBM PCjr (tm) what took two or three hours before now takes minutes or less. This length of time seems more like a reasonable wait for the screen to redraw, especially when working in the drawing editor.
Complex objects and scenes can still take a day or longer to calculate, even on a 1GHz computer, but that is better than five years or longer! What takes most of the time is usually the sorting of the triangles before the display starts at the back and works its way toward the front. When drawing elements with triangles you should try to use as few triangles as will make a good representation of the objects, and still have the triangles small enough in areas of the objects element's surface where out of order sorting might be a problem because of the angles the object is rotated to for the display.
Off and on over the years I was working on parts of the code for hidden line removal, and after the release of v2.6 I decided to rework all of DANCAD3D.COM (tm) to be compatible with hidden line removal, without disturbing much of the usability that the program had for simple line drawings, editing tool paths, and wire frame animation.
In order to make the program work as it did before, but have the "new" capability of working with triangle elements for hidden line display modes and such, I store the triangles used for hidden line removal as two line segments, the first line segment goes from p1 to p2 of the triangle, the second line segment goes from p3 of the triangle to p4 which is the end point of a "normal" from the plane of the triangle. The line segments from p2 to p3 and p3 to p1 of each triangle are IMPLIED, by the p1 to p2 line and point p3 of the p3 to p4 line, and are not stored in the workspace. Since the two line segments that make up each triangle and its normal are always consecutive and in that order you must never erase one of them or put them out of order or you will probably get LOTS of error messages when you try to display or work with that element. The program has some built in checking for this kind of error, but you should be aware of the need to always keep the line pairs, that make up each triangle, together if you manually edit line data.
If you enter triangles manually by writing or editing an ASCII file you should set p4 to be equal to p3, and then use the HIDDEN CORRECT GENERATE normals commands in the drawing editor to generate the normals to reflect the changes to the triangles end points, except for simple triangles parallel to the major axis, you would probably not be able to set the values for p4 correctly yourself.
The program assumes that triangles facing the viewer have line directions that move from p1 to p2 to p3 in a clockwise direction, and that p4 is located pointing nearer to the user than p3. If p4 points away, or the triangle is counterclockwise the triangle is not displayed in some modes to save time re-drawing the screen, since you cannot see the back side, or inside, of object's surfaces.
Sometimes when using the Lathe or other commands if the source element lines are drawn backwards the normals and triangles will be made the wrong way around. To see if this has happened, you can use some special display modes, e.g. the HIDDEN UPDATE NORMALS mode, or VIEW HIDDEN NORMALS mode, in the drawing editor, to see the normally invisible normal line segments. If you see the normals pointing in the wrong direction there are some commands to change the direction so that they go the way you want, i.e. pointing outside of the shape you are drawing. See the HIDDEN CORRECT and HIDDEN REVERT commands in the drawing editor to adjust the normals length and direction.
The four line attributes, i.e. color, width, shape, and style, have been altered to allow the program to identify line segments that are "free" old type line segments, from the new triangle line segments. You should let the program automatically assign these attributes, and not try to change them manually. You can still edit the line color and width generally but it may be best to leave the line shape and line stile attribute alone. If you need to edit the line attributes see Appendix N for more information about the meaning of the bits used in the line attribute values.
You should not mix or JOIN elements that have triangles in them, with elements that just have line segments in them. Although many commands can still operate on elements that have either line segments or triangles, some can only operate on one or the other. Some commands convert elements that have line segments into elements that have triangles, so you will have to keep in mind what you are doing and what type of data is in the elements you are working with.
When drawing elements for display with hidden line removal, remember that you are drawing the outside surface of the object, without portions of the surface under or passing through the surface of other objects. The objects need to be drawn as having a volume of thickness enclosed by the outer surface, and not just the "front" or when you rotate the object there will be "holes" appearing.
To produce hidden line removal the program sorts the triangles, and then displays the triangles that face forward, starting at the back and working in order to the front. This trick works most of the time, but it can get confused if the elements are not drawn carefully to make the triangles sort in the right order. Sub-dividing triangles to be smaller than the distance between objects generally improves the odds that the triangles will sort in the right order, but slows down the sorting since there will be many more triangles, so generally you draw large triangles where objects are at a distance, and smaller ones in and around where to objects meet. See the HIDDEN DIVIDE command in the drawing editor to sub-divide triangles in triangle elements to improve the sorting of the triangles when you have sorting problems due to the shape of your drawn objects.
Drawing elements for hidden line removal might seem to be more work than drawing wire-frame elements, because some forethought may be required to planning which edges will be drawn with edge triangles, which edges will be drawn with junction triangles, and which areas will be filled in using surface triangles. If you find it too much work do draw triangle elements you can still use the programs for wire frame animation since the triangle elements are an additional capability of the programs, not a replacement of previous capabilities.
There may be some example macro files to look at with regard to how triangle elements can be drawn using the macro commands. Some macros may have been included in the DANCAD3D.ZIP archive along with the programs, e.g. DEMO*.MAC or EX*.MAC, that might help you learn something about using the macro commands to draw triangle elements for hidden line display. There may also be example macro programs that make triangle elements in the download section.
Many of the commands such as Offset, Flip, Magnify, and Rotate, act in a similar way on triangle elements as they do on wire-frame elements made of "free" line segments. This could allow you to write your macro file to make a wire-frame animation to quickly work out bugs in the motion of the elements, then you could switch to using triangle elements of the same objects for the finished frame set. The Mutate command can be used to convert triangle elements into wire-frame elements for quick testing of the display values that would be used with the hidden line display modes later. You cannot convert wire-frame elements into proper triangle elements since the "free" lines lack the information needed to form the triangles, the Mutate command can convert "free" lines into long skinny line like shapes made of triangles, but that is a special purpose function for adding lettering and such to a triangle element, and will not fill in surfaces for you. So when you draw you need to draw triangle elements if you want to use the hidden line display modes later.
The Hidden Triangle command in the drawing editor is usually just used to place triangles here and there, the Hidden Fan command is generally quicker to use, since you can draw an edge of "free" lines and pick a common point for the triangles to be generated by Hidden Fan. The Polygon command can be used to make the "guide" line for "Hidden Fan" when you need to fill in a area near a round hole and such. When you use Polygon with Fan you generally only use one forth of a quasi circle since the triangles may cross over the source quarter circle otherwise due to the lines extending from the common point, you should check for this sort of error when you use the Fan command.
To use the Thicken command to make a triangle element, you first make the front face of the object out of triangles, by using the Triangle and Fan commands. The edges that you want thicken to make as sides need to be drawn so that they are edge type triangles and the p1 to p2 line falls on the edge that will become a side. You can create new sides inside a hole in the source face by outlining the hole with edge triangles. If you do not want your hole to have sides inside of it when thickened you should outline the hole with junction type triangles. Once you have outlined the outside edges and holes in your source face with edge and junction triangles, you then fill in any gaps with surface type triangles. You then use thicken to thicken the source face element into an element with sides and a back. You then use the display modes that show the normals to check that all the triangles are orientated properly, and the normals are pointing away from the interior of the element. If you have a hole in your object, then the normals on the sides inside the hole should point into the center area of the hole, and such.
To use the Lathe command to make a round triangle element, you first draw a series of "free" line segments in a new element. The line segments for the source element to be used with Lathe should be drawn end to end all flowing in the same direction. It is all right to have the source line fold back and forth, bit the last point of one line should touch the first point of the next line. After you use Lathe to make the triangle element from your source guide line you should check the element with the display modes that show the normals direction. If the normals are not pointing to the exterior of the element, use the Hidden Revert Both command or the Hidden Correct and Hidden Revert commands to correct the normals direction and length. If the normals are too short, or too long, to see clearly you can use the Hidden Correct Set command to set the length of the normals to a size that can be viewed more easily relative to the size of your object element.
The display modes used by the main menu Preview command and the commands in the Hardcopy sub-menu have been expanded to allow for display and printing of hidden line elements. Which of these modes will look best depends of what kind of video board you have, what your elements are of, and what type of printer you will be using.
In order to print color drawings you can try to save the Preview screen as a color BMP file, and probably use the software that came with your scanner to output the drawing to your color printer. Color BMP files look best when saved from a VESA compatible SVGA video board that is able to work with my programs. Black and White drawings can be printed directly from DANCAD3D.COM (tm) using some of the same type of DANCAD3D.COM (tm) drivers as have been used with versions previous to v2.7. Or you can save Black and White drawings as BMP files, for printing or display with some other program, at high resolution by using the Files Save Industry BMP command.
When printing my CAD program does not usually fill in the background, since laser print out generally does not look good with the whole page black, rather the program tries to make the drawing look like a pen and ink drawing with or with out shading as you chose by the display mode. You should set the line width in your drawing elements to 3 or 5 using the round equal pen mode for your display or printing using hidden line display modes that show the element edges as outlines.
If you print a color BMP file saved from the Preview command the quality of the printout will depend on the program you are using, and your color printer. To put drawings on the internet, the BMP file might be able to be converted to JPG or GIF in the software that came with your scanner, but you should set the compressing to the least compression setting so that the drawing does not become fuzzy. It is best to print from the un- compressed BMP file, the compressed formats might be used for display on the internet to speed up the downloading of the graphic file.
The background color or shade of gray can be set from the SET-UP PALETTE command in the drawing editor, or by using the PALETTE macro command. At present the drawing editor, and the Preview default background color are set with the same value, color index 0. You can override the background color in the Preview command by loading a Pixel file as a background file. You can also load a background of any color in the current palette with the LOAD PIXEL macro command if you use the LOAD PIXEL command before the DISPLAY command, and after the GRAPH_MODE command. The command setting for the background file to load under the displayed lines in the Preview command is in the exit menu that pops up after the first time the screen draws, and you press [Esc].
The display modes and their operation may change since I have not finalized the display code, but here is a list of the perspective display modes that I was working on around when this page was last revised.
When drawing triangle elements for display in the shaded modes, the lighter colors for the elements, 7 and 9 through 15, will generally look better. You can use the Lines edit Line style command the drawing editor can be used to change the line color for a whole triangle element.
Mode 1 is the default display mode and can be used to display triangle elements or "free" line drawings. For line drawings Mode 1 works like it did in previous versions except that you can now change the background color. If the background color is not black, then when triangle elements are displayed the objects will stand out from the background when the faces are filled in with black. This is a simple mode for displaying triangle elements on the M2 palette modes, for display on the SVGA 256 palette mode color mode the other display modes such as 64 or 74 would probably look better.
Modes 2 & 3 are for checking that triangles are drawn correctly. Mode 2 lets you see the three sides of all of the triangles. Mode 3 lets you see the normal lines pointing out of the element. To set the length of the normal lines displayed use the Hidden Correct Set command in the drawing editor.
Modes 4 & 5 are for making silhouette traveling mats for special effects. For Mode 4 you need to set the background color index 0 to color value 15 before you display the triangle elements. For Mode 5 you need to set the background color index 0 to color value 0 before you display the triangle elements.
The modes in this table are for display on the video screen, see printing modes list below for printing drawings. Note that all of the display modes will display on any of the video boards or palettes, but the shaded display modes will look "grainy" on the M2, C4, M16, and C16 palette displays. If your video board does not support the M256 or C256 palettes the M16 palette might be acceptable for some applications involving shading.
You can compare the shading effects in the different palettes by using the video test pattern, command Files Utilities Video Pattern, and selecting different video board modes and resolutions.
The FILES UTILITIES VIDEO PATTERN command displays a test pattern for each of the various video modes and palette setting combinations. Only some of the many combinations will be available for display, and which ones you can see depend on what kind of video board you are using and what video mode board type you selected when you installed the program.
Which modes you can display is also limited my which modes your monitor can display properly, do not select modes that will cause your monitor to lose synchronization, a.k.a. lose sync..
The video test pattern can be useful in adjusting the brightness settings on your video monitor, since the brightness tends to change quite a bit when the monitor and video board switches from one resolution to another resolution.
If the video test pattern looks very dark or light on your monitor, and the front monitor brightness and contrast controls are all the way to their maximum, your monitor may require internal adjustments. Internal adjustments to your monitor should be done by qualified service personal only. The adjustment near the focus control can sometimes be used to adjust the overall brightness, but you should never open your monitor and make changes to such controls since changing the high voltage controls might alter the x-ray output of your monitor and might possibly cause or contribute to cancer, birth defects, and sterility.
|--------------------------------------------------------------------------------------------------------------------------| |mode . Tri fill color . Tri outline color . lines shown . notes | |--------------------------------------------------------------------------------------------------------------------------| | | | 1 . black . line color . edges . also works for line drawings | | 2 . black . line color . sides . to see triangles | | 3 . black . line color . sides + normals . to see normals | | 4 . black . none . none . use with a white background for mate | | 5 . white . none . none . use with a black background for mate | | 6 . random . none . none . use to see surface triangles | | | |[ 10 series modes do not sort triangles, for quick setup of perspective values ]------------------------------------------| | | | 10 . no fill . line color . forward edges . quick perspective adjustments, no sort | | 11 . no fill . line color . all edges . edge wire-frame, no sort | | 12 . no fill . line color . all sides . sides wire-frame, no sort | | 13 . no fill . line color . all sides + normals . normals wire-frame, no sort | | | |[ 20 series modes fill triangles with line color, for use with M16 or C16 palette modes ]---------------------------------| | | | 20 . line color . black . edges . for M16 or C16 with background other than black | | 21 . line color . linecolor . edges . for M2 to make traveling mats with outlines | | 22 . line color . white . edges . for M2, M16, or C16 with background other than white | | 23 . line color . xor line color . edges . for M2, M16, or M16 | | 24 . line color . none . none . for M2 to make traveling mats without outlines | | | |[ 30 series modes lambert shade by the whole triangle like lambert using triangle sort order ]----------------------------| | | | 30 . sort shade . black . edges . for M256 or C256 | | 31 . sort shade . line color . edges . " | | 32 . sort shade . white . edges . " | | 33 . sort shade . xor line color . edges . " | | 34 . sort shade . none . none . " | | | |[ 40 series modes lambert shade by the pixel, with automatic lambert settings ]-------------------------------------------| | | | 40 . AL shade . black . edges . for M256 or C256. Has uses in making tool path files. | | 41 . AL shade . line color . edges . " See the conversion from Pixel to | | 42 . AL shade . white . edges . " ASCII file command. | | 43 . AL shade . xor line color . edges . " | | 44 . AL shade . none . none . " | | | |[ 50 series modes lambert shade by the pixel, with manual lambert settings ]----------------------------------------------| | | | 50 . ML shade . black . edges . for M256 or C256. Has uses in making tool path files. | | 51 . ML shade . line color . edges . " See the conversion from Pixel to | | 52 . ML shade . white . edges . " ASCII file command. | | 53 . ML shade . xor line color . edges . " | | 54 . ML shade . none . none . " | | | |[ 60 series modes automatic lambert + light source shade by the pixel ]---------------------------------------------------| | | | 60 . AL + LS shade . black . edges . for M256 or C256. Good for display of still images. | | 61 . AL + LS shade . line color . edges . " Can be used with the M16 modes | | 62 . AL + LS shade . white . edges . " on the larger size SVGA images. | | 63 . AL + LS shade . xor line color . edges . " | | 64 . AL + LS shade . none . none . " | | | |[ 70 series modes manual lambert + light source shade by the pixel ]------------------------------------------------------| | | | 70 . ML + LS shade . black . edges . for M256 or C256. Good for animated display since | | 71 . ML + LS shade . line color . edges . " the lighting values are more stable | | 72 . ML + LS shade . white . edges . " than the 60 series modes. | | 73 . ML + LS shade . xor line color . edges . " | | 74 . ML + LS shade . none . none . " | | | |--------------------------------------------------------------------------------------------------------------------------|
The video board you are using limits the quality of the results you can get. Also even if you have an SVGA board that can display all modes up to 1600 by 1200 pixels or more, your video monitor may go out of sync on the higher resolution video modes. The codes to enter to select the various video modes are displayed by the main menu preview command, such as E640M16 for monochrome display on an EGA board with 640 by 350 pixels, or S1280C256 for 256 palette mode color display mode on SVGA board with 1280 by 1024 pixels resolution. Older video boards such as Monochrome graphics, or CGA should still work but will not look good with some display modes because of the lack of palette colors or resolution.
The video board type is selected from the small menu that comes up over the opening title screen, and that selection limits which of the various video modes you can select later with the main menu Preview command. If you select SVGA type board the VGA modes should also work, so modes starting with V and S could be selected, but not C H or E. Only select a video board type that matches what is in your computer.
You should check your video board manual to see which modes are supported, and then check that your monitor can display those video modes without going out of sync. Do not try to display modes other than Hercules (tm) (720 by 348 monochrome graphics mode) on a Hercules (tm) or monochrome graphics (720 by 348) board or monitor. Do not try to display Hercules (tm) on video boards that do not support that mode since the BIOS will probably not intervene, and problems or damage to your computer may result. Most video boards that work with a color monitor or display CGA, EGA, VGA, or SVGA modes, do not support the Hercules (tm) monochrome mode, so you should never select that mode when using those video boards.
Many of the display modes listed above are not meant to be used for the display of drawings normally, they are for special applications. You should probably just use the modes listed below most of the time for ordinary display of drawings and animations.
Select the best display mode for task, and your video board type:
Use mode 1 for line drawings on all board types.
Use mode 1 for palette M2 modes for triangle elements.
Use mode 10 for quick setup of the perspective values before hidden line display of the triangle elements. You will see some hidden lines, but it should give a general idea of the perspective view of the elements. Mode 10 is quicker since the triangles are not sorted.
Use mode 20, 22, or 23 for palette M16 or C16 modes for triangles. The solid color for the fill reduces the grainy appearance that the shaded fill modes can produce in the more limited palette color modes.
Use modes 44 or 54 with M256 for making a surface tool path from a Pixel file. Be careful that the lighting is adjusted so that all of the object is shaded, since parts in full darkness will not be visible in the conversion, and parts that are past full brightness will also "flat top."
Use mode 64 for palette M16, M256 or C256 single still drawings. M16 can be somewhat grainy in mode 64, but on the larger SVGA resolutions may be acceptable for some applications when your video board does not support the 256 palette modes and you want to make a large BMP file with shading.
Use mode 74 for palette M16, M256 or C256 animations and sequences, generally you should keep lambert values constant for all of the frames, be sure to assign the lighting variables before calling the macro DISPLAY command.
When displaying triangles with the modes that show the triangle edge outlines you should set the line width in the triangle elements to 3 or 5 with the round equal shape option. This reduces parts of the edge lines disappearing during the triangle fill when the elements are displayed at various angles.
Before using the macro DISPLAY command you need to set the lighting variables if you use the modes that need them, i.e. modes 64 or 74 and such. Use these variable names in the default current directory that the program is running in since these variable names are the ones that the program will look for for setting the lighting values.
LS0ZFAR_.VAR ; Point beyond the deepest part of the elements, neg normally. LS0ZNEAR.VAR ; Point nearer than the closest part of elements, pos normally. LS1XDEG_.VAR ; Sets x rotation of movable light source 1, normally left at 0. LS1YDEG_.VAR ; Sets y rotation of movable light source 1, normally +90 to -90. LS1ZDEG_.VAR ; Sets z rotation of movable light source 1, normally +90 to -90. LS0LAMB_.VAR ; Sets brightness of diffuse light source 0, normally 0.5 to 1.0. LS0REFL_.VAR ; Brightness of diffuse light 0's reflection, normally 0.5 to 1.0. LS1BRIG_.VAR ; Sets brightness of movable light source 1, normally 0.5 to 1.0. LS1REFL_.VAR ; Brightness of movable light 1's reflection, normally 0.5 to 1.0.
If you do not assign these variables and old ones are on your harddisk, the program will read the old values and you may get confused as to why the program is not using the default values, so be sure to assign these variables with the values you want immediately before you use the macro DISPLAY command.
Variables LS0ZFAR_.VAR and LS0ZNEAR.VAR are used by display mode series 50 and 70, but not series 40 and 60 because mode series 40 and 60 automatically find the near and far points for the elements in the workspace. When doing animation you do not normally want the far and near points for the diffuse lighting moving around as the elements move, so mode series 70 lets you fix those values. Display mode series 50 might be used to prepare a tool path through use of the Pixel to ASCII conversion, in such a case you would want to be able to use the far and near points for clipping of the tool height movement, e.g. brightness becomes z axis motion.
Here is some example macro code showing how these lighting variables might be used:
EXAMPLE: VERSION v2.7A
; Example macro code.
WYSIWYG 1 { Set "What You See Is What You Get" state }
PALETTE 1 0 4 { Set pallet color value for background }
GRAPH_MODE S1280C256 { Set SVGA color graphics mode }
{ lighting vars used by hidden line display preview mode 74 }
LET LS0ZFAR_.VAR = -7.75 { for DISPLAY }
LET LS0ZNEAR.VAR = +5.50 { for DISPLAY }
LET LS1XDEG_.VAR = 0 { for DISPLAY }
LET LS1YDEG_.VAR = -75 { for DISPLAY }
LET LS1ZDEG_.VAR = -45 { for DISPLAY }
LET LS0LAMB_.VAR = 0.85 { for DISPLAY }
LET LS0REFL_.VAR = 0.8 { for DISPLAY }
LET LS1BRIG_.VAR = 1 { for DISPLAY }
LET LS1REFL_.VAR = 1 { for DISPLAY }
# 1 DISPLAY -25 -30 0 -20 100 74 1.25 0 { Display element }
; End example macro code.
There are three ways to print hidden line drawings currently in v2.7:
Use the JET or DOT commands, since the JET or DOT commands use raster graphics the display modes used for displaying on the screen have similar effects in the Workspace and Add commands. There are some differences since the printer makes black on white paper I did not want the print out to have a solid black background, and the lines look better as thin black lines rather than white lines. The shading in the print out is darker in the areas darker on the video display. If you want a dark background you can use the usual commands from the JET and DOT menus to fill a page file before you add the hidden line elements on top of that page.
Since the PostScript (tm), HPGL/2 laser, and Pen Plotters, operating through my Plot command cannot display "erased" lines over drawn lines, a special command in the Hardcopy sub-menu is provided called "Ready" that uses the JET commands to make a JET page file with the hidden line elements displayed on it, you then use display mode 1 to print out the trace from that page file which has been created by raster to vector conversion. This overcomes problems resulting from the fact that the SAVE 2D, LASER, IMAGESETTER, and PLOT commands do not work with triangle elements or the display modes for triangle elements. To use the "Ready" command for printing, you select "Ready" enter the element number for the triangle element and use the hidden line display mode you want, such as 64, then "Ready" makes a new element for you that is made of only "free" line segments, you then select the SAVE 2D, LASER, IMAGESETTER, or PLOT command and enter the element number of the element "Ready" made for you, then you select display mode 1 for printing this new element. You should set the size of the image when you use the "Ready" command and do not re-size the element "Ready" makes since that element contains raster lines that will not look correct if enlarged, and the shading will get darker if reduced. Also the element "Ready" makes is 2D, so the only rotation used on printing it should be 0 or 90 degrees on the Z axis, the X and Y rotations should be set to 0, if you want the triangle element rotated, do that with the "Ready" command and not with the printing command later.
If you have a color printer it probably operates under Windows (tm), and most Windows (tm) graphics programs load BMP type graphics files. Since the main menu Preview command in DANCAD3D (tm) can save the SVGA screen in 8 bit color you might be able to save the Preview screen as a BMP file, then load that file into a Windows (tm) graphics program such as MSPAINT.EXE (tm), then use the Windows (tm) driver for your color printer to print the drawing out.
When printing triangle elements with the modes that show the triangle edge outlines you should set the line width in the triangle elements to 3 or 5 with the round equal line shape option. This reduces parts of the edge lines disappearing during the triangle fill when the elements are displayed at various angles.
Differences in the display modes for printing, particularly to the JET page files, or commands that use the JET page files as an intermediate, such as in the Hardcopy Ready command, are:
modes = 20, 30, 40, 50, 60, 70 The triangle line color is forced to be 1, i.e. black toner. modes = 21, 30, 41, 51, 61, 71 The triangle line color is 1, black toner, unless 0. modes = 22, 32, 42, 52, 62, 72 The triangle line color is forced to be 0, i.e. blank paper. modes = 23, 33, 43, 53, 63, 73 The triangle line color is 0 unless the line color is 0. modes = 24, 34, 44, 54, 64, 74 The triangle line color outline is not displayed (shading or fill only).
On the JET page or print out color 0 is the white paper, and color 1 is the black toner. The background color on the JET page is the blank paper (white) rather than the default black or gray background color as on the video screen. As was mentioned filling the paper with toner all over does not look good as a background, so the variations in the display modes for printing adjust the line and background colors to achieve a better combination. If you want the background filled in, you could use the commands in the JET series and make a black page file or one filled with a pattern and plot the triangle elements over that rather than a blank page file. You could also save the drawing as a BMP file, and print that with the graphics program of your choice.
If you use JET ADD to add to a JET page that was all set to 1's (black toner) the triangles filled with 0's will print as paper white on top of a black toner background. The Pixel backgrounds do not work on the JET page printout, but you can use the JET commands to shade the JET page before using JET ADD if you want a background other than plain paper.
The preferred modes for printing hidden line drawings using the JET WORKSPACE or JET ADD commands would be:
Mode 1 for blank "white" filled triangles with black edge outlines on blank background.
Modes 60 or 70 for shaded surfaces with black edge outlines on blank paper background.
Since the line color used in the triangles is used to find the triangle fill color in modes 60 and 70 you can adjust the darkness of the elements somewhat by picking different line colors for the elements, in addition to using the lighting adjustment values associated with modes 60 and 70.
Paper white triangle edge outlines on dark shaded triangles does not generally work very well because the thin white edge lines are hard to see. It is usually better to have dark triangle edge outlines and lightly shaded triangles on a light paper background.
The shading values are reversed so that the JET values for the "dark" shaded areas are set to mostly 1's and the "light" shaded areas are set to mostly 0's. Therefore if you adjust the lighting values to make the video display lighter, the printout will also be made lighter in the shaded parts of the triangles.
Although the display modes 64 and 74 are preferred for the SVGA display and saving the BMP files, the modes 60 and 70 generally look better for line art printout on a laser printer because the edge and junction triangle's edge outlines give a more definite delineation of the elements form.
Setting the line thickness in the triangle elements to 3 or more, with Round Equal line shape, can help make the outlines of the triangle's edges more bold on the printout so as to improve the outline of the surfaces, you can use the [L]ines edit [L]ine style command in the drawing editor or the LINETYPE macro command to change the line width and line shape in the triangle elements.
The brightness values displayed by the [J]et [V]iew command do not give an exact impression of the shading because the screen resolution is less than the printer and the pixels get merged in a way that alters small details such as the shading dots used in "line art" two color drawings. The toner darkness setting in the printer can also effect the shading darkness. If you are going to photocopy a printout the brightness of the shading will also change because the copier will lighten or darken small details such as the shading dots.
For printers and plotters other than the ones that work with the JET commands you may need to use the Hardcopy Ready command to make a "free" line rendering of the triangle elements before you can print the drawing. The Hardcopy Ready command uses the JET commands to create a new element that is a view of the elements made only of "free" line segments, rather than the triangle elements themselves and so that new element can be printed or plotted on any of the supported devices that would be used to print or plot line drawings. On pen plotters it might be best to omit the shading, by using display mode 1 with Hardcopy Ready, since the pen pecking at the paper so much might make holes in it.
Drawing elements made with the Hardcopy Ready command should not be enlarged or reduced since the raster lines may get spread apart and become visible, or the shading dots may get too close together and look darker, or too far apart and look lighter. The element made by Hardcopy Ready is normally meant to print at a scale of 240. Also you should not make a Hardcopy Ready type file with the 150 dpi JET driver and print it with the 300 dpi driver for the same sorts of reasons.
The Demo or sample *.MAC files that offer elements that display hidden line removal will look best on computers that have compatible VESA SVGA, although the un-shaded modes look all right on CGA and Monochrome Graphics. The shaded modes will look very "grainy" on CGA and Monochrome Graphics, or in the C16 modes, but on the EGA, VGA, and SVGA the M16 modes don't look too bad if you stand back a distance from the monitor.
If you do not have any display mode better than the 16 "color" modes, you can use the M16 modes and make several hundred pixel files of the same view, then display those pixel files in the ANIMATE command with the animation frame delay time set to 0, the grain will then blend together because of the persistence of vision. You could then make a time exposure on film from your monitor to get a more even smooth gray tone display. The same trick will help on animations if you make enough frames to display the animation at the maximum frame rate by setting the macro ANIMATION command delay value to 0. One of the pioneers of movie making wanted to show his movies at 60 frames per second, so this is not so new of an idea, that is the idea that the blending of several frames together by rapid display looks better than looking a a single still frame from the set.