My Photo

Search

DWF Links

May 2008

Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Downloads

  • Downloads

February 21, 2007

Version Compare: A simple polygon example

The Autodesk Design Review 2008: DWF Version Compare article provides an overview of how the new Version Compare feature works. The Version Compare: A simple polyline example article provides a simple example of how comparisons for polylines work. This article takes the same approach for polylines but does so for polygons.

For the polyline article I:

  1. Created a DWG file with 9 polylines.
  2. Published a DWF file containing the 9 polylines.
  3. Converted the DWF file to ASCII and saved it as the original DWF file.
  4. Made a copy of the ASCII DWF file, edited it with a Text Editor, and saved the copy as the modified DWF file.
  5. Compared the original DWF file to the modified DWF file and reported the results.

The purpose of the polyline test was to determine if tiny changes, with all other things being exactly equal, would be detected by the Version Compare feature. Except for color, a known limitation, they were. For this article, the purpose is to demonstrate how changes in AutoCAD affect Version Compare results in the published DWF files. An AutoCAD polygon is the geometric primitive being tested.

For the polygon case covered by this article, the approach is the basically the same as the polyline case with a few twists to make cover other aspects of Version Compare. So I:

  1. Created a DWG file with 11 polygons and saved it as dwf_compare_polygons1.dwg.
  2. Published a DWF file containing the 11 polygons as dwf_compare_polygon1-Layout1.dwf.
  3. Made a copy of dwf_compare_polygons1.dwg and saved it as dwf_compare_polygons2.dwg.
  4. Edited dwf_compare_polygons2.dwg to make the desired changes to 10 of the polygons - leaving one untouched.
  5. Published a DWF file containing the 11 polygons as dwf_compare_polygon2-Layout1.dwf.
  6. Combined dwf_compare_polygon1-Layout1.dwf and dwf_compare_polygon2-Layout1.dwf, renamed the sheets to revision1 and revision2, and saved the new DWF file as dwf_compare_polygon1.dwf.
  7. Used the compare dialog Options button



    to specify red for Additions and blue for Deletions. By default, just like what Autodesk Architecture does for DWG comparisons, Additions are green and deletions are red. I wanted to highlight the additions, so I selected red for my Additions color. In deference to those who are red/green color blind, I selected blue for my Deletions color.
  8. Compared the revision1 sheet to revision2 sheet using just the one DWF file. Now the first sheet contained the markups.
  9. Inserted the unmarked up original sheet from dwf_compare_polygon1-Layout1.dwf.
  10. Reordered and renamed the sheets to have revision1, revision2, and revision1 with markups.

The net effect of these steps is that unlike the polyline article where I compared two different DWF files, I compared two sheets in the same DWF file. This worked. I feared I might get some kind of sharing violation, since the DWF file was already open, but it was allowed. After renaming the sheets, I was left with one DWF file that contained three sheets: the first revision, the second revision, and the first revision with the markups generated by the Version Compare of the first two sheets.

Download dwf_compare_polygons.dwf (117.3K)

Now let's talk about the changes between the sheets:

  • No difference - This is the control group or baseline.
  • Vertex added - The 5 point polygon changed to a 6 point polygon by using grip edit to insert an additional vertex.
  • Vertex deleted - The 5 point polygon changed to a 4 point polygon by using grip edit to make one vertex coincident with another.
  • Vertex changed - The point at the apex of the polygon was lowered by using grip edit.
  • Edge color - The polygon was placed on a layer whose color was green.
  • Edge pattern - The polygon was placed on a layer whose line pattern was dashed space. This also required setting of a line type scale which was applied to both the original and modified DWG files. In addition, I added a small line near the polygon, so it was easy to see that the pattern for the layer had indeed been applied.
  • Edge weight - The polygon was moved to a layer whose line weight was noticeably thicker.
  • Face color - A SOLID hatch of green was applied to a polygon. A SOLID hatch of magenta had been applied to all of the polygons in the original DWG.
  • Hatch - The hatch was modified from ANSI31 to GRASS.
  • Gradient - The gradient pattern was modified from a circular pattern to one oriented about a center line.
  • Region - In the original, a region was formed using one of the polygons and a circle. A CORK hatch pattern was applied. For the modified DWG file, a HONEY pattern was applied.

Upon comparing the two sheets in the same DWF file:

The results were basically as expected:

  • No difference - This shows an unexpected difference. Software developer, Neil Wan, analyzed my sheets to determine that the polygon in question actually consists of one triangle and three trapezoids. There are small differences in some of this geometry (highlighted in red):
    In revision1:
       T 3 2147157453,286666
           2147156735,286144
           2147158171,286144
       T 4 2147155874,285519
           2147159032,285519
           2147156735,286144
           2147158171,286144
       T 4 2147155155,284997
           2147159751,284997
           2147155874,285519
           2147159032,285519
       T 4 2147127624,264994
           2147187282,264994
           2147155155,284997
           2147159751,284997
    In revision2:
       T 3 2147157453,286666
           2147156735,286144
           2147158171,286144
       T 4 2147154821,284754
           2147160085,284754
           2147156735,286144
           2147158171,286144
       T 4 2147139027,273279
           2147175879,273279
           2147154821,284754
           2147160085,284754
       T 4 2147127624,264994
           2147187282,264994
           2147139027,273279
           2147175879,273279
    This is an artifact of the publishing process. Version Compare is very precise in this regard.
  • Vertex added - The deformed area based on the additional vertex is highlighted as an addition (red).
  • Vertex deleted - The area removed by deleting the vertex is highlighted as a deletion (blue).
  • Vertex changed - By lowering the top vertex point, the original area is shown as deleted (blue) and the resulting area is shown as added (red).
  • Edge color - The edge color change from black to green is not detected. This will be included in a future release.
  • Edge pattern - The original solid edge appears as a deletion (blue). The dashed edge as well as the extra line appear as additions (red).
  • Edge weight - The wider edge appears as an addition (red). Through obscured by the wider red edge, the original edge appears as a deletion (blue). The blue edge can be brought to the forefront by selection the Deletions markup item.
  • Face color - The face color change from magenta to green is not detected. This will be part of a future release.
  • Hatch - The geometry from the ANSI31 pattern appears as a deletion (blue). The geometry for the GRASS pattern appears as an addition (red). As these patterns are sparse, the red and blue appear to mix in the polygon.
  • Gradient - The mixture of original and new gradient pattern occurs much like what happens for hatch.
  • Region - The hatch and gradient comparison for polygons apply equally to regions.

My work with polygons today reminds me of a line from a Todd Rundgren song called " Born to Synthesize":

Pyramids, spheres, and obelisks are the patterns of all creation
But the red polygon's only desire is to get to the blue triangle

Red is the lowest color in the spectrum. Blue is higher. A triangle is the most stable 2D polygonal shape. In short, the polygon wants to better itself. Now on what other CAD blog will you get rock 'n' roll trivia like that?

The Version Compare feature errs on the side of caution. It is better to identify a piece of geometry as changed, although it may not really have, instead of ignore a piece of geometry that really has changed. This should be taken into consideration when using the feature. Version Compare can't determine if the polygon has made it from red to blue, but it sure can tell when geometry becomes a triangle.

February 19, 2007

Version Compare: A simple polyline example

As mentioned in an earlier blog posting, Version Compare of Autodesk Design Review 2008 is very precise when it comes to comparing lines in a DWF file. It detects all of the changes except for line color. I decided to conduct a simple test.


  1. I created a DWF file with 9 polylines. I inserted text next to each line to describe what change I was going to make to each polyline. I used AutoCAD 2007 to create the original version of this file.
    Download dwf_compare_lines_original.dwf (3.8K)


  2. I made a copy of the original DWF file. I converted the DWF file to ASCII using the unpack utility, so I could make simple changes using a text editor. I modified the file:

    1. No difference - This is a control point or baseline. No changes were made.
    2. Point added - The 5 point polyline became a 6 point polyline with the addition of another point at the end.
    3. Point deleted - The 5 point polyline became a 4 point polyline with the removal of the point at the end.
    4. Point changed - The 5 point polyline remained a 5 point polyline but had the coordinates of its last point moved up and to the right.
    5. Color (not detected) - No changes were made to the points. Only the line color has changed from black to purple.
    6. Pattern - No changes were made to the points. Only the line pattern was changed from solid to dashed.
    7. End Cap - No changes were made to the points. Only the line end cap was changed from rounded to butt .
    8. Join - No changes were made to the points. Only the line join style was changed from rounded to miter .
    9. Weight - No changes were made to the points. Only the line weight was changed from 2488 DWF units to 3488 DWF units.

    Download dwf_compare_lines_modified.dwf (3.8K)
    Like the original, this too is an ASCII DWF file that can be examined using a text editor such as Notepad.
     

  3. While viewing the original DWF file, I invoked Version Compare from the Tools menu.


  4. The Version Compare dialog allowed me to pick the modified DWF file as my second DWF file. Once the file was selected, it showed me the list of sheets in this file. In this case, there was only one sheet. I selected that sheet. Note that the dialog does alert users that Warning: Not all drawing changes are included in Compare. For details, please search for "Compare" in the help file. We want users to be aware of the 3D, image, fill pattern, and color limitations.

    The compare dialog has an Options button where you can select colors.



    By default, just like what Autodesk Architecture does for DWG comparisons, Additions are green and deletions are red. For this example, I wanted to highlight the additions, so I selected red for my Additions color. In deference to those who are red/green color blind, I selected blue for my Deletions color.


  5. After clicking OK from the Version Compare dialog, Autodesk Design Review created two markup items for me. The Additions markup item shows what needs to the original DWF to make it match the modified DWF. The Deletions markup item shows what needs to be removed from the original DWF to make it match the modified DWF. As mentioned in the previous posting, the Version Compare feature cannot detect differences as changes. In this example, 8 of the 9 polylines changed. Version Compare detects 7 of these changes - all except color. So the 7 polylines show up once as added and again as deleted. You can see that the No changes and Color polylines are the only two that Version Compare identifies as unchanged.


  6. When an object changes by moving, the change is easy to see. It shows up once in red as added and again in blue as deleted. Due to the movement, these items can be seen side by side. In our case, we have the original black polyline, the added red polyline, and the deleted blue polyline all on top of each other. You can bring the added (red) polyline to the forefront by selecting the Additions markup item. For the line pattern change case, you can see the parts of the solid blue Deletions polyline in the spaces left by the dashed red Additions polyline. Autodesk Design Review also shows a lasso around the region that bounds the extent of the differences included in that markup.


  7. The same is true for deletions. You can bring the deleted (blue) polyline to the forefront by selecting the Deletions markup item. Autodesk Design Review shows a lasso around the region that bounds the extent of the differences included in that markup.

By applying pen styles in AutoCAD, most architectural drawings have a variety of line styles based on pattern and weight. These styles are applied as part of publishing a DWF file and appear in the DWF file. The Version Compare feature detects these differences to alert users as to what these changes represent such as what was once a gas line is now a sewer line. This type of electronic processing is another reason DWF goes beyond the paper.

February 15, 2007

Autodesk Design Review 2008: DWF Version Compare Feature Overview

DWF Version Compare is one of the new features of Autodesk Design Review 2008. It is available from the Tools->Compare menu item. When invoked, the user is allowed to select a second DWF file and then a sheet from that file. The Compare capability then compares the current sheet to the selected sheet. Two markups are produced by this process:

  1. Additions shows what geometry items would need to be added to the original sheet to make them appear the second sheet.
  2. Deletions shows what geometry items would need to be removed from the original sheet because they do not appear on the second sheet

Differences are identified as additions and deletions. So if a piece of geometry changes, it shows up once as added and again as deleted. This may change in the future. Right now we don't have the data to determine that a piece of geometry in one DWF corresponds to the same piece of geometry in another DWF. Recall that DWF is a published format. It would be like trying to map graphics primitives to PEN UP/PEN DOWN commands in an HPGL file. We will fix that in the future. Doing so requires coordination with our design applications that publish DWF files.

The Additions and Deletions items are added to the currently open DWF file as regular markup items. Anything you can do with markup items (e.g., delete), you can do with these items. Think of the comparison tool as something that compares two sheets and creates the markups for you. It's as if you did this yourself but don't have to do so manually. As markups, you can save the resulting DWF file, print it, email it, etc. and they can see the results of the comparison. I can see the emails now: What do you mean nothing changed - look at this!

The Version Compare feature is based on an algorithm that interrogates the geometry that appears in the DWF file. Have the points that make up the geometry changed? For example: Is this line now longer or shorter?, Does the line have a different pattern?, or Has the shape of this polygon changed?.

As this is an initial implementation of Version Compare, it is important that users understand what Compare what it will and will not do.

Known Limitations

  • Version Compare is limited to 2D sheets. It does not evaluate 3D models. We already have a prototype of 3D comparison working. This will be coming in a future release.

  • Version Compare does not compare image data. Version Compare is currently based on geometry, not pixels. So it does not detect the color changes of the tiny dots that comprise photographs and other images that appear in DWF files. This too will be coming in a future release.

  • Version Compare detects changes in polyline attributes except color. In other words, detection includes changes for pattern, end style, join style, and weight. For example, if a solid line changes to a dashed line, Version Compare detects this difference. Similarly, Version Compare detects a thin line that changes to a wide line. Version Compare does not detect when nothing changes about a line except its color. In practice, patterns are used more frequently than color. For example, if a line changes from representing a gas line to a sewer line, even if the only thing that changes is the line pattern, and Version Compare detects this change.

  • Version Compare does not detect changes in polygon attributes for fill color and in some cases fill pattern. For example, if a filled area changes color from green to red, Version Compare will not detect it. This can happen in facilities management applications where color changes are associated with changes in office themeing. This limitation does not apply to hatch or gradient patterns. For example, Version Compare detects an area of a backyard that changes from GRASS to GRAVEL where the only change is the hatch pattern. This is because the hatch pattern for GRASS results in geometry in the DWF file that is different from the hatch pattern for GRAVEL.

  • Version Compare identifies everything on sheets as being different for comparisons of sheets that are published at different scales. In other words, if you compare two sheets published at different scales, you'll get lots of differences. In most instances, everything will show up as added and deleted. This happens because the numbers that represent the geometry in the DWF are all different when a different scale is used.

  • Version Compare identifies everything on the sheets as being different for comparisons of sheets that are published at DPI values. This is the same situation as with different scales.

  • Version Compare compares underlying geometry in a DWF file. If an original DWF file has a line from (0,0) to (2,2) and a subsequent DWF file has two lines from (0,0) to (1,1) and (1,1) to (2,2), Version Compare will detect this difference although the display appears identical in the Autodesk Design Review. This is an artifact of the DWF publishing process and will be investigated in conjunction with future development of DWF publishing applications.

This information can be summarized in the following table.

DWF
GEOMETRY
ITEM
CHANGE MEANINGFULLY
HIGHLIGHTS
DIFFERENCES
ASSOCIATED
AutoCAD
COMMAND
3D MODEL anything PUBLISH (3D)
2D SHEET scale PUBLISH (2D)
DPI
POLYLINE POINTS ADDED LINE,
CONSTRUCTION LINE,
POLYLINE,
ARC,
REVISION CLOUD,
ELLIPTICAL ARC,
POINT
POINTS DELETED
POINTS CHANGED
LINE COLOR
LINE PATTERN
LINE END CAP
LINE JOIN
LINE WEIGHT
POLYGON VERTEXES ADDED CIRCLE,
ELLIPSE,
POLYGON,
RECTANGLE
VERTEXES DELETED
VERTEXES CHANGED
EDGE COLOR
EDGE PATTERN
EDGE WEIGHT
FACE COLOR
FACE PATTERN

HATCH,
GRADIENT,
REGION

IMAGE PIXEL COLORS INSERT -> Raster Image Reference
TEXT INSERTION POINT MULTILINE TEXT,
TABLE
TEXT STRING
FONT NAME
FONT SIZE

The ability to identify what has changed from one version of a design to another is critical. Doing this electronically with a process that identifies additions and deletions goes beyond what can be done by aligning and eyeballing sheets of paper. This process will improve over time with future releases of Autodesk Design Review.