MCPcopy Create free account
hub / github.com/Pointcept/SegmentAnything3D / save_point_cloud

Function save_point_cloud

util.py:155–165  ·  view source on GitHub ↗
(coord, color=None, file_path="pc.ply", logger=None)

Source from the content-addressed store, hash-verified

153
154
155def save_point_cloud(coord, color=None, file_path="pc.ply", logger=None):
156 os.makedirs(os.path.dirname(file_path), exist_ok=True)
157 coord = to_numpy(coord)
158 if color is not None:
159 color = to_numpy(color)
160 pcd = o3d.geometry.PointCloud()
161 pcd.points = o3d.utility.Vector3dVector(coord)
162 pcd.colors = o3d.utility.Vector3dVector(np.ones_like(coord) if color is None else color)
163 o3d.io.write_point_cloud(file_path, pcd)
164 if logger is not None:
165 logger.info(f"Save Point Cloud to: {file_path}")
166
167
168def remove_small_group(group_ids, th):

Callers 2

visualize_pcdFunction · 0.85
visualize_partitionFunction · 0.85

Calls 1

to_numpyFunction · 0.85

Tested by

no test coverage detected