Erstellen Sie Polygon in der Masche

Erstellen Sie Polygon in der Masche

Aspose.3D for .NET ermöglicht das Erstellen eines Polygons in einem Netz. Um die Funktional ität nutzen zu können, bietet die API die CreatePolygon-Methode der Mesh-Klasse. Mit der CreatePolygon-Methode können Sie ein optimiertes Dreieck-oder Quad-Polygon erstellen, ohne zusätzlichen Speicher zuzuweisen. Das folgende Code-Snippet zeigt, wie diese Funktional ität verwendet wird.

// 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);