在网格中创建多边形
Contents
[
Hide
]
19.8或更高版本支持此功能。
在网格中创建多边形
Aspose.3D for .NET 允许在网格中创建多边形。为了使用该功能,API 提供了 Mesh
类的 CreatePolygon
方法。使用CreatePolygon方法,您可以创建优化的 三角形 或 四边形 多边形,而无需分配额外的内存。下面的代码段演示如何使用此功能。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-3d/Aspose.3D-for-.NET | |
Mesh mesh = new Mesh(); | |
mesh.CreatePolygon(new int[] { 0, 1, 2 }); //The old CreatePolygon needs to create a temporary array for holding the face indices | |
mesh.CreatePolygon(0, 1, 2); //The new overloads doesn't need extra allocation, and it's optimized internally. | |
//Or You can create a polygon using 4 vertices(quad) | |
//mesh.CreatePolygon(0, 1, 2, 3); |