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
- 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
- property is_source_cloud#
- 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 aTypeError
).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:
- Parameters:
assembly (DFAssembly)
df_cloud_source_list (List[DFPointCloud])
df_cloud_target_list (List[DFPointCloud])
- 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 objectrh_cloud_source_list (
List
[PointCloud
]) – list of point clouds after segmentation in Rhino formatrhino_mesh_target_list (
List
[Mesh
]) – list of rhino meshessigned_flag (
bool
) – flag to compute signed distancesswap (
bool
) – this mean we want to visualize the result on the target mesh (or viceversa)
- Return type:
- 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