meshlabxml/create.py
def cylinder_open_hires(script, height=1.0, radius=1, diameter=None,
                        cir_segments=48, height_segments=1,
                        invert_normals=False, center=False, color=None):
    """ Creates a round open tube, e.g. a cylinder with no top or bottom.

    Useful if you want to wrap it around and join the open ends together, forming a torus.

    invert_normals (bool (optional)): if True normals point outward; in false normals point inward.
    """
    if diameter is not None:
        radius = diameter / 2

    if center:
        z_translate = -height / 2
    else:
        z_translate = 0.0

    grid(script,
         [2 * math.pi * radius, height],
         x_segments=cir_segments,
         y_segments=height_segments)
    transform.rotate(script, 'x', 90)
    transform.translate(script, [math.pi * radius / 2, 0, z_translate])
    if not invert_normals:
        transform.rotate(script, 'z', 180)
    transform.wrap2cylinder(script, radius)
    clean.merge_vert(script, threshold=0.00002)
    if color is not None:
        vert_color.function(script, color=color)
    return None
def cylinder_open_hires(script, height=1.0, radius=1, diameter=None,
                        cir_segments=48, height_segments=1,
                        invert_normals=False, center=False, color=None):
    """ Creates a round open tube, e.g. a cylinder with no top or bottom.

    Useful if you want to wrap it around and join the open ends together, forming a torus.

    invert_normals (bool (optional)): if True normals point outward; in false normals point inward.
    """
    if diameter is not None:
        radius = diameter / 2

    if center:
        z_translate = -height / 2
    else:
        z_translate = 0.0

    grid(script,
         [2 * math.pi * radius, height],
         x_segments=cir_segments,
         y_segments=height_segments)
    transform.rotate(script, 'x', 90)
    transform.translate(script, [math.pi * radius / 2, 0, z_translate])
    if not invert_normals:
        transform.rotate(script, 'z', 180)
    transform.wrap2cylinder(script, radius)
    clean.merge_vert(script, threshold=0.00002)
    if color is not None:
        vert_color.function(script, color=color)
    return None
Creates a round open tube, e.g. a cylinder with no top or bottom.

    Useful if you want to wrap it around and join the open ends together, forming a torus.

    invert_normals (bool (optional)): if True normals point outward; in false normals point inward.