Working with PointCloud
Decode Mesh
Aspose.3D for Python via .NET allows decoding a mesh from a Draco file directly without building a scene using the decode method of DracoFormat class. The following code snippet shows how to use this functionality:
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"))Encode Mesh
Aspose.3D for Python via .NET allows encoding a sphere mesh to Draco file directly without building a scene using the encode method of DracoFormat class. The following code snippet shows how to use this functionality:
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")Encode Sphere as PointCloud
Aspose.3D for Python via .NET allows encoding a sphere mesh to Draco file as a point cloud using the encode method of DracoFormat class. The following code snippet shows how to use this functionality:
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
FileFormat.DRACO.encode(Sphere(), "data-dir" + "sphere.drc")Encode Mesh to PLY
Aspose.3D for Python via .NET allows encoding a mesh to PLY file directly without building a scene using the Encode method of PlyFormat class. The following code snippet shows how to use this functionality:
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(), "data-dir" + "sphere.ply")Decode Mesh From PLY
Aspose.3D for Python via .NET allows decoding a mesh/point cloud from a PLY file using the decode method of PlyFormat class. The following code snippet shows how to use this functionality:
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")Export to PLY as PointCloud
Aspose.3D for Python via .NET allows exporting a scene to PLY as PointCloud using the encode method of PlyFormat class. The following code snippet shows how to use this functionality:
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)Export 3D Scene as Point Cloud
Aspose.3D for Python via .NET allows exporting a 3D scene as PointCloud using point_cloud property of ObjSaveOptions class. The following code snippet shows how to use this functionality:
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)