diffCheck.df_error_estimation module#

This module contains the utility functions to compute the difference between source and target

class diffCheck.df_error_estimation.DFInvalidData(value)#

Bases: Enum

Enum to define the type of invalid data for joint or assembly analysis

MISSING_PCD = 2#
OUT_OF_TOLERANCE = 1#
VALID = 0#
class diffCheck.df_error_estimation.DFVizResults(assembly)#

Bases: object

This class compiles the results of the error estimation into one object

add(source, target, distances, sanity_check=DFInvalidData.VALID)#
Parameters:

sanity_check (DFInvalidData)

property analysis_type#
dump_serialization(dir)#

Dump the results into a JSON file for serialization

Return type:

str

Parameters:

dir (str)

filter_values_based_on_valuetype(settings)#
find_id(idx)#

Return the ID in str format of the element. This func is used during the csv export. With the following format: - beam: idx - joint: idx_b–idx_j–0 - joint_face: idx_b–idx_j–idx_f

Parameters:

idx (int) – the index of the element

Return type:

str

property is_source_cloud#
static load_serialization(file_path)#

Load the results from a JSON file

Return type:

DFVizResults

Parameters:

file_path (str)

class diffCheck.df_error_estimation.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)#

Bases: JSONEncoder

Special json encoder for numpy ndarray types.

default(obj)#

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
diffCheck.df_error_estimation.df_cloud_2_df_cloud_comparison(assembly, df_cloud_source_list, df_cloud_target_list)#

Compute the Euclidean distance for every point of a source pcd to its closest point on a target pointcloud

Return type:

DFVizResults

Parameters:
diffCheck.df_error_estimation.df_cloud_2_rh_mesh_distance(source, target, signed=False)#

Calculate the distance between every point of a source pcd to its closest point on a target Rhino Mesh

diffCheck.df_error_estimation.rh_cloud_2_rh_mesh_comparison(assembly, rh_cloud_source_list, rhino_mesh_target_list, signed_flag, swap)#

Computes distances between a pcd and a mesh and return the results

Parameters:
  • assembly (DFAssembly) – the DFAssembly object

  • rh_cloud_source_list (List[PointCloud]) – list of point clouds after segmentation in Rhino format

  • rhino_mesh_target_list (List[Mesh]) – list of rhino meshes

  • signed_flag (bool) – flag to compute signed distances

  • swap (bool) – this mean we want to visualize the result on the target mesh (or viceversa)

Return type:

DFVizResults

Returns:

the results of the comparison

diffCheck.df_error_estimation.rh_mesh_2_df_cloud_distance(source, target, signed=False)#

Calculate the distance between every vertex of a Rhino Mesh to its closest point on a PCD