1313class DFPoseComparison (component ):
1414 def RunScript (self ,
1515 i_assembly : diffCheck .df_geometries .DFAssembly ,
16- i_measured_poses : System .Collections .Generic .List [object ]):
16+ i_measured_planes : System .Collections .Generic .List [object ]):
1717
1818 CAD_poses = [beam .plane for beam in i_assembly .beams ]
1919
@@ -22,20 +22,20 @@ def RunScript(self,
2222 o_transforms_cad_to_measured = []
2323 # Compare the origins
2424 # measure the distance between the origins of the CAD pose and the measured pose and output this in the component
25- for i in range (len (i_measured_poses )):
26- if not i_measured_poses [i ]:
25+ for i in range (len (i_measured_planes )):
26+ if not i_measured_planes [i ]:
2727 o_distances .append (None )
2828 o_angles .append (None )
2929 o_transforms_cad_to_measured .append (None )
3030 continue
3131 cad_origin = CAD_poses [i ].Origin
32- measured_origin = i_measured_poses [i ].Origin
32+ measured_origin = i_measured_planes [i ].Origin
3333 distance = cad_origin .DistanceTo (measured_origin )
3434 o_distances .append (distance )
3535
3636 # Compare the orientations using the formula: $$ \theta = \arccos\left(\frac{\text{trace}(R_{\text{pred}}^T R_{\text{meas}}) - 1}{2}\right) $$
3737 transform_o_to_cad = Rhino .Geometry .Transform .PlaneToPlane (Rhino .Geometry .Plane .WorldXY , CAD_poses [i ])
38- transform_o_to_measured = Rhino .Geometry .Transform .PlaneToPlane (Rhino .Geometry .Plane .WorldXY , i_measured_poses [i ])
38+ transform_o_to_measured = Rhino .Geometry .Transform .PlaneToPlane (Rhino .Geometry .Plane .WorldXY , i_measured_planes [i ])
3939 np_transform_o_to_cad = numpy .array (transform_o_to_cad .ToDoubleArray (rowDominant = True )).reshape ((4 , 4 ))
4040 np_transform_o_to_measured = numpy .array (transform_o_to_measured .ToDoubleArray (rowDominant = True )).reshape ((4 , 4 ))
4141
@@ -46,7 +46,7 @@ def RunScript(self,
4646 o_angles .append (theta )
4747
4848 # Compute the transformation matrix between the CAD pose and the measured pose
49- transform_cad_to_measured = Rhino .Geometry .Transform .PlaneToPlane (CAD_poses [i ], i_measured_poses [i ])
49+ transform_cad_to_measured = Rhino .Geometry .Transform .PlaneToPlane (CAD_poses [i ], i_measured_planes [i ])
5050 o_transforms_cad_to_measured .append (transform_cad_to_measured )
5151
5252 return [o_distances , o_angles , o_transforms_cad_to_measured ]
0 commit comments