Create Polygon In Mesh

Create Polygon In Mesh

Aspose.3D for Node.js via Java allows creating a polygon in a mesh. In order to use the functionality, the API offers createPolygon method of Mesh class. Using CreatePolygon method you can create an optimized Triangle or Quad polygon without allocating extra memory. The following code snippet shows how to use this functionality. 

var aspose = aspose || {};

aspose.threed = require("aspose.threed");

// Initialize Mesh
var mesh = new aspose.threed.Mesh();

//The old CreatePolygon needs to create a temporary array for holding the face indices
//The new overloads doesn't need extra allocation, and it's optimized internally.
mesh.createPolygon(0, 1, 2);

//Or You can create a polygon using 4 vertices(quad)
//mesh.createPolygon(0, 1, 2, 3);