decode method

decode(self, file_name)

Decode the point cloud or mesh from specified file name

Returns

A Mesh or PointCloud instance depends on the file content


def decode(self, file_name):
    ...
ParameterTypeDescription
file_namestrThe file name contains the drc file

Exceptions

ExceptionDescription
IOExceptionThrown when failed to read from file

Example

The following code shows how to encode and decode a Mesh to/from byte array:

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

mesh = Sphere().to_mesh()
# encode mesh into Draco format
draco = FileFormat.DRACO.encode(mesh)
# decode mesh from Draco format
decodedMesh = pycore.cast(Mesh, FileFormat.DRACO.decode(draco))

decode(self, data)

Decode the point cloud or mesh from memory data

Returns

A Mesh or PointCloud instance depends on the content


def decode(self, data):
    ...
ParameterTypeDescription
databytesThe raw drc bytes

Exceptions

ExceptionDescription
ImportExceptionThrown when data is malformed.

Example

The following code shows how to encode and decode a Mesh to/from byte array:

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

mesh = Sphere().to_mesh()
# encode mesh into Draco format
draco = FileFormat.DRACO.encode(mesh)
# decode mesh from Draco format
decodedMesh = pycore.cast(Mesh, FileFormat.DRACO.decode(draco))

See Also