Since Total Annihilation came out last year, creative
commanders have been itching to make their own units.


Unfortunately, all the unit geometry is stored in 
.3do format... which reads like VCR instructions and
is incompatable with all publicly available modeling
programs.

Fortunately for us, Kinboat showed up and wrote
3do Builder. Builder makes 3do files by converting
geometry from the popular dxf format.

Unfortunately for us, dxf is a little -too- popular.
The fact is, dxf has grown and evolved over time, to
the point where there are many flavors of dxf to choose
from. Many programs can save dxf files; but claiming to 
reading dxf is like speaking chinese -- knowing one
dialect doesn't mean that you can understand the others.

And Builder is -very- picky. It wants its dxf files
to be set up just right -- luckily, builder wants less
information, not more, than most dxf flavors offer.
So preparing a dxf is just a matter of finding the
offensive data and removing it. You can do it by hand;
it's just boring and tedious.


Soap is a simple program (in modesty, a quick hack) to
clean up the dxf files so that Builder can read them.
Soap just tries to do what you would normally have to
do by hand; it runs through the file, removing junk info.

Here's what it does, specifically
> it opens the old DXF file
> opens/creates a file for export
> it writes these lines to the export file, 
  since they always seem to be the same:
"0
SECTION
2
ENTITIES
0"

> and then it runs down the rest of the import file,
  looking for the word 3DFACE.
> after copying that, it skips X number of lines,
  and copies until the next 3DFACE, & repeats.

> and then it tags an
"ENDSEC
0
EOF"
  on the export file, and closes.

The only thing that varies, is the X number of lines 
to delete per 3DFACE.
A standard, 4-point 3DFACE should have... 25 lines.
Now, in my case, Rhino was exporting 29 lines,
 so X = 29 - 25 = 4.
Most people (this means you) seem to find 8 lines of 
junk in their 3DFACEs.


This was still kinda tedious, because people often
use multiple dxf objects, and update them frequently
during the modeling process. With soap version 1,
you still had to run soap on each file, each time you
needed to clean up a new revision of the dxf.

version 1.3 has been modified to run batch cleaning.
the way this works, is you write a text file with the
following structure:

"<number of lines to delete per 3DFACE>

<first file to open>
<file to save as>

<second file to open>
<file to save as>
"

et cetera.
no brackets.
you can separate the file names with as many (or as few)
blank lines as you want, but the
"number of lines to delete"
always has to come on the first line of the file, and the
"file to save as"
line must always follow the "file to open" line directly.

an example batch.txt is included.

version 1.3 will also give you a list of statistics
on your dxf. For reference, most TA units have
50 to 100 polygons. The TA engine can render
thousands of polygons per second on a good system, but
the acceptable polygon limit per unit is largely determined
by the cost of the unit.
A unit which is likely to rush, should have a low polygon
count (because many are likely to be on-screen simultaneously)
A unit which is very expensive, or a static structure, can
afford more polygons, because it is less likely to occur
in large numbers on the screen at the same time.

Airfighters should be particularly polygon-conscious,
because they are not limited to exclusive space.
(aircraft can overlap in TA; thus, an unlimited number
may occur on the same screen at the same time)

If you have any questions, comments, or suggestions, 
visit TADD's forum at 

http://tadd.annihilated.org

and we'll see what we can do for ya!
-Rhadamanthus