Tek bir 3D nesnesinin ağını PLY dosyasında dönüştürün
Contents
[
Hide
]
Aspose.3D for Python via .NET API allows developers to convert the Mesh of a single 3D object in the PLY file.
3D nesnesi oluşturun ve PLY dosyasına kaydedin
The overloaded encodeMesh
members exposed by the PlyFormat
class can be used to convert the Mesh of a 3D object to PLY file. The encodeMesh
members take the Mesh
, output file name and PlySaveOptions
objects as parameters. Using the PLY save options, developers can change the name of coordinate components.
Programming ample ample
Bu kod örneği bir 3D silindir nesnesi oluşturur ve daha sonra PLY dosyasında kodlanır.
Python
from aspose.threed import FileFormat, FileContentType
from aspose.threed.entities import Cylinder
from aspose.threed.formats import PlySaveOptions
# Create a cylinder object and save it to ply file
FileFormat.PLY.encode_mesh(Cylinder(), "cylinder.ply")
# using Ply save options
# Save as binary PLY format, the default value is ASCII
opt = PlySaveOptions(FileContentType.BINARY)
# change the components to 's' and 't'
opt.texture_coordinate_components.item1 = "s
opt.texture_coordinate_components.item2 = "t"
# save the mesh
FileFormat.PLY.encode_mesh(Cylinder(), "cylinder.ply", opt)