facet_tools.html


Passive/Active Radar: Facet File Tools (Restricted Access)














Main



Links



Papers



Research



Project Only



UIUC Only

Here you will find a variety of MATLAB code for reading and writing
DEMACO-style facet files, converting other file formats to DEMACO facet
files, and calculating diagnostic information which is helpful in
making a facet file FISC compatible. You will also find instructions
on how to convert a CAD file in some format into a DEMACO facet file, and
rough instructions on tweaking a file which is almost FISC compatible to
making it truly FISC compatible.

MATLAB Code

Convering a CAD File into a DEMACO Facet File

Writing file format converters for various CAD file formats is a difficult
task. To ease the task, I created RAWTRI2FACET, a MATLAB function
which takes a “raw triangle” file and outputs a DEMACO facet file.


A raw triangle file contains lines of nine numbers each. Each line
corresponds to a different triangular facet. For each line,
the first three, second three, and last three numbers are the coordinates of
the first, second, and third vertex of that facet. Note that there is
a lot of redundancy in a raw triangle file.


Keith Rule’s
Crossroads
is a shareware program
by which runs on Windows machines
which can convert a large variety of CAD file formats into a raw triangle
file. When we get a new CAD model, I first use Crossroads to turn it
into a raw triangle file. I then run RAWTRI2FACET to create a facet file
from the raw triangle file.It would be much more efficient to write a
routine which directly translates a
particular CAD format into a DEMACO facet file, but, alas, I’m not that
well versed in CAD formats.


RAWTRI2FACET takes a brute-force approach to the problem and is
extremely slow. Essentially, it builds a table of vertices by going
through the coordinates in the input file. For each coordinate, it
searches through the table it has built so far to see if that coordinate
is already in the table. If it isn’t, it adds it to the end of the table.
Hence, as the algorithm works through the vertices in the input file,
it’s searching through an increasingly long table. As it is building up
the vertex coordinate table, it also creates a list of indices (a facet
list).


As it builds the table, it prints out the number of distinct vertices
it has accumulated so far, so it will give you the impression that it’s
actually doing something. As the table gets bigger, you will notice
that it takes longer and longer to print out the next number.

Making a Facet File FISC-Compatible

MATIS, Inc.
is developing a software product called
GeomFix which, if
it operates as advertised, will be able to take a rather messy CAD
model and produce a nice FISC-Compatible CAD model. It is not currently
commercially available. In the mean time, I’ve taken a brute-force
approach to fixing up CAD models.


As we’ll see below, it’s important to start with a CAD model which is at
least close to being FISC compatible, or else the task becomes too complex
too quickly. After trying out models from quite a few companies and
web sites, Viewpoint Digital
is the only source of such models that
I’ve found. We purchased a Falcon 100 from them which was FISC compatible
right out of the box. We also purchased a T-38A (catalog number
VP39544), an F-22 (VP1119), and a Cessna 402c
(the Cessna is actually available free!) which I was able to make FISC
compatible without too much hassle after using the SUPERCHECK routine
described below. We also
purchased an F-15 (VP1066); it has a lot more problems. I haven’t
started working
on it yet; I expect it will take me a while to make it FISC compatible.


For a file to be FISC compatible, every edge must appear exactly twice.
SUPERCHECK creates an internal representation of all the edges in a
file and counts the number of times each edge occurs. If an edge appears a
number of times that isn’t two, it will print out the vertices associated
with the edge, as well as the number of times the edge appears.
For instance, for the T-38A facet file I created using Crossroads and
RAWTRI2FACET from a model we purchased from
Viewpoint Digital,
the routine printed:



Edges not appearing twice:
2999 3000 1
2999 3001 1
3000 3004 1
3001 3004 1


This told me that the file was missing a couple of facets.


The routine then prints out all the triangles which contain the
offending edges. The triangles are printed out as four columns, with
the first three containing the vertices, as the last one containing
the facet number. Again for my T-38A file, the routine printed:



Facets containing offending edges:

2995 2999 3000 5795
3001 3003 3004 5798
2999 2293 3001 5870
3039 3000 3004 5877


After drawing some triangles on paper and scratching my head a bit,
I figured out what the two missing triangles were and added them to the
facet file by hand. The two missing triangles need to form a quadrilateral
to fill in the gap. Viewpoint Digital’s F-22 model exhibited a similar
gap which was also easily fixed. Note that SUPERCHECK doesn’t fix the file;
it only produces some information which may help you go into the file and
fix it by hand.


Alas, some files are not so simple. If I run SUPERCHECK on a facet file
created using Crossroads and RAWTRI2FACET from a Cessna 402c model demo
file available free from Viewpoint Digital, I get the following report:



Edges not appearing twice:
1036 1041 1 (A)
1036 3489 1 (B)
1041 3489 1 (C)
1363 1375 4 (D)
1420 1421 4 (E)



Facets containing offending edges:
1041 1036 1038 1210 (A)
1363 1360 1375 1780 (D)
1421 1419 1420 1848 (E)
1363 1375 1443 1888 (D) (gamma)

1421 1420 1444 1889 (E) (alpha)
1375 1363 1443 1904 (D) (epsilon)
1363 1375 1365 1914 (D)
1420 1421 1444 1928 (E) (beta)
1418 1421 1420 1929 (E)
1053 3489 1041 6733 (C)
3489 1033 1036 6735 (B)


What can we learn from this? To make things easier to explain, I’ve
labeled the edges with (A), (B), etc. tags. Drawing triangles on paper
illustrated that there was a missing triangle formed by the (A), (B),
and (C) edges which was easily added by hand. For the remaining triangles,
note that (gamma) and (epsilon) are duplicates, and that (alpha) and
(beta) are duplicates. (I’m afraid I don’t recall exactly what I did
at this point – I think I just concluded that (gamma), (alpha),
(epsilon), and (beta) were all rogue facets and deleted them and it
worked, but I can’t recall for sure.)


Anyway, as you can see, fixing up a facet file to make it FISC
compatible, when working by hand, is pretty tedious. If the report
is much more complicated than the report shown for the Cessna, I might
recommend just returning the model.


Note that this code is not very fast, so be prepared to wait a while.


The F-15 report produced by SUPERCHECK goes on for about a page. Hence,
it will be lot harder to make FISC compatible than the F-22, the T-38,
or the Cessna 402c.


– Aaron Lanterman, 8/21/00



Last updated 8/21/00. Send comments or questions to
lanterma@ifp.uiuc.edu.