Categories
3D

Autodesk Forge – Section hatches

Autodesk Forge has a nice feature known as section hatches. This feature fills out (or caps) parts of the model that is cut out by the section plane with a hatch pattern. You can see this in action below, when a z-plane cuts across the building:

The addition of hatches helps the viewer to see which parts of the model are cut out.

However, there is a problem with section hatches on some models, such as this:

The left part of the building is wrongly covered by the hatch and there are some weird triangulation problems on the right. This could happen when the meshes in the model is not 2-manifold.

Starting with Forge Viewer v7.35, there is a new option to turn off section hatches. It is located in the Configuration tab under Settings.

When you turn off section hatches, you still get the clipping, but without the potential artifacts:

You can also programmatically enable this behaviour by calling:

viewer.prefs.set(Autodesk.Viewing.Private.Prefs3D.DISPLAY_SECTION_HATCHES, false)

As a side benefit, performance is improved slightly with section hatching turned off.

If you are interested in the algorithms behind filling (or capping) of clipped mesh – though not necessarily the one implemented by Forge – you can refer to this and this.