com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class PolygonModifier



  • public class PolygonModifier
    extends Object
    Utilities to modify polygons
    • Method Detail

      • triangulate

        public static void triangulate(Scene scene)
        Convert all polygon-based meshes into full triangle mesh
        Parameters:
        scene - The scene to process
      • triangulate

        public static Mesh triangulate(Mesh mesh)
        Convert a polygon-based mesh into full triangle mesh
        Parameters:
        mesh - The original non-triangle mesh
        Returns:
        The generated new triangle mesh
      • triangulate

        public static int[][] triangulate(List<Vector4> controlPoints,
                                          List<int[]> polygons,
                                          boolean generateNormals,
                                          Vector3[][] nor_out)
        Convert a polygon-based mesh into full triangle mesh
        Parameters:
        controlPoints - Control points of the mesh
        polygons - Polygon faces
        generateNormals - Generate normals
        nor_out - Generated Per-control point normal
        Returns:
        A set of triangles
      • triangulate

        public static int[][] triangulate(List<Vector4> controlPoints,
                                          List<int[]> polygons)
        Convert a polygon-based mesh into triangles
        Parameters:
        controlPoints - Control points of the mesh
        polygons - Polygon faces
        Returns:
        A set of triangles
      • triangulate

        public static int[][] triangulate(List<Vector4> controlPoints,
                                          int[] polygon)
        Convert a polygon into triangles
        Parameters:
        controlPoints - Control points of the mesh
        polygon - Polygon face
        Returns:
        A set of triangles
      • triangulate

        public static int[][] triangulate(List<Vector4> controlPoints)
        Convert a polygon into triangles, the order of the polygon is defined by the controlPoints
        Parameters:
        controlPoints - Control points of the mesh
        Returns:
        A set of triangles
      • mergeMesh

        public static Mesh mergeMesh(Scene scene)
        Convert a whole scene to a single transformed mesh Vertex elements like normal/texture coordinates are not supported yet
        Parameters:
        scene - The scene to merge
        Returns:
        The merged mesh
      • mergeMesh

        public static Mesh mergeMesh(List<Node> nodes)
        Convert a whole node to a single transformed mesh Vertex elements like normal/texture coordinates are not supported yet
        Parameters:
        nodes - The nodes to merge
        Returns:
        Merged mesh
      • mergeMesh

        public static Mesh mergeMesh(Node node)
        Convert a whole node to a single transformed mesh Vertex elements like normal/texture coordinates are not supported yet
        Parameters:
        node - The node to merge
        Returns:
        Merged mesh
      • scale

        public static Scene scale(Scene scene,
                                  Vector3 scale)
        Scale all geometries(Scale the control points not the transformation matrix) in this scene
        Parameters:
        scene - The scene to scale
        scale - The scale factor
      • scale

        public static void scale(Node node,
                                 Vector3 scale)
        Scale all geometries(Scale the control points not the transformation matrix) in this node
        Parameters:
        node - The node to scale
        scale - The scale factor
      • generateNormal

        public static VertexElementNormal generateNormal(Mesh mesh)
        Generate normal data from Mesh definition
      • splitMesh

        public static void splitMesh(Node node,
                                     SplitMeshPolicy policy,
                                     boolean createChildNodes,
                                     boolean removeOldMesh)
        Split mesh into sub-meshes by VertexElementMaterial. Each sub-mesh will use only one material. Perform mesh splitting on a node
        Parameters:
        node -
        policy -
        createChildNodes - Create child nodes for each sub-mesh.
        removeOldMesh - Remove the old mesh after splitted, if this parameter is false, the old and new meshes will co-exists.
      • splitMesh

        public static void splitMesh(Node node,
                                     SplitMeshPolicy policy)
        Split mesh into sub-meshes by VertexElementMaterial. Each sub-mesh will use only one material. Perform mesh splitting on a node
        Parameters:
        node -
        policy -
      • splitMesh

        public static void splitMesh(Node node,
                                     SplitMeshPolicy policy,
                                     boolean createChildNodes)
        Split mesh into sub-meshes by VertexElementMaterial. Each sub-mesh will use only one material. Perform mesh splitting on a node
        Parameters:
        node -
        policy -
        createChildNodes - Create child nodes for each sub-mesh.
      • splitMesh

        public static void splitMesh(Scene scene,
                                     SplitMeshPolicy policy,
                                     boolean removeOldMesh)
        Split mesh into sub-meshes by VertexElementMaterial. Each sub-mesh will use only one material. Perform mesh splitting on all nodes of the scene.
        Parameters:
        scene -
        policy -
        removeOldMesh -
      • splitMesh

        public static void splitMesh(Scene scene,
                                     SplitMeshPolicy policy)
        Split mesh into sub-meshes by VertexElementMaterial. Each sub-mesh will use only one material. Perform mesh splitting on all nodes of the scene.
        Parameters:
        scene -
        policy -
      • buildTangentBinormal

        public static void buildTangentBinormal(Scene scene)
        This will create tangent and binormal on all meshes of the scene Normal is required, if normal is not existing on the mesh, it will also create the normal data from position. UV is also required, the mesh will be ignored if no UV is defined.
      • buildTangentBinormal

        public static void buildTangentBinormal(Mesh mesh)
        This will create tangent and binormal on the mesh Normal is required, if normal is not existing on the mesh, it will also create the normal data from position. UV is also required, an exception will be raised if no UV found.