Skip to content

[Poisson] New poisson() method that receive a json

Latest
Compare
Choose a tag to compare
@mfdeveloper mfdeveloper released this 24 Mar 08:34

Pass json string params with custom values to open3d and pymeshlab method types

Something like this below:

from surface_reconstruction import SurfaceReconstruction
import json
import os

# Json string parameters.
# PS: Try pass always minified json, to avoid parser errors
json_str = """
        {"estimate_normals":{"fast_normal_computation":true,"normals":[1,3]},"orient_normals_consistent_tangent_plane":{"k":100},"surface_reconstruction_screened_poisson":{"depth":8,"width":0,"scale":1.1,"linear_fit":false,"n_threads":-1}}
        """

# Instantiate a surface strategy (Open3dSurface, PyMeshlabSurface...)
surface: SurfaceStrategy = SurfaceReconstruction(
    method_type='open3d',
    point_cloud_file=os.path.join('files', 'point_cloud_file.ply'),
    output_file=os.path.join('files', 'output_file.ply')
)

# Call method poisson()
surface.poisson(json_filters=json_str)