For those of you working with the DWF Toolkit, did you know that you can control the number of bits used to represent 3D (x,y,z) values in your DWF output? DWF Software Architect, Garrick Evans, notes that you can specify the number of bits for the 3D geometry as well as the lighting normals. Larger numbers improve the fidelity of the resulting DWF file but also moderately increase its file size.
DWFModel::enableNormalsCompression( nTotalNormalBits );
DWFModel::enableVertexCompression( nTotalVertexBits, nTotalParameterBits );
The files below are named “Vert-n Norm-m.dwf” where n is the number of total bits used for vertex coordinate quantization (e.g. 54 bits / 3 dimensions = 18 bits per dimension) and m is the total number of bits used vertex normal vector quantization. Fewer bits means more compression but also less data and thus less accuracy. The last file, [54-24], is what the DWF Toolkit publishes by default.
Vertex | Normal | File Size (bytes) | File Name |
---|---|---|---|
18 | 24 | 10,226 | Vert-18Norm-24.dwf |
24 | 24 | 11,461 | Vert-24Norm-24.dwf |
30 | 24 | 12,707 | Vert-30Norm-24.dwf |
36 | 12 | 12,549 | Vert-36Norm-12.dwf |
36 | 15 | 13,164 | Vert-36Norm-15.dwf |
36 | 18 | 13,771 | Vert-36Norm-18.dwf |
36 | 21 | 14,403 | Vert-36Norm-21.dwf |
36 | 24 | 15,121 | Vert-36Norm-24.dwf |
42 | 24 | 17,027 | Vert-42Norm-24.dwf |
45 | 12 | 15,470 | Vert-45Norm-12.dwf |
45 | 15 | 16,157 | Vert-45Norm-15.dwf |
45 | 18 | 16,810 | Vert-45Norm-18.dwf |
45 | 21 | 17,434 | Vert-45Norm-21.dwf |
45 | 24 | 18,125 | Vert-45Norm-24.dwf |
48 | 12 | 17,334 | Vert-48Norm-12.dwf |
48 | 15 | 18,025 | Vert-48Norm-15.dwf |
48 | 18 | 18,692 | Vert-48Norm-18.dwf |
48 | 21 | 19,344 | Vert-48Norm-21.dwf |
48 | 24 | 20,098 | Vert-48Norm-24.dwf |
54 | 12 | 19,373 | Vert-54Norm-12.dwf |
54 | 15 | 20,102 | Vert-54Norm-15.dwf |
54 | 18 | 20,773 | Vert-54Norm-18.dwf |
54 | 21 | 21,447 | Vert-54Norm-21.dwf |
54 | 24 | 22,212 | Vert-54Norm-24.dwf |
For this particular case, the two ends of the spectrum are:
The second image has smoother geometry and more precise specular highlights. DWF Toolkit users can balance fidelity versus file size trade-offs suited to their own applications. Powerful programming capabilities for selecting how to represent 3D design data is another way DWF goes beyond 2D paper.