Skip to content

Commit c99c2e8

Browse files
Merge branch 'feature/export_pose_csv' of https://github.com/diffCheckOrg/diffCheck into feature/export_pose_csv
2 parents 22119a8 + d79cd59 commit c99c2e8

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎src/diffCheck/geometry/DFMesh.cc‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ namespace diffCheck::geometry
141141
double v = (dot00 * dot12 - dot01 * dot02) * invDenom;
142142

143143
// Check if point is in triangle
144-
double scale = std::max({v0v1.norm(), v0v2.norm()});
145144
double epsilon = 1e-6;
146145

147146
if ((u >= -epsilon) && (v >= -epsilon) && (u + v <= 1 + epsilon))

‎src/gh/components/DF_CAD_segmentator/code.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ def RunScript(self,
8989

9090
df_asssociated_cluster_faces_per_beam = []
9191
for i, df_b in enumerate(df_beams):
92-
beam_initial_pose = df_b.plane
93-
if beam_initial_pose.Transform(transforms[i]):
94-
beam_detected_pose = beam_initial_pose
92+
beam_detected_pose = Rhino.Geometry.Plane(df_b.plane)
93+
if beam_detected_pose.Transform(transforms[i]):
9594
o_poses_from_icp.append(beam_detected_pose)
96-
95+
else:
96+
o_poses_from_icp.append(None)
9797
rh_b_mesh_faces = [df_b_f.to_mesh() for df_b_f in df_b.side_faces]
9898
rh_test_mesh = Rhino.Geometry.Mesh()
9999
for j in range(len(rh_b_mesh_faces)):

‎src/gh/components/DF_CAD_segmentator/metadata.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
{
131131
"name": "o_poses_from_icp",
132132
"nickname": "o_poses_from_icp",
133-
"description": "The list of poses resulting from the ICP registration. If i_make_registration is False, this output will be empty.",
133+
"description": "The list of poses resulting from the ICP registration. If i_make_registration is False, this output will contain the original assembly beam planes (no ICP applied).",
134134
"optional": false,
135135
"sourceCount": 0,
136136
"graft": false

‎src/gh/components/DF_csv_exporter/code.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def RunScript(self,
198198
dist_err_list = []
199199
rot_err_list = []
200200
for data in assembly_dist_err_hist[i]:
201-
if data :
201+
if data is not None:
202202
dist_err_list.append(float(data))
203203
else:
204204
dist_err_list.append("nan")

‎src/gh/components/DF_pose_comparison/code.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import ghpythonlib.treehelpers as th
88

99
import diffCheck.df_geometries
10+
import diffCheck.df_poses
1011
import diffCheck.df_error_estimation
11-
1212
import numpy
1313

1414
def compute_comparison(measured_pose, cad_pose):

‎src/gh/components/DF_pose_estimation/code.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def RunScript(self,
3636
all_poses_this_time = []
3737
for i, face_clouds in enumerate(clusters_per_beam):
3838
try:
39-
if len(i_poses_from_icp) > i and i_poses_from_icp[i] is not None:
39+
if i_poses_from_icp and len(i_poses_from_icp) > i and i_poses_from_icp[i] is not None:
4040
# if there is a pose from ICP for this beam, use it directly without processing the cloud
4141
planes.append(i_poses_from_icp[i])
4242
all_poses_this_time.append(df_poses.DFPose.from_rh_plane(i_poses_from_icp[i]))

‎src/gh/diffCheck/diffCheck/df_error_estimation.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ def add_history(self, pose_history : dict[str, DFPosesBeam]):
285285
"""
286286
self.pose_history = pose_history
287287
for element in pose_history:
288-
self.last_poses[element] = pose_history[element].poses_dictionary[list(pose_history[element].poses_dictionary.keys())[-1]]
288+
poses_dict = pose_history[element].poses_dictionary
289+
self.last_poses[element] = poses_dict[next(reversed(poses_dict))] if poses_dict else None
289290

290291
def add_last_poses(self, last_poses : dict[str, DFPose]):
291292
"""

0 commit comments

Comments
 (0)