Warm tip: This article is reproduced from serverfault.com, please click

crop particular room/area from the forge viewer

发布于 2020-12-02 07:23:11

We are using forge viewer(v7) in our web application.

Our requirement is to crop particular room/area from the forge viewer. For example, if we have shown a house model in the forge viewer then if a user select a kitchen(from menu or navbar) then the viewer should show only kitchen area (including all its objects like cabinets, burner, fridge, sink etc.) and all other objects/sections should be hidden. Similarly for bedrooms, baths etc. It will be just for viewing purpose at run time and not for any automation.

Does any help that how can we achieve this?

Questioner
Raman
Viewed
0
Adam Nagy 2020-12-02 23:08:25

You could use the SectionExtension - mentioned here: Create a section plane leaning against one object

Documented here: https://forge.autodesk.com/en/docs/viewer/v7/reference/Extensions/SectionExtension/

This also has a function called setSectionBox(box) which might be best for what you want. If you can figure out the extents of the room then you could pass those values to it.

Here is a blog post on getting room related information extracted to SVF: https://forge.autodesk.com/blog/new-rvt-svf-model-derivative-parameter-generates-additional-content-including-rooms-and-spaces

The other option would be to find all the objects inside the given room and hide everything else. If there is a property for each object that specifies which room they are in, then you could do it based on that using Viewer.search()