Преобразование сетки одного объекта 3D в файле PLY

Создайте объект 3D и сохраните его в файл PLY

Перегруженные члены encodeMesh, открытые классом PlyFormat, могут использоваться для преобразования сетки объекта 3D в файл PLY. Члены encodeMesh принимают в качестве параметров Mesh, имя выходного файла и объекты PlySaveOptions. Используя параметры сохранения PLY, разработчики могут изменить имя компонентов координат.

Образец программирования

Этот пример кода создает объект 3D Cylinder, а затем кодирует в файле PLY.

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)