More from the AutoCAD Accuracy Universe and the Floating Point
Load ARX Files Automatically

DWF Precision Article by Brian Mathews of the DWF Team

dwfit_ball.gif

DWF precision

One of the advantages (to some customers at least, maybe not you) is the security offered by DWF because it has the same restrictions as physical paper.  Many users don't want people stealing their model data.  Let me explain:
 
When you take a measurement in AutoCAD from a DWG file you have a 64-bit double-precision floating point value that gives you extreme levels of precision and accuracy.  You also have lots of model intelligence.  For example an ADT door knows it is a door and the wall knows that it needs to have a hole to contain the door and that the framing inside the wall needs to adjust based on the position of the door.  The door and walls aren't just pictures made of lines, they are intelligent objects with cross-linked relationships.
 
With physical paper and a physical ruler we all know there are limitations to the precision and accuracy; we all know you only have are a bunch of dumb pixels (the model intelligence is gone).
 
The DWF files you have today are essentially electronic plots, generated from AutoCAD's (or another application's) plot engine.  As such many of the same limitations apply to DWF as to paper.  This is where the security comes in: since the DWF doesn't have the same precision and accuracy, and since the DWF geometry is tessellated (blocks and objects get exploded into their individual graphic strokes) it isn't easy to turn a DWF back into a DWG (just like it isn't easy to turn paper into a DWG).  Even if you did the work to change the paper or DWF back into a DWG you'd be missing lots of model intelligence.  Many customers feel that physical-paper is sufficiently secure and they want that same level of security with DWF.
 
So why are your measurements not 100% accurate/precise with DWF?
 
By default AutoCAD 2004 generates DWF files at 400 dots-per-inch on whatever virtual paper size you are plotting to.  If you plot to 8.5x11 inch paper, that means in the horizontal dimension there are only about 4,000 dots or coordinates that the DWF lines can terminate at.  This effectively limits the precision of any measurement.  If your drawing represents a 300 foot long building, and if that floor plan (after you account for margins) is filling about 66% of the width of the page, that means there are only 4,000 * .66 = 2,640 dots at which the lines can end at.  This means that our precision is the 300 feet / 2,640 dots = 0.1136 feet (or 1.36 inches).  Wow!  So if I use the default 400 DPI on small 8.5x11 paper I can only take measurements that are accurate to within about 1 inch!  This is much less precision than AutoCAD (which can measure features smaller than an atom!).  Also note that the DWF in this example is actually HIGHER precision than what you would be able to do with a ruler and physical paper.
 
So how do I improve the precision?
 
The analogy is the same for DWF as it is for paper.  With paper if the author wants consumers to be able to make better measurements what do you do?  You print to larger paper (or you buy an electron microscope)!  If I make my 300 foot building and print to E-sized paper rather than Letter-sized, the result is better precision both with physical paper and for DWF (since the DWF will be using the same 400 DPI times a lot more inches of virtual paper which means there are a lot more dots).
 
But what do I do if I want to allow higher precision without changing the paper size (since my printer only prints to a specific paper size, that is the size I have to use)?
 
With physical paper you don't have many options here.  You could get a higher resolution printer (1000 DPI rather than 300 DPI for example), but it is still hard to get additional precision when using a ruler and the human eye.  For the most part you have to go to a bigger paper size to get higher precision measurements with physical paper.
 
With DWF you can leave the paper size alone (at 8.5x11) and change the DPI setting (in the plot options custom-properties dialog).  You can set this DPI up to a much higher number (the DPI times the paper width must be less than 2^31 which is 2,147,483,648).  If you used the maximum precision of DWF (which is still a lot less than for a DWG which uses 2^48) you can get great precision in your measurements.  For example: for 8.5x11 paper we could set the DPI in AutoCAD 2004 to be 195,225,786 DPI (try that with your laser printer!).  In our example above if you crank the math out you'll find that you can measure your 300 foot building down to 0.000028 inches!!  When was the last time you needed a measurement accurate to one-10,000th of an inch??

Let’s also consider a GIS mapping example. DWF has a maximum precision of 2,147,483,648 total dots when you increase either your DWF DPI or your DWF paper size (or a combination of both). If we say the continental USA is about 3,000 miles wide at what precision can a DWF resolve a map of the USA? Well that’s just (3000 mi * 5280 ft/mi * 12 in/ft) / 2,147,483,648 = 0.089 inches. In other words when making a DWF that represents the entire continental USA we can resolve objects down to a precision that is about 2.3 millimeters in size! Not many people need precision that high! However, if you use the default AutoCAD DWF precision of 400 DPI on an E-sized sheet of paper you’d only be using 14,400 out of the available 2,147,483,648 DWF dots and thus you’d only be able measure the USA down to +/- 1,100 feet.


I increased my DPI value very high but my measurements still aren't perfect. Why?
 
The paper size and the DPI setting are only part of the story.  That determines the absolute maximum possible precision that is available.  However, other factors influence the precision of your measurements.  For example, when you measure between two line endpoints, where exactly are you measuring between?  Remember that lines have width and they have end-caps.  As such they have volume.  Since some types of geometry become tessellated in the DWF file and many types have volume, the auto-snap technology sometimes can't tell exactly what piece of tessellated geometry or which part of the volume you are wanting to measure from.  For the line case, are you measuring from the line endpoint or from the edge of the line-cap semi-circle that extends past the endpoint?  Also, the auto-snap technology in certain cases may depend on the resolution of your screen (the mouse can only point at a particular screen pixel) and there are very few pixels on a screen.  Furthermore, the DWF coordinates have to pass through multiple coordinate transforms.  Each transform introduces round-off errors and precision errors which accumulate. For most drawings these issues are so extremely small that you can ignore their effect.
 
Summary:

To get better measurement precision:

  • The author must intentionally enable you to receive the extra precision as part of the security concept.
  • The author can increase the size of the virtual DWF paper.
  • The author can increase the DPI setting of the DWF driver to use more pixels and precision.  Increasing DPI will increase the DWF file size, so you don't want to use a crazy DPI.
  • Plotting without line weights or other settings that lead to tessellation *may* improve the precision (but this depends on a complex set of variables and may not change the precision at all).

    DWF can measure the continental USA with a precision of +/- 2.4 millimeters when using the maximum DPI and paper size settings

    http://www.autodesk.com/dwfit

    Brian Mathews
     Autodesk, Inc.

  • Comments