meshlabxml/select.py
def small_parts(script, ratio=0.2, non_closed_only=False):
    """ Select the small disconnected parts (components) of a mesh.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        ratio (float): This ratio (between 0 and 1) defines the meaning of
            'small' as the threshold ratio between the number of faces of the
            largest component and the other ones. A larger value will select
            more components.
        non_closed_only (bool): Select only non-closed components.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    filter_xml = ''.join([
        '  <filter name="Small component selection">\n',
        '    <Param name="NbFaceRatio" ',
        'value="{}" '.format(ratio),
        'description="Small component ratio" ',
        'type="RichFloat" ',
        '/>\n',
        '    <Param name="NonClosedOnly" ',
        'value="{}" '.format(str(non_closed_only).lower()),
        'description="Select only non closed components" ',
        'type="RichBool" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(script, filter_xml)
    return None
def small_parts(script, ratio=0.2, non_closed_only=False):
    """ Select the small disconnected parts (components) of a mesh.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        ratio (float): This ratio (between 0 and 1) defines the meaning of
            'small' as the threshold ratio between the number of faces of the
            largest component and the other ones. A larger value will select
            more components.
        non_closed_only (bool): Select only non-closed components.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    filter_xml = ''.join([
        '  <filter name="Small component selection">\n',
        '    <Param name="NbFaceRatio" ',
        'value="{}" '.format(ratio),
        'description="Small component ratio" ',
        'type="RichFloat" ',
        '/>\n',
        '    <Param name="NonClosedOnly" ',
        'value="{}" '.format(str(non_closed_only).lower()),
        'description="Select only non closed components" ',
        'type="RichBool" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(script, filter_xml)
    return None
def small_parts ( script , ratio = 0.2 , non_closed_only = False ) : filter_xml = '' . join ( [ '  <filter name="Small component selection">\n' , '    <Param name="NbFaceRatio" ' , 'value="{}" ' . format ( ratio ) , 'description="Small component ratio" ' , 'type="RichFloat" ' , '/>\n' , '    <Param name="NonClosedOnly" ' , 'value="{}" ' . format ( str ( non_closed_only ) . lower ( ) ) , 'description="Select only non closed components" ' , 'type="RichBool" ' , '/>\n' , '  </filter>\n' ] ) util . write_filter ( script , filter_xml ) return None
Select the small disconnected parts (components) of a mesh.

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        ratio (float): This ratio (between 0 and 1) defines the meaning of
            'small' as the threshold ratio between the number of faces of the
            largest component and the other ones. A larger value will select
            more components.
        non_closed_only (bool): Select only non-closed components.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
Select the small disconnected parts ( components ) of a mesh .