{"id":1674,"date":"2021-01-29T14:28:09","date_gmt":"2021-01-29T06:28:09","guid":{"rendered":"https:\/\/tongwing.woon.sg\/blog\/?p=1674"},"modified":"2021-01-29T14:37:17","modified_gmt":"2021-01-29T06:37:17","slug":"autodesk-forge-section-hatches","status":"publish","type":"post","link":"https:\/\/tongwing.woon.sg\/blog\/autodesk-forge-section-hatches\/","title":{"rendered":"Autodesk Forge &#8211; Section hatches"},"content":{"rendered":"\n<p><a href=\"https:\/\/forge.autodesk.com\">Autodesk Forge<\/a> 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:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"503\" src=\"https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/0a-1024x503.png\" alt=\"\" class=\"wp-image-1675\" srcset=\"https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/0a-1024x503.png 1024w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/0a-300x147.png 300w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/0a-768x378.png 768w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/0a-1536x755.png 1536w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/0a-1200x590.png 1200w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/0a.png 1599w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The addition of hatches helps the viewer to see which parts of the model are cut out. <\/p>\n\n\n\n<p>However, there is a problem with section hatches on some models, such as this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"504\" src=\"https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/1-1024x504.png\" alt=\"\" class=\"wp-image-1676\" srcset=\"https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/1-1024x504.png 1024w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/1-300x148.png 300w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/1-768x378.png 768w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/1-1536x756.png 1536w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/1-1200x591.png 1200w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/1.png 1598w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>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. <\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"389\" height=\"652\" src=\"https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/3.png\" alt=\"\" class=\"wp-image-1677\" srcset=\"https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/3.png 389w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/3-179x300.png 179w\" sizes=\"(max-width: 389px) 100vw, 389px\" \/><\/figure><\/div>\n\n\n\n<p>When you turn off section hatches, you still get the clipping, but without the potential artifacts:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"505\" src=\"https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/2-1024x505.png\" alt=\"\" class=\"wp-image-1678\" srcset=\"https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/2-1024x505.png 1024w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/2-300x148.png 300w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/2-768x379.png 768w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/2-1536x758.png 1536w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/2-1200x592.png 1200w, https:\/\/tongwing.woon.sg\/blog\/wp-content\/uploads\/2021\/01\/2.png 1595w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can also programmatically enable this behaviour by calling:<\/p>\n\n\n\n<p class=\"has-small-font-size\"><code>viewer.prefs.set(Autodesk.Viewing.Private.Prefs3D.DISPLAY_SECTION_HATCHES, false)<\/code><\/p>\n\n\n\n<p>As a side benefit, performance is improved slightly with section hatching turned off.<\/p>\n\n\n\n<p>If you are interested in the algorithms behind filling (or capping) of clipped mesh &#8211; though not necessarily the one implemented by Forge &#8211; you can refer to <a href=\"https:\/\/www.scitepress.org\/papers\/2017\/60972\/60972.pdf\">this<\/a> and <a href=\"https:\/\/www.geometrictools.com\/Documentation\/ClipMesh.pdf\">this<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[36],"_links":{"self":[{"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/posts\/1674"}],"collection":[{"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/comments?post=1674"}],"version-history":[{"count":3,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/posts\/1674\/revisions"}],"predecessor-version":[{"id":1681,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/posts\/1674\/revisions\/1681"}],"wp:attachment":[{"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/media?parent=1674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/categories?post=1674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tongwing.woon.sg\/blog\/wp-json\/wp\/v2\/tags?post=1674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}