Mesh

Overview

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

Mesh.Mesh creates an empty mesh with default name.

This class provides 18 methods for working with Mesh objects in Java programs. Available methods include: Mesh, addControlPoint, clone, createPolygon, difference, doBoolean, getEdges, getPolygonCount, getPolygonSize, getPolygons, intersect, isManifold, and 6 additional methods. All exported members are accessible to any Java application after installing the Aspose.3D FOSS for Java package. Properties: edges, manifold, polygonCount, polygons.

Description

Mesh is a class in the Aspose.3D FOSS library for Java that exposes 54 methods and 19 properties for programmatic use. It extends Geometry and implements Iterable<int[]>, inheriting shared functionality from its parent type.

Core capabilities include: list<int[]>; list<integer>; boolean. These operations enable developers to integrate mesh functionality directly into Java applications.

The class also provides the polygonCount property (gets the polygon count), the polygons property (gets the polygons), the edges property (gets the edges).

The class offers 6 constructor overloads, allowing flexible initialization depending on the calling context.

Properties

NameTypeAccessDescription
polygonCountintReadGets the polygon count.
polygonsList<int[]>ReadGets the polygons.
edgesList<Integer>ReadGets the edges.
manifoldbooleanReadGets the manifold.

Methods

SignatureDescription
Mesh()Creates an empty mesh with default name
Mesh(name: String)
addControlPoint(x: double, y: double, z: double)Adds a weighted 4D control point
addControlPoint(x: double, y: double, z: double, w: double)
createPolygon(indices: int[])Creates a quadrilateral polygon from four vertex indices
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 polygon count.
getPolygonSize(index: int)intReturns the number of vertices of the polygon at the given index
getPolygons()List<int[]>Returns the polygons.
getEdges()List<Integer>Returns the edges.
isManifold()booleanReturns true if manifold is set.
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 new mesh
optimize(removeVertices: boolean)MeshSimplifies geometry considering tolerance, threshold, and angle deviation
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 on the mesh
union(a: Mesh, b: Mesh)MeshReturns a mesh representing the union of two meshes
difference(a: Mesh, b: Mesh)Mesh
intersect(a: Mesh, b: Mesh)Mesh
doBoolean(operation: BooleanOperation, a: Mesh, ma: Matrix4, b: Mesh, mb: Matrix4)MeshPerforms the specified Boolean operation on two transformed meshes

See Also