Home > database >  How to get the mesh(vertex and index buffers) from the object I obtained from the method `getRenderP
How to get the mesh(vertex and index buffers) from the object I obtained from the method `getRenderP

Time:12-24

I want to obtain the mesh from the object I obtain from calling getRenderProxy method in node.js. This is my implementation, where I pass an ObjectID from the model tree:

function getMeshByDbID(dbID) {
var instanceTree = getInstanceTree();
var mesh = undefined;

instanceTree.enumNodeFragments(
  dbID,
  function (fragId) {
    mesh = window.NOP_VIEWER.impl.getRenderProxy(
      window.NOP_VIEWER.model,
      fragId
    );
  },
  true
);

return mesh;

}

I get an object, as shown below. getRenderProxy Output Object

But whenever I try to extract geometry(by calling mesh.geometry) from this object, I get undefined. The structure of geometry object within the above object is as follows: Geometry Object I want to get the mesh, specifically, the ib and vb arrays in the figure above for performing calculations. Any help is appreciated.

CodePudding user response:

Your approach looks good. You can take a look at this article where Philippe described how to do Boolean operations in the Forge Viewer.

  • Related