decode method
Contents
[
Hide
]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):
...
Parameter | Type | Description |
---|---|---|
file_name | str | The file name contains the drc file |
Exceptions
Exception | Description |
---|---|
IOException | Thrown 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):
...
Parameter | Type | Description |
---|---|---|
data | bytes | The raw drc bytes |
Exceptions
Exception | Description |
---|---|
ImportException | Thrown 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
- module
aspose.threed.formats
- class
DracoFormat
- class
Geometry
- class
ImportException
- class
Mesh
- class
PointCloud