FIXDWG - Fix AutoCad® import rounding errors
AutoCad® allows import of drawings using DXF format (a text based graphics format). Normally this works well, with some tweaking, but a subtle problem may exist depending on the import file.
The PROBLEM
Drawings imported from other programs (usually by DXF) often have insufficient decimals to satisfy some AutoCad® requirements. If 2 lines, for example, are present, it is possible that - although the lines are drawn using only 3 discrete points - the two lines do not touch as intended. This rounding error is usually around 1x10-7 in drawings that come from certain programs which restrict the number of decimals output to DXF. Usually, the rounding error is not noticeable in lines, but almost always occurs in arcs.
The result of the problem is that some AutoCad® tools, PEDIT and boundary tools such as BPOLY (release 12) or BOUNDARY (later versions), fail, since the figure is considered to be an open rather than a closed figure. By experimentation, the threshold seems to be at 1x10E-10 as in the following data:
The PROPOSAL
The above method should guarantee that all (?) arcs and lines now touch, where expected. A further issue may be present where a line (usually, rather than an arc) touches another line or arc, but not at the end point, as in a T intersection. This issue may be addressed in any future versions of FIXDWG. The magic distance (perpendicular) of 1x10E-10 seems to hold true for this situation as well.
The FIXDWG routine does not use elevations (Z component)! The Z value for each entity's data should be preserved.
DOWNLOAD FIXDWG
Current version: 1.0 (August, 2005)
Download FIXDWG here, along with a brief help file (FIXDWG.TXT) explaining usage, etc.
| FIXDWG (protected lisp file, help file) | fixdwg.zip | (6,458 bytes) |
|
|
Back to SRS Home |