encode method
Contents
[
Hide
]encode(self, entity, stream)
Encode the entity and save the result into the stream.
def encode(self, entity, stream):
...
Parameter | Type | Description |
---|---|---|
entity | Entity | The entity to encode |
stream | io.RawIOBase | The stream to write to, this method will not close this stream |
Example
The following code shows how to encode a mesh into PLY file:
from aspose.threed import FileFormat
from aspose.threed.entities import Sphere
mesh = Sphere().to_mesh()
# encode mesh into PLY format
FileFormat.PLY.encode(mesh, "sphere.ply")
encode(self, entity, file_name)
Encode the entity and save the result into an external file.
def encode(self, entity, file_name):
...
Parameter | Type | Description |
---|---|---|
entity | Entity | The entity to encode |
file_name | str | The file to write to |
Example
The following code shows how to encode a mesh into PLY file:
from aspose.threed import FileFormat
from aspose.threed.entities import Sphere
mesh = Sphere().to_mesh()
# encode mesh into PLY format
FileFormat.PLY.encode(mesh, "sphere.ply")
encode(self, entity, stream, opt)
Encode the entity and save the result into the stream.
def encode(self, entity, stream, opt):
...
Parameter | Type | Description |
---|---|---|
entity | Entity | The entity to encode |
stream | io.RawIOBase | The stream to write to, this method will not close this stream |
opt | PlySaveOptions | Save options |
Example
The following code shows how to encode a mesh into PLY file:
from aspose.threed import FileFormat
from aspose.threed.entities import Sphere
mesh = Sphere().to_mesh()
# encode mesh into PLY format
FileFormat.PLY.encode(mesh, "sphere.ply")
encode(self, entity, file_name, opt)
Encode the entity and save the result into an external file.
def encode(self, entity, file_name, opt):
...
Parameter | Type | Description |
---|---|---|
entity | Entity | The entity to encode |
file_name | str | The file to write to |
opt | PlySaveOptions | Save options |
Example
The following code shows how to encode a mesh into PLY file:
from aspose.threed import FileFormat
from aspose.threed.entities import Sphere
mesh = Sphere().to_mesh()
# encode mesh into PLY format
FileFormat.PLY.encode(mesh, "sphere.ply")
See Also
- module
aspose.threed.formats
- class
PlyFormat