Mesh

Overview

Mesh is a class in Aspose.3D FOSS for Java. Inherits from: Geometry, Iterable<int[]>.

Mesh.Mesh creates an empty mesh instance.

Properties

NameTypeAccessDescription
polygonCountintReadProvides the current number of polygons
polygonsList<int[]>ReadProvides access to the list of polygon index arrays
edgesList<Integer>ReadProvides access to the list of mesh edge indices
manifoldbooleanRead

Methods

SignatureDescription
Mesh()Creates a mesh with the specified name
Mesh(name: String)
addControlPoint(x: double, y: double, z: double)Adds a 3D point (x,y,z) to the mesh’s control point list
addControlPoint(x: double, y: double, z: double, w: double)
createPolygon(indices: int[])Defines a polygon from a sub‑range of an index array
createPolygon(indices: int[], offset: int, length: int)
createPolygon(v1: int, v2: int, v3: int)
createPolygon(v1: int, v2: int, v3: int, v4: int)
getPolygonCount()intReturns the total number of polygons in the mesh
getPolygonSize(index: int)intReturns the number of vertices of the polygon at the given index
getPolygons()List<int[]>Returns a list of index arrays, each representing a polygon
getEdges()List<Integer>Returns a list of edge vertex indices
isManifold()booleanIndicates whether the mesh is manifold
iterator()Iterator<int[]>Provides an iterator over polygon index arrays
toMesh()MeshReturns a copy of this mesh as a Mesh object
clone()MeshCreates a deep copy of the mesh
triangulate()MeshConverts all polygons to triangles and returns the resulting mesh
optimize(removeVertices: boolean)MeshReduces mesh complexity with tolerance, threshold, and angle threshold for smoothing
optimize(removeVertices: boolean, tolerance: float)Mesh
optimize(removeVertices: boolean, tolerance: float, threshold: float)Mesh
optimize(removeVertices: boolean, tolerance: float, threshold: float, angleThreshold: float)Mesh
optimize2(removeVertices: boolean)MeshPerforms an alternative optimization, optionally removing vertices
union(a: Mesh, b: Mesh)MeshReturns a new mesh representing the union of two meshes
difference(a: Mesh, b: Mesh)MeshReturns a new mesh representing the subtraction of the second mesh from the first
intersect(a: Mesh, b: Mesh)Mesh
doBoolean(operation: BooleanOperation, a: Mesh, ma: Matrix4, b: Mesh, mb: Matrix4)MeshPerforms the specified Boolean operation on two meshes with given transforms