<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%check_overslam_step</TITLE><H1>%check_overslam_step  </H1><P CLASS="Paragraph">Classname: <B>%check_overslam_step  </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 evaluates the length of a constructed line and step configuration for a
    common section cut through an area that display the Quarter Panel Beauty Step with
    overslam.  If the overslam steps and w line distance meet the checking constraints,
    then the check passes and no further check is required.  Otherwise, the checker will
    further evaluate the ratio between the Finished LOL and Drawn LOL.  The finished LOL
    is the total arc length of R1, R2, R3, and two lines that connect them.  The Drawn LOL
    is the curve that starts from the tangent of R1 and Class A Surface to the tangent
    of R3 and the 6-degree draft angle curve.
    Note: This template checker can only validate the current work part; otherwise, the
          selected geometry objects are not valid in any other parts.
Parameters:
    ( List )   overslam_geom  -  Line geometry for measuring the distance of the overslam and door flange.
    ( Vector )  overslam_direction - A vector that indicates the direction of the overslam
                                     dimension.
    ( Point )   first_intersection_pt - A virtual intersection of the first horizontal step
                                        and the 3-degree Re-strike.  The W line is a
                                        horizontal dimension line between the first
                                        intersection and the second intersection.
    ( Point )   second_intersection_pt - A virtual intersection of the first step horizontal
                                         step and the 6-degree draft angle.
    ( Vector )  w_line_direction - A vector that indicates the W horizontal line between the first
                                  intersection and second intersection.
    ( Name )    Part_unit - mm or inches. Default is mm.
    ( Number )  overslam_tol - The distance from the top of the "Class A Surface"
                                           to the top of the first step should be 10.4mm.
                                           The value is derived by adding the 2.4mm door flange
                                           to the 8mm overslam.
    ( Number )  wline_tol - The distance of the W line between two virtual intersections should be 12mm.
    ( Number )  ratio_range - Ratio constraint of the finished LOL and drawn LOL within (1, 1.05), which means
                the value of the finished LOL should be equal to or plus 5% of the drawn LOL.
    ( String )  error_message - The overslam step configuration fails three constraints.
     (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.
Results:
    PASS         -- The overslam step configuration satisfy the overslam step constraint and
                    the W line constraint.
    FAIL         -- The overslam step configuration fails the checking criteria.
</PRE><PRE><FONT COLOR= blue>DefClass: %check_overslam_step ( %ug_base_checker );
</FONT></PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )    %test_category: "Template";
   ( String )    %displayed_name: "Check overslam step configuration";
</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\">   Attributes for this class</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List )             overslam_geom_mask: {curve, edge};
   ( String )           overslam_geom_label: "Lines for measuring distance of overslam and door flange:";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List )             finished_lol_mask: {curve, edge};
   ( String )           finished_lol_label: "Lines and arcs for finished LOL:";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List )             drawn_lol_mask: {curve, edge};
   ( String )           drawn_lol_label: "Curve for drawn LOL:";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List )             part_unit_option: {mm, inches};
   ( String )           part_unit_label: "Part unit:";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )           overslam_tol_label: "Overslam step constraint:";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )           wline_tol_label: "W line constraint:";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( String )           ratio_range_label: "Ratio constraint of Finished LOL and Drawn LOL:";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   ( List Parameter )   overslam_geom: {};
   ( Point Parameter )  first_intersection_pt: point(0,0,0);
   ( Point Parameter )  second_intersection_pt: point(0,0,0);
   ( Vector Parameter ) w_line_direction: {1,0,0};
   ( Vector Parameter ) overslam_direction: {0,1,0};
   ( List Parameter )   finished_lol: {};
   ( List Parameter )   drawn_lol: {};
   ( Name Parameter )   part_unit: mm;
   ( Number Parameter ) overslam_tol: 10.4;
   ( Number Parameter ) wline_tol: 12.0;
   ( List Parameter )   ratio_range: {{GE, 1.0}, {LE, 1.05}};
   ( String Parameter ) error_message: "The overslam step configuration fails to meet the constraints.";
</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 )           error_message_label: "Error message:";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>   (Any Uncached)   do_check: 
   @{
       $count << length(overslam_geom:);
       if ($count < 2) then
       @{
           $msg << "Fail to check because the overslam geometry are not completely specified.";   
           ug_mqc_log(LOG_ERROR, {}, $msg);  
       }
       else 
       @{
           if ( mqc_is_valid_object_identifier ( nth(1, overslam_geom:) ) = false ) then
           @{
               $msg << "Fail to check due to invalid overslem geometry object.";   
               ug_mqc_log(LOG_ERROR, {}, $msg);  
           }
           else
           @{
           $point1 << ug_curve_askStartPoint(ug_refObject(nth(1,overslam_geom:), ""));
           $point2 << ug_curve_askStartPoint(ug_refObject(nth(2,overslam_geom:), ""));
           $vec << $Point1 - $Point2; 
           $unit_vec << unitize(overslam_direction:); 
           $overslam << abs($vec.$unit_vec); 
           $part_units << ug_askPartUnits( "" ); 
           $unit_string << makestring(part_unit:);

           $dist << if (part_unit: = mm) then 
                    @{ 
                        if ($part_units = pounds_and_inches) then 
                          $overslam*25.4
                        else $overslam; 
                    } 
                    else 
                    @{ 
                        if ($part_units = grams_and_millimeters) then 
                           $overslam/25.4
                        else $overslam; 
                    }; 

           $pass << if ($dist = overslam_tol:) then 
                        true
                    else
                    @{
                        $msg << error_message: + " The overslam step is " +
                        format("%f"; $dist) + " " + $unit_string +".";   
                        ug_mqc_log(LOG_ERROR, {}, $msg);  
                        false;
                    };

           $check_lol << if $pass then
           @{
               $vec << first_intersection_pt: - second_intersection_pt:; 
               $unit_vec << unitize(w_line_direction:); 
               $wdist << abs($vec.$unit_vec); 
               $dist << if (part_unit: = mm) then 
                        @{ 
                            if ($part_units = pounds_and_inches) then 
                                $wdist*25.4
                            else $wdist; 
                        } 
                        else 
                        @{ 
                            if ($part_units = grams_and_millimeters) then 
                                $wdist/25.4
                            else $wdist; 
                        }; 

               if ($dist = wline_tol:) then 
                   false
               else
                   true;
           }
           else
               true;

           if ($check_lol) then
           @{
               $parm_list << {};
               $f_lol << loop
               {
                   for $each in finished_lol:;
                   for $f_lol is ug_curve_askArcLength(ug_refObject($each, ""), $parm_list);
                   sum $f_lol;
               };

               $d_lol << loop
               {
                   for $each in drawn_lol:;
                   for $d_lol is ug_curve_askArcLength(ug_refObject($each, ""), $parm_list);
                   sum $d_lol;
               };

               $ratio << $f_lol/$d_lol;

               $pass << mqc_is_value_inside_range($ratio, ratio_range:);

               if -$pass then
               @{
                   $msg << error_message: + " The ratio of finished lol and drawn lol is " +
                           format("%f"; $ratio) + ".";   
                   ug_mqc_log(LOG_ERROR, {}, $msg);  
               }
               else do_nothing;
           }
           else do_nothing;
       };
     };
   };

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