How to create a cutting box?

How to create a cutting box?It is not very similar to clippingBox.See the link below for the effect

At least from the link it does seem similar to the behavior of the clipping box class you can find here:

1 Like

But the ClippingBox Class works with the ScaleHandles operator is change the size of the model.You can move the cutting plane of the cutting box in demo in the link.It is more like cutting the model than changing the size of the model.It’s more like use six cutting planes to create a cutting box.

Actually, I think you are misunderstanding how the scale handles interact with the clipbox. If you load the arboleda sample model into the standard webviewer you can run the code below in the console to create a clipbox with scale handles attached.(make sure you have included ScaleHandles.js, ClippingBox.js as well as ViewerUtility.js):

myScaleHandles = new ScaleHandles(hwv);
let id = hwv.operatorManager.registerCustomOperator(myScaleHandles);
hwv.operatorManager.push(id);

myClippingBox = new ClippingBox(hwv);

    
myScaleHandles.registerEventReceiver(function (nodeid) {
    myClippingBox.scaleEvent(nodeid);               
});


await myClippingBox.createFromNodes([6958]);  //Nodeid for kitchen on floor 4
myScaleHandles.show(myClippingBox.getNode());

I hope that makes things more clear.

clipbox

It’s true that I didn’t understand how the scale handles interact with the clipbox before. I’m very sorry for the trouble, thank you for your patience

2 Likes