simen-andresen
simen-andresen

Reputation: 2327

Change size of cutplanes tool in Forge Viewer

I'm using ForgeViewer to display both IFC models and custom geometry (point clouds and meshes using THREE.js directly), and I'm using the Section tool to cut away parts of the model.

Is there anyway I can set the size of the planes in the UI. I want the arrows and planes to be centered around specific models making them easier to use. Also, it would be nice to be able to set the default size and position of the cutting box.

here

here

Upvotes: 0

Views: 617

Answers (2)

michael beale
michael beale

Reputation: 1196

Adding to Petr's answer...

  1. Use the 'box section' tool (see screenshot) and manually adjust the box size by clicking on each of the box faces to adjust. enter image description here

  2. Then use Augusto's blog post (below) to programmatically capture (using viewer.getState();) and replay your box section (viewer.setCutPlanes(planes);).

https://forge.autodesk.com/blog/viewer-setcutplanes

Upvotes: 1

Petr Broz
Petr Broz

Reputation: 9909

The size of the cutting plane/box as well as the position of the manipulating gizmo are estimated by the section tool based on the bounding box of all visible objects. There's no UI to change that behavior, but you might be able to reverse engineer the official Section tool and perhaps modify it to your needs.

Edit: alternatively, you could retrieve the THREE.js geometry representing the cutting plane after it's been created by the Section tool (and placed into viewer.impl.sceneAfter) and customize it as needed.

Upvotes: 1

Related Questions