How to generate section planes through Viewer API?
Like this screenshot:
某草草2017-06-26 11:00:18
Yes, you can set the cut plane through the viewer.setCutPlanes()
function, which accepts an array of THREE.Vector4
, which is an array of cut planes. Each THREE.Vector4
represents an advanced mathematical surface equation ax + by + cz + d = 0
. The normal direction of this surface equation is (a,b,c)
and is d from the origin of the coordinates.
Unit. In addition, Forge Viewer also uses (x, y, z)
of THREE.Vector4
to represent the normal direction of the surface (a, b, c)
, and w
represents the distance d
from 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 call viewer.setCutPlanes()
without passing in any parameters. After canceling, the house will return to its original state:
伊谢尔伦2017-06-26 11:00:18
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.