meshlabxml/create.py
def sphere_cap(script, angle=1.0, subdivisions=3, color=None):
    """# angle = Angle of the cone subtending the cap. It must be <180 less than 180
    # subdivisions = Subdivision level; Number of the recursive subdivision of the
    # surface. Default is 3 (a sphere approximation composed by 1280 faces).
    # Admitted values are in the range 0 (an icosahedron) to 8 (a 1.3 MegaTris
    # approximation of a sphere). Formula for number of faces: F=20*4^subdivisions
    # color = specify a color name to apply vertex colors to the newly
    # created mesh"""
    filter_xml = ''.join([
        '  <filter name="Sphere Cap">\n',
        '    <Param name="angle" ',
        'value="%s" ' % angle,
        'description="Angle" ',
        'type="RichFloat" ',
        '/>\n',
        '    <Param name="subdiv" ',
        'value="%d" ' % subdivisions,
        'description="Subdiv. Level" ',
        'type="RichInt" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(script, filter_xml)
    if isinstance(script, FilterScript):
        script.add_layer('Sphere Cap', change_layer=True)
    if color is not None:
        vert_color.function(script, color=color)
    return None
def sphere_cap(script, angle=1.0, subdivisions=3, color=None):
    """# angle = Angle of the cone subtending the cap. It must be <180 less than 180
    # subdivisions = Subdivision level; Number of the recursive subdivision of the
    # surface. Default is 3 (a sphere approximation composed by 1280 faces).
    # Admitted values are in the range 0 (an icosahedron) to 8 (a 1.3 MegaTris
    # approximation of a sphere). Formula for number of faces: F=20*4^subdivisions
    # color = specify a color name to apply vertex colors to the newly
    # created mesh"""
    filter_xml = ''.join([
        '  <filter name="Sphere Cap">\n',
        '    <Param name="angle" ',
        'value="%s" ' % angle,
        'description="Angle" ',
        'type="RichFloat" ',
        '/>\n',
        '    <Param name="subdiv" ',
        'value="%d" ' % subdivisions,
        'description="Subdiv. Level" ',
        'type="RichInt" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(script, filter_xml)
    if isinstance(script, FilterScript):
        script.add_layer('Sphere Cap', change_layer=True)
    if color is not None:
        vert_color.function(script, color=color)
    return None
# angle = Angle of the cone subtending the cap. It must be <180 less than 180
    # subdivisions = Subdivision level; Number of the recursive subdivision of the
    # surface. Default is 3 (a sphere approximation composed by 1280 faces).
    # Admitted values are in the range 0 (an icosahedron) to 8 (a 1.3 MegaTris
    # approximation of a sphere). Formula for number of faces: F=20*4^subdivisions
    # color = specify a color name to apply vertex colors to the newly
    # created mesh