optimize method

optimize

Optimize the mesh’s memory usage by eliminating duplicated control points

Returns

New mesh instance with compact memory usage

def optimize(self, vertex_elements):
    ...
ParameterTypeDescription
vertex_elementsboolOptimize duplicated vertex element data

Example

The following code shows how to eliminate duplicated control points from an unoptimized mesh:

from aspose.threed.entities import Sphere

# Sphere.ToMesh generates 117 control points
mesh = Sphere().to_mesh()
# After optimized, there're only 86 control points, polygon indices are also remapped.
optimized = mesh.optimize(True)

optimize

Optimize the mesh’s memory usage by eliminating duplicated control points

Returns

New mesh instance with compact memory usage

def optimize(self, vertex_elements, tolerance_control_point, tolerance_normal, tolerance_uv):
    ...
ParameterTypeDescription
vertex_elementsboolOptimize duplicated vertex element data
tolerance_control_pointfloatThe tolerance for control point, default value is 1e-9
tolerance_normalfloatThe tolerance for normal/tangent/binormal default value is 1e-9
tolerance_uvfloatThe tolerance for uv, default value is 1e-9

See Also