Skip to content

Writing a ply file with meshes from numpy arrays. #185

@rtrwalker

Description

@rtrwalker

I can write a ply file of points by passing an array to the pipeline object:

import pdal

xyz = np.array([(0.0, 0.0, 0.0), (1.0, 0.0, 0.0),(1.0, 2.0, 0.0),(4.0, 1.0, 0.0)], dtype=[('X', '<f8'), ('Y', '<f8'), ('Z', '<f8')])
abc = np.array([(0, 1, 2), (2, 1, 3)], dtype=[('A', '<u4'), ('B', '<u4'), ('C', '<u4')])

pipeline = pdal.Writer.ply(filename="myply.ply", faces=True).pipeline(xyz)
pipeline.execute()

Is there anyway to pass an array of faces too (abc in my snippet above)?

Looking in Pipeline.__init__ there is only a spot for arrays.

def __init__(

Basically I'm reading a point cloud file, making a mesh (using poisson), removing some triangles and points from the mesh (this part not in pdal), and writing the resulting points from the mesh. After the mesh stage I also tried deleting rows from pipeline.meshes and pipeline.arrays but I believe they are read only. I tried using filters.crop on the meshed pointcloud - while points are deleted the entire mesh is destroyed. Is there anyway to pass meshes to filters along with arrays? and is it possible for crop etc filters to also crop the mesh?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions