<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_exam_geom_combo</TITLE><H1>%mqc_exam_geom_combo </H1><P CLASS="Paragraph">Classname: <B>%mqc_exam_geom_combo </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>
      A combo checker that consists of all of the examining geometry functions.
      Each checking function can be disabled or enabled.
      The default is all enabled.
 Parameters:
    (Number) Distance_tol       - Distance tolerance for check.
                                  The default is 0.025.
    (Name)   Unit               - grams_and_millimeters or pounds_and_inches
                                  The default is grams_and_millimeters.
     (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.
    (Name)   Log _type          - LOG_ERROR, LOG_WARNING, or LOG_INFO.
                                  The default is LOG_ERROR.
    (String) log_msg            - Additional error/warning/info/None message
                                  Default is "".
</PRE><PRE><FONT COLOR= blue>Defclass: %mqc_exam_geom_combo( %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:   "Examine Geometry - Combo";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_obj_Tiny_label:         "Check Tiny objects";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_obj_Misaligned_label:   "Check Misaligned Objects";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_body_data_struct_label: "Check Body Data Structures";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_body_consistency_label: "Check Body Consistency";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_body_ff_intersect_label: "Check Face-Face Intersection";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_body_boundaries_label:  "Check Sheet Boundaries";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_face_smooth_label:      "Check Face Smoothness";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_face_self_intersect_label:  "Check Face Self-Intersection";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_face_spike_label:        "Check Face Spikes/Cuts";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_edge_smooth_label:      "Check Edge Smoothness";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   check_edge_tolerance_label:   "Check Edge Tolerances";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( List )                     unit_option: { grams_and_millimeters,
                                            pounds_and_inches
                                           };
( String )                   unit_label:  "Tolerance Unit";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( String )                   Distance_tol_label: "Distance Threshold Tolerance";

</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;
( Boolean Parameter )        check_obj_Tiny:               TRUE;
( Boolean Parameter )        check_obj_Misaligned:         TRUE;
( Boolean Parameter )        check_body_data_struct:       TRUE;
( Boolean Parameter )        check_body_consistency:       TRUE;
( Boolean Parameter )        check_body_ff_intersect:      TRUE;
( Boolean Parameter )        check_body_boundaries:        TRUE;
( Boolean Parameter )        check_face_smooth:            TRUE;
( Boolean Parameter )        check_face_self_intersect:    TRUE;
( Boolean Parameter )        check_face_spike:             TRUE;
( Boolean Parameter )        check_edge_smooth:            TRUE;
( Boolean Parameter )        check_edge_tolerance:         TRUE;
( Name Parameter )           unit:        grams_and_millimeters;
( Number Parameter )         Distance_tol: 0.025;
( Number Parameter )         Angle_tol: 0.500; 
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Parameter for log_type:</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>( Name Parameter )           log_type: LOG_ERROR;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Parameter 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><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  ( string Parameter )         log_msg: "";</PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  ( string )                   log_msg_label: "Additional Message";</PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Paramter for geometry selection:</PRE><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:            { solid, curve, Face, edge };
( Name )                     selection_mode:            Multiple;
</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>( List )                     tiny_entity_type: { All, conic, spline, line, arc, curve, solid, face, edge };
( List )                     misalign_entity_type: { All, line, arc, spline, faces };

</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>( Uncached Any ) do_check:
@{
    # This function is added to support the detail message to go with each object logged.
    $status << ug_mqc_log_object_detail_flag( 1 );

    # Deal with units:
    $Distance_tol << mqc_convert_unit_for_tolerance(Distance_tol:, unit:);

    # Check tiny objects
    If ( check_obj_Tiny: )
    Then
    @{
        $tiny_obj << ug_mqc_ask_tiny_geom ( $Distance_tol, selection:, Position( All, tiny_entity_type: ) );

        If ( -empty?($tiny_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << $tiny_obj;
            $msg   << "Failed on tiny object check.";
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $msg );
            };
        }
        Else donothing;
    }
    Else donothing;

    # Check misaligned objects
    If ( check_obj_Misaligned: )
    Then
    @{
        $misalign_obj << ug_mqc_ask_misalign_geom ( Angle_tol:, selection:, 
                                                    Position( All, misalign_entity_type: ) );

        If ( (-empty?($misalign_obj)) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << $misalign_obj;
            $msg   << "Failed on misaligned object check.";
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $msg );
           };
        }
        Else donothing;
    }
    Else donothing;

    # Check bodies data structure
    $num_bad_struct <<
    If ( check_body_data_struct: )
    Then
    @{
        $ret_obj << ug_mqc_ask_body_with_bad_struct ( selection: );

        $next_check_message  << If ( check_body_consistency: & check_body_ff_intersect: ) Then
                                   "~nBody consistency check and face-face intersection check did not run."
                                Else If (check_body_consistency:) Then
                                   "~nBody consistency check did not run."
                                Else IF (check_body_ff_intersect:) Then
                                   "~nFace-face intersection check did not run."
                                Else
                                   "";

        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << first( $ret_obj );
            $msgs  << second( $ret_obj );
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );
                for $each_str is nth( $indx, $msgs );

                for $each_msg is "Failed on body data structure check. " + 
                                 $each_str + $next_check_message;

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $each_msg );
            };

            Length( $ret_obj );
        }
        Else 0;
    }
    Else 0;

    # Check body consistency
    $num_inconsist << 
    If ( check_body_consistency: & ($num_bad_struct=0 ) )
    Then
    @{
        $ret_obj << ug_mqc_ask_body_with_inconsist(  selection:  );

        $next_check_message  << IF (check_body_ff_intersect:) Then
                                   "~nFace-face intersection check did not run."
                                Else
                                   "";


        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs << first( $ret_obj );
            $msgs << second( $ret_obj );
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );
                for $each_str is nth( $indx, $msgs );

                for $each_msg is "Failed on body consistency check. " 
                                 + $each_str + $next_check_message;

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $each_msg );
            };

            Length( $ret_obj );                                                                               
        }
        Else 0;
    }
    Else 0;

    # Check body face-face intersection
    If ( check_body_ff_intersect: & ($num_bad_struct=0) & ($num_inconsist=0) )
    Then
    @{
        $ret_obj << ug_mqc_ask_body_with_ff( selection: );

        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << first( $ret_obj );
            $msgs  << second( $ret_obj );
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );
                for $each_str is nth( $indx, $msgs );
 
                for $each_msg is "Failed on face-face intersection check. " + $each_str;

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $each_msg );
           };
        }
        Else donothing;
    } 
    Else donothing;

    # Check body boundary
    If ( check_body_boundaries: )
    Then
    @{
        $ret_obj << ug_mqc_ask_body_boundaries( selection: );

        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << first( $ret_obj );
            $msgs  << second( $ret_obj );
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );
                for $each_msg is " has " + StringValue( nth( $indx, $msgs ) ) + " boundary(ies).";

                do ug_mqc_log_object_detail( LOG_INFO, { $each_obj }, $each_msg );
            };
        }
        Else donothing;
    }
    Else donothing;

    # Check faces smooth
    If ( check_face_smooth: )
    Then
    @{
        $ret_obj << ug_mqc_ask_face_not_smooth( selection: );

        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << first( $ret_obj );
            $msgs  << second( $ret_obj );
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );
                for $each_str is nth( $indx, $msgs );

                for $each_msg is "Failed on face smoothness check. " + $each_str;

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $each_msg );
            };
        }
        Else donothing;
    }
    Else donothing;

    # Check face self intersection
    If ( check_face_self_intersect: )
    Then
    @{
        $ret_obj << ug_mqc_ask_face_self_intersect( selection: );
  
        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << first( $ret_obj );
            $msgs  << second( $ret_obj );
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );
                for $each_str is nth( $indx, $msgs );

                for $each_msg is "Failed on face self-intersect check. " + $each_str;

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $each_msg );
            };
        }
        Else donothing;
    }
    Else donothing;

    # Check face spike
    If ( check_face_spike: )
    Then
    @{
        $ret_obj << ug_mqc_ask_face_with_spike( $Distance_tol, selection: );

        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << $ret_obj;
            $msg   << "Failed on face Spikes or Cut check.";
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $msg );
           };
        }
        Else donothing;
    }
    Else donothing;

    # Check edges smooth
    If ( check_edge_smooth: )
    Then
    @{
        $ret_obj << ug_mqc_ask_edge_not_smooth( Angle_tol:, selection: );

        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << $ret_obj;
            $msg   << "Failed on smooth edge check.";
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $msg );
            };
        }
        Else donothing;
    }
    Else donothing;

    # Check edge tolerance
    If ( check_edge_tolerance: )
    Then
    @{
        $ret_obj << ug_mqc_ask_edge_over_tolerance( $Distance_tol, selection: );

        If ( -empty?($ret_obj) | ( log_type: = LOG_INFO ) )
        Then
        @{
            $objs  << $ret_obj;
            $msg   << "Failed on edge tolerance check.";
            $count << Length( $objs );

            loop
            {
                for $indx from 1 to $count;
                for $each_obj is nth( $indx, $objs );

                do ug_mqc_log_object_detail( log_type:, { $each_obj }, $msg );
           };
        }
        Else donothing;
    }
    Else donothing;
};

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