Mesh — Aspose.3D FOSS for .NET

Namensraum: Aspose.ThreeD.Entities (Aspose.3D.Converter 1.0.0)

Mesh speichert Polygongeometrie als eine Liste von Kontrollpunkten (vertex positions) und eine Liste von Polygonflächen. Jede Polygonfläche ist eine Liste von nullbasierten Indizes in das Kontrollpunkte‑Array. Zusätzliche per-vertex Daten – normals, UV coordinates, vertex colours – wird angehängt als VertexElement Schichten.

public class Mesh : Geometry

Methods

A3DObjectSceneObjectEntityGeometryMesh


Methods

Erstelle ein einzelnes Dreiecks‑Mesh von Grund auf:

using Aspose.ThreeD;
using Aspose.ThreeD.Entities;

// Create the mesh and add three vertex positions
var mesh = new Mesh();
mesh.ControlPoints.Add(new Vector4(0.0, 0.0, 0.0, 1.0));   // vertex 0
mesh.ControlPoints.Add(new Vector4(1.0, 0.0, 0.0, 1.0));   // vertex 1
mesh.ControlPoints.Add(new Vector4(0.5, 1.0, 0.0, 1.0));   // vertex 2

// Define one triangle face using vertex indices
mesh.CreatePolygon(0, 1, 2);

// Attach to a scene and save
var scene = new Scene();
scene.RootNode.CreateChildNode("triangle", mesh);
scene.Save("triangle.stl");

Aus einem Primitive erstellen und inspizieren:

var sphere = new Sphere(1);
var mesh = sphere.ToMesh();

Console.WriteLine("Vertices: " + mesh.ControlPoints.Count);
Console.WriteLine("Polygons: " + mesh.PolygonCount);

Methods

MethodsMethodsMethodsMethods
ControlPointsList<Vector4>bekommenVertex-Positionen in homogenen Koordinaten
PolygonCountintgetAnzahl der Polygonflächen
Namestringget/setName der Mesh-Entität

Methods

MethodsRückgabetypMethods
CreatePolygon(params int[] indices)voidErstellt eine Polygonfläche aus Kontrollpunkt‑Indizes

Siehe auch

 Deutsch