PolygonModifier

PolygonModifier class

Utilities to modify polygons @hideconstructor

Methods

triangulate

NameDescription
triangulate(scene)Convert all polygon-based meshes into full triangle mesh

Parameters:

NameTypeDescription
sceneSceneThe scene to process

Result:


triangulate

NameDescription
triangulate(mesh)Convert a polygon-based mesh into full triangle mesh

Parameters:

NameTypeDescription
meshMeshThe original non-triangle mesh

Result: Mesh


mergeMesh

NameDescription
mergeMesh(scene)Convert a whole scene to a single transformed mesh Vertex elements like normal/texture coordinates are not supported yet

Parameters:

NameTypeDescription
sceneSceneThe scene to merge

Result: Mesh


mergeMesh

NameDescription
mergeMesh(node)Convert a whole node to a single transformed mesh Vertex elements like normal/texture coordinates are not supported yet

Parameters:

NameTypeDescription
nodeNodeThe node to merge

Result: Mesh


scale

NameDescription
scale(scene, scale)Scale all geometries(Scale the control points not the transformation matrix) in this scene

Parameters:

NameTypeDescription
sceneSceneThe scene to scale
scaleVector3The scale factor

Result: Mesh


scale

NameDescription
scale(node, scale)Scale all geometries(Scale the control points not the transformation matrix) in this node

Parameters:

NameTypeDescription
nodeNodeThe node to scale
scaleVector3The scale factor

Result: Mesh


generateNormal

NameDescription
generateNormal(mesh)Generate normal data from Mesh definition

Result: VertexElementNormal


generateUV

NameDescription
generateUV(mesh, normals)Generate UV data from the given input mesh and specified normal data.

Parameters:

NameTypeDescription
meshMeshThe input mesh
normalsVertexElementNormalThe normal data

Result: VertexElementUV


generateUV

NameDescription
generateUV(mesh)Generate UV data from the given input mesh

Parameters:

NameTypeDescription
meshMeshThe input mesh

Result: VertexElementUV


splitMesh

NameDescription
splitMesh(node, policy, createChildNodes, removeOldMesh)Split mesh into sub-meshes by VertexElementMaterial. Each sub-mesh will use only one material. Perform mesh splitting on a node

Parameters:

NameTypeDescription
nodNodenull
policySplitMeshPolicySplitMeshPolicy
createChildNodesbooleanCreate child nodes for each sub-mesh.
removeOldMeshbooleanRemove the old mesh after split, if this parameter is false, the old and new meshes will co-exists.

Result: VertexElementUV


splitMesh

NameDescription
splitMesh(scene, policy, 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:

NameTypeDescription
scenScenenull
policySplitMeshPolicySplitMeshPolicy
removeOldMesbooleannull

Result: VertexElementUV


splitMesh

NameDescription
splitMesh(mesh, policy)Split mesh into sub-meshes by VertexElementMaterial. Each sub-mesh will use only one material. The original mesh will not get changed.

Result: Mesh[]


buildTangentBinormal

NameDescription
buildTangentBinormal(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.

Result: Mesh[]


buildTangentBinormal

NameDescription
buildTangentBinormal(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.

Result: Mesh[]