Yes, you can set the cut plane through theviewer.setCutPlanes()function, which accepts an array ofTHREE.Vector4, which is an array of cut planes. EachTHREE.Vector4represents an advanced mathematical surface equationax + by + cz + d = 0. The normal direction of this surface equation is(a,b,c)and isd from the origin of the coordinates.Unit. In addition, Forge Viewer also uses(x, y, z)ofTHREE.Vector4to represent the normal direction of the surface(a, b, c), andwrepresents the distancedfrom the origin. The calling example is as follows:
var cutplanes = [ new THREE.Vector4( 0, 0, -1, -17 ), new THREE.Vector4( 0, 0, 1, 0 ), ]; veiwer.setCutPlanes( cutplanes );
Screenshot of results:
If you want to cancel the cutting, just callviewer.setCutPlanes()without passing in any parameters. After canceling, the house will return to its original state:
Hello Kang Gong, I am Xiao Zhao. I have asked you about your reputation in Shanghai. Now I would like to ask you whether the displayed part can be selected by default after the model is cut (triggering the that.viewer.getSelection() event). I am just getting started with forge, and this problem has been bothering me for a while.
Yes, you can set the cut plane through the
viewer.setCutPlanes()
function, which accepts an array ofTHREE.Vector4
, which is an array of cut planes. EachTHREE.Vector4
represents an advanced mathematical surface equationax + by + cz + d = 0
. The normal direction of this surface equation is(a,b,c)
and isd from the origin of the coordinates.
Unit. In addition, Forge Viewer also uses(x, y, z)
ofTHREE.Vector4
to represent the normal direction of the surface(a, b, c)
, andw
represents the distanced
from the origin. The calling example is as follows:Screenshot of results:
If you want to cancel the cutting, just call
viewer.setCutPlanes()
without passing in any parameters. After canceling, the house will return to its original state:Hello Kang Gong, I am Xiao Zhao. I have asked you about your reputation in Shanghai. Now I would like to ask you whether the displayed part can be selected by default after the model is cut (triggering the that.viewer.getSelection() event). I am just getting started with forge, and this problem has been bothering me for a while.