com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class Mesh

  • All Implemented Interfaces:
    IMeshConvertible, java.lang.Iterable<int[]>


    public class Mesh
    extends Geometry
    implements java.lang.Iterable<int[]>, IMeshConvertible
    A mesh is made of many n-sided polygons.
    • Constructor Detail

      • Mesh

        public Mesh()
        Initializes a new instance of the Mesh class.
      • Mesh

        public Mesh(java.lang.String name)
        Initializes a new instance of the Mesh class.
        Parameters:
        name - Name.
    • Method Detail

      • getEdges

        public java.util.List<java.lang.Integer> getEdges()
        Gets edges of the Mesh. Edge is optional in mesh, so it can be empty.
      • getPolygonSize

        public int getPolygonSize(int index)
        Gets the vertex count of the specified polygon.
        Parameters:
        index - Index.
        Returns:
        The polygon size.
      • getPolygonCount

        public int getPolygonCount()
        Gets the count of polygons
      • getPolygons

        public java.util.List<int[]> getPolygons()
        Gets the polygons definition of the mesh
      • createPolygon

        public void createPolygon(int[] indices)
        Creates a new polygon with all vertices defined in indices. To create polygon vertex by vertex, please use PolygonBuilder.
        Parameters:
        indices - Array of the polygon indices, each index points to a control point that forms the polygon.
      • createPolygon

        public void createPolygon(int v1,
                                  int v2,
                                  int v3,
                                  int v4)
        Create a polygon with 4 vertices(quad)
        Parameters:
        v1 - Index of the first vertex
        v2 - Index of the second vertex
        v3 - Index of the third vertex
        v4 - Index of the fourth vertex
      • createPolygon

        public void createPolygon(int v1,
                                  int v2,
                                  int v3)
        Create a polygon with 3 vertices(triangle)
        Parameters:
        v1 - Index of the first vertex
        v2 - Index of the second vertex
        v3 - Index of the third vertex
      • toMesh

        public Mesh toMesh()
        Gets the Mesh instance from current entity.
        Specified by:
        toMesh in interface IMeshConvertible
        Returns:
        The mesh.
      • iterator

        public java.util.Iterator<int[]> iterator()
        Gets the enumerator for each inner polygons.
        Specified by:
        iterator in interface java.lang.Iterable<int[]>
        Returns:
        The enumerator.