decode method

decode(self, file_name)

Decode a point cloud or mesh from the specified stream.

Returns

A Mesh or PointCloud instance


def decode(self, file_name):
    ...
ParameterTypeDescription
file_namestrThe input stream

Example

The following code shows how to decode a mesh from a PLY file:

from aspose import pycore
from aspose.threed import FileFormat
from aspose.threed.entities import Mesh, Sphere

# Generate a test file for decoding
FileFormat.PLY.encode(Sphere(), "sphere.ply")
# Decode the file
mesh = pycore.cast(Mesh, FileFormat.PLY.decode("sphere.ply"))

decode(self, stream)

Decode a point cloud or mesh from the specified stream.

Returns

A Mesh or PointCloud instance


def decode(self, stream):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe input stream

Example

The following code shows how to decode a mesh from a PLY file:

from aspose import pycore
from aspose.threed import FileFormat
from aspose.threed.entities import Mesh, Sphere

# Generate a test file for decoding
FileFormat.PLY.encode(Sphere(), "sphere.ply")
# Decode the file
mesh = pycore.cast(Mesh, FileFormat.PLY.decode("sphere.ply"))

decode(self, file_name, opt)

Decode a point cloud or mesh from the specified stream.

Returns

A Mesh or PointCloud instance


def decode(self, file_name, opt):
    ...
ParameterTypeDescription
file_namestrThe input stream
optPlyLoadOptionsThe load option of PLY format

Example

The following code shows how to decode a mesh from a PLY file:

from aspose import pycore
from aspose.threed import FileFormat
from aspose.threed.entities import Mesh, Sphere

# Generate a test file for decoding
FileFormat.PLY.encode(Sphere(), "sphere.ply")
# Decode the file
mesh = pycore.cast(Mesh, FileFormat.PLY.decode("sphere.ply"))

decode(self, stream, opt)

Decode a point cloud or mesh from the specified stream.

Returns

A Mesh or PointCloud instance


def decode(self, stream, opt):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe input stream
optPlyLoadOptionsThe load option of PLY format

Example

The following code shows how to decode a mesh from a PLY file:

from aspose import pycore
from aspose.threed import FileFormat
from aspose.threed.entities import Mesh, Sphere

# Generate a test file for decoding
FileFormat.PLY.encode(Sphere(), "sphere.ply")
# Decode the file
mesh = pycore.cast(Mesh, FileFormat.PLY.decode("sphere.ply"))

See Also