Model.hm_compareentitiesrotate#
- Model.hm_compareentitiesrotate(source_entities, target_entities, tolerance, vec_x, vec_y, vec_z, base_x, base_y, base_z, angle, steps, result_type=1, review_results=False)#
Generates comparison results for entities rotated about an axis. This may find multiple matches, depending on the requested options. This must be preceded by a call to
Model.hm_compareinit().These results can then be queried using hm_compareget APIs, or written to a file using hm_comparewrite APIs.
- Parameters:
source_entities (Collection) – The collection containing the source entities. Valid entities are surfaces or elements.
target_entities (Collection) – The collection containing the target entities. Valid entities are surfaces or elements.
tolerance (double) – The tolerance value to use for the comparison.
vec_x (double) – X-coordinate of a location along rotation vector.
vec_y (double) – Y-coordinate of a location along rotation vector.
vec_z (double) – Z-coordinate of a location along rotation vector.
base_x (double) – X-coordinate of rotation vector base.
base_y (double) – Y-coordinate of rotation vector base.
base_z (double) – Z-coordinate of rotation vector base.
angle (double) – The rotation angle to use for searching for matches.
steps (int) – The number of steps to consider. This dictates how many increments of angle are searched for matches. For example, if angle is 45 and steps is 3, the angles 45, 90 and 135 will be searched. Must be ≥ 1.
result_type (int) –
SURFS to SURFS
SURFS to ELEMS
ELEMS to SURFS
ELEMS to ELEMS
0 - Basic
Matched (paired)
Unmatched
Matched (paired)
Unmatched
Matched
Unmatched
1 - Full (default)
Matched (paired)
Overlapped
Intersected
Unmatched
Matched (paired)
Overlapped
Intersected
Unmatched
Matched
Overlapped
Intersected
Unmatched
2 - Detailed
Matched (paired)
Overlapped (paired)
Intersected (paired)
Unmatched
Matched (paired)
Overlapped (paired)
Intersected (paired)
Unmatched
Matched
Overlapped (paired)
Intersected (paired)
Unmatched
review_results (bool) –
False - Do not automatically show the graphical comparison results after execution.
True - Automatically show the graphical comparison results after execution (default). This is cleared upon a call to
Model.hm_compareend().
- Returns:
hwReturnStatus- Status object
Example#
Write the detailed comparison results file to “ C:/temp / my_compare.txt “ for the rotational comparison use an angle of 45.0 and 6 steps , of surfs with IDs 1 - 20 and 101 - 120 about the y - axis at ( 0.0,0.0,0.0 )#import hm import hm.entities as ent model = hm.Model() surfs1 = hm.Collection(model, ent.Surface, list(range(1, 21))) surfs2 = hm.Collection(model, ent.Surface, list(range(101, 121))) model.hm_compareinit() model.hm_compareentitiesrotate( source_entities=surfs1, target_entities=surfs2, tolerance=0.1, vec_x=0.0, vec_y=1.0, vec_z=0.0, base_x=0.0, base_y=0.0, base_z=0.0, angle=45.0, steps=6, result_type=2, review_results=False, ) model.hm_comparewriteresults( filename="C:/temp/my_compare.txt", source_component_id=0, target_component_id=0 ) model.hm_compareend()