javascript - Is there a way to generate section planes through API?
漂亮男人
漂亮男人 2017-06-26 10:58:18
0
2
677

How to generate section planes through Viewer API?

Like this screenshot:

漂亮男人
漂亮男人

reply all (2)
某草草

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.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!