Package com.aspose.threed
Class Mesh
- java.lang.Object
-
- All Implemented Interfaces:
IMeshConvertible
,INamedObject
,java.lang.Iterable<int[]>
public class Mesh extends Geometry implements java.lang.Iterable<int[]>, IMeshConvertible
A mesh is made of many n-sided polygons.
-
-
Field Summary
-
Fields inherited from class com.aspose.threed.A3DObject
name, properties
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mesh
clone()
void
createPolygon(int[] indices)
Creates a new polygon with all vertices defined inindices
.void
createPolygon(int[] indices, int offset, int length)
Creates a new polygon with all vertices defined inindices
.void
createPolygon(int v1, int v2, int v3)
Create a polygon with 3 vertices(triangle)void
createPolygon(int v1, int v2, int v3, int v4)
Create a polygon with 4 vertices(quad)java.util.List<java.lang.Integer>
getEdges()
Gets edges of the Mesh.int
getPolygonCount()
Gets the count of polygonsjava.util.List<int[]>
getPolygons()
Gets the polygons definition of the meshint
getPolygonSize(int index)
Gets the vertex count of the specified polygon.java.util.Iterator<int[]>
iterator()
Gets the enumerator for each inner polygons.Mesh
toMesh()
Gets the Mesh instance from current entity.-
Methods inherited from class com.aspose.threed.Geometry
addElement, createElement, createElement, createElementUV, createElementUV, getCastShadows, getControlPoints, getDeformers, getDeformers2, getElement, getReceiveShadows, getVertexElementOfUV, getVertexElements, getVisible, setCastShadows, setReceiveShadows, setVisible
-
Methods inherited from class com.aspose.threed.Entity
getBoundingBox, getEntityRendererKey, getExcluded, getParentNode, getParentNodes, setExcluded, setParentNode
-
Methods inherited from class com.aspose.threed.SceneObject
getScene
-
Methods inherited from class com.aspose.threed.A3DObject
findProperty, getName, getProperties, getProperty, removeProperty, removeProperty, setName, setProperty
-
-
-
-
Method Detail
-
clone
public Mesh clone()
- Overrides:
clone
in classjava.lang.Object
-
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, int offset, int length)
Creates a new polygon with all vertices defined inindices
. To create polygon vertex by vertex, please usePolygonBuilder
.- Parameters:
indices
- Array of the polygon indices, each index points to a control point that forms the polygon.offset
- The offset of the first polygon indexlength
- The length of the indices
-
createPolygon
public void createPolygon(int[] indices)
Creates a new polygon with all vertices defined inindices
. To create polygon vertex by vertex, please usePolygonBuilder
.- 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 vertexv2
- Index of the second vertexv3
- Index of the third vertexv4
- 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 vertexv2
- Index of the second vertexv3
- Index of the third vertex
-
toMesh
public Mesh toMesh()
Gets the Mesh instance from current entity.- Specified by:
toMesh
in interfaceIMeshConvertible
- Returns:
- The mesh.
-
iterator
public java.util.Iterator<int[]> iterator()
Gets the enumerator for each inner polygons.- Specified by:
iterator
in interfacejava.lang.Iterable<int[]>
- Returns:
- The enumerator.
-
-