<HTML><HEAD><link type="text/css" href="../css/main_styles.css" rel="stylesheet"></HEAD>
<BODY><TITLE>%mqc_pdq_narrow_surface</TITLE><H1>%mqc_pdq_narrow_surface  </H1><P CLASS="Paragraph">Classname: <B>%mqc_pdq_narrow_surface  </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\">  DOCUMENTATION</PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">
<B>Description:</B>
    This checker searches for faces whose underline B-spline surface or patches
    of which the maximum width is less than the absolute distance tolerance.
    Very small surfaces or patches can cause considerable problems for further
    geometry creation and downstream applications. Patches that fall short of
    a particular extent in at least one direction can result in defective
    elements. Changes in the system or in the accuracy range can cause this
    problem and can lead to gaps in the topology. Reworking these elements
    requires considerable effort.
    In addition, narrow elements raise the storage requirements (file size),
    increase the effort required to make changes, and raise the dangers of
    continuity problems. They often occur through system automation without
    the user's knowledge or intent. The automatic closure of gaps in the case
    of data importation from foreign systems also causes these types of flaws.
    Recommendation: Narrow patches should be avoided or eliminated through
    suitable enlargement and division of the neighboring elements and then
    subsequently deleted.
Reference:
    SASIG-PDQ Issue 2.0 (Dated 9/29/2004)
    Criteria Code: Narrow Surface or Patch (G-SU-NA)
Parameters:
    ************************* Geometry Identification *************************
    ( List )  filter             - This parameter is used to display filter
                                   option button in checker customization dialog.
                                   This parameter is also used to collect entities
                                   selected by the class selection dialog.
                                   If Solid_Body or Sheet_Body is selected, the
                                   checker will collect all faces of these bodies
                                   to validate.
                                   Default is empty.
    ( Name )  filter_type_mode   - This parameter is used to set entity type filter mode
                                   which can be Include or Exclude.
                                   Include - Collect entities with the specified entity
                                             types in the list filter_type_filter.
                                   Exclude - Collect entities without the specified entity
                                             types in the list filter_type_filter.
                                   Default is Include.
    ( List )  filter_type_filter - This Parameter is used to collect the entity types
                                   for entity type filter.
                                   It can be a list of entity type names
                                   For example: {Face, Solid_Body, Sheet_Body }
                                   Default is {Face, Solid_Body, Sheet_Body}.
    ( Name )  filter_layer_mode  - This parameter is used to set layer filter mode
                                   which can be Include or Exclude.
                                   Include - Collect entities with the specified
                                             layers in the list filter_layer_filter.
                                   Exclude - Collect entities without the specified
                                             layers in the list filter_layer_filter.
                                   Default is Include.
    ( List )  filter_layer_filter- This Parameter is used to collect the layers
                                   for layer filter.
                                   It can be a list of layers string or category
                                   name string, For example: {"8,10-12", "SOLID"}
                                   Default is {ALL}.
    ( Name )  filter_color_mode  - This parameter is used to set color filter mode
                                   which can be Include or Exclude.
                                   See filter_layer_mode.
                                   Default is Include.
    ( List )  filter_color_filter- This parameter is used to collect the colors
                                   for color filter.
                                   It can be a list of color RGB,
                                   such as {{255,0,0},{102,102,102}},
                                   or color index, such as {1,2,3}
                                   Default is {ALL}.
    ( Any )filter_class_selection- This parameter is used to add a class selection
                                   dialog for the user to select face or solid objects.
                                   The available entity types are set by the entity type
                                   filter parameter filter_type_filter.
    ( Boolean) check_invisible_layers
                                   This parameter is used to determine to check the entity
                                   on invisible layers or not.
                                   Default is False.
    1. If selection list is empty, and the filter setting is default,
       checker will collect all faces in part to validate.
    2. If selection list is empty, and the filter setting is not default,
       checker will use filter option to collect faces to validate.
    3. If selection list is not empty, and the filter setting is default,
       checker will validate faces in the selection list.
    4. If selection list is not empty, and the filter setting is not default,
       checker will use intersection of selection and filter option to
       collect faces to validate.
    ****************************    Unit Option    ****************************
    (Name)    unit              - Unit for the distance tolerance. Can be:
                                      grams_and_millimeters
                                      pounds_and_inches
                                  Default is grams_and_millimeters
    *************************** Validation Criteria ***************************
    (Number)  abs_tol           - Absolute distance tolerance
                                  Default is 0.01 mm.
    (Boolean) segment_check     - True  - Check the surface and its patches
                                  False - Only check surface
                                  Default is False.
    (Integer) u_sample_point    - Number of sample points per segment
                                  in U direction.
                                  Default is 10.
    (Integer) v_sample_point    - Number of sample points per segment
                                  in V direction.
                                  Default is 10.
    ***************************  Topology Tolerance ***************************
    (Number)  distance          - Topological distance tolerance.
                                  Default is 0.1 mm.
    (Number)  tangent_angle     - Topological angle tolerance.
                                  Unit is degrees.
                                  Default is 30 degrees.
    (Number)  curvature         - Topological curvature tolerance
                                  Default is 2.
    (Integer) edge_curve_points - Number of edge curve points for evaluating
                                  the topology.
                                  Default is 10.
    ***************************     Log Setting     ***************************
    (Name)    log_type        - Indicate which logging type to use to report
                                the violation.
                                    LOG_ERROR
                                    LOG_WARNING
                                    LOG_INFO
                                  Default is LOG_ERROR
    (String)  log_msg         - User defined message to be added when the system
                                reports the violation.
                                Default is an empty string.
    ***************************        Others       ***************************
    (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  - No faces violate the constraint.
    FAIL  - Found faces whose underline B-spline surface or patches
            violate the narrow surface checking criteria.
UG objects logged:
    Faces that violate the narrow surface checking criteria.

<B>See Also:</B>
    Checker: Narrow Face (G-FA-NA) (mqc_pdq_narrow_face)
</PRE><PRE><FONT COLOR= blue>DefClass: %mqc_pdq_narrow_surface ( %ug_base_checker );
</FONT></PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Check-Mate Attributes and Parameters</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )  %test_category: "SASIG-PDQ.Surfaces (G-SU)";
    ( String )  %displayed_name: "Narrow Surface or Patch: G-SU-NA";

</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\">  Checker specific Attributes and Parameters</PRE><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Parameter for unit</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Name Parameter )      unit: grams_and_millimeters ;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Checker Criteria</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( List )                unit_option:{grams_and_millimeters, pounds_and_inches};
    ( String )              unit_label: "Unit";

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

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Number Parameter )    abs_tol: 0.01;
    ( Boolean Parameter )   segment_check: False;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Geometry Selection and Filters</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              segment_check_label: "Segment Check";
    
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              filter_begin_group: "Geometry Identification";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              filter_label: "Filter Methods";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( List Parameter )      filter: {};
    ( Name Parameter )      filter_Type_Mode: Include;
    ( List Parameter )      filter_Type_Filter: {Face, Solid_Body, Sheet_Body};
    ( Name Parameter )      filter_Layer_Mode: Include;
    ( List Parameter )      filter_Layer_Filter: {ALL};
    ( Name Parameter )      filter_Color_Mode: Include;
    ( List Parameter )      filter_Color_Filter: {ALL};
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Check invisible Layers or not</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Any )                 filter_Class_Selection: "Selections";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Boolean Parameter )   check_invisible_layers: False;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Sample Points Parameter</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              check_invisible_layers_label: "Check Invisible Layers";
    ( Any )                 filter_end_group:;

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              sample_points_begin_group: "Number of Sample Points";    
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              u_sample_point_label: "In u-direction";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Integer Parameter )   u_sample_point: 10;
    ( Integer Parameter )   v_sample_point: 10;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Topological tolerances    </PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              v_sample_point_label: "In v-direction";
    ( Any )                 sample_points_end_group:;    

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              topo_begin_group: "Topological Tolerances";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              distance_label: "Distance";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              tangent_angle_label: "Tangent Angle (Degrees)";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              curvature_label: "Curvature";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Number Parameter )    distance: 0.1;
    ( Number Parameter )    tangent_angle: 30;
    ( Number Parameter )    curvature: 2.0;
    ( Integer Parameter )   edge_curve_points: 10;
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Log attributes and parameters</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              edge_curve_points_label: "Number of Edge Curve Points";
    ( Any )                 topo_end_group:;
    
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Boolean )             log_detail: False;
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( List )                log_type_option: { LOG_ERROR, 
                                               LOG_WARNING, 
                                               LOG_INFO };
    ( String )              log_type_label: "Log Option";
</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Name Parameter )      log_type: LOG_ERROR;
    ( String Parameter )    log_msg: "";
</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Logical attribute to judge if using filter system of validation function</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( String )              log_msg_label: "Log Message";

</SPAN></FONT></PRE></DIV><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( Boolean )             apply_filter?: 
                            if( ((filter_Type_Mode: = Include & filter_Type_Filter: = {ALL}) |
                                 (filter_Type_Mode: = Include & filter_Type_Filter: = allowed_entity_types:) |
                                 (filter_Type_Mode: = Exclude & filter_Type_Filter: = {}) ) &   
                                (!mqc_applyFilter?( filter_Layer_Mode:, filter_Layer_Filter:, 
                                                    filter_Color_Mode:, filter_Color_Filter: ) ))
                            then false
                            else true;

    ( List )                layer_filters:
                            If ( !check_invisible_layers: )
                            Then
                            @{
                                $filter_layers  << mqc_parse_layerSpecification( filter_Layer_Filter: );
                                $invisble_layers << Nth( 4, mqc_askLayerInfo() );
                                {mqc_convertIntegerListToString(SetDifference( $filter_layers, $invisble_layers ))};
                            }
                            Else filter_Layer_Filter:;

</SPAN></FONT></PRE></DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\">  Attributes for faces collection and selection</PRE><DIV><PRE STYLE=\"text-align : left;\" CLASS=\"Code\"><FONT COLOR=blue>    ( List )                allowed_entity_types: {Face, Solid_Body, Sheet_Body}; 
    ( List )                entities_collection:
                                #Collect faces, bodies with layer, color filters.
                                mqc_collectEntitiesWithFilterOptions( 
                                    Include, If (filter_Type_Mode: = Include)
                                             Then filter_Type_Filter:
                                             Else SetDifference(allowed_entity_types:,filter_Type_Filter:),
                                    filter_Layer_Mode:,layer_filters:,
                                    filter_Color_Mode:,filter_Color_Filter: );

    ( List )                entities_selection:
                                mqc_convertHandlesToTags ( filter: );

    ( List )                face_list:
                                If ( (check_invisible_layers:) & Empty?(filter:) & (!apply_filter?:) )
                                Then {True, {}}  # Check All in Parts
                                Else If ( (!check_invisible_layers:) & Empty?(filter:) & (!apply_filter?:) )
                                Then {False, entities_collection:}
                                Else If ( Empty?(filter:) & apply_filter?: )
                                Then {False, entities_collection:}
                                Else If ( (!Empty?(filter:)) & (!apply_filter?:) )
                                Then {False, entities_selection:}
                                Else If ( (!Empty?(filter:)) & apply_filter?: )
                                Then {False, SetIntersection(entities_collection:, entities_selection:)}
                                Else {False, {}};
 
</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>    (Any Uncached)    do_check: 
    @{
        $abs_tol << mqc_convert_unit_for_tolerance(abs_tol:, unit:);

        $topo_tol << {mqc_convert_unit_for_tolerance(distance:, unit:), tangent_angle:, curvature:};

        $criteria << {segment_check:, u_sample_point:, v_sample_point:, edge_curve_points:};
       
        $detail_flag << if (log_detail: = TRUE) then 1 else 0;
        
        if ( face_list: = {False, {}} )
        then Donothing
        else
        @{
            ug_mqc_log_object_detail_flag( $detail_flag );

            mqc_pdqcad_setCriteriaNameOption( SASIG_PDQ );

            mqc_pdqcad_tinySurfacePatch( face_list:, $topo_tol,
                                   $criteria, 
                                   $abs_tol, 0.0000001,
                                   log_type:, log_msg: );
        };
    };

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