Skip to content

Commit 29b4749

Browse files
committed
FIX: got rid of distance/distance component in docs
1 parent d4f93c1 commit 29b4749

File tree

9 files changed

+24
-205
lines changed

9 files changed

+24
-205
lines changed

doc/documentation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,4 @@ If you need to add a new page to the [tutorials](tutorials.rst) (e.g. a [new tut
6868

6969
```{eval-rst}
7070
.. literalinclude:: tutorials.rst
71-
:language: rst
72-
:lines: 6-14
71+
:language: rst

doc/gh_DFCloudCloudDistance.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

doc/gh_components.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ DF has a Grasshopper_ plugin with a set of components that allows the user to in
4141
- .. image:: ../src/gh/components/DF_cloud_uniform_downsample/icon.png
4242
- `gh_DFCloudUniformDownsample <gh_DFCloudUniformDownsample.html>`_
4343

44-
* - .. image:: ../src/gh/components/DF_cloud_voxel_downsample/icon.png
45-
- `gh_DFCloudVoxelDownsample <gh_DFCloudVoxelDownsample.html>`_
46-
- .. image:: ../src/gh/components/DF_cloud_cloud_distance/icon.png
47-
- `gh_DFCloudCloudDistance <gh_DFCloudCloudDistance.html>`_
48-
4944
* - .. image:: ../src/gh/components/DF_cloud_mesh_distance/icon.png
5045
- `gh_DFCloudMeshDistance <gh_DFCloudMeshDistance.html>`_
5146
- .. image:: ../src/gh/components/DF_csv_exporter/icon.png
@@ -83,8 +78,8 @@ DF has a Grasshopper_ plugin with a set of components that allows the user to in
8378

8479
* - .. image:: ../src/gh/components/DF_merge_assemblies/icon.png
8580
- `gh_DFMergeAssemblies <gh_DFMergeAssemblies.html>`_
86-
-
87-
-
81+
- .. image:: ../src/gh/components/DF_cloud_voxel_downsample/icon.png
82+
- `gh_DFCloudVoxelDownsample <gh_DFCloudVoxelDownsample.html>`_
8883

8984

9085
.. toctree::
@@ -93,7 +88,6 @@ DF has a Grasshopper_ plugin with a set of components that allows the user to in
9388

9489
gh_DFBuildAssembly
9590
gh_DFCADSegmentator
96-
gh_DFCloudCloudDistance
9791
gh_DFCloudMeshDistance
9892
gh_DFCloudNormalEstimator
9993
gh_DFCloudSizeDownsample

doc/tutorials.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ diffCheck tutorials
1010
key-concepts
1111
joints-evaluation
1212
assembly-evaluation
13-

src/gh/components/DF_cloud_cloud_distance/code.py

Lines changed: 0 additions & 37 deletions
This file was deleted.
-2.71 KB
Binary file not shown.

src/gh/components/DF_cloud_cloud_distance/metadata.json

Lines changed: 0 additions & 112 deletions
This file was deleted.

src/gh/diffCheck/diffCheck/df_error_estimation.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,21 @@ def filter_values_based_on_valuetype(self, settings):
128128
def is_source_cloud(self):
129129
return type(self.source[0]) is diffcheck_bindings.dfb_geometry.DFPointCloud
130130

131-
132-
def df_cloud_2_df_cloud_comparison(source_list, target_list):
131+
# FIXME: ths is currently broken, we need to fix it
132+
def df_cloud_2_df_cloud_comparison(
133+
assembly: DFAssembly,
134+
df_cloud_source_list: typing.List[diffcheck_bindings.dfb_geometry.DFPointCloud],
135+
df_cloud_target_list: typing.List[diffcheck_bindings.dfb_geometry.DFPointCloud]
136+
) -> DFVizResults:
133137
"""
134138
Compute the Euclidean distance for every point of a source pcd to its
135139
closest point on a target pointcloud
136140
"""
137-
results = DFVizResults(DFAssembly())
138-
for source, target in zip(source_list, target_list):
141+
results = DFVizResults(
142+
DFAssembly(
143+
[], "cloud-cloud-dummy-dfassembly"
144+
))
145+
for source, target in zip(df_cloud_source_list, df_cloud_target_list):
139146
distances = np.asarray(source.compute_distance(target))
140147
results.add(source, target, distances)
141148

@@ -171,9 +178,6 @@ def rh_cloud_2_rh_mesh_comparison(
171178
if swap:
172179
source_df, target = target, source_df
173180

174-
# FIXME: this is a hack to avoid that the assembly segmentator breaks this
175-
# snippet because it is not stamping the rhino pout cloud with the sanity check
176-
# user string value.
177181
sanity_check_value_uncasted = source_rh.GetUserString("df_sanity_scan_check")
178182
sanity_check_value = None
179183
if sanity_check_value_uncasted is None:

src/gh/diffCheck/diffCheck/df_util.py

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -163,40 +163,20 @@ def get_doc_2_meters_unitf():
163163
def merge_shared_indexes(original_dict):
164164
"""
165165
Merge the shared indexes of a dictionary
166-
167166
Assume we have a dictionary with lists of indexes as values.
168167
We want to merge the lists that share some indexes, in order to have a dictionary with, for each key, indexes that are not present under other keys.
169-
170168
:param original_dict: the dictionary to merge
171169
:return: the merged dictionary
172170
"""
173-
merged_dict = {}
174-
index_to_key = {}
171+
new_dict = {}
175172

176173
for key, (face, indexes) in original_dict.items():
177-
merged_indexes = set(indexes)
178-
keys_to_merge = set()
179-
180-
for index in indexes:
181-
if index in index_to_key:
182-
keys_to_merge.add(index_to_key[index])
183-
184-
for merge_key in keys_to_merge:
185-
merged_indexes.update(merged_dict[merge_key][1])
186-
# del merged_dict[merge_key]
187-
188-
for index in merged_indexes:
189-
index_to_key[index] = key
190-
191-
merged_dict[key] = (face, list(merged_indexes))
192-
193-
keys_with_duplicates = {}
194-
195-
for key in merged_dict.keys():
196-
for other_key, (face, indexes) in merged_dict.items():
197-
if key in indexes:
198-
if key not in keys_with_duplicates:
199-
keys_with_duplicates[key] = []
200-
keys_with_duplicates[key].append(other_key)
201-
202-
return merged_dict
174+
intersection_found = False
175+
for other_key, (other_face, other_indexes) in original_dict.items():
176+
if key != other_key:
177+
if set(indexes).intersection(set(other_indexes)):
178+
new_dict[key] = (face, list(set(indexes).union(set(other_indexes))))
179+
intersection_found = True
180+
if not intersection_found:
181+
new_dict[key] = (face, indexes)
182+
return new_dict

0 commit comments

Comments
 (0)