def tube_hires(script, height=<NUM_LIT:1.0>, radius=None, radius1=None, radius2=None,<EOL>diameter=None, diameter1=None, diameter2=None, cir_segments=<NUM_LIT:32>,<EOL>rad_segments=<NUM_LIT:1>, height_segments=<NUM_LIT:1>, center=False,<EOL>simple_bottom=False, color=None):
<EOL>if radius is not None and diameter is None:<EOL><INDENT>if radius1 is None and diameter1 is None:<EOL><INDENT>radius1 = radius<EOL><DEDENT>if radius2 is None and diameter2 is None:<EOL><INDENT>radius2 = <NUM_LIT:0><EOL><DEDENT><DEDENT>if diameter is not None:<EOL><INDENT>if radius1 is None and diameter1 is None:<EOL><INDENT>radius1 = diameter / <NUM_LIT:2><EOL><DEDENT>if radius2 is None and diameter2 is None:<EOL><INDENT>radius2 = <NUM_LIT:0><EOL><DEDENT><DEDENT>if diameter1 is not None:<EOL><INDENT>radius1 = diameter1 / <NUM_LIT:2><EOL><DEDENT>if diameter2 is not None:<EOL><INDENT>radius2 = diameter2 / <NUM_LIT:2><EOL><DEDENT>if radius1 is None:<EOL><INDENT>radius1 = <NUM_LIT:1><EOL><DEDENT>if radius2 is None:<EOL><INDENT>radius2 = <NUM_LIT:0><EOL><DEDENT>annulus_hires(script,<EOL>radius1=radius1,<EOL>radius2=radius2,<EOL>cir_segments=cir_segments,<EOL>rad_segments=rad_segments)<EOL>transform.translate(script, [<NUM_LIT:0>, <NUM_LIT:0>, height])<EOL>if simple_bottom:<EOL><INDENT>annulus(script,<EOL>radius1=radius1,<EOL>radius2=radius2,<EOL>cir_segments=cir_segments)<EOL><DEDENT>else:<EOL><INDENT>layers.duplicate(script)<EOL>transform.translate(script, [<NUM_LIT:0>, <NUM_LIT:0>, -height])<EOL><DEDENT>transform.rotate(script, '<STR_LIT:x>', <NUM_LIT>)<EOL>cylinder_open_hires(script, height, radius1,<EOL>cir_segments=cir_segments,<EOL>height_segments=height_segments)<EOL>if radius2 != <NUM_LIT:0>:<EOL><INDENT>cylinder_open_hires(script, height, radius2,<EOL>cir_segments=cir_segments,<EOL>height_segments=height_segments,<EOL>invert_normals=True)<EOL><DEDENT>layers.join(script)<EOL>clean.merge_vert(script, threshold=<NUM_LIT>)<EOL>if center:<EOL><INDENT>transform.translate(script, [<NUM_LIT:0>, <NUM_LIT:0>, -height / <NUM_LIT:2>])<EOL><DEDENT>if color is not None:<EOL><INDENT>vert_color.function(script, color=color)<EOL><DEDENT>return None<EOL>
Create a cylinder with user defined number of segments