stl_from_3dply

formatwriter.stl_from_3dply(total_points_3d, output_dir: str, output_prefix: str, target_faces: int = 5000, boundary_weight: float = 0.5, sampling_factor: float = 0.1, laplacian_smoothing: bool = True)

Creates a 3D STL object from a given 3D point cloud using the pymeshlab library. It generates an intermediate .ply file where the point cloud is saved(generated for debugging purposes).

Parameters:
  • total_points_3d (numpy array) – Pointcloud (Nx3 dimensions)

  • target_faces (int) – Total number of faces of the final STL (approx)

  • boundary_weight (float) – Boundary Preserving Weight: The importance of the boundary during simplification. Default (1.0) means that the boundary has the same importance of the rest. Values greater than 1.0 raise boundary importance and has the effect of removing less vertices on the border. Admitted range of values (0,+inf).

  • sampling_factor (float) – It is a ratio from 0 to 1 that sets the percentage of reduction in the number of points of the simplified pointcloud. Reduced number of points = sampling_factor * initial number of points Defaults to 0.1. Low values are recommended for the robustness of the algorithm.

  • filename_output (string) – Name of the output file containing the STL object