Создать многоугольник в сетке
Contents
[
Hide
]
Эта функция поддерживается версией 19,8 или выше.
Создать многоугольник в сетке
Aspose.3D for .NET позволяет создать многоугольник в сетке. Чтобы использовать эту функциональность, API предлагает метод CreatePolygon
класса Mesh
. Используя метод CreatePolygon, вы можете создать оптимизированный полигон Треугольник или Квад без выделения дополнительной памяти. Следующий фрагмент кода показывает, как использовать эту функциональность.
This file contains 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); |