<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_check_misaligned_object</TITLE><H1>%mqc_check_misaligned_object  </H1><P CLASS="Paragraph">Classname: <B>%mqc_check_misaligned_object  </B></P><P CLASS="Paragraph">Inherits from: <B><A href=..\checkmate\xug_base_checker.html>%ug_base_checker </A></B></P><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"> </PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">
<B>Description:</B>
    This checker checks all of the selected geometry that may be
    close to being orthogonal with respect to the WCS but are not
    exactly aligned to it.
    This test consists of lines, circles, planes, cylinders, cones,
    tori, swept and swung surfaces. For each object, a vector is
    obtained as follows:
        lines - a vector in the direction of the line
        arcs and circles - a vector normal to the plane of the curve
        planes - the normal vector
        cylinders, cones, tori, surfaces of revolution - the axis vector
        extruded surfaces - the extrusion vector
    Objects for which the vector is almost, but not exactly, parallel to
    XC, YC or ZC are flagged as misaligned.
Parameters:
    (Number)  Angle_tol       - angle tolerance for misaligned geometry.
                                The default is 0.5.
    (Boolean)  disabled?      - If it is true, the checker is disabled.
                                Default is False.
    (Boolean)  save_log_in_part
                             - The flag indicates whether the checking results can
                               be saved to the part file
                               Default is True.
    (Integer) log_type        - Error, Warning, Info, or None.
                                The default is to log error.
    (String)  log_msg         - error/warning/info/None message
Results:
    PASS:   --  No misaligned geometry object.
    FAIL:   --  Found misaligned geometry.
Object Log:
    Misaligned geometry.
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_check_misaligned_object ( %ug_base_checker );
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                      %test_category: "Modeling.Examine Geometry";
( String )                      %displayed_name: "Objects - Misaligned";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( Boolean Parameter )           disabled?: false;
( Boolean Parameter )           save_log_in_part: True;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Paramter for distance tolerance:</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( Number Parameter )         Angle_tol:                 0.5;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Paramter for geometry selection:</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   Angle_tol_label:           "Angle Threshold Tolerance in Degree";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( List )                    selection:                 {};

</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">#( List )                     selection_mask:            { line, arc,
#                                                          spline, face  };
#( Name )                     selection_mode:            Multiple;
</PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Paramter for log_type:</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( Integer Parameter )           log_type: 1;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Paramter for log_msg:</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( list )                        log_type_option: { LOG_ERROR, 
                                                   LOG_WARNING, 
                                                   LOG_INFO, 
                                                   LOG_ANY };
( string )                      log_type_label: "Log Option";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( string Parameter )            log_msg: "";
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">   Checker function</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( string )                      log_msg_label: "Log Message";

( List )                        misaligned_entity_type: { All, line, arc, spline, faces };

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>(Any Uncached)  do_check: 
@{
    $misaligned_obj << ug_mqc_ask_misalign_geom
                     ( Angle_tol:, selection:, Position( All, misaligned_entity_type: ) );
                
    $usr_msg << If ( "" = log_msg: ) Then "" Else log_msg: + "~n";

    $detail_msg << "Found " + Stringvalue( Length( $misaligned_obj ) ) + 
        " misaligned geometry(ies) in part.";
        
    If   ( -empty?( $misaligned_obj ) )
    Then  ug_mqc_log( Nth( log_type:, log_type_option: ), $misaligned_obj, $usr_msg + $detail_msg)
    Else  Donothing;
 };

</SPAN></FONT></PRE></DIV></TABLE><p class=EndLine>&nbsp;</p><p class=blank>&nbsp;</p></BODY></HTML>