使用点云

Contents
[ ]

解码网格

Aspose.3D for Python via .NET 允许直接从 Draco 文件解码网格,而无需使用 DracoFormat 类的 decode 方法构建场景。以下代码段显示了如何使用此功能:

from aspose import pycore
from aspose.threed import FileFormat
from aspose.threed.entities import PointCloud

#  For complete examples and data files, please go to https:# github.com/aspose-3d/Aspose.3D-for-.NET
pointCloud = pycore.cast(PointCloud, FileFormat.DRACO.decode("data-dir"  + "point_cloud_no_qp.drc"))

编码网格

Aspose.3D for Python via .NET 允许直接将球体网格编码为 Draco 文件,而无需使用 DracoFormat 类的 encode 方法构建场景。以下代码段显示了如何使用此功能:

from aspose.threed import FileFormat
from aspose.threed.entities import Sphere

#  For complete examples and data files, please go to https:# github.com/aspose-3d/Aspose.3D-for-.NET
FileFormat.DRACO.encode(Sphere(), "data-dir"  + "sphere.drc")

将球体编码为点云

Aspose.3D for Python via .NET 允许使用 DracoFormat 类的 encode 方法将球体网格编码为 Draco 文件作为点云。以下代码段显示了如何使用此功能:

from aspose.threed import FileFormat
from aspose.threed.entities import Sphere
from aspose.threed.formats import DracoSaveOptions

options = DracoSaveOptions()
options.point_cloud = true 
#  For complete examples and data files, please go to https:# github.com/aspose-3d/Aspose.3D-for-.NET
FileFormat.DRACO.encode(Sphere(), "data-dir"  + "sphere.drc", options)

将网格编码到 PLY

Aspose.3D for Python via .NET 允许直接将网格编码为 PLY 文件,而无需使用 PlyFormat 类的 编码 方法构建场景。以下代码段显示了如何使用此功能:

from aspose.threed import FileFormat
from aspose.threed.entities import Sphere

#  For complete examples and data files, please go to https:# github.com/aspose-3d/Aspose.3D-for-.NET
FileFormat.PLY.encode(Sphere(), "sphere.ply")

从 PLY 解码网格

Aspose.3D for Python via .NET 允许使用 PlyFormat 类的 decode 方法从 PLY 文件解码网格/点云。以下代码段显示了如何使用此功能:

from aspose.threed import FileFormat
from aspose.threed.entities import Sphere

#  For complete examples and data files, please go to https:# github.com/aspose-3d/Aspose.3D-for-.NET
FileFormat.PLY.encode(Sphere(), "sphere.ply")

作为PointCloud导出到 PLY

Aspose.3D for Python via .NET 允许使用 PlyFormat 类的 encode 方法将场景作为PointCloud导出到 PLY。以下代码段显示了如何使用此功能:

from aspose.threed import FileFormat
from aspose.threed.entities import Sphere
from aspose.threed.formats import PlySaveOptions

options = PlySaveOptions()
options.point_cloud = true 
#  For complete examples and data files, please go to https:# github.com/aspose-3d/Aspose.3D-for-.NET
FileFormat.PLY.encode(Sphere(), "data-dir"  + "sphere.ply", options)

将 3D 场景导出为点云

Aspose.3D for Python via .NET 允许使用 ObjSaveOptions 类的 point_cloud 属性将 3D 场景导出为PointCloud。以下代码段显示了如何使用此功能:

from aspose.threed import Scene
from aspose.threed.entities import Sphere
from aspose.threed.formats import ObjSaveOptions

#  For complete examples and data files, please go to https:# github.com/aspose-3d/Aspose.3D-for-.NET
scene = Scene(Sphere())
options = ObjSaveOptions()
options.point_cloud = true 
scene.save("data-dir"  + "Export3DSceneAsPointCloud.obj", options)